Qmmp
decoderfactory.h
1 /***************************************************************************
2  * Copyright (C) 2006-2020 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 DECODERFACTORY_H
22 #define DECODERFACTORY_H
23 
24 #include <QObject>
25 #include <QString>
26 #include <QIODevice>
27 #include <QStringList>
28 #include "qmmp_export.h"
29 #include "decoder.h"
30 #include "metadatamodel.h"
31 #include "trackinfo.h"
32 
37 {
38  QString name;
39  QString shortName;
40  QStringList filters;
41  QString description;
42  QStringList contentTypes;
43  QStringList protocols;
45  bool hasAbout = false;
46  bool hasSettings = false;
47  bool noInput = false;
48  int priority = 0;
49 };
54 {
55 public:
59  virtual ~DecoderFactory() {}
63  virtual bool canDecode(QIODevice *d) const = 0;
67  virtual DecoderProperties properties() const = 0;
73  virtual Decoder *create(const QString &path, QIODevice *input = nullptr) = 0;
82  virtual QList<TrackInfo *> createPlayList(const QString &fileName, TrackInfo::Parts parts, QStringList *ignoredPaths) = 0;
89  virtual MetaDataModel* createMetaDataModel(const QString &path, bool readOnly) = 0;
94  virtual void showSettings(QWidget *parent) = 0;
99  virtual void showAbout(QWidget *parent) = 0;
103  virtual QString translation() const = 0;
104 
105 };
106 
107 Q_DECLARE_INTERFACE(DecoderFactory, "DecoderFactory/1.0")
108 
109 #endif
bool hasAbout
Definition: decoderfactory.h:45
virtual QList< TrackInfo * > createPlayList(const QString &fileName, TrackInfo::Parts parts, QStringList *ignoredPaths)=0
virtual bool canDecode(QIODevice *d) const =0
virtual void showSettings(QWidget *parent)=0
int priority
Definition: decoderfactory.h:48
virtual DecoderProperties properties() const =0
virtual MetaDataModel * createMetaDataModel(const QString &path, bool readOnly)=0
The MetaDataModel is the base interface class of metadata access.
Definition: metadatamodel.h:80
Input plugin interface (decoder factory).
Definition: decoderfactory.h:53
QStringList protocols
Definition: decoderfactory.h:43
QStringList contentTypes
Definition: decoderfactory.h:42
The Decoder class provides the base interface class of audio decoders.
Definition: decoder.h:25
QString name
Definition: decoderfactory.h:38
QStringList filters
Definition: decoderfactory.h:40
virtual ~DecoderFactory()
Definition: decoderfactory.h:59
virtual QString translation() const =0
bool noInput
Definition: decoderfactory.h:47
virtual void showAbout(QWidget *parent)=0
virtual Decoder * create(const QString &path, QIODevice *input=nullptr)=0
QString description
Definition: decoderfactory.h:41
Structure to store input plugin properties.
Definition: decoderfactory.h:36
bool hasSettings
Definition: decoderfactory.h:46
QString shortName
Definition: decoderfactory.h:39