-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 { | |||
84 | cfg.writeEntry( "Shuffle", shuffled ); | 84 | cfg.writeEntry( "Shuffle", shuffled ); |
85 | cfg.writeEntry( "VideoGamma", videoGamma ); | 85 | cfg.writeEntry( "VideoGamma", videoGamma ); |
86 | } | 86 | } |
87 | 87 | ||
88 | MediaPlayerState::MediaType MediaPlayerState::mediaType() const | ||
89 | { | ||
90 | return view() == 'a' ? MediaPlayerState::Audio : MediaPlayerState::Video; | ||
91 | } | ||
92 | |||
88 | // slots | 93 | // slots |
89 | void MediaPlayerState::setIsStreaming( bool b ) { | 94 | void MediaPlayerState::setIsStreaming( bool b ) { |
90 | streaming = b; | 95 | streaming = b; |
91 | } | 96 | } |
@@ -202,8 +207,9 @@ void MediaPlayerState::setView( char v ) { | |||
202 | return; | 207 | return; |
203 | } | 208 | } |
204 | curView = v; | 209 | curView = v; |
205 | emit viewChanged(v); | 210 | emit viewChanged(v); |
211 | emit mediaTypeChanged( mediaType() ); | ||
206 | } | 212 | } |
207 | 213 | ||
208 | void MediaPlayerState::setPrev(){ | 214 | void MediaPlayerState::setPrev(){ |
209 | emit prev(); | 215 | 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; | |||
46 | 46 | ||
47 | class MediaPlayerState : public QObject { | 47 | class MediaPlayerState : public QObject { |
48 | Q_OBJECT | 48 | Q_OBJECT |
49 | public: | 49 | public: |
50 | enum MediaType { Audio, Video }; | ||
51 | |||
50 | MediaPlayerState( QObject *parent, const char *name ); | 52 | MediaPlayerState( QObject *parent, const char *name ); |
51 | ~MediaPlayerState(); | 53 | ~MediaPlayerState(); |
52 | 54 | ||
53 | bool isStreaming() const { return streaming; } | 55 | bool isStreaming() const { return streaming; } |
@@ -61,8 +63,9 @@ public: | |||
61 | bool isStopped() const { return stopped; } | 63 | bool isStopped() const { return stopped; } |
62 | long position() const { return curPosition; } | 64 | long position() const { return curPosition; } |
63 | long length() const { return curLength; } | 65 | long length() const { return curLength; } |
64 | char view() const { return curView; } | 66 | char view() const { return curView; } |
67 | MediaType mediaType() const; | ||
65 | 68 | ||
66 | public slots: | 69 | public slots: |
67 | void setIsStreaming( bool b ); | 70 | void setIsStreaming( bool b ); |
68 | void setIsSeekable( bool b ); | 71 | void setIsSeekable( bool b ); |
@@ -107,8 +110,9 @@ signals: | |||
107 | void positionChanged( long ); // When the slider is moved | 110 | void positionChanged( long ); // When the slider is moved |
108 | void positionUpdated( long ); // When the media file progresses | 111 | void positionUpdated( long ); // When the media file progresses |
109 | void lengthChanged( long ); | 112 | void lengthChanged( long ); |
110 | void viewChanged( char ); | 113 | void viewChanged( char ); |
114 | void mediaTypeChanged( MediaType type ); | ||
111 | void isSeekableToggled( bool ); | 115 | void isSeekableToggled( bool ); |
112 | void blankToggled( bool ); | 116 | void blankToggled( bool ); |
113 | void videoGammaChanged( int ); | 117 | void videoGammaChanged( int ); |
114 | void prev(); | 118 | void prev(); |