Qmmp
decoderfactory.h
1 /***************************************************************************
2  * Copyright (C) 2006-2018 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 public:
43  {
44  hasAbout = false;
45  hasSettings = false;
46  noInput = false;
47  priority = 0;
48  }
49  QString name;
50  QString shortName;
51  QStringList filters;
52  QString description;
53  QStringList contentTypes;
54  QStringList protocols;
56  bool hasAbout;
57  bool hasSettings;
58  bool noInput;
59  int priority;
60 };
65 {
66 public:
70  virtual ~DecoderFactory() {}
74  virtual bool canDecode(QIODevice *d) const = 0;
78  virtual DecoderProperties properties() const = 0;
84  virtual Decoder *create(const QString &path, QIODevice *input = 0) = 0;
93  virtual QList<TrackInfo *> createPlayList(const QString &fileName, TrackInfo::Parts parts, QStringList *ignoredPaths) = 0;
100  virtual MetaDataModel* createMetaDataModel(const QString &path, bool readOnly, QObject *parent) = 0;
105  virtual void showSettings(QWidget *parent) = 0;
110  virtual void showAbout(QWidget *parent) = 0;
114  virtual QString translation() const = 0;
115 
116 };
117 
118 Q_DECLARE_INTERFACE(DecoderFactory, "DecoderFactory/1.0")
119 
120 #endif
QString name
Definition: decoderfactory.h:49
QStringList filters
Definition: decoderfactory.h:51
QString shortName
Definition: decoderfactory.h:50
The MetaDataModel is the base interface class of metadata access.
Definition: metadatamodel.h:54
QStringList contentTypes
Definition: decoderfactory.h:53
Input plugin interface (decoder factory).
Definition: decoderfactory.h:64
DecoderProperties()
Definition: decoderfactory.h:42
The Decoder class provides the base interface class of audio decoders.
Definition: decoder.h:25
bool noInput
Definition: decoderfactory.h:58
virtual ~DecoderFactory()
Definition: decoderfactory.h:70
bool hasAbout
Definition: decoderfactory.h:56
bool hasSettings
Definition: decoderfactory.h:57
QString description
Definition: decoderfactory.h:52
Helper class to store input plugin properties.
Definition: decoderfactory.h:36
QStringList protocols
Definition: decoderfactory.h:54
int priority
Definition: decoderfactory.h:59