author | simon <simon> | 2002-12-02 18:11:26 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-02 18:11:26 (UTC) |
commit | 66979ef81a8e945f8d34db05399b1d92cdb3b67a (patch) (side-by-side diff) | |
tree | 1d99c8cceb3abae3be0947c712b0fa28d0c24d87 | |
parent | 41fe383fe8b840de6dc0bcd47cd29b0d68bf760a (diff) | |
download | opie-66979ef81a8e945f8d34db05399b1d92cdb3b67a.zip opie-66979ef81a8e945f8d34db05399b1d92cdb3b67a.tar.gz opie-66979ef81a8e945f8d34db05399b1d92cdb3b67a.tar.bz2 |
- introducing MediaType { Video, Audio } enum, to get rid of the
char view ('a' and 'v') step by step
-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 @@ -84,8 +84,13 @@ void MediaPlayerState::writeConfig( Config& cfg ) const { cfg.writeEntry( "Shuffle", shuffled ); cfg.writeEntry( "VideoGamma", videoGamma ); } +MediaPlayerState::MediaType MediaPlayerState::mediaType() const +{ + return view() == 'a' ? MediaPlayerState::Audio : MediaPlayerState::Video; +} + // slots void MediaPlayerState::setIsStreaming( bool b ) { streaming = b; } @@ -202,8 +207,9 @@ void MediaPlayerState::setView( char v ) { return; } curView = v; emit viewChanged(v); + emit mediaTypeChanged( mediaType() ); } void MediaPlayerState::setPrev(){ emit prev(); 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 @@ -46,8 +46,10 @@ class Config; class MediaPlayerState : public QObject { Q_OBJECT public: + enum MediaType { Audio, Video }; + MediaPlayerState( QObject *parent, const char *name ); ~MediaPlayerState(); bool isStreaming() const { return streaming; } @@ -61,8 +63,9 @@ public: bool isStopped() const { return stopped; } long position() const { return curPosition; } long length() const { return curLength; } char view() const { return curView; } + MediaType mediaType() const; public slots: void setIsStreaming( bool b ); void setIsSeekable( bool b ); @@ -107,8 +110,9 @@ signals: void positionChanged( long ); // When the slider is moved void positionUpdated( long ); // When the media file progresses void lengthChanged( long ); void viewChanged( char ); + void mediaTypeChanged( MediaType type ); void isSeekableToggled( bool ); void blankToggled( bool ); void videoGammaChanged( int ); void prev(); |