author | zecke <zecke> | 2004-03-14 18:05:28 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-14 18:05:28 (UTC) |
commit | 9e54b8bd8343af7c301da17d82596d6027e53309 (patch) (side-by-side diff) | |
tree | 693613ff9f1a0f3415e0623e636d47ac4798da2d | |
parent | 98bbe5561e8e1a862e19a3d0a0d49ed90ef15b54 (diff) | |
download | opie-9e54b8bd8343af7c301da17d82596d6027e53309.zip opie-9e54b8bd8343af7c301da17d82596d6027e53309.tar.gz opie-9e54b8bd8343af7c301da17d82596d6027e53309.tar.bz2 |
OpiePlayer -> ODP
12 files changed, 23 insertions, 7 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp index 8bcc567..7da2d54 100644 --- a/core/multimedia/opieplayer/audiowidget.cpp +++ b/core/multimedia/opieplayer/audiowidget.cpp @@ -1,84 +1,85 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include <qpe/qpeapplication.h> #include <qpe/resource.h> #include <qpe/config.h> #include <qdir.h> #include "audiowidget.h" #include "mediaplayerstate.h" #include <stdlib.h> #include <stdio.h> extern MediaPlayerState *mediaPlayerState; static const int xo = -2; // movable x offset static const int yo = 22; // movable y offset +using namespace Opie::Ui; struct MediaButton { bool isToggle, isHeld, isDown; }; //Layout information for the audioButtons (and if it is a toggle button or not) MediaButton audioButtons[] = { { TRUE, FALSE, FALSE }, // play { FALSE, FALSE, FALSE }, // stop { FALSE, FALSE, FALSE }, // next { FALSE, FALSE, FALSE }, // previous { FALSE, FALSE, FALSE }, // volume up { FALSE, FALSE, FALSE }, // volume down { TRUE, FALSE, FALSE }, // repeat/loop { FALSE, FALSE, FALSE }, // playlist { FALSE, FALSE, FALSE }, // forward { FALSE, FALSE, FALSE } // back }; const char *skin_mask_file_names[10] = { "play", "stop", "next", "prev", "up", "down", "loop", "playlist", "forward", "back" }; static void changeTextColor( QWidget *w ) { QPalette p = w->palette(); p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); w->setPalette( p ); } static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton)); AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : QWidget( parent, name, f ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) { setCaption( tr("OpiePlayer") ); // qDebug("<<<<<audioWidget"); Config cfg("OpiePlayer"); cfg.setGroup("Options"); skin = cfg.readEntry("Skin","default"); //skin = "scaleTest"; // color of background, frame, degree of transparency // QString skinPath = "opieplayer/skins/" + skin; QString skinPath; skinPath = "opieplayer2/skins/" + skin; if(!QDir(QString(getenv("OPIEDIR")) +"/pics/"+skinPath).exists()) diff --git a/core/multimedia/opieplayer/audiowidget.h b/core/multimedia/opieplayer/audiowidget.h index 96bc55c..0a7cb26 100644 --- a/core/multimedia/opieplayer/audiowidget.h +++ b/core/multimedia/opieplayer/audiowidget.h @@ -1,118 +1,118 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #ifndef AUDIO_WIDGET_H #define AUDIO_WIDGET_H #include <qwidget.h> #include <qpainter.h> #include <qdrawutil.h> #include <qpixmap.h> #include <qbitmap.h> #include <qstring.h> #include <qslider.h> #include <qlineedit.h> #include <qframe.h> -#include <opie/oticker.h> +#include <opie2/oticker.h> class QPixmap; enum AudioButtons { AudioPlay=0, AudioStop, AudioNext, AudioPrevious, AudioVolumeUp, AudioVolumeDown, AudioLoop, AudioPlayList, AudioForward, AudioBack }; //#define USE_DBLBUF class AudioWidget : public QWidget { Q_OBJECT public: AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 ); ~AudioWidget(); void setTickerText( const QString &text ) { songInfo.setText( text ); } bool isStreaming; public slots: void updateSlider( long, long ); void sliderPressed( ); void sliderReleased( ); // void setPaused( bool b) { setToggleButton( AudioPause, b ); } void setLooping( bool b) { setToggleButton( AudioLoop, b ); } void setPlaying( bool b) { setToggleButton( AudioPlay, b ); } void setPosition( long ); void setLength( long ); void setView( char ); signals: void moreClicked(); void lessClicked(); void moreReleased(); void lessReleased(); void sliderMoved(long); void forwardClicked(); void backClicked(); void forwardReleased(); void backReleased(); protected: void doBlank(); void doUnblank(); void paintEvent( QPaintEvent *pe ); void showEvent( QShowEvent *se ); void resizeEvent( QResizeEvent *re ); void mouseMoveEvent( QMouseEvent *event ); void mousePressEvent( QMouseEvent *event ); void mouseReleaseEvent( QMouseEvent *event ); void timerEvent( QTimerEvent *event ); void closeEvent( QCloseEvent *event ); void keyReleaseEvent( QKeyEvent *e); private: void toggleButton( int ); void setToggleButton( int, bool ); void paintButton( QPainter *p, int i ); QString skin; QPixmap *pixBg; QImage *imgUp; QImage *imgDn; QImage *imgButtonMask; QBitmap *masks[11]; QPixmap *buttonPixUp[11]; QPixmap *buttonPixDown[11]; QPixmap *pixmaps[4]; - OTicker songInfo; + Opie::Ui::OTicker songInfo; QSlider slider; QLineEdit time; int xoff, yoff; }; #endif // AUDIO_WIDGET_H diff --git a/core/multimedia/opieplayer/config.in b/core/multimedia/opieplayer/config.in index dc1b79a..d25b11f 100644 --- a/core/multimedia/opieplayer/config.in +++ b/core/multimedia/opieplayer/config.in @@ -1,12 +1,12 @@ config OPIEPLAYER boolean "opie-mediaplayer (mediaplayer that plays mp3, mpeg, and wav)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIEUI2 source core/multimedia/opieplayer/libflash/config.in source core/multimedia/opieplayer/libmad/config.in source core/multimedia/opieplayer/libmpeg3/config.in source core/multimedia/opieplayer/modplug/config.in source core/multimedia/opieplayer/wavplugin/config.in source core/multimedia/opieplayer/vorbis/tremor/config.in source core/multimedia/opieplayer/vorbis/config.in diff --git a/core/multimedia/opieplayer/inputDialog.cpp b/core/multimedia/opieplayer/inputDialog.cpp index 38b8f53..44a1cdd 100644 --- a/core/multimedia/opieplayer/inputDialog.cpp +++ b/core/multimedia/opieplayer/inputDialog.cpp @@ -1,57 +1,58 @@ #include "inputDialog.h" #include <qpe/resource.h> -#include <opie/ofiledialog.h> +#include <opie2/ofiledialog.h> #include <qlineedit.h> #include <qpushbutton.h> +using namespace Opie::Ui; InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) { setName( "InputDialog" ); } resize( 234, 115); setMaximumSize( QSize( 240, 40)); setCaption( tr( name ) ); QPushButton *browserButton; browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton"); browserButton->setGeometry( QRect( 205, 10, 22, 22)); connect( browserButton, SIGNAL(released()),this,SLOT(browse())); LineEdit1 = new QLineEdit( this, "LineEdit1" ); LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) ); LineEdit1->setFocus(); } /* * return the current text(input) */ QString InputDialog::text() const { return LineEdit1->text(); } /* * Destroys the object and frees any allocated resources */ InputDialog::~InputDialog() { } void InputDialog::browse() { MimeTypes types; QStringList audio, video, all; audio << "audio/*"; audio << "playlist/plain"; audio << "audio/x-mpegurl"; video << "video/*"; video << "playlist/plain"; all += audio; all += video; types.insert("All Media Files", all ); types.insert("Audio", audio ); types.insert("Video", video ); QString str = OFileDialog::getOpenFileName( 1,"/","", types, 0 ); LineEdit1->setText(str); diff --git a/core/multimedia/opieplayer/libflash/libflashpluginimpl.cpp b/core/multimedia/opieplayer/libflash/libflashpluginimpl.cpp index af2c07e..b2a1b5d 100644 --- a/core/multimedia/opieplayer/libflash/libflashpluginimpl.cpp +++ b/core/multimedia/opieplayer/libflash/libflashpluginimpl.cpp @@ -11,60 +11,62 @@ ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "libflashplugin.h" #include "libflashpluginimpl.h" LibFlashPluginImpl::LibFlashPluginImpl() : libflashplugin(0), ref(0) { } LibFlashPluginImpl::~LibFlashPluginImpl() { if ( libflashplugin ) delete libflashplugin; } MediaPlayerDecoder *LibFlashPluginImpl::decoder() { if ( !libflashplugin ) libflashplugin = new LibFlashPlugin; return libflashplugin; } MediaPlayerEncoder *LibFlashPluginImpl::encoder() { return NULL; } #ifndef QT_NO_COMPONENT QRESULT LibFlashPluginImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { *iface = 0; if ( ( uuid == IID_QUnknown ) || ( uuid == IID_MediaPlayerPlugin ) ) *iface = this, (*iface)->addRef(); + else + return QS_FALSE; return QS_OK; } Q_EXPORT_INTERFACE() { Q_CREATE_INSTANCE( LibFlashPluginImpl ) } #endif diff --git a/core/multimedia/opieplayer/libmad/libmadpluginimpl.cpp b/core/multimedia/opieplayer/libmad/libmadpluginimpl.cpp index 67779e8..b3e01e5 100644 --- a/core/multimedia/opieplayer/libmad/libmadpluginimpl.cpp +++ b/core/multimedia/opieplayer/libmad/libmadpluginimpl.cpp @@ -11,60 +11,62 @@ ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "libmadplugin.h" #include "libmadpluginimpl.h" LibMadPluginImpl::LibMadPluginImpl() : libmadplugin(0), ref(0) { } LibMadPluginImpl::~LibMadPluginImpl() { if ( libmadplugin ) delete libmadplugin; } MediaPlayerDecoder *LibMadPluginImpl::decoder() { if ( !libmadplugin ) libmadplugin = new LibMadPlugin; return libmadplugin; } MediaPlayerEncoder *LibMadPluginImpl::encoder() { return NULL; } #ifndef QT_NO_COMPONENT QRESULT LibMadPluginImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { *iface = 0; if ( ( uuid == IID_QUnknown ) || ( uuid == IID_MediaPlayerPlugin ) ) *iface = this, (*iface)->addRef(); + else + return QS_FALSE; return QS_OK; } Q_EXPORT_INTERFACE() { Q_CREATE_INSTANCE( LibMadPluginImpl ) } #endif diff --git a/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.cpp b/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.cpp index bf3f372..f6d34b8 100644 --- a/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.cpp +++ b/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.cpp @@ -11,60 +11,62 @@ ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "libmpeg3plugin.h" #include "libmpeg3pluginimpl.h" LibMpeg3PluginImpl::LibMpeg3PluginImpl() : libmpeg3plugin(0), ref(0) { } LibMpeg3PluginImpl::~LibMpeg3PluginImpl() { if ( libmpeg3plugin ) delete libmpeg3plugin; } MediaPlayerDecoder *LibMpeg3PluginImpl::decoder() { if ( !libmpeg3plugin ) libmpeg3plugin = new LibMpeg3Plugin; return libmpeg3plugin; } MediaPlayerEncoder *LibMpeg3PluginImpl::encoder() { return NULL; } #ifndef QT_NO_COMPONENT QRESULT LibMpeg3PluginImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { *iface = 0; if ( ( uuid == IID_QUnknown ) || ( uuid == IID_MediaPlayerPlugin ) ) *iface = this, (*iface)->addRef(); + else + return QS_FALSE; return QS_OK; } Q_EXPORT_INTERFACE() { Q_CREATE_INSTANCE( LibMpeg3PluginImpl ) } #endif diff --git a/core/multimedia/opieplayer/modplug/modpluginimpl.cpp b/core/multimedia/opieplayer/modplug/modpluginimpl.cpp index 6e64e76..6205779 100644 --- a/core/multimedia/opieplayer/modplug/modpluginimpl.cpp +++ b/core/multimedia/opieplayer/modplug/modpluginimpl.cpp @@ -1,60 +1,62 @@ /* This file is part of the KDE project Copyright (C) 2002 Simon Hausmann <hausmann@kde.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "modplugin.h" #include "modpluginimpl.h" ModPluginImpl::ModPluginImpl() :m_plugin( 0 ), ref( 0 ) { } ModPluginImpl::~ModPluginImpl() { delete m_plugin; } #ifndef QT_NO_COMPONENT QRESULT ModPluginImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { *iface = 0; if ( ( uuid == IID_QUnknown ) || ( uuid == IID_MediaPlayerPlugin ) ) *iface = this, (*iface)->addRef(); + else + return QS_FALSE; return QS_OK; } Q_EXPORT_INTERFACE() { Q_CREATE_INSTANCE( ModPluginImpl ) } #endif MediaPlayerDecoder *ModPluginImpl::decoder() { if ( !m_plugin ) m_plugin = new ModPlugin; return m_plugin; } MediaPlayerEncoder *ModPluginImpl::encoder() { return 0; } diff --git a/core/multimedia/opieplayer/opieplayer.pro b/core/multimedia/opieplayer/opieplayer.pro index 03d8a89..d7b0fb8 100644 --- a/core/multimedia/opieplayer/opieplayer.pro +++ b/core/multimedia/opieplayer/opieplayer.pro @@ -1,21 +1,21 @@ TEMPLATE = app CONFIG = qt warn_on release #release DESTDIR = $(OPIEDIR)/bin HEADERS = loopcontrol.h mediaplayerplugininterface.h \ playlistselection.h mediaplayerstate.h \ videowidget.h audiowidget.h playlistwidget.h \ mediaplayer.h audiodevice.h inputDialog.h om3u.h SOURCES = main.cpp \ loopcontrol.cpp playlistselection.cpp mediaplayerstate.cpp \ videowidget.cpp audiowidget.cpp playlistwidget.cpp \ mediaplayer.cpp audiodevice.cpp inputDialog.cpp om3u.cpp TARGET = opieplayer INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lpthread -lopie +LIBS += -lqpe -lpthread -lopieui2 INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include include ( $(OPIEDIR)/include.pro ) diff --git a/core/multimedia/opieplayer/videowidget.cpp b/core/multimedia/opieplayer/videowidget.cpp index d002c42..164458b 100644 --- a/core/multimedia/opieplayer/videowidget.cpp +++ b/core/multimedia/opieplayer/videowidget.cpp @@ -520,100 +520,102 @@ bool VideoWidget::playVideo() { { #endif QPainter p(this); w = 320; h = 240; if ( mediaPlayerState->scaled() ) { // maintain aspect ratio if ( w * sh > sw * h ) w = sw * h / sh; else h = sh * w / sw; } else { w = sw; h = sh; } int bytes = ( dd == 16 ) ? 2 : 4; QImage tempFrame( w, h, bytes << 3 ); result = mediaPlayerState->curDecoder()->videoReadScaledFrame( tempFrame.jumpTable(), 0, 0, sw, sh, w, h, format, 0) == 0; if ( result && mediaPlayerState->fullscreen() ) { int rw = h, rh = w; QImage rotatedFrame( rw, rh, bytes << 3 ); ushort* in = (ushort*)tempFrame.bits(); ushort* out = (ushort*)rotatedFrame.bits(); int spl = rotatedFrame.bytesPerLine() / bytes; for (int x=0; x<h; x++) { if ( bytes == 2 ) { ushort* lout = out++ + (w - 1)*spl; for (int y=0; y<w; y++) { *lout=*in++; lout-=spl; } } else { - ulong* lout = ((ulong *)out)++ + (w - 1)*spl; + ulong* _out = (ulong *)out; + ulong* lout = _out++ + (w - 1)*spl; for (int y=0; y<w; y++) { - *lout=*((ulong*)in)++; + ulong *_in = (ulong*)in; + *lout=*_in++; lout-=spl; } } } p.drawImage( (240 - rw) / 2, (320 - rh) / 2, rotatedFrame, 0, 0, rw, rh ); } #ifdef USE_DIRECT_PAINTER } #endif } else { w = 220; h = 160; // maintain aspect ratio if ( w * sh > sw * h ) w = sw * h / sh; else h = sh * w / sw; result = mediaPlayerState->curDecoder()->videoReadScaledFrame( currentFrame->jumpTable(), 0, 0, sw, sh, w, h, format, 0) == 0; QPainter p( this ); int deskW = qApp->desktop()->width(); // Image changed size, therefore need to blank the possibly unpainted regions first if ( scaledWidth != w || scaledHeight != h ) { p.setBrush( QBrush( Qt::black ) ); p.drawRect( ( deskW -scaledWidth)/2, 20, scaledWidth, 160 ); } scaledWidth = w; scaledHeight = h; if ( result ) { p.drawImage( (deskW - scaledWidth) / 2, 20 + (160 - scaledHeight) / 2, *currentFrame, 0, 0, scaledWidth, scaledHeight ); } } return result; } diff --git a/core/multimedia/opieplayer/vorbis/libtremorpluginimpl.cpp b/core/multimedia/opieplayer/vorbis/libtremorpluginimpl.cpp index 440747a..0c7b1ea 100644 --- a/core/multimedia/opieplayer/vorbis/libtremorpluginimpl.cpp +++ b/core/multimedia/opieplayer/vorbis/libtremorpluginimpl.cpp @@ -12,60 +12,62 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ****************************************************************************/ #include "libtremorplugin.h" #include "libtremorpluginimpl.h" LibTremorPluginImpl::LibTremorPluginImpl() : libtremorplugin(0), ref(0) { } LibTremorPluginImpl::~LibTremorPluginImpl() { if ( libtremorplugin ) delete libtremorplugin; } MediaPlayerDecoder *LibTremorPluginImpl::decoder() { if ( !libtremorplugin ) libtremorplugin = new LibTremorPlugin; return libtremorplugin; } MediaPlayerEncoder *LibTremorPluginImpl::encoder() { return NULL; } #ifndef QT_NO_COMPONENT QRESULT LibTremorPluginImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { *iface = 0; if ( ( uuid == IID_QUnknown ) || ( uuid == IID_MediaPlayerPlugin ) ) *iface = this, (*iface)->addRef(); + else + return QS_FALSE; return QS_OK; } Q_EXPORT_INTERFACE() { Q_CREATE_INSTANCE( LibTremorPluginImpl ) } #endif diff --git a/core/multimedia/opieplayer/wavplugin/wavpluginimpl.cpp b/core/multimedia/opieplayer/wavplugin/wavpluginimpl.cpp index c232d7b..4280880 100644 --- a/core/multimedia/opieplayer/wavplugin/wavpluginimpl.cpp +++ b/core/multimedia/opieplayer/wavplugin/wavpluginimpl.cpp @@ -10,60 +10,62 @@ ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "wavplugin.h" #include "wavpluginimpl.h" WavPluginImpl::WavPluginImpl() : libmadplugin(0), ref(0) { } WavPluginImpl::~WavPluginImpl() { if ( libmadplugin ) delete libmadplugin; } MediaPlayerDecoder *WavPluginImpl::decoder() { if ( !libmadplugin ) libmadplugin = new WavPlugin; return libmadplugin; } MediaPlayerEncoder *WavPluginImpl::encoder() { return NULL; } #ifndef QT_NO_COMPONENT QRESULT WavPluginImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { *iface = 0; if ( ( uuid == IID_QUnknown ) || ( uuid == IID_MediaPlayerPlugin ) ) *iface = this, (*iface)->addRef(); + else + return QS_FALSE; return QS_OK; } Q_EXPORT_INTERFACE() { Q_CREATE_INSTANCE( WavPluginImpl ) } #endif |