summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/mediaplayerstate.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
index 40fa1a4..d54d870 100644
--- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
@@ -32,80 +32,93 @@
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/qpeapplication.h> 36#include <qpe/qpeapplication.h>
37#include <qpe/qlibrary.h> 37#include <qpe/qlibrary.h>
38#include <qpe/config.h> 38#include <qpe/config.h>
39#include <qvaluelist.h> 39#include <qvaluelist.h>
40#include <qobject.h> 40#include <qobject.h>
41#include <qdir.h> 41#include <qdir.h>
42#include "mediaplayerstate.h" 42#include "mediaplayerstate.h"
43 43
44#include <assert.h> 44#include <assert.h>
45 45
46//#define MediaPlayerDebug(x) qDebug x 46//#define MediaPlayerDebug(x) qDebug x
47#define MediaPlayerDebug(x) 47#define MediaPlayerDebug(x)
48 48
49 49
50MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) 50MediaPlayerState::MediaPlayerState( QObject *parent, const char *name )
51 : QObject( parent, name ) { 51 : QObject( parent, name ) {
52 Config cfg( "OpiePlayer" ); 52 Config cfg( "OpiePlayer" );
53 readConfig( cfg ); 53 readConfig( cfg );
54 streaming = false; 54 streaming = false;
55 seekable = true; 55 seekable = true;
56 backendInitialized = false;
56} 57}
57 58
58 59
59MediaPlayerState::~MediaPlayerState() { 60MediaPlayerState::~MediaPlayerState() {
60} 61}
61 62
62 63
63void MediaPlayerState::readConfig( Config& cfg ) { 64void MediaPlayerState::readConfig( Config& cfg ) {
64 cfg.setGroup("Options"); 65 cfg.setGroup("Options");
65 fullscreen = cfg.readBoolEntry( "FullScreen" ); 66 fullscreen = cfg.readBoolEntry( "FullScreen" );
66 scaled = cfg.readBoolEntry( "Scaling" ); 67 scaled = cfg.readBoolEntry( "Scaling" );
67 looping = cfg.readBoolEntry( "Looping" ); 68 looping = cfg.readBoolEntry( "Looping" );
68 shuffled = cfg.readBoolEntry( "Shuffle" ); 69 shuffled = cfg.readBoolEntry( "Shuffle" );
69 videoGamma = cfg.readNumEntry( "VideoGamma" ); 70 videoGamma = cfg.readNumEntry( "VideoGamma" );
70 playing = FALSE; 71 playing = FALSE;
71 streaming = FALSE; 72 streaming = FALSE;
72 paused = FALSE; 73 paused = FALSE;
73 curPosition = 0; 74 curPosition = 0;
74 curLength = 0; 75 curLength = 0;
75 m_displayType = MediaSelection; 76 m_displayType = MediaSelection;
76} 77}
77 78
78 79
79void MediaPlayerState::writeConfig( Config& cfg ) const { 80void MediaPlayerState::writeConfig( Config& cfg ) const {
80 cfg.setGroup( "Options" ); 81 cfg.setGroup( "Options" );
81 cfg.writeEntry( "FullScreen", fullscreen ); 82 cfg.writeEntry( "FullScreen", fullscreen );
82 cfg.writeEntry( "Scaling", scaled ); 83 cfg.writeEntry( "Scaling", scaled );
83 cfg.writeEntry( "Looping", looping ); 84 cfg.writeEntry( "Looping", looping );
84 cfg.writeEntry( "Shuffle", shuffled ); 85 cfg.writeEntry( "Shuffle", shuffled );
85 cfg.writeEntry( "VideoGamma", videoGamma ); 86 cfg.writeEntry( "VideoGamma", videoGamma );
86} 87}
87 88
89bool MediaPlayerState::isInitialized() const
90{
91 return backendInitialized; // for now, more to come (skin stuff)
92}
93
94void MediaPlayerState::setBackendInitialized()
95{
96 assert( backendInitialized == false );
97 backendInitialized = true;
98 emit initialized();
99}
100
88MediaPlayerState::DisplayType MediaPlayerState::displayType() const 101MediaPlayerState::DisplayType MediaPlayerState::displayType() const
89{ 102{
90 return m_displayType; 103 return m_displayType;
91} 104}
92 105
93// slots 106// slots
94void MediaPlayerState::setIsStreaming( bool b ) { 107void MediaPlayerState::setIsStreaming( bool b ) {
95 streaming = b; 108 streaming = b;
96} 109}
97 110
98void MediaPlayerState::setIsSeekable( bool b ) { 111void MediaPlayerState::setIsSeekable( bool b ) {
99 seekable = b; 112 seekable = b;
100 emit isSeekableToggled(b); 113 emit isSeekableToggled(b);
101} 114}
102 115
103 116
104void MediaPlayerState::setFullscreen( bool b ) { 117void MediaPlayerState::setFullscreen( bool b ) {
105 if ( fullscreen == b ) { 118 if ( fullscreen == b ) {
106 return; 119 return;
107 } 120 }
108 fullscreen = b; 121 fullscreen = b;
109 emit fullscreenToggled(b); 122 emit fullscreenToggled(b);
110} 123}
111 124