Qmmp
abstractengine.h
1 /***************************************************************************
2  * Copyright (C) 2009-2016 by Ilya Kotov *
3  * forkotov02@ya.ru *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19  ***************************************************************************/
20 
21 #ifndef ABSTRACTENGINE_H
22 #define ABSTRACTENGINE_H
23 
24 #include <QMutex>
25 #include <QThread>
26 #include <QStringList>
27 #include "enginefactory.h"
28 #include "qmmpsettings.h"
29 
30 class QIODevice;
31 class InputSource;
32 class QmmpPluginCache;
33 
34 
38 class AbstractEngine : public QThread
39 {
40  Q_OBJECT
41 public:
46  AbstractEngine(QObject *parent = 0);
50  virtual ~AbstractEngine();
55  virtual bool enqueue(InputSource *source) = 0;
60  virtual bool play() = 0;
64  virtual void seek(qint64 time) = 0;
68  virtual void stop() = 0;
72  virtual void pause() = 0;
77  virtual void setMuted(bool muted) = 0;
81  QMutex *mutex();
88  static AbstractEngine *create(InputSource *s, QObject *parent = 0);
92  static QList<EngineFactory*> factories();
96  static QList<EngineFactory*> enabledFactories();
100  static EngineFactory *findByFilePath(const QString &path);
106  static void setEnabled(EngineFactory* factory, bool enable = true);
111  static bool isEnabled(EngineFactory* factory);
116  static QString file(EngineFactory *factory);
121  static QStringList protocols();
122 
123 private:
124  QMutex m_mutex;
125  static void loadPlugins();
126  static QList<QmmpPluginCache*> *m_cache;
127  static QStringList m_disabledNames;
128 };
129 
130 
131 #endif // ABSTRACTENGINE_H
virtual void seek(qint64 time)=0
The InputSource class provides the base interface class of transports.
Definition: inputsource.h:38
static QList< EngineFactory * > enabledFactories()
AbstractEngine(QObject *parent=0)
static QString file(EngineFactory *factory)
QMutex * mutex()
virtual void setMuted(bool muted)=0
virtual void pause()=0
static bool isEnabled(EngineFactory *factory)
static QStringList protocols()
The AbstractEngine class provides the base interface class of audio audio engines.
Definition: abstractengine.h:38
static QList< EngineFactory * > factories()
Engine plugin interface.
Definition: enginefactory.h:60
static EngineFactory * findByFilePath(const QString &path)
virtual bool enqueue(InputSource *source)=0
static void setEnabled(EngineFactory *factory, bool enable=true)
virtual bool play()=0
virtual ~AbstractEngine()
virtual void stop()=0
static AbstractEngine * create(InputSource *s, QObject *parent=0)