Diffstat (limited to 'noncore/multimedia/opieplayer2/mediaplayerstate.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.cpp | 60 |
1 files changed, 51 insertions, 9 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index d984022..4ec5989 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp | |||
@@ -1,3 +1,38 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> | ||
5 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> | ||
6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> | ||
7 | =. | ||
8 | .=l. | ||
9 | .>+-= | ||
10 | _;:, .> :=|. This program is free software; you can | ||
11 | .> <`_, > . <= redistribute it and/or modify it under | ||
12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | ||
13 | .="- .-=="i, .._ License as published by the Free Software | ||
14 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
15 | ._= =} : or (at your option) any later version. | ||
16 | .%`+i> _;_. | ||
17 | .i_,=:_. -<s. This program is distributed in the hope that | ||
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
19 | : .. .:, . . . without even the implied warranty of | ||
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
22 | ..}^=.= = ; General Public License for more | ||
23 | ++= -. .` .: details. | ||
24 | : = ...= . :.=- | ||
25 | -. .:....=;==+<; You should have received a copy of the GNU | ||
26 | -_. . . )=. = General Public License along with | ||
27 | -- :-=` this library; see the file COPYING.LIB. | ||
28 | If not, write to the Free Software Foundation, | ||
29 | Inc., 59 Temple Place - Suite 330, | ||
30 | Boston, MA 02111-1307, USA. | ||
31 | |||
32 | */ | ||
33 | |||
34 | // this file is based on work by trolltech | ||
35 | |||
1 | #include <qpe/qpeapplication.h> | 36 | #include <qpe/qpeapplication.h> |
2 | #include <qpe/qlibrary.h> | 37 | #include <qpe/qlibrary.h> |
3 | #include <qpe/config.h> | 38 | #include <qpe/config.h> |
@@ -21,9 +56,6 @@ MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) | |||
21 | 56 | ||
22 | 57 | ||
23 | MediaPlayerState::~MediaPlayerState() { | 58 | MediaPlayerState::~MediaPlayerState() { |
24 | // Config cfg( "OpiePlayer" ); | ||
25 | // writeConfig( cfg ); | ||
26 | |||
27 | } | 59 | } |
28 | 60 | ||
29 | 61 | ||
@@ -34,6 +66,7 @@ void MediaPlayerState::readConfig( Config& cfg ) { | |||
34 | isLooping = cfg.readBoolEntry( "Looping" ); | 66 | isLooping = cfg.readBoolEntry( "Looping" ); |
35 | isShuffled = cfg.readBoolEntry( "Shuffle" ); | 67 | isShuffled = cfg.readBoolEntry( "Shuffle" ); |
36 | usePlaylist = cfg.readBoolEntry( "UsePlayList" ); | 68 | usePlaylist = cfg.readBoolEntry( "UsePlayList" ); |
69 | videoGamma = cfg.readNumEntry( "VideoGamma" ); | ||
37 | usePlaylist = TRUE; | 70 | usePlaylist = TRUE; |
38 | isPlaying = FALSE; | 71 | isPlaying = FALSE; |
39 | isStreaming = FALSE; | 72 | isStreaming = FALSE; |
@@ -45,12 +78,13 @@ void MediaPlayerState::readConfig( Config& cfg ) { | |||
45 | 78 | ||
46 | 79 | ||
47 | void MediaPlayerState::writeConfig( Config& cfg ) const { | 80 | void MediaPlayerState::writeConfig( Config& cfg ) const { |
48 | cfg.setGroup("Options"); | 81 | cfg.setGroup( "Options" ); |
49 | cfg.writeEntry("FullScreen", isFullscreen ); | 82 | cfg.writeEntry( "FullScreen", isFullscreen ); |
50 | cfg.writeEntry("Scaling", isScaled ); | 83 | cfg.writeEntry( "Scaling", isScaled ); |
51 | cfg.writeEntry("Looping", isLooping ); | 84 | cfg.writeEntry( "Looping", isLooping ); |
52 | cfg.writeEntry("Shuffle", isShuffled ); | 85 | cfg.writeEntry( "Shuffle", isShuffled ); |
53 | cfg.writeEntry("UsePlayList", usePlaylist ); | 86 | cfg.writeEntry( "UsePlayList", usePlaylist ); |
87 | cfg.writeEntry( "VideoGamma", videoGamma ); | ||
54 | } | 88 | } |
55 | 89 | ||
56 | 90 | ||
@@ -209,6 +243,14 @@ void MediaPlayerState::updatePosition( long p ){ | |||
209 | emit positionUpdated(p); | 243 | emit positionUpdated(p); |
210 | } | 244 | } |
211 | 245 | ||
246 | void MediaPlayerState::setVideoGamma( int v ){ | ||
247 | if ( videoGamma == v ) { | ||
248 | return; | ||
249 | } | ||
250 | videoGamma = v; | ||
251 | emit videoGammaChanged( v ); | ||
252 | } | ||
253 | |||
212 | void MediaPlayerState::setLength( long l ) { | 254 | void MediaPlayerState::setLength( long l ) { |
213 | if ( curLength == l ) { | 255 | if ( curLength == l ) { |
214 | return; | 256 | return; |