-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 @@ -165,3 +165,3 @@ void MediaPlayer::next() { mediaPlayerState->setPlaying(false); - mediaPlayerState->setView('l'); + mediaPlayerState->setDisplayType( MediaPlayerState::MediaSelection ); if(l) mediaPlayerState->setLooping(l); 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 @@ -87,14 +87,2 @@ void MediaPlayerState::writeConfig( Config& cfg ) const { -char MediaPlayerState::view() const -{ - switch ( m_displayType ) { - case Audio: return 'a'; - case Video: return 'v'; - case MediaSelection: return 'l'; - default: assert( false ); - } - // never reached - return 42; -} - MediaPlayerState::DisplayType MediaPlayerState::displayType() const @@ -216,11 +204,2 @@ void MediaPlayerState::setLength( long l ) { -void MediaPlayerState::setView( char v ) { - switch ( v ) { - case 'a': setDisplayType( Audio ); return; - case 'v': setDisplayType( Video ); return; - case 'l': setDisplayType( MediaSelection ); return; - default: assert( false ); - } -} - void MediaPlayerState::setDisplayType( DisplayType displayType ) @@ -244,3 +223,3 @@ void MediaPlayerState::setList() { setPlaying( FALSE ); - setView('l'); + setDisplayType( MediaSelection ); } @@ -248,3 +227,3 @@ void MediaPlayerState::setList() { void MediaPlayerState::setVideo() { - setView('v'); + setDisplayType( Video ); } @@ -252,3 +231,3 @@ void MediaPlayerState::setVideo() { void MediaPlayerState::setAudio() { - setView('a'); + setDisplayType( Audio ); } 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 @@ -65,3 +65,2 @@ public: long length() const { return curLength; } - char view() const; DisplayType displayType() const; @@ -81,3 +80,2 @@ public slots: void setLength( long l ); - void setView( char v ); void setDisplayType( MediaPlayerState::DisplayType displayType ); 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 @@ -223,5 +223,5 @@ void PlayListWidgetGui::setActiveWindow() { // When we get raised we need to ensure that it switches views - char origView = mediaPlayerState->view(); - mediaPlayerState->setView( 'l' ); // invalidate - mediaPlayerState->setView( origView ); // now switch back + MediaPlayerState::DisplayType origDisplayType = mediaPlayerState->displayType(); + mediaPlayerState->setDisplayType( MediaPlayerState::MediaSelection ); // invalidate + mediaPlayerState->setDisplayType( origDisplayType ); // now switch back } 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 @@ -87,6 +87,6 @@ void XineControl::play( const QString& fileName ) { - char whichGui; + MediaPlayerState::DisplayType displayType; // qDebug( QString( "libXine->hasVideo() return : %1 ").arg( libXine->hasVideo() ) ); if ( !libXine->hasVideo() ) { - whichGui = 'a'; + displayType = MediaPlayerState::Audio; qDebug("HAS AUDIO"); @@ -95,3 +95,3 @@ void XineControl::play( const QString& fileName ) { } else { - whichGui = 'v'; + displayType = MediaPlayerState::Video; qDebug("HAS VIDEO"); @@ -104,3 +104,3 @@ void XineControl::play( const QString& fileName ) { // which gui (video / audio) - mediaPlayerState->setView( whichGui ); + mediaPlayerState->setDisplayType( displayType ); @@ -111,3 +111,3 @@ void XineControl::play( const QString& fileName ) { QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) - << ( whichGui == 'v' ? QPEApplication::Disable : QPEApplication::DisableSuspend ); + << ( displayType == MediaPlayerState::Video ? QPEApplication::Disable : QPEApplication::DisableSuspend ); } |