summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/mediaplayerstate.cpp
authorllornkcor <llornkcor>2002-06-17 12:54:54 (UTC)
committer llornkcor <llornkcor>2002-06-17 12:54:54 (UTC)
commit282007e58a8a038a0db042341528510e73ac80fc (patch) (unidiff)
treef1a16c9a6a380bdc4217e9f92ac6ef6128d10717 /core/multimedia/opieplayer/mediaplayerstate.cpp
parent2917d7481dc8c1b053e3212a699e64948a90ec4c (diff)
downloadopie-282007e58a8a038a0db042341528510e73ac80fc.zip
opie-282007e58a8a038a0db042341528510e73ac80fc.tar.gz
opie-282007e58a8a038a0db042341528510e73ac80fc.tar.bz2
fixes for goofy crap going on
Diffstat (limited to 'core/multimedia/opieplayer/mediaplayerstate.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/mediaplayerstate.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/core/multimedia/opieplayer/mediaplayerstate.cpp b/core/multimedia/opieplayer/mediaplayerstate.cpp
index 3ac9ac4..cf166d6 100644
--- a/core/multimedia/opieplayer/mediaplayerstate.cpp
+++ b/core/multimedia/opieplayer/mediaplayerstate.cpp
@@ -1,22 +1,22 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2 ** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3 **
4** This file is part of Qtopia Environment. 4 ** This file is part of 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
7** GNU General Public License version 2 as published by the Free Software 7 ** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8 ** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9 ** packaging of this file.
10** 10 **
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13 **
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15 **
16** Contact info@trolltech.com if any conditions of this licensing are 16 ** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17 ** not clear to you.
18** 18 **
19**********************************************************************/ 19 **********************************************************************/
20#include <qpe/qpeapplication.h> 20#include <qpe/qpeapplication.h>
21#include <qpe/qlibrary.h> 21#include <qpe/qlibrary.h>
22#include <qpe/config.h> 22#include <qpe/config.h>
@@ -41,7 +41,7 @@
41 41
42 42
43MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) 43MediaPlayerState::MediaPlayerState( QObject *parent, const char *name )
44 : QObject( parent, name ), decoder( NULL ), libmpeg3decoder( NULL ) { 44 : QObject( parent, name ), decoder( NULL ), libmpeg3decoder( NULL ) {
45 Config cfg( "OpiePlayer" ); 45 Config cfg( "OpiePlayer" );
46 readConfig( cfg ); 46 readConfig( cfg );
47 loadPlugins(); 47 loadPlugins();
@@ -106,7 +106,7 @@ MediaPlayerDecoder *MediaPlayerState::newDecoder( const QString& file ) {
106 if(file.left(4)=="http") 106 if(file.left(4)=="http")
107 isStreaming = TRUE; 107 isStreaming = TRUE;
108 else 108 else
109 isStreaming = FALSE; 109 isStreaming = FALSE;
110 return decoder = tmpDecoder; 110 return decoder = tmpDecoder;
111} 111}
112 112
@@ -131,9 +131,9 @@ void MediaPlayerState::loadPlugins() {
131#ifndef QT_NO_COMPONENT 131#ifndef QT_NO_COMPONENT
132 QValueList<MediaPlayerPlugin>::Iterator mit; 132 QValueList<MediaPlayerPlugin>::Iterator mit;
133 for ( mit = pluginList.begin(); mit != pluginList.end(); ++mit ) { 133 for ( mit = pluginList.begin(); mit != pluginList.end(); ++mit ) {
134 (*mit).iface->release(); 134 (*mit).iface->release();
135 (*mit).library->unload(); 135 (*mit).library->unload();
136 delete (*mit).library; 136 delete (*mit).library;
137 } 137 }
138 pluginList.clear(); 138 pluginList.clear();
139 139
@@ -142,28 +142,28 @@ void MediaPlayerState::loadPlugins() {
142 QStringList list = dir.entryList(); 142 QStringList list = dir.entryList();
143 QStringList::Iterator it; 143 QStringList::Iterator it;
144 for ( it = list.begin(); it != list.end(); ++it ) { 144 for ( it = list.begin(); it != list.end(); ++it ) {
145 MediaPlayerPluginInterface *iface = 0; 145 MediaPlayerPluginInterface *iface = 0;
146 QLibrary *lib = new QLibrary( path + "/" + *it ); 146 QLibrary *lib = new QLibrary( path + "/" + *it );
147// qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); 147// qDebug( "querying: %s", QString( path + "/" + *it ).latin1() );
148 148
149 if ( lib->queryInterface( IID_MediaPlayerPlugin, (QUnknownInterface**)&iface ) == QS_OK ) { 149 if ( lib->queryInterface( IID_MediaPlayerPlugin, (QUnknownInterface**)&iface ) == QS_OK ) {
150 150
151// qDebug( "loading: %s", QString( path + "/" + *it ).latin1() ); 151// qDebug( "loading: %s", QString( path + "/" + *it ).latin1() );
152 152
153 MediaPlayerPlugin plugin; 153 MediaPlayerPlugin plugin;
154 plugin.library = lib; 154 plugin.library = lib;
155 plugin.iface = iface; 155 plugin.iface = iface;
156 plugin.decoder = plugin.iface->decoder(); 156 plugin.decoder = plugin.iface->decoder();
157 plugin.encoder = plugin.iface->encoder(); 157 plugin.encoder = plugin.iface->encoder();
158 pluginList.append( plugin ); 158 pluginList.append( plugin );
159 159
160 // ### hack to get true sample count 160 // ### hack to get true sample count
161 if ( plugin.decoder->pluginName() == QString("LibMpeg3Plugin") ) 161 if ( plugin.decoder->pluginName() == QString("LibMpeg3Plugin") )
162 libmpeg3decoder = plugin.decoder; 162 libmpeg3decoder = plugin.decoder;
163 163
164 } else { 164 } else {
165 delete lib; 165 delete lib;
166 } 166 }
167 } 167 }
168#else 168#else
169 pluginList.clear(); 169 pluginList.clear();
@@ -188,8 +188,8 @@ void MediaPlayerState::loadPlugins() {
188#endif 188#endif
189 189
190 if ( pluginList.count() ) 190 if ( pluginList.count() )
191 MediaPlayerDebug(( "%i decoders found", pluginList.count() )); 191 MediaPlayerDebug(( "%i decoders found", pluginList.count() ));
192 else 192 else
193 MediaPlayerDebug(( "No decoders found" )); 193 MediaPlayerDebug(( "No decoders found" ));
194} 194}
195 195