-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 14 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.cpp | 16 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.h | 6 |
4 files changed, 23 insertions, 15 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 74bc390..1600320 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -161,5 +161,5 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); - connect( mediaPlayerState, SIGNAL( mediaTypeChanged(MediaPlayerState::MediaType) ), this, SLOT( setMediaType(MediaPlayerState::MediaType) ) ); + connect( mediaPlayerState, SIGNAL( displayTypeChanged(MediaPlayerState::DisplayType) ), this, SLOT( setDisplayType(MediaPlayerState::DisplayType) ) ); connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); @@ -265,13 +265,13 @@ void AudioWidget::setLength( long max ) { -void AudioWidget::setMediaType( MediaPlayerState::MediaType mediaType ) { - if ( mediaType == MediaPlayerState::Video ) { - killTimers(); - hide(); +void AudioWidget::setDisplayType( MediaPlayerState::DisplayType mediaType ) { + if ( mediaType == MediaPlayerState::Audio ) { + // startTimer( 150 ); + showMaximized(); return; } - // startTimer( 150 ); - showMaximized(); + killTimers(); + hide(); } diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index 3f0c059..91fcbc5 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h @@ -82,5 +82,5 @@ public slots: void setLength( long ); void setSeekable( bool ); - void setMediaType( MediaPlayerState::MediaType mediaType ); + void setDisplayType( MediaPlayerState::DisplayType displayType ); signals: diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index 22451b7..6806adc 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp @@ -42,5 +42,5 @@ #include "mediaplayerstate.h" - +#include <assert.h> //#define MediaPlayerDebug(x) qDebug x @@ -86,7 +86,15 @@ void MediaPlayerState::writeConfig( Config& cfg ) const { } -MediaPlayerState::MediaType MediaPlayerState::mediaType() const +MediaPlayerState::DisplayType MediaPlayerState::displayType() const { - return view() == 'a' ? MediaPlayerState::Audio : MediaPlayerState::Video; + char v = view(); + switch ( v ) { + case 'a': return MediaPlayerState::Audio; + case 'v': return MediaPlayerState::Video; + case 'l': return MediaPlayerState::MediaSelection; + default: assert( false ); + } + // never reached + return MediaPlayerState::MediaSelection; } @@ -209,5 +217,5 @@ void MediaPlayerState::setView( char v ) { curView = v; emit viewChanged(v); - emit mediaTypeChanged( mediaType() ); + emit displayTypeChanged( displayType() ); } diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.h b/noncore/multimedia/opieplayer2/mediaplayerstate.h index 05264cf..ca531c5 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.h +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.h @@ -48,5 +48,5 @@ class MediaPlayerState : public QObject { Q_OBJECT public: - enum MediaType { Audio, Video }; + enum DisplayType { Audio, Video, MediaSelection }; MediaPlayerState( QObject *parent, const char *name ); @@ -65,5 +65,5 @@ public: long length() const { return curLength; } char view() const { return curView; } - MediaType mediaType() const; + DisplayType displayType() const; public slots: @@ -112,5 +112,5 @@ signals: void lengthChanged( long ); void viewChanged( char ); - void mediaTypeChanged( MediaPlayerState::MediaType type ); + void displayTypeChanged( MediaPlayerState::DisplayType type ); void isSeekableToggled( bool ); void blankToggled( bool ); |