summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp58
-rw-r--r--noncore/multimedia/opieplayer2/lib.h1
2 files changed, 58 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index 6431de7..9d4b1be 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -74,2 +74,3 @@ Lib::Lib( InitializationMode initMode, XineVideoWidget* widget )
{
+ m_initialized = false;
m_video = false;
@@ -89,4 +90,6 @@ Lib::Lib( InitializationMode initMode, XineVideoWidget* widget )
- if ( initMode == InitializeImmediately )
+ if ( initMode == InitializeImmediately ) {
initialize();
+ m_initialized = true;
+ }
else
@@ -136,2 +139,5 @@ void Lib::initialize()
Lib::~Lib() {
+ assert( isRunning() == false )
+ assert( m_initialized );
+
// free( m_config );
@@ -151,2 +157,4 @@ Lib::~Lib() {
void Lib::resize ( const QSize &s ) {
+ assert( m_initialized );
+
if ( s. width ( ) && s. height ( ) ) {
@@ -176,2 +184,4 @@ int Lib::subVersion() {
int Lib::play( const QString& fileName, int startPos, int start_time ) {
+ assert( m_initialized );
+
QString str = fileName.stripWhiteSpace();
@@ -184,2 +194,4 @@ int Lib::play( const QString& fileName, int startPos, int start_time ) {
void Lib::stop() {
+ assert( m_initialized );
+
qDebug("<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>");
@@ -189,2 +201,4 @@ void Lib::stop() {
void Lib::pause( bool toggle ) {
+ assert( m_initialized );
+
xine_set_param( m_stream, XINE_PARAM_SPEED, toggle ? XINE_SPEED_PAUSE : XINE_SPEED_NORMAL );
@@ -193,2 +207,4 @@ void Lib::pause( bool toggle ) {
int Lib::speed() const {
+ assert( m_initialized );
+
return xine_get_param ( m_stream, XINE_PARAM_SPEED );
@@ -197,2 +213,4 @@ int Lib::speed() const {
void Lib::setSpeed( int speed ) {
+ assert( m_initialized );
+
xine_set_param ( m_stream, XINE_PARAM_SPEED, speed );
@@ -201,2 +219,4 @@ void Lib::setSpeed( int speed ) {
int Lib::status() const {
+ assert( m_initialized );
+
return xine_get_status( m_stream );
@@ -205,2 +225,4 @@ int Lib::status() const {
int Lib::currentPosition() const {
+ assert( m_initialized );
+
int pos, time, length;
@@ -211,2 +233,4 @@ int Lib::currentPosition() const {
int Lib::currentTime() const {
+ assert( m_initialized );
+
int pos, time, length;
@@ -217,2 +241,4 @@ int Lib::currentTime() const {
int Lib::length() const {
+ assert( m_initialized );
+
int pos, time, length;
@@ -223,2 +249,4 @@ int Lib::length() const {
bool Lib::isSeekable() const {
+ assert( m_initialized );
+
return xine_get_stream_info( m_stream, XINE_STREAM_INFO_SEEKABLE );
@@ -227,2 +255,4 @@ bool Lib::isSeekable() const {
void Lib::seekTo( int time ) {
+ assert( m_initialized );
+
//xine_trick_mode ( m_stream, XINE_TRICK_MODE_SEEK_TO_TIME, time ); NOT IMPLEMENTED YET IN XINE :_(
@@ -234,2 +264,4 @@ void Lib::seekTo( int time ) {
Frame Lib::currentFrame() const {
+ assert( m_initialized );
+
Frame frame;
@@ -239,2 +271,4 @@ Frame Lib::currentFrame() const {
QString Lib::metaInfo( int number) const {
+ assert( m_initialized );
+
return xine_get_meta_info( m_stream, number );
@@ -243,2 +277,4 @@ QString Lib::metaInfo( int number) const {
int Lib::error() const {
+ assert( m_initialized );
+
return xine_get_error( m_stream );
@@ -258,2 +294,4 @@ void Lib::handleXineEvent( const xine_event_t* t ) {
void Lib::handleXineEvent( int type ) {
+ assert( m_initialized );
+
if ( type == XINE_EVENT_UI_PLAYBACK_FINISHED ) {
@@ -265,2 +303,4 @@ void Lib::handleXineEvent( int type ) {
void Lib::setShowVideo( bool video ) {
+ assert( m_initialized );
+
m_video = video;
@@ -270,2 +310,4 @@ void Lib::setShowVideo( bool video ) {
bool Lib::isShowingVideo() const {
+ assert( m_initialized );
+
return ::null_is_showing_video( m_videoOutput );
@@ -274,2 +316,4 @@ bool Lib::isShowingVideo() const {
bool Lib::hasVideo() const {
+ assert( m_initialized );
+
return xine_get_stream_info( m_stream, 18 );
@@ -278,2 +322,4 @@ bool Lib::hasVideo() const {
void Lib::showVideoFullScreen( bool fullScreen ) {
+ assert( m_initialized );
+
::null_set_fullscreen( m_videoOutput, fullScreen );
@@ -282,2 +328,4 @@ void Lib::showVideoFullScreen( bool fullScreen ) {
bool Lib::isVideoFullScreen() const {
+ assert( m_initialized );
+
return ::null_is_fullscreen( m_videoOutput );
@@ -286,2 +334,4 @@ bool Lib::isVideoFullScreen() const {
void Lib::setScaling( bool scale ) {
+ assert( m_initialized );
+
::null_set_scaling( m_videoOutput, scale );
@@ -290,2 +340,4 @@ void Lib::setScaling( bool scale ) {
void Lib::setGamma( int value ) {
+ assert( m_initialized );
+
//qDebug( QString( "%1").arg(value) );
@@ -296,2 +348,4 @@ void Lib::setGamma( int value ) {
bool Lib::isScaling() const {
+ assert( m_initialized );
+
return ::null_is_scaling( m_videoOutput );
@@ -309,2 +363,4 @@ void Lib::xine_display_frame( void* user_data, uint8_t *frame,
void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) {
+ assert( m_initialized );
+
if ( !m_video ) {
diff --git a/noncore/multimedia/opieplayer2/lib.h b/noncore/multimedia/opieplayer2/lib.h
index 6363918..7e3a912 100644
--- a/noncore/multimedia/opieplayer2/lib.h
+++ b/noncore/multimedia/opieplayer2/lib.h
@@ -194,2 +194,3 @@ namespace XINE {
int m_bytes_per_pixel;
+ bool m_initialized:1;
bool m_video:1;