-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index 44bc46b..31773f2 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp | |||
@@ -22,64 +22,66 @@ | |||
22 | ..}^=.= = ; General Public License for more | 22 | ..}^=.= = ; General Public License for more |
23 | ++= -. .` .: details. | 23 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 24 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 25 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = General Public License along with | 26 | -_. . . )=. = General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 27 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | // this file is based on work by trolltech | 34 | // this file is based on work by trolltech |
35 | 35 | ||
36 | #include <qpe/config.h> | 36 | #include <qpe/config.h> |
37 | #include "mediaplayerstate.h" | 37 | #include "mediaplayerstate.h" |
38 | 38 | ||
39 | #include <assert.h> | 39 | #include <assert.h> |
40 | 40 | ||
41 | #define MediaPlayerDebug(x) | 41 | #define MediaPlayerDebug(x) |
42 | 42 | ||
43 | 43 | ||
44 | MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) | 44 | MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) |
45 | : QObject( parent, name ) { | 45 | : QObject( parent, name ) { |
46 | Config cfg( "OpiePlayer" ); | 46 | Config cfg( "OpiePlayer" ); |
47 | readConfig( cfg ); | 47 | readConfig( cfg ); |
48 | streaming = false; | 48 | streaming = false; |
49 | seekable = true; | 49 | seekable = true; |
50 | } | 50 | } |
51 | 51 | ||
52 | 52 | ||
53 | MediaPlayerState::~MediaPlayerState() { | 53 | MediaPlayerState::~MediaPlayerState() { |
54 | Config cfg( "OpiePlayer" ); | ||
55 | writeConfig( cfg ); | ||
54 | } | 56 | } |
55 | 57 | ||
56 | 58 | ||
57 | void MediaPlayerState::readConfig( Config& cfg ) { | 59 | void MediaPlayerState::readConfig( Config& cfg ) { |
58 | cfg.setGroup("Options"); | 60 | cfg.setGroup("Options"); |
59 | fullscreen = cfg.readBoolEntry( "FullScreen" ); | 61 | fullscreen = cfg.readBoolEntry( "FullScreen" ); |
60 | scaled = cfg.readBoolEntry( "Scaling" ); | 62 | scaled = cfg.readBoolEntry( "Scaling" ); |
61 | looping = cfg.readBoolEntry( "Looping" ); | 63 | looping = cfg.readBoolEntry( "Looping" ); |
62 | shuffled = cfg.readBoolEntry( "Shuffle" ); | 64 | shuffled = cfg.readBoolEntry( "Shuffle" ); |
63 | videoGamma = cfg.readNumEntry( "VideoGamma" ); | 65 | videoGamma = cfg.readNumEntry( "VideoGamma" ); |
64 | playing = FALSE; | 66 | playing = FALSE; |
65 | streaming = FALSE; | 67 | streaming = FALSE; |
66 | paused = FALSE; | 68 | paused = FALSE; |
67 | curPosition = 0; | 69 | curPosition = 0; |
68 | curLength = 0; | 70 | curLength = 0; |
69 | m_displayType = MediaSelection; | 71 | m_displayType = MediaSelection; |
70 | } | 72 | } |
71 | 73 | ||
72 | 74 | ||
73 | void MediaPlayerState::writeConfig( Config& cfg ) const { | 75 | void MediaPlayerState::writeConfig( Config& cfg ) const { |
74 | cfg.setGroup( "Options" ); | 76 | cfg.setGroup( "Options" ); |
75 | cfg.writeEntry( "FullScreen", fullscreen ); | 77 | cfg.writeEntry( "FullScreen", fullscreen ); |
76 | cfg.writeEntry( "Scaling", scaled ); | 78 | cfg.writeEntry( "Scaling", scaled ); |
77 | cfg.writeEntry( "Looping", looping ); | 79 | cfg.writeEntry( "Looping", looping ); |
78 | cfg.writeEntry( "Shuffle", shuffled ); | 80 | cfg.writeEntry( "Shuffle", shuffled ); |
79 | cfg.writeEntry( "VideoGamma", videoGamma ); | 81 | cfg.writeEntry( "VideoGamma", videoGamma ); |
80 | } | 82 | } |
81 | 83 | ||
82 | MediaPlayerState::DisplayType MediaPlayerState::displayType() const | 84 | MediaPlayerState::DisplayType MediaPlayerState::displayType() const |
83 | { | 85 | { |
84 | return m_displayType; | 86 | return m_displayType; |
85 | } | 87 | } |
@@ -228,32 +230,35 @@ void MediaPlayerState::setAudio() { | |||
228 | } | 230 | } |
229 | 231 | ||
230 | void MediaPlayerState::toggleFullscreen() { | 232 | void MediaPlayerState::toggleFullscreen() { |
231 | setFullscreen( !fullscreen ); | 233 | setFullscreen( !fullscreen ); |
232 | } | 234 | } |
233 | 235 | ||
234 | void MediaPlayerState::toggleScaled() { | 236 | void MediaPlayerState::toggleScaled() { |
235 | setScaled( !scaled); | 237 | setScaled( !scaled); |
236 | } | 238 | } |
237 | 239 | ||
238 | void MediaPlayerState::toggleLooping() { | 240 | void MediaPlayerState::toggleLooping() { |
239 | setLooping( !looping); | 241 | setLooping( !looping); |
240 | } | 242 | } |
241 | 243 | ||
242 | void MediaPlayerState::toggleShuffled() { | 244 | void MediaPlayerState::toggleShuffled() { |
243 | setShuffled( !shuffled); | 245 | setShuffled( !shuffled); |
244 | } | 246 | } |
245 | 247 | ||
246 | void MediaPlayerState::togglePaused() { | 248 | void MediaPlayerState::togglePaused() { |
247 | setPaused( !paused); | 249 | setPaused( !paused); |
248 | } | 250 | } |
249 | 251 | ||
250 | void MediaPlayerState::togglePlaying() { | 252 | void MediaPlayerState::togglePlaying() { |
251 | setPlaying( !playing); | 253 | setPlaying( !playing); |
252 | } | 254 | } |
253 | 255 | ||
254 | void MediaPlayerState::toggleBlank() { | 256 | void MediaPlayerState::toggleBlank() { |
255 | setBlanked( !blanked); | 257 | setBlanked( !blanked); |
256 | } | 258 | } |
257 | 259 | ||
258 | 260 | ||
259 | 261 | ||
262 | |||
263 | |||
264 | |||