author | simon <simon> | 2002-12-02 18:11:26 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-02 18:11:26 (UTC) |
commit | 66979ef81a8e945f8d34db05399b1d92cdb3b67a (patch) (unidiff) | |
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 | |||
@@ -76,24 +76,29 @@ void MediaPlayerState::readConfig( Config& cfg ) { | |||
76 | } | 76 | } |
77 | 77 | ||
78 | 78 | ||
79 | void MediaPlayerState::writeConfig( Config& cfg ) const { | 79 | void MediaPlayerState::writeConfig( Config& cfg ) const { |
80 | cfg.setGroup( "Options" ); | 80 | cfg.setGroup( "Options" ); |
81 | cfg.writeEntry( "FullScreen", fullscreen ); | 81 | cfg.writeEntry( "FullScreen", fullscreen ); |
82 | cfg.writeEntry( "Scaling", scaled ); | 82 | cfg.writeEntry( "Scaling", scaled ); |
83 | cfg.writeEntry( "Looping", looping ); | 83 | cfg.writeEntry( "Looping", looping ); |
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 | } |
92 | 97 | ||
93 | void MediaPlayerState::setIsSeekable( bool b ) { | 98 | void MediaPlayerState::setIsSeekable( bool b ) { |
94 | seekable = b; | 99 | seekable = b; |
95 | emit isSeekableToggled(b); | 100 | emit isSeekableToggled(b); |
96 | } | 101 | } |
97 | 102 | ||
98 | 103 | ||
99 | void MediaPlayerState::setFullscreen( bool b ) { | 104 | void MediaPlayerState::setFullscreen( bool b ) { |
@@ -194,24 +199,25 @@ void MediaPlayerState::setLength( long l ) { | |||
194 | return; | 199 | return; |
195 | } | 200 | } |
196 | curLength = l; | 201 | curLength = l; |
197 | emit lengthChanged(l); | 202 | emit lengthChanged(l); |
198 | } | 203 | } |
199 | 204 | ||
200 | void MediaPlayerState::setView( char v ) { | 205 | void MediaPlayerState::setView( char v ) { |
201 | if ( curView == v ) { | 206 | if ( curView == 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(); |
210 | } | 216 | } |
211 | 217 | ||
212 | void MediaPlayerState::setNext() { | 218 | void MediaPlayerState::setNext() { |
213 | emit next(); | 219 | emit next(); |
214 | } | 220 | } |
215 | 221 | ||
216 | void MediaPlayerState::setList() { | 222 | void MediaPlayerState::setList() { |
217 | setPlaying( FALSE ); | 223 | setPlaying( FALSE ); |
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 | |||
@@ -38,39 +38,42 @@ | |||
38 | 38 | ||
39 | 39 | ||
40 | #include <qobject.h> | 40 | #include <qobject.h> |
41 | 41 | ||
42 | 42 | ||
43 | class MediaPlayerDecoder; | 43 | class MediaPlayerDecoder; |
44 | class Config; | 44 | class Config; |
45 | 45 | ||
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; } |
54 | bool isSeekable() const { return seekable; } | 56 | bool isSeekable() const { return seekable; } |
55 | bool isFullscreen() const { return fullscreen; } | 57 | bool isFullscreen() const { return fullscreen; } |
56 | bool isScaled() const { return scaled; } | 58 | bool isScaled() const { return scaled; } |
57 | bool isLooping() const { return looping; } | 59 | bool isLooping() const { return looping; } |
58 | bool isShuffled() const { return shuffled; } | 60 | bool isShuffled() const { return shuffled; } |
59 | bool isPaused() const { return paused; } | 61 | bool isPaused() const { return paused; } |
60 | bool isPlaying() const { return playing; } | 62 | bool isPlaying() const { return playing; } |
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 ); |
69 | void setFullscreen( bool b ); | 72 | void setFullscreen( bool b ); |
70 | void setScaled( bool b ); | 73 | void setScaled( bool b ); |
71 | void setLooping( bool b ); | 74 | void setLooping( bool b ); |
72 | void setShuffled( bool b ); | 75 | void setShuffled( bool b ); |
73 | void setPaused( bool b ); | 76 | void setPaused( bool b ); |
74 | void setPlaying( bool b ); | 77 | void setPlaying( bool b ); |
75 | void setStopped( bool b ); | 78 | void setStopped( bool b ); |
76 | void setPosition( long p ); | 79 | void setPosition( long p ); |
@@ -99,24 +102,25 @@ public slots: | |||
99 | signals: | 102 | signals: |
100 | void fullscreenToggled( bool ); | 103 | void fullscreenToggled( bool ); |
101 | void scaledToggled( bool ); | 104 | void scaledToggled( bool ); |
102 | void loopingToggled( bool ); | 105 | void loopingToggled( bool ); |
103 | void shuffledToggled( bool ); | 106 | void shuffledToggled( bool ); |
104 | void pausedToggled( bool ); | 107 | void pausedToggled( bool ); |
105 | void playingToggled( bool ); | 108 | void playingToggled( bool ); |
106 | void stopToggled( bool ); | 109 | void stopToggled( bool ); |
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(); |
115 | void next(); | 119 | void next(); |
116 | 120 | ||
117 | private: | 121 | private: |
118 | bool streaming : 1; | 122 | bool streaming : 1; |
119 | bool seekable : 1; | 123 | bool seekable : 1; |
120 | bool fullscreen: 1; | 124 | bool fullscreen: 1; |
121 | bool scaled : 1; | 125 | bool scaled : 1; |
122 | bool blanked : 1; | 126 | bool blanked : 1; |