Qmmp
qmmpplugincache_p.h
1 /***************************************************************************
2  * Copyright (C) 2013-2021 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 QMMPPLUGINCACHE_P_H
22 #define QMMPPLUGINCACHE_P_H
23 
24 #include <QString>
25 #include <QStringList>
26 #include <QObject>
27 #include <QSettings>
28 
29 class DecoderFactory;
30 class OutputFactory;
31 class EngineFactory;
32 class EffectFactory;
33 class InputSourceFactory;
34 
38 class QmmpPluginCache
39 {
40 public:
41  QmmpPluginCache(const QString &file, QSettings *settings);
42 
43  const QString shortName() const;
44  const QString file() const;
45  const QStringList &filters() const;
46  int priority() const;
47  bool hasError() const;
48 
49  DecoderFactory *decoderFactory();
50  OutputFactory *outputFactory();
51  EngineFactory *engineFactory();
52  EffectFactory *effectFactory();
53  InputSourceFactory *inputSourceFactory();
54 
55  static void cleanup(QSettings *settings);
56 
57 private:
58  QObject *instance();
59  void loadTranslation(const QString &translation);
60  QString m_path;
61  QString m_shortName;
62  QStringList m_filters;
63  bool m_error = false;
64  QObject *m_instance = nullptr;
65  DecoderFactory *m_decoderFactory = nullptr;
66  OutputFactory *m_outputFactory = nullptr;
67  EngineFactory *m_engineFactory = nullptr;
68  EffectFactory *m_effectFactory = nullptr;
69  InputSourceFactory *m_inputSourceFactory = nullptr;
70  int m_priority = 0;
71 };
72 
73 #endif // QMMPPLUGINCACHE_P_H
Transport plugin interface.
Definition: inputsourcefactory.h:49
Effect plugin interface (effect factory).
Definition: effectfactory.h:55
Input plugin interface (decoder factory).
Definition: decoderfactory.h:53
Engine plugin interface.
Definition: enginefactory.h:54
Output plugin interface (output factory).
Definition: outputfactory.h:47