author | harlekin <harlekin> | 2002-11-10 15:09:09 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-11-10 15:09:09 (UTC) |
commit | 91932ca42cee5568477b1e49532a0b9e4d9bcf96 (patch) (unidiff) | |
tree | f134612cf7aa15787077b0a76c34aab30d72cae3 | |
parent | b6b57412a12c06d07f22060b7a165d71e5eddb84 (diff) | |
download | opie-91932ca42cee5568477b1e49532a0b9e4d9bcf96.zip opie-91932ca42cee5568477b1e49532a0b9e4d9bcf96.tar.gz opie-91932ca42cee5568477b1e49532a0b9e4d9bcf96.tar.bz2 |
besser seekable handling
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 33 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.cpp | 16 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.h | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/nullvideo.c | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 7 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 7 |
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 | |||
@@ -190,12 +190,12 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
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() ) ); |
@@ -204,6 +204,4 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
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() ); |
@@ -309,7 +307,18 @@ void AudioWidget::setLength( long max ) { | |||
309 | void AudioWidget::setView( char view ) { | 307 | void AudioWidget::setView( char view ) { |
310 | 308 | ||
311 | // this isnt working for some reason | 309 | if ( view == 'a' ) { |
310 | // startTimer( 150 ); | ||
311 | showMaximized(); | ||
312 | } else { | ||
313 | killTimers(); | ||
314 | hide(); | ||
315 | } | ||
316 | // qApp->processEvents(); | ||
317 | } | ||
318 | |||
319 | |||
320 | void 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()) { |
@@ -322,16 +331,8 @@ void AudioWidget::setView( char view ) { | |||
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 | ||
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 | |||
@@ -95,4 +95,5 @@ public slots: | |||
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 | ||
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 | |||
@@ -302,5 +302,5 @@ void MediaPlayer::blank( bool b ) { | |||
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 ) { |
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 | |||
@@ -53,4 +53,5 @@ MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) | |||
53 | readConfig( cfg ); | 53 | readConfig( cfg ); |
54 | isStreaming = false; | 54 | isStreaming = false; |
55 | isSeekable = true; | ||
55 | } | 56 | } |
56 | 57 | ||
@@ -96,4 +97,8 @@ bool MediaPlayerState::streaming() { | |||
96 | } | 97 | } |
97 | 98 | ||
99 | bool MediaPlayerState::seekable() { | ||
100 | return isSeekable; | ||
101 | } | ||
102 | |||
98 | bool MediaPlayerState::fullscreen() { | 103 | bool MediaPlayerState::fullscreen() { |
99 | return isFullscreen; | 104 | return isFullscreen; |
@@ -113,5 +118,5 @@ bool MediaPlayerState::shuffled() { | |||
113 | 118 | ||
114 | 119 | ||
115 | bool MediaPlayerState:: playlist() { | 120 | bool MediaPlayerState::playlist() { |
116 | return usePlaylist; | 121 | return usePlaylist; |
117 | } | 122 | } |
@@ -150,4 +155,13 @@ void MediaPlayerState::setIsStreaming( bool b ) { | |||
150 | } | 155 | } |
151 | 156 | ||
157 | void MediaPlayerState::setIsSeekable( bool b ) { | ||
158 | |||
159 | //if ( isSeekable == b ) { | ||
160 | // return; | ||
161 | // } | ||
162 | isSeekable = b; | ||
163 | emit isSeekableToggled(b); | ||
164 | } | ||
165 | |||
152 | 166 | ||
153 | void MediaPlayerState::setFullscreen( bool b ) { | 167 | void MediaPlayerState::setFullscreen( bool 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 | |||
@@ -55,4 +55,5 @@ public: | |||
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(); |
@@ -69,4 +70,5 @@ public: | |||
69 | public slots: | 70 | public 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 ); |
@@ -114,4 +116,5 @@ signals: | |||
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 ); |
@@ -121,4 +124,5 @@ signals: | |||
121 | private: | 124 | private: |
122 | bool isStreaming; | 125 | bool isStreaming; |
126 | bool isSeekable; | ||
123 | bool isFullscreen; | 127 | bool isFullscreen; |
124 | bool isScaled; | 128 | bool isScaled; |
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 | |||
@@ -498,5 +498,5 @@ static vo_info_t vo_info_null = { | |||
498 | 498 | ||
499 | vo_info_t *get_video_out_plugin_info(){ | 499 | vo_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 | } |
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 | |||
@@ -385,10 +385,9 @@ void VideoWidget::makeVisible() { | |||
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) ) ); |
@@ -400,6 +399,6 @@ void VideoWidget::makeVisible() { | |||
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) { |
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 | |||
@@ -76,7 +76,7 @@ void XineControl::play( const QString& fileName ) { | |||
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 |
@@ -100,5 +100,6 @@ void XineControl::play( const QString& fileName ) { | |||
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 ); |