-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.cpp | 27 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.h | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | 6 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 10 |
5 files changed, 12 insertions, 35 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index 74ab2e3..68bbae9 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp | |||
@@ -158,17 +158,17 @@ void MediaPlayer::next() { | |||
158 | play(); | 158 | play(); |
159 | } | 159 | } |
160 | } else { | 160 | } else { |
161 | mediaPlayerState->setList(); | 161 | mediaPlayerState->setList(); |
162 | } | 162 | } |
163 | } else { //if playing from file list, let's just stop | 163 | } else { //if playing from file list, let's just stop |
164 | qDebug("<<<<<<<<<<<<<<<<<stop for filelists"); | 164 | qDebug("<<<<<<<<<<<<<<<<<stop for filelists"); |
165 | mediaPlayerState->setPlaying(false); | 165 | mediaPlayerState->setPlaying(false); |
166 | mediaPlayerState->setView('l'); | 166 | mediaPlayerState->setDisplayType( MediaPlayerState::MediaSelection ); |
167 | if(l) mediaPlayerState->setLooping(l); | 167 | if(l) mediaPlayerState->setLooping(l); |
168 | if(r) mediaPlayerState->setShuffled(r); | 168 | if(r) mediaPlayerState->setShuffled(r); |
169 | } | 169 | } |
170 | qApp->processEvents(); | 170 | qApp->processEvents(); |
171 | } | 171 | } |
172 | 172 | ||
173 | 173 | ||
174 | void MediaPlayer::startDecreasingVolume() { | 174 | void MediaPlayer::startDecreasingVolume() { |
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index 901b43f..40fa1a4 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp | |||
@@ -80,28 +80,16 @@ void MediaPlayerState::writeConfig( Config& cfg ) const { | |||
80 | cfg.setGroup( "Options" ); | 80 | cfg.setGroup( "Options" ); |
81 | cfg.writeEntry( "FullScreen", fullscreen ); | 81 | cfg.writeEntry( "FullScreen", fullscreen ); |
82 | cfg.writeEntry( "Scaling", scaled ); | 82 | cfg.writeEntry( "Scaling", scaled ); |
83 | cfg.writeEntry( "Looping", looping ); | 83 | cfg.writeEntry( "Looping", looping ); |
84 | cfg.writeEntry( "Shuffle", shuffled ); | 84 | cfg.writeEntry( "Shuffle", shuffled ); |
85 | cfg.writeEntry( "VideoGamma", videoGamma ); | 85 | cfg.writeEntry( "VideoGamma", videoGamma ); |
86 | } | 86 | } |
87 | 87 | ||
88 | char MediaPlayerState::view() const | ||
89 | { | ||
90 | switch ( m_displayType ) { | ||
91 | case Audio: return 'a'; | ||
92 | case Video: return 'v'; | ||
93 | case MediaSelection: return 'l'; | ||
94 | default: assert( false ); | ||
95 | } | ||
96 | // never reached | ||
97 | return 42; | ||
98 | } | ||
99 | |||
100 | MediaPlayerState::DisplayType MediaPlayerState::displayType() const | 88 | MediaPlayerState::DisplayType MediaPlayerState::displayType() const |
101 | { | 89 | { |
102 | return m_displayType; | 90 | return m_displayType; |
103 | } | 91 | } |
104 | 92 | ||
105 | // slots | 93 | // slots |
106 | void MediaPlayerState::setIsStreaming( bool b ) { | 94 | void MediaPlayerState::setIsStreaming( bool b ) { |
107 | streaming = b; | 95 | streaming = b; |
@@ -209,25 +197,16 @@ void MediaPlayerState::setVideoGamma( int v ){ | |||
209 | void MediaPlayerState::setLength( long l ) { | 197 | void MediaPlayerState::setLength( long l ) { |
210 | if ( curLength == l ) { | 198 | if ( curLength == l ) { |
211 | return; | 199 | return; |
212 | } | 200 | } |
213 | curLength = l; | 201 | curLength = l; |
214 | emit lengthChanged(l); | 202 | emit lengthChanged(l); |
215 | } | 203 | } |
216 | 204 | ||
217 | void MediaPlayerState::setView( char v ) { | ||
218 | switch ( v ) { | ||
219 | case 'a': setDisplayType( Audio ); return; | ||
220 | case 'v': setDisplayType( Video ); return; | ||
221 | case 'l': setDisplayType( MediaSelection ); return; | ||
222 | default: assert( false ); | ||
223 | } | ||
224 | } | ||
225 | |||
226 | void MediaPlayerState::setDisplayType( DisplayType displayType ) | 205 | void MediaPlayerState::setDisplayType( DisplayType displayType ) |
227 | { | 206 | { |
228 | if ( m_displayType == displayType ) | 207 | if ( m_displayType == displayType ) |
229 | return; | 208 | return; |
230 | 209 | ||
231 | m_displayType = displayType; | 210 | m_displayType = displayType; |
232 | emit displayTypeChanged( m_displayType ); | 211 | emit displayTypeChanged( m_displayType ); |
233 | } | 212 | } |
@@ -237,25 +216,25 @@ void MediaPlayerState::setPrev(){ | |||
237 | } | 216 | } |
238 | 217 | ||
239 | void MediaPlayerState::setNext() { | 218 | void MediaPlayerState::setNext() { |
240 | emit next(); | 219 | emit next(); |
241 | } | 220 | } |
242 | 221 | ||
243 | void MediaPlayerState::setList() { | 222 | void MediaPlayerState::setList() { |
244 | setPlaying( FALSE ); | 223 | setPlaying( FALSE ); |
245 | setView('l'); | 224 | setDisplayType( MediaSelection ); |
246 | } | 225 | } |
247 | 226 | ||
248 | void MediaPlayerState::setVideo() { | 227 | void MediaPlayerState::setVideo() { |
249 | setView('v'); | 228 | setDisplayType( Video ); |
250 | } | 229 | } |
251 | 230 | ||
252 | void MediaPlayerState::setAudio() { | 231 | void MediaPlayerState::setAudio() { |
253 | setView('a'); | 232 | setDisplayType( Audio ); |
254 | } | 233 | } |
255 | 234 | ||
256 | void MediaPlayerState::toggleFullscreen() { | 235 | void MediaPlayerState::toggleFullscreen() { |
257 | setFullscreen( !fullscreen ); | 236 | setFullscreen( !fullscreen ); |
258 | } | 237 | } |
259 | 238 | ||
260 | void MediaPlayerState::toggleScaled() { | 239 | void MediaPlayerState::toggleScaled() { |
261 | setScaled( !scaled); | 240 | setScaled( !scaled); |
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.h b/noncore/multimedia/opieplayer2/mediaplayerstate.h index b18780b..c887bb8 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.h +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.h | |||
@@ -58,33 +58,31 @@ public: | |||
58 | bool isScaled() const { return scaled; } | 58 | bool isScaled() const { return scaled; } |
59 | bool isLooping() const { return looping; } | 59 | bool isLooping() const { return looping; } |
60 | bool isShuffled() const { return shuffled; } | 60 | bool isShuffled() const { return shuffled; } |
61 | bool isPaused() const { return paused; } | 61 | bool isPaused() const { return paused; } |
62 | bool isPlaying() const { return playing; } | 62 | bool isPlaying() const { return playing; } |
63 | bool isStopped() const { return stopped; } | 63 | bool isStopped() const { return stopped; } |
64 | long position() const { return curPosition; } | 64 | long position() const { return curPosition; } |
65 | long length() const { return curLength; } | 65 | long length() const { return curLength; } |
66 | char view() const; | ||
67 | DisplayType displayType() const; | 66 | DisplayType displayType() const; |
68 | 67 | ||
69 | public slots: | 68 | public slots: |
70 | void setIsStreaming( bool b ); | 69 | void setIsStreaming( bool b ); |
71 | void setIsSeekable( bool b ); | 70 | void setIsSeekable( bool b ); |
72 | void setFullscreen( bool b ); | 71 | void setFullscreen( bool b ); |
73 | void setScaled( bool b ); | 72 | void setScaled( bool b ); |
74 | void setLooping( bool b ); | 73 | void setLooping( bool b ); |
75 | void setShuffled( bool b ); | 74 | void setShuffled( bool b ); |
76 | void setPaused( bool b ); | 75 | void setPaused( bool b ); |
77 | void setPlaying( bool b ); | 76 | void setPlaying( bool b ); |
78 | void setStopped( bool b ); | 77 | void setStopped( bool b ); |
79 | void setPosition( long p ); | 78 | void setPosition( long p ); |
80 | void updatePosition( long p ); | 79 | void updatePosition( long p ); |
81 | void setLength( long l ); | 80 | void setLength( long l ); |
82 | void setView( char v ); | ||
83 | void setDisplayType( MediaPlayerState::DisplayType displayType ); | 81 | void setDisplayType( MediaPlayerState::DisplayType displayType ); |
84 | void setBlanked( bool b ); | 82 | void setBlanked( bool b ); |
85 | void setVideoGamma( int v ); | 83 | void setVideoGamma( int v ); |
86 | 84 | ||
87 | void setPrev(); | 85 | void setPrev(); |
88 | void setNext(); | 86 | void setNext(); |
89 | void setList(); | 87 | void setList(); |
90 | void setVideo(); | 88 | void setVideo(); |
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp index db7c979..8be7a2f 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | |||
@@ -216,13 +216,13 @@ void PlayListWidgetGui::setView( char view ) { | |||
216 | else | 216 | else |
217 | hide(); | 217 | hide(); |
218 | } | 218 | } |
219 | 219 | ||
220 | 220 | ||
221 | void PlayListWidgetGui::setActiveWindow() { | 221 | void PlayListWidgetGui::setActiveWindow() { |
222 | // qDebug("SETTING active window"); | 222 | // qDebug("SETTING active window"); |
223 | // When we get raised we need to ensure that it switches views | 223 | // When we get raised we need to ensure that it switches views |
224 | char origView = mediaPlayerState->view(); | 224 | MediaPlayerState::DisplayType origDisplayType = mediaPlayerState->displayType(); |
225 | mediaPlayerState->setView( 'l' ); // invalidate | 225 | mediaPlayerState->setDisplayType( MediaPlayerState::MediaSelection ); // invalidate |
226 | mediaPlayerState->setView( origView ); // now switch back | 226 | mediaPlayerState->setDisplayType( origDisplayType ); // now switch back |
227 | } | 227 | } |
228 | 228 | ||
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 71e08a6..e7d5a7b 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -80,41 +80,41 @@ void XineControl::play( const QString& fileName ) { | |||
80 | if ( !libXine->play( fileName, 0, 0 ) ) { | 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 | MediaPlayerState::DisplayType displayType; |
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 | displayType = MediaPlayerState::Audio; |
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 | displayType = MediaPlayerState::Video; |
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->setIsSeekable( libXine->isSeekable() ); | 102 | mediaPlayerState->setIsSeekable( libXine->isSeekable() ); |
103 | 103 | ||
104 | // which gui (video / audio) | 104 | // which gui (video / audio) |
105 | mediaPlayerState->setView( whichGui ); | 105 | mediaPlayerState->setDisplayType( displayType ); |
106 | 106 | ||
107 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 107 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
108 | if ( !disabledSuspendScreenSaver ) { | 108 | if ( !disabledSuspendScreenSaver ) { |
109 | disabledSuspendScreenSaver = TRUE; | 109 | disabledSuspendScreenSaver = TRUE; |
110 | // Stop the screen from blanking and power saving state | 110 | // Stop the screen from blanking and power saving state |
111 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) | 111 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) |
112 | << ( whichGui == 'v' ? QPEApplication::Disable : QPEApplication::DisableSuspend ); | 112 | << ( displayType == MediaPlayerState::Video ? QPEApplication::Disable : QPEApplication::DisableSuspend ); |
113 | } | 113 | } |
114 | #endif | 114 | #endif |
115 | 115 | ||
116 | length(); | 116 | length(); |
117 | position(); | 117 | position(); |
118 | } | 118 | } |
119 | 119 | ||
120 | void XineControl::nextMedia() { | 120 | void XineControl::nextMedia() { |