author | simon <simon> | 2002-12-02 19:29:34 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-02 19:29:34 (UTC) |
commit | af73e44e57b1095f92b6f6bcd530c2e4b626a664 (patch) (side-by-side diff) | |
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 @@ -160,13 +160,13 @@ void MediaPlayer::next() { } else { mediaPlayerState->setList(); } } else { //if playing from file list, let's just stop qDebug("<<<<<<<<<<<<<<<<<stop for filelists"); mediaPlayerState->setPlaying(false); - mediaPlayerState->setView('l'); + mediaPlayerState->setDisplayType( MediaPlayerState::MediaSelection ); if(l) mediaPlayerState->setLooping(l); if(r) mediaPlayerState->setShuffled(r); } qApp->processEvents(); } 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 @@ -82,24 +82,12 @@ void MediaPlayerState::writeConfig( Config& cfg ) const { cfg.writeEntry( "Scaling", scaled ); cfg.writeEntry( "Looping", looping ); cfg.writeEntry( "Shuffle", shuffled ); cfg.writeEntry( "VideoGamma", videoGamma ); } -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 { return m_displayType; } // slots @@ -211,21 +199,12 @@ void MediaPlayerState::setLength( long l ) { return; } curLength = l; emit lengthChanged(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 ) { if ( m_displayType == displayType ) return; m_displayType = displayType; @@ -239,21 +218,21 @@ void MediaPlayerState::setPrev(){ void MediaPlayerState::setNext() { emit next(); } void MediaPlayerState::setList() { setPlaying( FALSE ); - setView('l'); + setDisplayType( MediaSelection ); } void MediaPlayerState::setVideo() { - setView('v'); + setDisplayType( Video ); } void MediaPlayerState::setAudio() { - setView('a'); + setDisplayType( Audio ); } void MediaPlayerState::toggleFullscreen() { setFullscreen( !fullscreen ); } 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 @@ -60,13 +60,12 @@ public: bool isShuffled() const { return shuffled; } bool isPaused() const { return paused; } bool isPlaying() const { return playing; } bool isStopped() const { return stopped; } long position() const { return curPosition; } long length() const { return curLength; } - char view() const; DisplayType displayType() const; public slots: void setIsStreaming( bool b ); void setIsSeekable( bool b ); void setFullscreen( bool b ); @@ -76,13 +75,12 @@ public slots: void setPaused( bool b ); void setPlaying( bool b ); void setStopped( bool b ); void setPosition( long p ); void updatePosition( long p ); void setLength( long l ); - void setView( char v ); void setDisplayType( MediaPlayerState::DisplayType displayType ); void setBlanked( bool b ); void setVideoGamma( int v ); void setPrev(); void setNext(); 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 @@ -218,11 +218,11 @@ void PlayListWidgetGui::setView( char view ) { } void PlayListWidgetGui::setActiveWindow() { // qDebug("SETTING active window"); // 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 @@ -82,37 +82,37 @@ void XineControl::play( const QString& fileName ) { // toggle stop so the the play button is reset mediaPlayerState->setPlaying( false ); return; } mediaPlayerState->setPlaying( true ); - 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"); libXine->setShowVideo( false ); hasAudioChannel = TRUE; } else { - whichGui = 'v'; + displayType = MediaPlayerState::Video; qDebug("HAS VIDEO"); libXine->setShowVideo( true ); hasVideoChannel = TRUE; } // determine if slider is shown mediaPlayerState->setIsSeekable( libXine->isSeekable() ); // which gui (video / audio) - mediaPlayerState->setView( whichGui ); + mediaPlayerState->setDisplayType( displayType ); #if defined(Q_WS_QWS) && !defined(QT_NO_COP) if ( !disabledSuspendScreenSaver ) { disabledSuspendScreenSaver = TRUE; // Stop the screen from blanking and power saving state QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) - << ( whichGui == 'v' ? QPEApplication::Disable : QPEApplication::DisableSuspend ); + << ( displayType == MediaPlayerState::Video ? QPEApplication::Disable : QPEApplication::DisableSuspend ); } #endif length(); position(); } |