Qmmp
decoderfactory.h
1 /***************************************************************************
2  * Copyright (C) 2006-2017 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 class QObject;
25 class QString;
26 class QIODevice;
27 class QWidget;
28 class QTranslator;
29 class QStringList;
30 
31 class Decoder;
32 class Output;
33 class FileInfo;
34 class MetaDataModel;
35 
40 {
41 public:
46  {
47  hasAbout = false;
48  hasSettings = false;
49  noInput = false;
50  priority = 0;
51  }
52  QString name;
53  QString shortName;
54  QStringList filters;
55  QString description;
56  QStringList contentTypes;
57  QStringList protocols;
59  bool hasAbout;
60  bool hasSettings;
61  bool noInput;
62  int priority;
63 };
68 {
69 public:
73  virtual ~DecoderFactory() {}
77  virtual bool canDecode(QIODevice *d) const = 0;
81  virtual const DecoderProperties properties() const = 0;
87  virtual Decoder *create(const QString &path, QIODevice *input = 0) = 0;
96  virtual QList<FileInfo *> createPlayList(const QString &fileName, bool useMetaData, QStringList *ignoredPaths) = 0;
103  virtual MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0) = 0;
108  virtual void showSettings(QWidget *parent) = 0;
113  virtual void showAbout(QWidget *parent) = 0;
118  virtual QTranslator *createTranslator(QObject *parent) = 0;
119 };
120 
121 Q_DECLARE_INTERFACE(DecoderFactory, "DecoderFactory/1.0")
122 
123 #endif
The FileInfo class stores metadata and audio information about media file or stream.
Definition: fileinfo.h:32
QString name
Definition: decoderfactory.h:52
QStringList filters
Definition: decoderfactory.h:54
The Output class provides the base interface class of audio outputs.
Definition: output.h:26
QString shortName
Definition: decoderfactory.h:53
The MetaDataModel is the base interface class of metadata access.
Definition: metadatamodel.h:34
QStringList contentTypes
Definition: decoderfactory.h:56
Input plugin interface (decoder factory).
Definition: decoderfactory.h:67
DecoderProperties()
Definition: decoderfactory.h:45
The Decoder class provides the base interface class of audio decoders.
Definition: decoder.h:26
bool noInput
Definition: decoderfactory.h:61
virtual ~DecoderFactory()
Definition: decoderfactory.h:73
bool hasAbout
Definition: decoderfactory.h:59
bool hasSettings
Definition: decoderfactory.h:60
QString description
Definition: decoderfactory.h:55
Helper class to store input plugin properties.
Definition: decoderfactory.h:39
QStringList protocols
Definition: decoderfactory.h:57
int priority
Definition: decoderfactory.h:62