CuteLogger
Fast and simple logging solution for Qt based applications
qmlmetadata.h
1 /*
2  * Copyright (c) 2013-2017 Meltytech, LLC
3  * Author: Dan Dennedy <dan@dennedy.org>
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 3 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, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef QMLMETADATA_H
20 #define QMLMETADATA_H
21 
22 #include <QObject>
23 #include <QString>
24 #include <QDir>
25 #include <QUrl>
26 
27 class QmlMetadata : public QObject
28 {
29  Q_OBJECT
30  Q_ENUMS(PluginType)
31  Q_PROPERTY(PluginType type READ type WRITE setType)
32  Q_PROPERTY(QString name READ name WRITE setName)
33  Q_PROPERTY(QString mlt_service READ mlt_service WRITE set_mlt_service)
34  Q_PROPERTY(bool needsGPU READ needsGPU WRITE setNeedsGPU NOTIFY changed)
35  Q_PROPERTY(QString qml READ qmlFileName WRITE setQmlFileName)
36  Q_PROPERTY(QString vui READ vuiFileName WRITE setVuiFileName)
37  Q_PROPERTY(QUrl qmlFilePath READ qmlFilePath )
38  Q_PROPERTY(QUrl vuiFilePath READ vuiFilePath )
39  Q_PROPERTY(bool isAudio READ isAudio WRITE setIsAudio NOTIFY changed)
40  Q_PROPERTY(bool isHidden READ isHidden WRITE setIsHidden NOTIFY changed)
41  Q_PROPERTY(bool isFavorite READ isFavorite WRITE setIsFavorite NOTIFY changed)
42  Q_PROPERTY(QString gpuAlt READ gpuAlt WRITE setGpuAlt NOTIFY changed)
43  Q_PROPERTY(bool allowMultiple READ allowMultiple WRITE setAllowMultiple)
44  Q_PROPERTY(bool isClipOnly READ isClipOnly WRITE setIsClipOnly)
45  Q_PROPERTY(bool isGpuCompatible READ isGpuCompatible() WRITE setIsGpuCompatible)
46 
47 public:
48  enum PluginType {
49  Filter,
50  Producer,
51  Transition
52  };
53 
54  explicit QmlMetadata(QObject *parent = 0);
55  void loadSettings();
56 
57  PluginType type() const { return m_type; }
58  void setType(PluginType);
59  QString name() const { return m_name; }
60  void setName(const QString&);
61  QString mlt_service() const { return m_mlt_service; }
62  void set_mlt_service(const QString&);
63  QString uniqueId() const;
64  bool needsGPU() const { return m_needsGPU; }
65  void setNeedsGPU(bool);
66  QString qmlFileName() const { return m_qmlFileName; }
67  void setQmlFileName(const QString&);
68  QString vuiFileName() const { return m_vuiFileName; }
69  void setVuiFileName(const QString&);
70  QDir path() const { return m_path; }
71  void setPath(const QDir& path);
72  QUrl qmlFilePath() const;
73  QUrl vuiFilePath() const;
74  bool isAudio() const { return m_isAudio; }
75  void setIsAudio(bool isAudio);
76  bool isHidden() const { return m_isHidden; }
77  void setIsHidden(bool isHidden);
78  bool isFavorite() const { return m_isFavorite; }
79  void setIsFavorite(bool isFavorite);
80  QString gpuAlt() const { return m_gpuAlt; }
81  void setGpuAlt(const QString&);
82  bool allowMultiple() const { return m_allowMultiple; }
83  void setAllowMultiple(bool allowMultiple);
84  bool isClipOnly() const { return m_isClipOnly; }
85  void setIsClipOnly(bool isClipOnly);
86  bool isGpuCompatible() const { return m_isGpuCompatible; }
87  void setIsGpuCompatible(bool isCompatible) { m_isGpuCompatible = isCompatible; }
88 
89 signals:
90  void changed();
91 
92 private:
93  PluginType m_type;
94  QString m_name;
95  QString m_mlt_service;
96  bool m_needsGPU;
97  QString m_qmlFileName;
98  QString m_vuiFileName;
99  QDir m_path;
100  bool m_isAudio;
101  bool m_isHidden;
102  bool m_isFavorite;
103  QString m_gpuAlt;
104  bool m_allowMultiple;
105  bool m_isClipOnly;
106  bool m_isGpuCompatible;
107 };
108 
109 #endif // QMLMETADATA_H