summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-13 22:49:10 (UTC)
committer simon <simon>2002-12-13 22:49:10 (UTC)
commit789181777295e96d75c68d5136dcfdb4c77b85ca (patch) (unidiff)
treeb3bd3b288068cc75246db7821ca7194b29fc75dc
parentb90d33132c1191fd299e902da9684e51615d1c41 (diff)
downloadopie-789181777295e96d75c68d5136dcfdb4c77b85ca.zip
opie-789181777295e96d75c68d5136dcfdb4c77b85ca.tar.gz
opie-789181777295e96d75c68d5136dcfdb4c77b85ca.tar.bz2
- assert everything is initialized when accessing xine functionality
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 )
74{ 74{
75 m_initialized = false;
75 m_video = false; 76 m_video = false;
@@ -89,4 +90,6 @@ Lib::Lib( InitializationMode initMode, XineVideoWidget* widget )
89 90
90 if ( initMode == InitializeImmediately ) 91 if ( initMode == InitializeImmediately ) {
91 initialize(); 92 initialize();
93 m_initialized = true;
94 }
92 else 95 else
@@ -136,2 +139,5 @@ void Lib::initialize()
136Lib::~Lib() { 139Lib::~Lib() {
140 assert( isRunning() == false )
141 assert( m_initialized );
142
137// free( m_config ); 143// free( m_config );
@@ -151,2 +157,4 @@ Lib::~Lib() {
151void Lib::resize ( const QSize &s ) { 157void Lib::resize ( const QSize &s ) {
158 assert( m_initialized );
159
152 if ( s. width ( ) && s. height ( ) ) { 160 if ( s. width ( ) && s. height ( ) ) {
@@ -176,2 +184,4 @@ int Lib::subVersion() {
176int Lib::play( const QString& fileName, int startPos, int start_time ) { 184int Lib::play( const QString& fileName, int startPos, int start_time ) {
185 assert( m_initialized );
186
177 QString str = fileName.stripWhiteSpace(); 187 QString str = fileName.stripWhiteSpace();
@@ -184,2 +194,4 @@ int Lib::play( const QString& fileName, int startPos, int start_time ) {
184void Lib::stop() { 194void Lib::stop() {
195 assert( m_initialized );
196
185 qDebug("<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>"); 197 qDebug("<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>");
@@ -189,2 +201,4 @@ void Lib::stop() {
189void Lib::pause( bool toggle ) { 201void Lib::pause( bool toggle ) {
202 assert( m_initialized );
203
190 xine_set_param( m_stream, XINE_PARAM_SPEED, toggle ? XINE_SPEED_PAUSE : XINE_SPEED_NORMAL ); 204 xine_set_param( m_stream, XINE_PARAM_SPEED, toggle ? XINE_SPEED_PAUSE : XINE_SPEED_NORMAL );
@@ -193,2 +207,4 @@ void Lib::pause( bool toggle ) {
193int Lib::speed() const { 207int Lib::speed() const {
208 assert( m_initialized );
209
194 return xine_get_param ( m_stream, XINE_PARAM_SPEED ); 210 return xine_get_param ( m_stream, XINE_PARAM_SPEED );
@@ -197,2 +213,4 @@ int Lib::speed() const {
197void Lib::setSpeed( int speed ) { 213void Lib::setSpeed( int speed ) {
214 assert( m_initialized );
215
198 xine_set_param ( m_stream, XINE_PARAM_SPEED, speed ); 216 xine_set_param ( m_stream, XINE_PARAM_SPEED, speed );
@@ -201,2 +219,4 @@ void Lib::setSpeed( int speed ) {
201int Lib::status() const { 219int Lib::status() const {
220 assert( m_initialized );
221
202 return xine_get_status( m_stream ); 222 return xine_get_status( m_stream );
@@ -205,2 +225,4 @@ int Lib::status() const {
205int Lib::currentPosition() const { 225int Lib::currentPosition() const {
226 assert( m_initialized );
227
206 int pos, time, length; 228 int pos, time, length;
@@ -211,2 +233,4 @@ int Lib::currentPosition() const {
211int Lib::currentTime() const { 233int Lib::currentTime() const {
234 assert( m_initialized );
235
212 int pos, time, length; 236 int pos, time, length;
@@ -217,2 +241,4 @@ int Lib::currentTime() const {
217int Lib::length() const { 241int Lib::length() const {
242 assert( m_initialized );
243
218 int pos, time, length; 244 int pos, time, length;
@@ -223,2 +249,4 @@ int Lib::length() const {
223bool Lib::isSeekable() const { 249bool Lib::isSeekable() const {
250 assert( m_initialized );
251
224 return xine_get_stream_info( m_stream, XINE_STREAM_INFO_SEEKABLE ); 252 return xine_get_stream_info( m_stream, XINE_STREAM_INFO_SEEKABLE );
@@ -227,2 +255,4 @@ bool Lib::isSeekable() const {
227void Lib::seekTo( int time ) { 255void Lib::seekTo( int time ) {
256 assert( m_initialized );
257
228 //xine_trick_mode ( m_stream, XINE_TRICK_MODE_SEEK_TO_TIME, time ); NOT IMPLEMENTED YET IN XINE :_( 258 //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 ) {
234Frame Lib::currentFrame() const { 264Frame Lib::currentFrame() const {
265 assert( m_initialized );
266
235 Frame frame; 267 Frame frame;
@@ -239,2 +271,4 @@ Frame Lib::currentFrame() const {
239QString Lib::metaInfo( int number) const { 271QString Lib::metaInfo( int number) const {
272 assert( m_initialized );
273
240 return xine_get_meta_info( m_stream, number ); 274 return xine_get_meta_info( m_stream, number );
@@ -243,2 +277,4 @@ QString Lib::metaInfo( int number) const {
243int Lib::error() const { 277int Lib::error() const {
278 assert( m_initialized );
279
244 return xine_get_error( m_stream ); 280 return xine_get_error( m_stream );
@@ -258,2 +294,4 @@ void Lib::handleXineEvent( const xine_event_t* t ) {
258void Lib::handleXineEvent( int type ) { 294void Lib::handleXineEvent( int type ) {
295 assert( m_initialized );
296
259 if ( type == XINE_EVENT_UI_PLAYBACK_FINISHED ) { 297 if ( type == XINE_EVENT_UI_PLAYBACK_FINISHED ) {
@@ -265,2 +303,4 @@ void Lib::handleXineEvent( int type ) {
265void Lib::setShowVideo( bool video ) { 303void Lib::setShowVideo( bool video ) {
304 assert( m_initialized );
305
266 m_video = video; 306 m_video = video;
@@ -270,2 +310,4 @@ void Lib::setShowVideo( bool video ) {
270bool Lib::isShowingVideo() const { 310bool Lib::isShowingVideo() const {
311 assert( m_initialized );
312
271 return ::null_is_showing_video( m_videoOutput ); 313 return ::null_is_showing_video( m_videoOutput );
@@ -274,2 +316,4 @@ bool Lib::isShowingVideo() const {
274bool Lib::hasVideo() const { 316bool Lib::hasVideo() const {
317 assert( m_initialized );
318
275 return xine_get_stream_info( m_stream, 18 ); 319 return xine_get_stream_info( m_stream, 18 );
@@ -278,2 +322,4 @@ bool Lib::hasVideo() const {
278void Lib::showVideoFullScreen( bool fullScreen ) { 322void Lib::showVideoFullScreen( bool fullScreen ) {
323 assert( m_initialized );
324
279 ::null_set_fullscreen( m_videoOutput, fullScreen ); 325 ::null_set_fullscreen( m_videoOutput, fullScreen );
@@ -282,2 +328,4 @@ void Lib::showVideoFullScreen( bool fullScreen ) {
282bool Lib::isVideoFullScreen() const { 328bool Lib::isVideoFullScreen() const {
329 assert( m_initialized );
330
283 return ::null_is_fullscreen( m_videoOutput ); 331 return ::null_is_fullscreen( m_videoOutput );
@@ -286,2 +334,4 @@ bool Lib::isVideoFullScreen() const {
286void Lib::setScaling( bool scale ) { 334void Lib::setScaling( bool scale ) {
335 assert( m_initialized );
336
287 ::null_set_scaling( m_videoOutput, scale ); 337 ::null_set_scaling( m_videoOutput, scale );
@@ -290,2 +340,4 @@ void Lib::setScaling( bool scale ) {
290void Lib::setGamma( int value ) { 340void Lib::setGamma( int value ) {
341 assert( m_initialized );
342
291 //qDebug( QString( "%1").arg(value) ); 343 //qDebug( QString( "%1").arg(value) );
@@ -296,2 +348,4 @@ void Lib::setGamma( int value ) {
296bool Lib::isScaling() const { 348bool Lib::isScaling() const {
349 assert( m_initialized );
350
297 return ::null_is_scaling( m_videoOutput ); 351 return ::null_is_scaling( m_videoOutput );
@@ -309,2 +363,4 @@ void Lib::xine_display_frame( void* user_data, uint8_t *frame,
309void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { 363void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) {
364 assert( m_initialized );
365
310 if ( !m_video ) { 366 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 {
194 int m_bytes_per_pixel; 194 int m_bytes_per_pixel;
195 bool m_initialized:1;
195 bool m_video:1; 196 bool m_video:1;