summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-11-10 15:09:09 (UTC)
committer harlekin <harlekin>2002-11-10 15:09:09 (UTC)
commit91932ca42cee5568477b1e49532a0b9e4d9bcf96 (patch) (unidiff)
treef134612cf7aa15787077b0a76c34aab30d72cae3
parentb6b57412a12c06d07f22060b7a165d71e5eddb84 (diff)
downloadopie-91932ca42cee5568477b1e49532a0b9e4d9bcf96.zip
opie-91932ca42cee5568477b1e49532a0b9e4d9bcf96.tar.gz
opie-91932ca42cee5568477b1e49532a0b9e4d9bcf96.tar.bz2
besser seekable handling
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp33
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.h1
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp2
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.cpp16
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.h4
-rw-r--r--noncore/multimedia/opieplayer2/nullvideo.c2
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp7
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp7
8 files changed, 46 insertions, 26 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index a6fd334..00d516c 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -180,40 +180,38 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
180 slider.setMinValue( 0 ); 180 slider.setMinValue( 0 );
181 slider.setMaxValue( 1 ); 181 slider.setMaxValue( 1 );
182 slider.setFocusPolicy( QWidget::NoFocus ); 182 slider.setFocusPolicy( QWidget::NoFocus );
183 slider.setBackgroundPixmap( *pixBg ); 183 slider.setBackgroundPixmap( *pixBg );
184 184
185 time.setFocusPolicy( QWidget::NoFocus ); 185 time.setFocusPolicy( QWidget::NoFocus );
186 time.setAlignment( Qt::AlignCenter ); 186 time.setAlignment( Qt::AlignCenter );
187 time.setFrame(FALSE); 187 time.setFrame(FALSE);
188 changeTextColor( &time ); 188 changeTextColor( &time );
189 189
190 resizeEvent( NULL ); 190 resizeEvent( NULL );
191 191
192 connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); 192 connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
193 connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); 193 connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
194 194
195 connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); 195 connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) );
196 connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); 196 connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) );
197 connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); 197 connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) );
198 // connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) );
199 connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); 198 connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) );
199 connect( mediaPlayerState, SIGNAL( isSeekableToggled( bool ) ), this, SLOT( setSeekable( bool ) ) );
200 200
201 connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); 201 connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) );
202 connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); 202 connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) );
203 connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) ); 203 connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) );
204 connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) ); 204 connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) );
205 205
206
207
208 // Intialise state 206 // Intialise state
209 setLength( mediaPlayerState->length() ); 207 setLength( mediaPlayerState->length() );
210 setPosition( mediaPlayerState->position() ); 208 setPosition( mediaPlayerState->position() );
211 setLooping( mediaPlayerState->fullscreen() ); 209 setLooping( mediaPlayerState->fullscreen() );
212 // setPaused( mediaPlayerState->paused() ); 210 // setPaused( mediaPlayerState->paused() );
213 setPlaying( mediaPlayerState->playing() ); 211 setPlaying( mediaPlayerState->playing() );
214 212
215} 213}
216 214
217AudioWidget::~AudioWidget() { 215AudioWidget::~AudioWidget() {
218 216
219 for ( int i = 0; i < 10; i++ ) { 217 for ( int i = 0; i < 10; i++ ) {
@@ -299,49 +297,52 @@ void AudioWidget::setPosition( long i ) {
299 // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i); 297 // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i);
300 updateSlider( i, mediaPlayerState->length() ); 298 updateSlider( i, mediaPlayerState->length() );
301} 299}
302 300
303 301
304void AudioWidget::setLength( long max ) { 302void AudioWidget::setLength( long max ) {
305 updateSlider( mediaPlayerState->position(), max ); 303 updateSlider( mediaPlayerState->position(), max );
306} 304}
307 305
308 306
309void AudioWidget::setView( char view ) { 307void AudioWidget::setView( char view ) {
310 308
311 // this isnt working for some reason 309if ( view == 'a' ) {
310 // startTimer( 150 );
311 showMaximized();
312 } else {
313 killTimers();
314 hide();
315 }
316 // qApp->processEvents();
317}
318
319
320void AudioWidget::setSeekable( bool isSeekable ) {
312 321
313 if ( mediaPlayerState->streaming() ) { 322 if ( isSeekable ) {
314 qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>"); 323 qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>");
315 if( !slider.isHidden()) { 324 if( !slider.isHidden()) {
316 slider.hide(); 325 slider.hide();
317 } 326 }
318 disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 327 disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
319 disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); 328 disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
320 } else { 329 } else {
321 // this stops the slider from being moved, thus 330 // this stops the slider from being moved, thus
322 // does not stop stream when it reaches the end 331 // does not stop stream when it reaches the end
323 slider.show(); 332 slider.show();
333 qDebug( " CONNECT SET POSTION " );
324 connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 334 connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
325 connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); 335 connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
326 } 336 }
327
328 if ( view == 'a' ) {
329 // startTimer( 150 );
330 showMaximized();
331 } else {
332 killTimers();
333 hide();
334 }
335 // qApp->processEvents();
336} 337}
337 338
338 339
339static QString timeAsString( long length ) { 340static QString timeAsString( long length ) {
340 int minutes = length / 60; 341 int minutes = length / 60;
341 int seconds = length % 60; 342 int seconds = length % 60;
342 return QString("%1:%2%3").arg( minutes ).arg( seconds / 10 ).arg( seconds % 10 ); 343 return QString("%1:%2%3").arg( minutes ).arg( seconds / 10 ).arg( seconds % 10 );
343} 344}
344 345
345void AudioWidget::updateSlider( long i, long max ) { 346void AudioWidget::updateSlider( long i, long max ) {
346 347
347 time.setText( timeAsString( i ) + " / " + timeAsString( max ) ); 348 time.setText( timeAsString( i ) + " / " + timeAsString( max ) );
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h
index c544882..09dc19b 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.h
+++ b/noncore/multimedia/opieplayer2/audiowidget.h
@@ -85,24 +85,25 @@ public:
85 AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 ); 85 AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 );
86 ~AudioWidget(); 86 ~AudioWidget();
87 void setTickerText( const QString &text ) { songInfo.setText( text ); } 87 void setTickerText( const QString &text ) { songInfo.setText( text ); }
88public slots: 88public slots:
89 void updateSlider( long, long ); 89 void updateSlider( long, long );
90 void sliderPressed( ); 90 void sliderPressed( );
91 void sliderReleased( ); 91 void sliderReleased( );
92// void setPaused( bool b) { setToggleButton( AudioPause, b ); } 92// void setPaused( bool b) { setToggleButton( AudioPause, b ); }
93 void setLooping( bool b) { setToggleButton( AudioLoop, b ); } 93 void setLooping( bool b) { setToggleButton( AudioLoop, b ); }
94 void setPlaying( bool b) { setToggleButton( AudioPlay, b ); } 94 void setPlaying( bool b) { setToggleButton( AudioPlay, b ); }
95 void setPosition( long ); 95 void setPosition( long );
96 void setLength( long ); 96 void setLength( long );
97 void setSeekable( bool );
97 void setView( char ); 98 void setView( char );
98 99
99signals: 100signals:
100 void moreClicked(); 101 void moreClicked();
101 void lessClicked(); 102 void lessClicked();
102 void moreReleased(); 103 void moreReleased();
103 void lessReleased(); 104 void lessReleased();
104 void forwardClicked(); 105 void forwardClicked();
105 void backClicked(); 106 void backClicked();
106 void forwardReleased(); 107 void forwardReleased();
107 void backReleased(); 108 void backReleased();
108 void sliderMoved(long); 109 void sliderMoved(long);
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index f0a01a1..8b0f501 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -292,25 +292,25 @@ void MediaPlayer::timerEvent( QTimerEvent * ) {
292 } else { 292 } else {
293 p.drawRect( (w - 200) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 ); 293 p.drawRect( (w - 200) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 );
294 } 294 }
295 } 295 }
296 } 296 }
297} 297}
298 298
299 299
300void MediaPlayer::blank( bool b ) { 300void MediaPlayer::blank( bool b ) {
301 fd=open("/dev/fb0",O_RDWR); 301 fd=open("/dev/fb0",O_RDWR);
302#ifdef QT_QWS_EBX 302#ifdef QT_QWS_EBX
303 fl= open( "/dev/fl", O_RDWR ); 303 fl= open( "/dev/fl", O_RDWR );
304#endif 304#endif
305 if (fd != -1) { 305 if (fd != -1) {
306 if ( b ) { 306 if ( b ) {
307 qDebug("do blanking"); 307 qDebug("do blanking");
308#ifdef QT_QWS_EBX 308#ifdef QT_QWS_EBX
309 ioctl( fd, FBIOBLANK, 1 ); 309 ioctl( fd, FBIOBLANK, 1 );
310 if(fl !=-1) { 310 if(fl !=-1) {
311 ioctl( fl, 2 ); 311 ioctl( fl, 2 );
312 ::close(fl); 312 ::close(fl);
313 } 313 }
314#else 314#else
315 ioctl( fd, FBIOBLANK, 3 ); 315 ioctl( fd, FBIOBLANK, 3 );
316#endif 316#endif
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
index 4ec5989..0b33dfd 100644
--- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
@@ -43,24 +43,25 @@
43 43
44 44
45 45
46//#define MediaPlayerDebug(x) qDebug x 46//#define MediaPlayerDebug(x) qDebug x
47#define MediaPlayerDebug(x) 47#define MediaPlayerDebug(x)
48 48
49 49
50MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) 50MediaPlayerState::MediaPlayerState( QObject *parent, const char *name )
51 : QObject( parent, name ) { 51 : QObject( parent, name ) {
52 Config cfg( "OpiePlayer" ); 52 Config cfg( "OpiePlayer" );
53 readConfig( cfg ); 53 readConfig( cfg );
54 isStreaming = false; 54 isStreaming = false;
55 isSeekable = true;
55} 56}
56 57
57 58
58MediaPlayerState::~MediaPlayerState() { 59MediaPlayerState::~MediaPlayerState() {
59} 60}
60 61
61 62
62void MediaPlayerState::readConfig( Config& cfg ) { 63void MediaPlayerState::readConfig( Config& cfg ) {
63 cfg.setGroup("Options"); 64 cfg.setGroup("Options");
64 isFullscreen = cfg.readBoolEntry( "FullScreen" ); 65 isFullscreen = cfg.readBoolEntry( "FullScreen" );
65 isScaled = cfg.readBoolEntry( "Scaling" ); 66 isScaled = cfg.readBoolEntry( "Scaling" );
66 isLooping = cfg.readBoolEntry( "Looping" ); 67 isLooping = cfg.readBoolEntry( "Looping" );
@@ -86,42 +87,46 @@ void MediaPlayerState::writeConfig( Config& cfg ) const {
86 cfg.writeEntry( "UsePlayList", usePlaylist ); 87 cfg.writeEntry( "UsePlayList", usePlaylist );
87 cfg.writeEntry( "VideoGamma", videoGamma ); 88 cfg.writeEntry( "VideoGamma", videoGamma );
88} 89}
89 90
90 91
91// public stuff 92// public stuff
92 93
93 94
94bool MediaPlayerState::streaming() { 95bool MediaPlayerState::streaming() {
95 return isStreaming; 96 return isStreaming;
96} 97}
97 98
99bool MediaPlayerState::seekable() {
100 return isSeekable;
101}
102
98bool MediaPlayerState::fullscreen() { 103bool MediaPlayerState::fullscreen() {
99 return isFullscreen; 104 return isFullscreen;
100} 105}
101 106
102bool MediaPlayerState::scaled() { 107bool MediaPlayerState::scaled() {
103 return isScaled; 108 return isScaled;
104} 109}
105 110
106bool MediaPlayerState::looping() { 111bool MediaPlayerState::looping() {
107 return isLooping; 112 return isLooping;
108} 113}
109 114
110bool MediaPlayerState::shuffled() { 115bool MediaPlayerState::shuffled() {
111 return isShuffled; 116 return isShuffled;
112} 117}
113 118
114 119
115bool MediaPlayerState:: playlist() { 120bool MediaPlayerState::playlist() {
116 return usePlaylist; 121 return usePlaylist;
117} 122}
118 123
119bool MediaPlayerState::paused() { 124bool MediaPlayerState::paused() {
120 return isPaused; 125 return isPaused;
121} 126}
122 127
123bool MediaPlayerState::playing() { 128bool MediaPlayerState::playing() {
124 return isPlaying; 129 return isPlaying;
125} 130}
126 131
127bool MediaPlayerState::stop() { 132bool MediaPlayerState::stop() {
@@ -140,24 +145,33 @@ char MediaPlayerState::view() {
140 return curView; 145 return curView;
141} 146}
142 147
143// slots 148// slots
144void MediaPlayerState::setIsStreaming( bool b ) { 149void MediaPlayerState::setIsStreaming( bool b ) {
145 150
146 if ( isStreaming == b ) { 151 if ( isStreaming == b ) {
147 return; 152 return;
148 } 153 }
149 isStreaming = b; 154 isStreaming = b;
150} 155}
151 156
157void MediaPlayerState::setIsSeekable( bool b ) {
158
159 //if ( isSeekable == b ) {
160 // return;
161 // }
162 isSeekable = b;
163 emit isSeekableToggled(b);
164}
165
152 166
153void MediaPlayerState::setFullscreen( bool b ) { 167void MediaPlayerState::setFullscreen( bool b ) {
154 if ( isFullscreen == b ) { 168 if ( isFullscreen == b ) {
155 return; 169 return;
156 } 170 }
157 isFullscreen = b; 171 isFullscreen = b;
158 emit fullscreenToggled(b); 172 emit fullscreenToggled(b);
159} 173}
160 174
161 175
162void MediaPlayerState::setBlanked( bool b ) { 176void MediaPlayerState::setBlanked( bool b ) {
163 if ( isBlanked == b ) { 177 if ( isBlanked == b ) {
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.h b/noncore/multimedia/opieplayer2/mediaplayerstate.h
index 4fef8e0..8c4e09e 100644
--- a/noncore/multimedia/opieplayer2/mediaplayerstate.h
+++ b/noncore/multimedia/opieplayer2/mediaplayerstate.h
@@ -45,38 +45,40 @@ class Config;
45 45
46 46
47class MediaPlayerState : public QObject { 47class MediaPlayerState : public QObject {
48Q_OBJECT 48Q_OBJECT
49public: 49public:
50 MediaPlayerState( QObject *parent, const char *name ); 50 MediaPlayerState( QObject *parent, const char *name );
51 ~MediaPlayerState(); 51 ~MediaPlayerState();
52 52
53 bool isPaused; 53 bool isPaused;
54 bool isPlaying; 54 bool isPlaying;
55 bool isStoped; 55 bool isStoped;
56 bool streaming(); 56 bool streaming();
57 bool seekable();
57 bool fullscreen(); 58 bool fullscreen();
58 bool scaled(); 59 bool scaled();
59 bool looping(); 60 bool looping();
60 bool shuffled(); 61 bool shuffled();
61 bool playlist(); 62 bool playlist();
62 bool paused(); 63 bool paused();
63 bool playing(); 64 bool playing();
64 bool stop(); 65 bool stop();
65 long position(); 66 long position();
66 long length(); 67 long length();
67 char view(); 68 char view();
68 69
69public slots: 70public slots:
70 void setIsStreaming( bool b ); 71 void setIsStreaming( bool b );
72 void setIsSeekable( bool b );
71 void setFullscreen( bool b ); 73 void setFullscreen( bool b );
72 void setScaled( bool b ); 74 void setScaled( bool b );
73 void setLooping( bool b ); 75 void setLooping( bool b );
74 void setShuffled( bool b ); 76 void setShuffled( bool b );
75 void setPlaylist( bool b ); 77 void setPlaylist( bool b );
76 void setPaused( bool b ); 78 void setPaused( bool b );
77 void setPlaying( bool b ); 79 void setPlaying( bool b );
78 void setStop( bool b ); 80 void setStop( bool b );
79 void setPosition( long p ); 81 void setPosition( long p );
80 void updatePosition( long p ); 82 void updatePosition( long p );
81 void setLength( long l ); 83 void setLength( long l );
82 void setView( char v ); 84 void setView( char v );
@@ -104,31 +106,33 @@ signals:
104 void fullscreenToggled( bool ); 106 void fullscreenToggled( bool );
105 void scaledToggled( bool ); 107 void scaledToggled( bool );
106 void loopingToggled( bool ); 108 void loopingToggled( bool );
107 void shuffledToggled( bool ); 109 void shuffledToggled( bool );
108 void playlistToggled( bool ); 110 void playlistToggled( bool );
109 void pausedToggled( bool ); 111 void pausedToggled( bool );
110 void playingToggled( bool ); 112 void playingToggled( bool );
111 void stopToggled( bool ); 113 void stopToggled( bool );
112 void positionChanged( long ); // When the slider is moved 114 void positionChanged( long ); // When the slider is moved
113 void positionUpdated( long ); // When the media file progresses 115 void positionUpdated( long ); // When the media file progresses
114 void lengthChanged( long ); 116 void lengthChanged( long );
115 void viewChanged( char ); 117 void viewChanged( char );
118 void isSeekableToggled( bool );
116 void blankToggled( bool ); 119 void blankToggled( bool );
117 void videoGammaChanged( int ); 120 void videoGammaChanged( int );
118 void prev(); 121 void prev();
119 void next(); 122 void next();
120 123
121private: 124private:
122 bool isStreaming; 125 bool isStreaming;
126 bool isSeekable;
123 bool isFullscreen; 127 bool isFullscreen;
124 bool isScaled; 128 bool isScaled;
125 bool isBlanked; 129 bool isBlanked;
126 bool isLooping; 130 bool isLooping;
127 bool isShuffled; 131 bool isShuffled;
128 bool usePlaylist; 132 bool usePlaylist;
129 long curPosition; 133 long curPosition;
130 long curLength; 134 long curLength;
131 char curView; 135 char curView;
132 int videoGamma; 136 int videoGamma;
133 void readConfig( Config& cfg ); 137 void readConfig( Config& cfg );
134 138
diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c
index b1f4811..707efeb 100644
--- a/noncore/multimedia/opieplayer2/nullvideo.c
+++ b/noncore/multimedia/opieplayer2/nullvideo.c
@@ -488,25 +488,25 @@ xine_vo_driver_t* init_video_out_plugin( config_values_t* conf,
488 vo->yuv2rgb_cmap); 488 vo->yuv2rgb_cmap);
489 489
490 return ( xine_vo_driver_t*) vo; 490 return ( xine_vo_driver_t*) vo;
491} 491}
492 492
493#if 0 493#if 0
494static vo_info_t vo_info_null = { 494static vo_info_t vo_info_null = {
495 5, 495 5,
496 XINE_VISUAL_TYPE_FB 496 XINE_VISUAL_TYPE_FB
497}; 497};
498 498
499vo_info_t *get_video_out_plugin_info(){ 499vo_info_t *get_video_out_plugin_info(){
500 vo_info_null.description = _("xine video output plugin using null device"); 500 vo_info_null.description = ("xine video output plugin using null device");
501 return &vo_info_null; 501 return &vo_info_null;
502} 502}
503 503
504#endif 504#endif
505 505
506/* this is special for this device */ 506/* this is special for this device */
507/** 507/**
508 * We know that we will be controled by the XINE LIB++ 508 * We know that we will be controled by the XINE LIB++
509 */ 509 */
510 510
511/** 511/**
512 * 512 *
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index 7b8ad7a..7d71d09 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -375,41 +375,40 @@ void VideoWidget::showEvent( QShowEvent* ) {
375 void VideoWidget::backToNormal() { 375 void VideoWidget::backToNormal() {
376 mediaPlayerState->setFullscreen( FALSE ); 376 mediaPlayerState->setFullscreen( FALSE );
377 makeVisible(); 377 makeVisible();
378 } 378 }
379 379
380void VideoWidget::makeVisible() { 380void VideoWidget::makeVisible() {
381 if ( mediaPlayerState->fullscreen() ) { 381 if ( mediaPlayerState->fullscreen() ) {
382 setBackgroundMode( QWidget::NoBackground ); 382 setBackgroundMode( QWidget::NoBackground );
383 showFullScreen(); 383 showFullScreen();
384 resize( qApp->desktop()->size() ); 384 resize( qApp->desktop()->size() );
385 slider->hide(); 385 slider->hide();
386 videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); 386 videoFrame-> setGeometry ( 0, 0, width ( ), height ( ));
387// qApp->processEvents();
388 } else { 387 } else {
389 showNormal(); 388 showNormal();
390 showMaximized(); 389 showMaximized();
391 setBackgroundPixmap( *pixBg ); 390 setBackgroundPixmap( *pixBg );
392 if ( mediaPlayerState->streaming() ) { 391 if ( mediaPlayerState->seekable() ) {
393 slider->hide(); 392 slider->hide();
394 disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 393 disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
395 disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); 394 disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
396 } else { 395 } else {
397 slider->show(); 396 slider->show();
398 connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 397 connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
399 connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); 398 connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
400 } 399 }
401 QWidget *d = QApplication::desktop(); 400 QWidget *d = QApplication::desktop();
402 int w=d->width(); 401 int w = d->width();
403 int h=d->height(); 402 int h = d->height();
404 403
405 if(w>h) { 404 if(w>h) {
406 int newW=(w/2)-(246/2); //this will only work with 320x240 405 int newW=(w/2)-(246/2); //this will only work with 320x240
407 videoFrame->setGeometry( QRect( newW, 4, 240, 170 ) ); 406 videoFrame->setGeometry( QRect( newW, 4, 240, 170 ) );
408 } else 407 } else
409 videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) ); 408 videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) );
410 409
411// qApp->processEvents(); 410// qApp->processEvents();
412 } 411 }
413} 412}
414 413
415 414
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index 03176b3..65ac127 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -66,49 +66,50 @@ XineControl::~XineControl() {
66 // Re-enable the suspend mode 66 // Re-enable the suspend mode
67 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; 67 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
68 } 68 }
69#endif 69#endif
70 delete libXine; 70 delete libXine;
71} 71}
72 72
73void XineControl::play( const QString& fileName ) { 73void XineControl::play( const QString& fileName ) {
74 hasVideoChannel = FALSE; 74 hasVideoChannel = FALSE;
75 hasAudioChannel = FALSE; 75 hasAudioChannel = FALSE;
76 m_fileName = fileName; 76 m_fileName = fileName;
77 77
78 //qDebug("<<FILENAME: " + fileName + ">>>>"); 78 qDebug("<<FILENAME: " + fileName + ">>>>");
79 79
80 if ( !libXine->play( fileName ) ) { 80 if ( !libXine->play( fileName, 0, 0 ) ) {
81 QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() ); 81 QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() );
82 // toggle stop so the the play button is reset 82 // toggle stop so the the play button is reset
83 mediaPlayerState->setPlaying( false ); 83 mediaPlayerState->setPlaying( false );
84 return; 84 return;
85 } 85 }
86 mediaPlayerState->setPlaying( true ); 86 mediaPlayerState->setPlaying( true );
87 87
88 char whichGui; 88 char whichGui;
89 // qDebug( QString( "libXine->hasVideo() return : %1 ").arg( libXine->hasVideo() ) ); 89 // qDebug( QString( "libXine->hasVideo() return : %1 ").arg( libXine->hasVideo() ) );
90 if ( !libXine->hasVideo() ) { 90 if ( !libXine->hasVideo() ) {
91 whichGui = 'a'; 91 whichGui = 'a';
92 qDebug("HAS AUDIO"); 92 qDebug("HAS AUDIO");
93 libXine->setShowVideo( false ); 93 libXine->setShowVideo( false );
94 hasAudioChannel = TRUE; 94 hasAudioChannel = TRUE;
95 } else { 95 } else {
96 whichGui = 'v'; 96 whichGui = 'v';
97 qDebug("HAS VIDEO"); 97 qDebug("HAS VIDEO");
98 libXine->setShowVideo( true ); 98 libXine->setShowVideo( true );
99 hasVideoChannel = TRUE; 99 hasVideoChannel = TRUE;
100 } 100 }
101 // determine if slider is shown 101 // determine if slider is shown
102 mediaPlayerState->setIsStreaming( !libXine->isSeekable() ); 102 mediaPlayerState->setIsSeekable( !libXine->isSeekable() );
103
103 // which gui (video / audio) 104 // which gui (video / audio)
104 mediaPlayerState->setView( whichGui ); 105 mediaPlayerState->setView( whichGui );
105 106
106#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 107#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
107 if ( !disabledSuspendScreenSaver ) { 108 if ( !disabledSuspendScreenSaver ) {
108 disabledSuspendScreenSaver = TRUE; 109 disabledSuspendScreenSaver = TRUE;
109 // Stop the screen from blanking and power saving state 110 // Stop the screen from blanking and power saving state
110 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) 111 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" )
111 << ( whichGui == 'v' ? QPEApplication::Disable : QPEApplication::DisableSuspend ); 112 << ( whichGui == 'v' ? QPEApplication::Disable : QPEApplication::DisableSuspend );
112 } 113 }
113#endif 114#endif
114 115