Qmmp
|
00001 /*************************************************************************** 00002 * Copyright (C) 2009-2013 by Ilya Kotov * 00003 * forkotov02@hotmail.ru * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 00019 ***************************************************************************/ 00020 00021 #ifndef ABSTRACTENGINE_H 00022 #define ABSTRACTENGINE_H 00023 00024 #include <QMutex> 00025 #include <QThread> 00026 #include <QStringList> 00027 #include "enginefactory.h" 00028 #include "qmmpsettings.h" 00029 00030 class QIODevice; 00031 class InputSource; 00032 class QmmpPluginCache; 00033 00034 00038 class AbstractEngine : public QThread 00039 { 00040 Q_OBJECT 00041 public: 00046 AbstractEngine(QObject *parent = 0); 00050 virtual ~AbstractEngine(); 00055 virtual bool enqueue(InputSource *source) = 0; 00060 virtual bool play() = 0; 00064 virtual void seek(qint64 time) = 0; 00068 virtual void stop() = 0; 00072 virtual void pause() = 0; 00077 virtual void setMuted(bool muted) = 0; 00081 QMutex *mutex(); 00088 static AbstractEngine *create(InputSource *s, QObject *parent = 0); 00092 static QList<EngineFactory*> factories(); 00096 static QList<EngineFactory*> enabledFactories(); 00100 static EngineFactory *findByPath(const QString &path); 00106 static void setEnabled(EngineFactory* factory, bool enable = true); 00111 static bool isEnabled(EngineFactory* factory); 00116 static QString file(EngineFactory *factory); 00121 static QStringList protocols(); 00122 00123 private: 00124 QMutex m_mutex; 00125 static void loadPlugins(); 00126 static QList<QmmpPluginCache*> *m_cache; 00127 static QStringList m_disabledNames; 00128 }; 00129 00130 00131 #endif // ABSTRACTENGINE_H