summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
authorharlekin <harlekin>2002-07-01 23:39:54 (UTC)
committer harlekin <harlekin>2002-07-01 23:39:54 (UTC)
commit7ae4965a4052808172e843356cdfb2d0a673bccf (patch) (side-by-side diff)
treecb9567ea7740ea1b3e63de03f836581a0e5ad589 /noncore/multimedia/opieplayer2/mediaplayerstate.cpp
parent329ea43b68180058bcd8e9d2af4d09d9c03c55a3 (diff)
downloadopie-7ae4965a4052808172e843356cdfb2d0a673bccf.zip
opie-7ae4965a4052808172e843356cdfb2d0a673bccf.tar.gz
opie-7ae4965a4052808172e843356cdfb2d0a673bccf.tar.bz2
gui
Diffstat (limited to 'noncore/multimedia/opieplayer2/mediaplayerstate.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.cpp78
1 files changed, 78 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
new file mode 100644
index 0000000..9b5f70e
--- a/dev/null
+++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
@@ -0,0 +1,78 @@
+
+
+
+#include <qpe/qpeapplication.h>
+#include <qpe/qlibrary.h>
+#include <qpe/config.h>
+#include <qvaluelist.h>
+#include <qobject.h>
+#include <qdir.h>
+#include <qpe/mediaplayerplugininterface.h>
+#include "mediaplayerstate.h"
+
+
+
+#ifdef QT_NO_COMPONENT
+// Plugins which are compiled in when no plugin architecture available
+#include "libmad/libmadpluginimpl.h"
+#include "libmpeg3/libmpeg3pluginimpl.h"
+#include "wavplugin/wavpluginimpl.h"
+#endif
+
+
+//#define MediaPlayerDebug(x) qDebug x
+#define MediaPlayerDebug(x)
+
+
+MediaPlayerState::MediaPlayerState( QObject *parent, const char *name )
+ : QObject( parent, name ), decoder( NULL ), libmpeg3decoder( NULL ) {
+ Config cfg( "OpiePlayer" );
+ readConfig( cfg );
+}
+
+
+MediaPlayerState::~MediaPlayerState() {
+ Config cfg( "OpiePlayer" );
+ writeConfig( cfg );
+}
+
+
+void MediaPlayerState::readConfig( Config& cfg ) {
+ cfg.setGroup("Options");
+ isFullscreen = cfg.readBoolEntry( "FullScreen" );
+ isScaled = cfg.readBoolEntry( "Scaling" );
+ isLooping = cfg.readBoolEntry( "Looping" );
+ isShuffled = cfg.readBoolEntry( "Shuffle" );
+ usePlaylist = cfg.readBoolEntry( "UsePlayList" );
+ usePlaylist = TRUE;
+ isPlaying = FALSE;
+ isPaused = FALSE;
+ curPosition = 0;
+ curLength = 0;
+ curView = 'l';
+}
+
+
+void MediaPlayerState::writeConfig( Config& cfg ) const {
+ cfg.setGroup("Options");
+ cfg.writeEntry("FullScreen", isFullscreen );
+ cfg.writeEntry("Scaling", isScaled );
+ cfg.writeEntry("Looping", isLooping );
+ cfg.writeEntry("Shuffle", isShuffled );
+ cfg.writeEntry("UsePlayList", usePlaylist );
+}
+
+
+struct MediaPlayerPlugin {
+#ifndef QT_NO_COMPONENT
+ QLibrary *library;
+#endif
+ MediaPlayerPluginInterface *iface;
+ MediaPlayerDecoder *decoder;
+ MediaPlayerEncoder *encoder;
+};
+
+
+static QValueList<MediaPlayerPlugin> pluginList;
+
+