Diffstat (limited to 'core/multimedia/opieplayer/mediaplayerstate.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/mediaplayerstate.cpp | 67 |
1 files changed, 36 insertions, 31 deletions
diff --git a/core/multimedia/opieplayer/mediaplayerstate.cpp b/core/multimedia/opieplayer/mediaplayerstate.cpp index 7e82166..13741f6 100644 --- a/core/multimedia/opieplayer/mediaplayerstate.cpp +++ b/core/multimedia/opieplayer/mediaplayerstate.cpp @@ -1,6 +1,6 @@ /********************************************************************** -** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. +** Copyright (C) 2000 Trolltech AS. All rights reserved. ** -** This file is part of the Qtopia Environment. +** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the @@ -20,11 +20,12 @@ #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 @@ -35,6 +36,6 @@ -#define MediaPlayerDebug(x) qDebug x -//#define MediaPlayerDebug(x) +//#define MediaPlayerDebug(x) qDebug x +#define MediaPlayerDebug(x) @@ -96,8 +97,8 @@ MediaPlayerDecoder *MediaPlayerState::newDecoder( const QString& file ) { 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; @@ -115,4 +116,8 @@ MediaPlayerDecoder *MediaPlayerState::libMpeg3Decoder() { } +// ### hack to get true sample count +// MediaPlayerDecoder *MediaPlayerState::libWavDecoder() { +// return libwavdecoder; +// } void MediaPlayerState::loadPlugins() { @@ -121,7 +126,7 @@ void MediaPlayerState::loadPlugins() { 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(); @@ -132,27 +137,27 @@ void MediaPlayerState::loadPlugins() { 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 @@ -179,7 +184,7 @@ void MediaPlayerState::loadPlugins() { if ( pluginList.count() ) - MediaPlayerDebug(( "%i decoders found", pluginList.count() )); + MediaPlayerDebug(( "%i decoders found", pluginList.count() )); else - MediaPlayerDebug(( "No decoders found" )); + MediaPlayerDebug(( "No decoders found" )); } |