Diffstat (limited to 'core/multimedia/opieplayer/mediaplayerstate.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/mediaplayerstate.cpp | 68 |
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,6 +1,6 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
@@ -20,13 +20,11 @@ | |||
20 | #include <qpe/qpeapplication.h> | 20 | #include <qpe/qpeapplication.h> |
21 | #include <qpe/qlibrary.h> | 21 | #include <qpe/qlibrary.h> |
22 | #include <qpe/mediaplayerplugininterface.h> | ||
22 | #include <qpe/config.h> | 23 | #include <qpe/config.h> |
23 | #include <qvaluelist.h> | 24 | #include <qvaluelist.h> |
24 | #include <qobject.h> | 25 | #include <qobject.h> |
25 | #include <qdir.h> | 26 | #include <qdir.h> |
26 | #include "mediaplayerplugininterface.h" | ||
27 | #include "mediaplayerstate.h" | 27 | #include "mediaplayerstate.h" |
28 | 28 | ||
29 | |||
30 | |||
31 | #ifdef QT_NO_COMPONENT | 29 | #ifdef QT_NO_COMPONENT |
32 | // Plugins which are compiled in when no plugin architecture available | 30 | // Plugins which are compiled in when no plugin architecture available |
@@ -37,6 +35,6 @@ | |||
37 | 35 | ||
38 | 36 | ||
39 | //#define MediaPlayerDebug(x) qDebug x | 37 | #define MediaPlayerDebug(x)qDebug x |
40 | #define MediaPlayerDebug(x) | 38 | //#define MediaPlayerDebug(x) |
41 | 39 | ||
42 | 40 | ||
@@ -98,8 +96,8 @@ MediaPlayerDecoder *MediaPlayerState::newDecoder( const QString& file ) { | |||
98 | QValueList<MediaPlayerPlugin>::Iterator it; | 96 | QValueList<MediaPlayerPlugin>::Iterator it; |
99 | for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { | 97 | for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { |
100 | if ( (*it).decoder->isFileSupported( file ) ) { | 98 | if ( (*it).decoder->isFileSupported( file ) ) { |
101 | tmpDecoder = (*it).decoder; | 99 | tmpDecoder = (*it).decoder; |
102 | break; | 100 | break; |
103 | } | 101 | } |
104 | } | 102 | } |
105 | return decoder = tmpDecoder; | 103 | return decoder = tmpDecoder; |
@@ -117,8 +115,4 @@ MediaPlayerDecoder *MediaPlayerState::libMpeg3Decoder() { | |||
117 | } | 115 | } |
118 | 116 | ||
119 | // ### hack to get true sample count | ||
120 | // MediaPlayerDecoder *MediaPlayerState::libWavDecoder() { | ||
121 | // return libwavdecoder; | ||
122 | // } | ||
123 | 117 | ||
124 | void MediaPlayerState::loadPlugins() { | 118 | void MediaPlayerState::loadPlugins() { |
@@ -127,7 +121,7 @@ void MediaPlayerState::loadPlugins() { | |||
127 | QValueList<MediaPlayerPlugin>::Iterator mit; | 121 | QValueList<MediaPlayerPlugin>::Iterator mit; |
128 | for ( mit = pluginList.begin(); mit != pluginList.end(); ++mit ) { | 122 | for ( mit = pluginList.begin(); mit != pluginList.end(); ++mit ) { |
129 | (*mit).iface->release(); | 123 | (*mit).iface->release(); |
130 | (*mit).library->unload(); | 124 | (*mit).library->unload(); |
131 | delete (*mit).library; | 125 | delete (*mit).library; |
132 | } | 126 | } |
133 | pluginList.clear(); | 127 | pluginList.clear(); |
@@ -138,27 +132,27 @@ void MediaPlayerState::loadPlugins() { | |||
138 | QStringList::Iterator it; | 132 | QStringList::Iterator it; |
139 | for ( it = list.begin(); it != list.end(); ++it ) { | 133 | for ( it = list.begin(); it != list.end(); ++it ) { |
140 | MediaPlayerPluginInterface *iface = 0; | 134 | MediaPlayerPluginInterface *iface = 0; |
141 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 135 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
142 | 136 | ||
143 | MediaPlayerDebug(( "querying: %s", QString( path + "/" + *it ).latin1() )); | 137 | MediaPlayerDebug(( "querying: %s", QString( path + "/" + *it ).latin1() )); |
144 | 138 | ||
145 | if ( lib->queryInterface( IID_MediaPlayerPlugin, (QUnknownInterface**)&iface ) == QS_OK ) { | 139 | if ( lib->queryInterface( IID_MediaPlayerPlugin, (QUnknownInterface**)&iface ) == QS_OK ) { |
146 | 140 | ||
147 | MediaPlayerDebug(( "loading: %s", QString( path + "/" + *it ).latin1() )); | 141 | MediaPlayerDebug(( "loading: %s", QString( path + "/" + *it ).latin1() )); |
148 | 142 | ||
149 | MediaPlayerPlugin plugin; | 143 | MediaPlayerPlugin plugin; |
150 | plugin.library = lib; | 144 | plugin.library = lib; |
151 | plugin.iface = iface; | 145 | plugin.iface = iface; |
152 | plugin.decoder = plugin.iface->decoder(); | 146 | plugin.decoder = plugin.iface->decoder(); |
153 | plugin.encoder = plugin.iface->encoder(); | 147 | plugin.encoder = plugin.iface->encoder(); |
154 | pluginList.append( plugin ); | 148 | pluginList.append( plugin ); |
155 | 149 | ||
156 | // ### hack to get true sample count | 150 | // ### hack to get true sample count |
157 | if ( plugin.decoder->pluginName() == QString("LibMpeg3Plugin") ) | 151 | if ( plugin.decoder->pluginName() == QString("LibMpeg3Plugin") ) |
158 | libmpeg3decoder = plugin.decoder; | 152 | libmpeg3decoder = plugin.decoder; |
159 | 153 | ||
160 | } else { | 154 | } else { |
161 | delete lib; | 155 | delete lib; |
162 | } | 156 | } |
163 | } | 157 | } |
164 | #else | 158 | #else |
@@ -185,7 +179,7 @@ void MediaPlayerState::loadPlugins() { | |||
185 | 179 | ||
186 | if ( pluginList.count() ) | 180 | if ( pluginList.count() ) |
187 | MediaPlayerDebug(( "%i decoders found", pluginList.count() )); | 181 | MediaPlayerDebug(( "%i decoders found", pluginList.count() )); |
188 | else | 182 | else |
189 | MediaPlayerDebug(( "No decoders found" )); | 183 | MediaPlayerDebug(( "No decoders found" )); |
190 | } | 184 | } |
191 | 185 | ||