summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/mediaplayerstate.cpp
Side-by-side diff
Diffstat (limited to 'core/multimedia/opieplayer/mediaplayerstate.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/mediaplayerstate.cpp60
1 files changed, 33 insertions, 27 deletions
diff --git a/core/multimedia/opieplayer/mediaplayerstate.cpp b/core/multimedia/opieplayer/mediaplayerstate.cpp
index 9b9d133..2a6bca3 100644
--- a/core/multimedia/opieplayer/mediaplayerstate.cpp
+++ b/core/multimedia/opieplayer/mediaplayerstate.cpp
@@ -26,6 +26,8 @@
#include "mediaplayerplugininterface.h"
#include "mediaplayerstate.h"
+
+
#ifdef QT_NO_COMPONENT
// Plugins which are compiled in when no plugin architecture available
#include "libmad/libmadpluginimpl.h"
@@ -34,7 +36,7 @@
#endif
-//#define MediaPlayerDebug(x) qDebug x
+//#define MediaPlayerDebug(x) qDebug x
#define MediaPlayerDebug(x)
@@ -95,10 +97,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;
}
@@ -114,15 +116,19 @@ 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();
@@ -131,29 +137,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();
@@ -178,8 +184,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" ));
}