summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/mediaplayerstate.cpp
authorllornkcor <llornkcor>2002-02-25 01:35:47 (UTC)
committer llornkcor <llornkcor>2002-02-25 01:35:47 (UTC)
commitf180c1a5e8fc889ff1fb390d5cc94cdbc5085046 (patch) (side-by-side diff)
tree5e9ea6f1313f4c33d57fb266523c1cfbe0826756 /core/multimedia/opieplayer/mediaplayerstate.cpp
parentc0446b55fc32b7fdea9f58db06e40da703f5e8ff (diff)
downloadopie-f180c1a5e8fc889ff1fb390d5cc94cdbc5085046.zip
opie-f180c1a5e8fc889ff1fb390d5cc94cdbc5085046.tar.gz
opie-f180c1a5e8fc889ff1fb390d5cc94cdbc5085046.tar.bz2
fucked up- no workie.. back out
Diffstat (limited to 'core/multimedia/opieplayer/mediaplayerstate.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/mediaplayerstate.cpp68
1 files changed, 31 insertions, 37 deletions
diff --git a/core/multimedia/opieplayer/mediaplayerstate.cpp b/core/multimedia/opieplayer/mediaplayerstate.cpp
index 2a6bca3..7e82166 100644
--- a/core/multimedia/opieplayer/mediaplayerstate.cpp
+++ b/core/multimedia/opieplayer/mediaplayerstate.cpp
@@ -1,7 +1,7 @@
/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
-** This file is part of Qtopia Environment.
+** This file is part of the Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
@@ -19,15 +19,13 @@
**********************************************************************/
#include <qpe/qpeapplication.h>
#include <qpe/qlibrary.h>
+#include <qpe/mediaplayerplugininterface.h>
#include <qpe/config.h>
#include <qvaluelist.h>
#include <qobject.h>
#include <qdir.h>
-#include "mediaplayerplugininterface.h"
#include "mediaplayerstate.h"
-
-
#ifdef QT_NO_COMPONENT
// Plugins which are compiled in when no plugin architecture available
#include "libmad/libmadpluginimpl.h"
@@ -36,8 +34,8 @@
#endif
-//#define MediaPlayerDebug(x) qDebug x
-#define MediaPlayerDebug(x)
+#define MediaPlayerDebug(x) qDebug x
+//#define MediaPlayerDebug(x)
MediaPlayerState::MediaPlayerState( QObject *parent, const char *name )
@@ -97,10 +95,10 @@ MediaPlayerDecoder *MediaPlayerState::newDecoder( const QString& file ) {
MediaPlayerDecoder *tmpDecoder = NULL;
QValueList<MediaPlayerPlugin>::Iterator it;
for ( it = pluginList.begin(); it != pluginList.end(); ++it ) {
- if ( (*it).decoder->isFileSupported( file ) ) {
- tmpDecoder = (*it).decoder;
- break;
- }
+ if ( (*it).decoder->isFileSupported( file ) ) {
+ tmpDecoder = (*it).decoder;
+ break;
+ }
}
return decoder = tmpDecoder;
}
@@ -116,19 +114,15 @@ MediaPlayerDecoder *MediaPlayerState::libMpeg3Decoder() {
return libmpeg3decoder;
}
-// ### hack to get true sample count
-// MediaPlayerDecoder *MediaPlayerState::libWavDecoder() {
-// return libwavdecoder;
-// }
void MediaPlayerState::loadPlugins() {
#ifndef QT_NO_COMPONENT
QValueList<MediaPlayerPlugin>::Iterator mit;
for ( mit = pluginList.begin(); mit != pluginList.end(); ++mit ) {
- (*mit).iface->release();
- (*mit).library->unload();
- delete (*mit).library;
+ (*mit).iface->release();
+ (*mit).library->unload();
+ delete (*mit).library;
}
pluginList.clear();
@@ -137,29 +131,29 @@ void MediaPlayerState::loadPlugins() {
QStringList list = dir.entryList();
QStringList::Iterator it;
for ( it = list.begin(); it != list.end(); ++it ) {
- MediaPlayerPluginInterface *iface = 0;
- QLibrary *lib = new QLibrary( path + "/" + *it );
+ MediaPlayerPluginInterface *iface = 0;
+ QLibrary *lib = new QLibrary( path + "/" + *it );
- MediaPlayerDebug(( "querying: %s", QString( path + "/" + *it ).latin1() ));
+ MediaPlayerDebug(( "querying: %s", QString( path + "/" + *it ).latin1() ));
- if ( lib->queryInterface( IID_MediaPlayerPlugin, (QUnknownInterface**)&iface ) == QS_OK ) {
+ if ( lib->queryInterface( IID_MediaPlayerPlugin, (QUnknownInterface**)&iface ) == QS_OK ) {
- MediaPlayerDebug(( "loading: %s", QString( path + "/" + *it ).latin1() ));
+ MediaPlayerDebug(( "loading: %s", QString( path + "/" + *it ).latin1() ));
- MediaPlayerPlugin plugin;
- plugin.library = lib;
- plugin.iface = iface;
- plugin.decoder = plugin.iface->decoder();
- plugin.encoder = plugin.iface->encoder();
- pluginList.append( plugin );
+ MediaPlayerPlugin plugin;
+ plugin.library = lib;
+ plugin.iface = iface;
+ plugin.decoder = plugin.iface->decoder();
+ plugin.encoder = plugin.iface->encoder();
+ pluginList.append( plugin );
- // ### hack to get true sample count
- if ( plugin.decoder->pluginName() == QString("LibMpeg3Plugin") )
- libmpeg3decoder = plugin.decoder;
+ // ### hack to get true sample count
+ if ( plugin.decoder->pluginName() == QString("LibMpeg3Plugin") )
+ libmpeg3decoder = plugin.decoder;
- } else {
- delete lib;
- }
+ } else {
+ delete lib;
+ }
}
#else
pluginList.clear();
@@ -184,8 +178,8 @@ void MediaPlayerState::loadPlugins() {
#endif
if ( pluginList.count() )
- MediaPlayerDebug(( "%i decoders found", pluginList.count() ));
+ MediaPlayerDebug(( "%i decoders found", pluginList.count() ));
else
- MediaPlayerDebug(( "No decoders found" ));
+ MediaPlayerDebug(( "No decoders found" ));
}