author | llornkcor <llornkcor> | 2002-02-24 21:51:51 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-02-24 21:51:51 (UTC) |
commit | 36b768c465c6ecddceb57ff1d7a5087e9848c897 (patch) (unidiff) | |
tree | 4ddde589e2393ca136e24cda4fc456612149ae72 /core/multimedia/opieplayer/mediaplayerstate.cpp | |
parent | ade25ac278169f0e0c9ee0771e754adb46cf7ce2 (diff) | |
download | opie-36b768c465c6ecddceb57ff1d7a5087e9848c897.zip opie-36b768c465c6ecddceb57ff1d7a5087e9848c897.tar.gz opie-36b768c465c6ecddceb57ff1d7a5087e9848c897.tar.bz2 |
changed mediaplayerplugininterface.h location
Diffstat (limited to 'core/multimedia/opieplayer/mediaplayerstate.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/mediaplayerstate.cpp | 60 |
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 | |||
@@ -27,4 +27,6 @@ | |||
27 | #include "mediaplayerstate.h" | 27 | #include "mediaplayerstate.h" |
28 | 28 | ||
29 | |||
30 | |||
29 | #ifdef QT_NO_COMPONENT | 31 | #ifdef QT_NO_COMPONENT |
30 | // Plugins which are compiled in when no plugin architecture available | 32 | // Plugins which are compiled in when no plugin architecture available |
@@ -35,5 +37,5 @@ | |||
35 | 37 | ||
36 | 38 | ||
37 | //#define MediaPlayerDebug(x)qDebug x | 39 | //#define MediaPlayerDebug(x) qDebug x |
38 | #define MediaPlayerDebug(x) | 40 | #define MediaPlayerDebug(x) |
39 | 41 | ||
@@ -96,8 +98,8 @@ MediaPlayerDecoder *MediaPlayerState::newDecoder( const QString& file ) { | |||
96 | QValueList<MediaPlayerPlugin>::Iterator it; | 98 | QValueList<MediaPlayerPlugin>::Iterator it; |
97 | for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { | 99 | for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { |
98 | if ( (*it).decoder->isFileSupported( file ) ) { | 100 | if ( (*it).decoder->isFileSupported( file ) ) { |
99 | tmpDecoder = (*it).decoder; | 101 | tmpDecoder = (*it).decoder; |
100 | break; | 102 | break; |
101 | } | 103 | } |
102 | } | 104 | } |
103 | return decoder = tmpDecoder; | 105 | return decoder = tmpDecoder; |
@@ -115,4 +117,8 @@ MediaPlayerDecoder *MediaPlayerState::libMpeg3Decoder() { | |||
115 | } | 117 | } |
116 | 118 | ||
119 | // ### hack to get true sample count | ||
120 | // MediaPlayerDecoder *MediaPlayerState::libWavDecoder() { | ||
121 | // return libwavdecoder; | ||
122 | // } | ||
117 | 123 | ||
118 | void MediaPlayerState::loadPlugins() { | 124 | void MediaPlayerState::loadPlugins() { |
@@ -121,7 +127,7 @@ void MediaPlayerState::loadPlugins() { | |||
121 | QValueList<MediaPlayerPlugin>::Iterator mit; | 127 | QValueList<MediaPlayerPlugin>::Iterator mit; |
122 | for ( mit = pluginList.begin(); mit != pluginList.end(); ++mit ) { | 128 | for ( mit = pluginList.begin(); mit != pluginList.end(); ++mit ) { |
123 | (*mit).iface->release(); | 129 | (*mit).iface->release(); |
124 | (*mit).library->unload(); | 130 | (*mit).library->unload(); |
125 | delete (*mit).library; | 131 | delete (*mit).library; |
126 | } | 132 | } |
127 | pluginList.clear(); | 133 | pluginList.clear(); |
@@ -132,27 +138,27 @@ void MediaPlayerState::loadPlugins() { | |||
132 | QStringList::Iterator it; | 138 | QStringList::Iterator it; |
133 | for ( it = list.begin(); it != list.end(); ++it ) { | 139 | for ( it = list.begin(); it != list.end(); ++it ) { |
134 | MediaPlayerPluginInterface *iface = 0; | 140 | MediaPlayerPluginInterface *iface = 0; |
135 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 141 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
136 | 142 | ||
137 | MediaPlayerDebug(( "querying: %s", QString( path + "/" + *it ).latin1() )); | 143 | MediaPlayerDebug(( "querying: %s", QString( path + "/" + *it ).latin1() )); |
138 | 144 | ||
139 | if ( lib->queryInterface( IID_MediaPlayerPlugin, (QUnknownInterface**)&iface ) == QS_OK ) { | 145 | if ( lib->queryInterface( IID_MediaPlayerPlugin, (QUnknownInterface**)&iface ) == QS_OK ) { |
140 | 146 | ||
141 | MediaPlayerDebug(( "loading: %s", QString( path + "/" + *it ).latin1() )); | 147 | MediaPlayerDebug(( "loading: %s", QString( path + "/" + *it ).latin1() )); |
142 | 148 | ||
143 | MediaPlayerPlugin plugin; | 149 | MediaPlayerPlugin plugin; |
144 | plugin.library = lib; | 150 | plugin.library = lib; |
145 | plugin.iface = iface; | 151 | plugin.iface = iface; |
146 | plugin.decoder = plugin.iface->decoder(); | 152 | plugin.decoder = plugin.iface->decoder(); |
147 | plugin.encoder = plugin.iface->encoder(); | 153 | plugin.encoder = plugin.iface->encoder(); |
148 | pluginList.append( plugin ); | 154 | pluginList.append( plugin ); |
149 | 155 | ||
150 | // ### hack to get true sample count | 156 | // ### hack to get true sample count |
151 | if ( plugin.decoder->pluginName() == QString("LibMpeg3Plugin") ) | 157 | if ( plugin.decoder->pluginName() == QString("LibMpeg3Plugin") ) |
152 | libmpeg3decoder = plugin.decoder; | 158 | libmpeg3decoder = plugin.decoder; |
153 | 159 | ||
154 | } else { | 160 | } else { |
155 | delete lib; | 161 | delete lib; |
156 | } | 162 | } |
157 | } | 163 | } |
158 | #else | 164 | #else |
@@ -179,7 +185,7 @@ void MediaPlayerState::loadPlugins() { | |||
179 | 185 | ||
180 | if ( pluginList.count() ) | 186 | if ( pluginList.count() ) |
181 | MediaPlayerDebug(( "%i decoders found", pluginList.count() )); | 187 | MediaPlayerDebug(( "%i decoders found", pluginList.count() )); |
182 | else | 188 | else |
183 | MediaPlayerDebug(( "No decoders found" )); | 189 | MediaPlayerDebug(( "No decoders found" )); |
184 | } | 190 | } |
185 | 191 | ||