author | simon <simon> | 2002-12-02 19:29:34 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-02 19:29:34 (UTC) |
commit | af73e44e57b1095f92b6f6bcd530c2e4b626a664 (patch) (unidiff) | |
tree | f4178ea80b26bec9955e4c529d3b0c92301b08a8 | |
parent | 24081d2efe5860c9656716b04af00e5ab85d1cd3 (diff) | |
download | opie-af73e44e57b1095f92b6f6bcd530c2e4b626a664.zip opie-af73e44e57b1095f92b6f6bcd530c2e4b626a664.tar.gz opie-af73e44e57b1095f92b6f6bcd530c2e4b626a664.tar.bz2 |
- completed MediaPlayer::DisplayType transition
-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 | |||
@@ -163,7 +163,7 @@ void MediaPlayer::next() { | |||
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 | } |
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 | |||
@@ -85,18 +85,6 @@ void MediaPlayerState::writeConfig( Config& cfg ) const { | |||
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; |
@@ -214,15 +202,6 @@ void MediaPlayerState::setLength( long 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 ) |
@@ -242,15 +221,15 @@ void MediaPlayerState::setNext() { | |||
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() { |
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 | |||
@@ -63,7 +63,6 @@ public: | |||
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: |
@@ -79,7 +78,6 @@ public slots: | |||
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 ); |
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 | |||
@@ -221,8 +221,8 @@ void PlayListWidgetGui::setView( char view ) { | |||
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 | |||
@@ -85,15 +85,15 @@ void XineControl::play( const QString& fileName ) { | |||
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; |
@@ -102,14 +102,14 @@ void XineControl::play( const QString& fileName ) { | |||
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 | ||