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,5 +1,5 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
@@ -21,3 +21,2 @@ | |||
21 | #include <qpe/qlibrary.h> | 21 | #include <qpe/qlibrary.h> |
22 | #include <qpe/mediaplayerplugininterface.h> | ||
23 | #include <qpe/config.h> | 22 | #include <qpe/config.h> |
@@ -26,4 +25,6 @@ | |||
26 | #include <qdir.h> | 25 | #include <qdir.h> |
26 | #include "mediaplayerplugininterface.h" | ||
27 | #include "mediaplayerstate.h" | 27 | #include "mediaplayerstate.h" |
28 | 28 | ||
29 | |||
29 | #ifdef QT_NO_COMPONENT | 30 | #ifdef QT_NO_COMPONENT |
@@ -36,4 +37,4 @@ | |||
36 | 37 | ||
37 | #define MediaPlayerDebug(x)qDebug x | 38 | //#define MediaPlayerDebug(x) qDebug x |
38 | //#define MediaPlayerDebug(x) | 39 | #define MediaPlayerDebug(x) |
39 | 40 | ||
@@ -97,6 +98,6 @@ MediaPlayerDecoder *MediaPlayerState::newDecoder( const QString& file ) { | |||
97 | for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { | 98 | for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { |
98 | if ( (*it).decoder->isFileSupported( file ) ) { | 99 | if ( (*it).decoder->isFileSupported( file ) ) { |
99 | tmpDecoder = (*it).decoder; | 100 | tmpDecoder = (*it).decoder; |
100 | break; | 101 | break; |
101 | } | 102 | } |
102 | } | 103 | } |
@@ -116,2 +117,6 @@ MediaPlayerDecoder *MediaPlayerState::libMpeg3Decoder() { | |||
116 | 117 | ||
118 | // ### hack to get true sample count | ||
119 | // MediaPlayerDecoder *MediaPlayerState::libWavDecoder() { | ||
120 | // return libwavdecoder; | ||
121 | // } | ||
117 | 122 | ||
@@ -122,5 +127,5 @@ void MediaPlayerState::loadPlugins() { | |||
122 | for ( mit = pluginList.begin(); mit != pluginList.end(); ++mit ) { | 127 | for ( mit = pluginList.begin(); mit != pluginList.end(); ++mit ) { |
123 | (*mit).iface->release(); | 128 | (*mit).iface->release(); |
124 | (*mit).library->unload(); | 129 | (*mit).library->unload(); |
125 | delete (*mit).library; | 130 | delete (*mit).library; |
126 | } | 131 | } |
@@ -133,25 +138,25 @@ void MediaPlayerState::loadPlugins() { | |||
133 | for ( it = list.begin(); it != list.end(); ++it ) { | 138 | for ( it = list.begin(); it != list.end(); ++it ) { |
134 | MediaPlayerPluginInterface *iface = 0; | 139 | MediaPlayerPluginInterface *iface = 0; |
135 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 140 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
136 | 141 | ||
137 | MediaPlayerDebug(( "querying: %s", QString( path + "/" + *it ).latin1() )); | 142 | MediaPlayerDebug(( "querying: %s", QString( path + "/" + *it ).latin1() )); |
138 | 143 | ||
139 | if ( lib->queryInterface( IID_MediaPlayerPlugin, (QUnknownInterface**)&iface ) == QS_OK ) { | 144 | if ( lib->queryInterface( IID_MediaPlayerPlugin, (QUnknownInterface**)&iface ) == QS_OK ) { |
140 | 145 | ||
141 | MediaPlayerDebug(( "loading: %s", QString( path + "/" + *it ).latin1() )); | 146 | MediaPlayerDebug(( "loading: %s", QString( path + "/" + *it ).latin1() )); |
142 | 147 | ||
143 | MediaPlayerPlugin plugin; | 148 | MediaPlayerPlugin plugin; |
144 | plugin.library = lib; | 149 | plugin.library = lib; |
145 | plugin.iface = iface; | 150 | plugin.iface = iface; |
146 | plugin.decoder = plugin.iface->decoder(); | 151 | plugin.decoder = plugin.iface->decoder(); |
147 | plugin.encoder = plugin.iface->encoder(); | 152 | plugin.encoder = plugin.iface->encoder(); |
148 | pluginList.append( plugin ); | 153 | pluginList.append( plugin ); |
149 | 154 | ||
150 | // ### hack to get true sample count | 155 | // ### hack to get true sample count |
151 | if ( plugin.decoder->pluginName() == QString("LibMpeg3Plugin") ) | 156 | if ( plugin.decoder->pluginName() == QString("LibMpeg3Plugin") ) |
152 | libmpeg3decoder = plugin.decoder; | 157 | libmpeg3decoder = plugin.decoder; |
153 | 158 | ||
154 | } else { | 159 | } else { |
155 | delete lib; | 160 | delete lib; |
156 | } | 161 | } |
157 | } | 162 | } |
@@ -180,5 +185,5 @@ void MediaPlayerState::loadPlugins() { | |||
180 | if ( pluginList.count() ) | 185 | if ( pluginList.count() ) |
181 | MediaPlayerDebug(( "%i decoders found", pluginList.count() )); | 186 | MediaPlayerDebug(( "%i decoders found", pluginList.count() )); |
182 | else | 187 | else |
183 | MediaPlayerDebug(( "No decoders found" )); | 188 | MediaPlayerDebug(( "No decoders found" )); |
184 | } | 189 | } |