summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/mediaplayerstate.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.cpp48
1 files changed, 45 insertions, 3 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,6 +1,41 @@
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>
4#include <qvaluelist.h> 39#include <qvaluelist.h>
5#include <qobject.h> 40#include <qobject.h>
6#include <qdir.h> 41#include <qdir.h>
@@ -18,25 +53,23 @@ MediaPlayerState::MediaPlayerState( QObject *parent, const char *name )
18 readConfig( cfg ); 53 readConfig( cfg );
19 isStreaming = false; 54 isStreaming = false;
20} 55}
21 56
22 57
23MediaPlayerState::~MediaPlayerState() { 58MediaPlayerState::~MediaPlayerState() {
24// Config cfg( "OpiePlayer" );
25// writeConfig( cfg );
26
27} 59}
28 60
29 61
30void MediaPlayerState::readConfig( Config& cfg ) { 62void MediaPlayerState::readConfig( Config& cfg ) {
31 cfg.setGroup("Options"); 63 cfg.setGroup("Options");
32 isFullscreen = cfg.readBoolEntry( "FullScreen" ); 64 isFullscreen = cfg.readBoolEntry( "FullScreen" );
33 isScaled = cfg.readBoolEntry( "Scaling" ); 65 isScaled = cfg.readBoolEntry( "Scaling" );
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;
40 isPaused = FALSE; 73 isPaused = FALSE;
41 curPosition = 0; 74 curPosition = 0;
42 curLength = 0; 75 curLength = 0;
@@ -48,12 +81,13 @@ 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
57// public stuff 91// public stuff
58 92
59 93
@@ -206,12 +240,20 @@ void MediaPlayerState::updatePosition( long p ){
206 return; 240 return;
207 } 241 }
208 curPosition = p; 242 curPosition = p;
209 emit positionUpdated(p); 243 emit positionUpdated(p);
210} 244}
211 245
246void MediaPlayerState::setVideoGamma( int v ){
247 if ( videoGamma == v ) {
248 return;
249 }
250 videoGamma = v;
251 emit videoGammaChanged( v );
252}
253
212void MediaPlayerState::setLength( long l ) { 254void MediaPlayerState::setLength( long l ) {
213 if ( curLength == l ) { 255 if ( curLength == l ) {
214 return; 256 return;
215 } 257 }
216 curLength = l; 258 curLength = l;
217 emit lengthChanged(l); 259 emit lengthChanged(l);