-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.cpp | 6 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.h | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index 586870c..22451b7 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp @@ -86,4 +86,9 @@ void MediaPlayerState::writeConfig( Config& cfg ) const { } +MediaPlayerState::MediaType MediaPlayerState::mediaType() const +{ + return view() == 'a' ? MediaPlayerState::Audio : MediaPlayerState::Video; +} + // slots void MediaPlayerState::setIsStreaming( bool b ) { @@ -204,4 +209,5 @@ void MediaPlayerState::setView( char v ) { curView = v; emit viewChanged(v); + emit mediaTypeChanged( mediaType() ); } diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.h b/noncore/multimedia/opieplayer2/mediaplayerstate.h index fc4e6cb..9474882 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.h +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.h @@ -48,4 +48,6 @@ class MediaPlayerState : public QObject { Q_OBJECT public: + enum MediaType { Audio, Video }; + MediaPlayerState( QObject *parent, const char *name ); ~MediaPlayerState(); @@ -63,4 +65,5 @@ public: long length() const { return curLength; } char view() const { return curView; } + MediaType mediaType() const; public slots: @@ -109,4 +112,5 @@ signals: void lengthChanged( long ); void viewChanged( char ); + void mediaTypeChanged( MediaType type ); void isSeekableToggled( bool ); void blankToggled( bool ); |