Qmmp
Loading...
Searching...
No Matches
abstractengine.h
1/***************************************************************************
2 * Copyright (C) 2009-2022 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
30class QIODevice;
31class InputSource;
32class QmmpPluginCache;
33class EngineFactory;
34
35
39class QMMP_EXPORT AbstractEngine : public QThread
40{
41 Q_OBJECT
42public:
47 AbstractEngine(QObject *parent = nullptr);
51 virtual ~AbstractEngine();
56 virtual bool enqueue(InputSource *source) = 0;
61 virtual bool play() = 0;
65 virtual void seek(qint64 time) = 0;
69 virtual void stop() = 0;
73 virtual void pause() = 0;
80 static AbstractEngine *create(InputSource *s, QObject *parent = nullptr);
84 static QList<EngineFactory*> factories();
88 static QList<EngineFactory*> enabledFactories();
92 static QStringList nameFilters();
96 static QStringList contentTypes();
100 static EngineFactory *findByFilePath(const QString &path);
106 static void setEnabled(EngineFactory *factory, bool enable = true);
112 static bool isEnabled(const EngineFactory *factory);
117 static bool isEnabled(const AbstractEngine *engine);
122 static QString file(const EngineFactory *factory);
127 static QStringList protocols();
128
129protected:
133 QMutex *mutex();
134
135private:
136 QMutex m_mutex;
137 static void loadPlugins();
138 static QList<QmmpPluginCache*> *m_cache;
139 static QStringList m_disabledNames;
140};
141
142
143#endif // ABSTRACTENGINE_H
The AbstractEngine class provides the base interface class of audio audio engines.
Definition abstractengine.h:40
static QStringList nameFilters()
QMutex * mutex()
virtual void stop()=0
static bool isEnabled(const EngineFactory *factory)
virtual void pause()=0
static QStringList protocols()
static bool isEnabled(const AbstractEngine *engine)
static QStringList contentTypes()
virtual ~AbstractEngine()
static EngineFactory * findByFilePath(const QString &path)
static QList< EngineFactory * > factories()
static QString file(const EngineFactory *factory)
static void setEnabled(EngineFactory *factory, bool enable=true)
AbstractEngine(QObject *parent=nullptr)
virtual bool play()=0
static QList< EngineFactory * > enabledFactories()
virtual void seek(qint64 time)=0
static AbstractEngine * create(InputSource *s, QObject *parent=nullptr)
virtual bool enqueue(InputSource *source)=0
Engine plugin interface.
Definition enginefactory.h:55
The InputSource class provides the base interface class of transports.
Definition inputsource.h:39