Torc  0.1
torcoutputs.h
Go to the documentation of this file.
1 #ifndef TORCOUTPUTS_H
2 #define TORCOUTPUTS_H
3 
4 // Qt
5 #include <QList>
6 #include <QMutex>
7 
8 // Torc
9 #include "torchttpservice.h"
10 #include "torcoutput.h"
11 #include "torccentral.h"
12 
13 class TorcOutputs final : public QObject, public TorcHTTPService, public TorcDeviceHandler
14 {
15  Q_OBJECT
16  Q_CLASSINFO("Version", "1.0.0")
17  Q_CLASSINFO("GetOutputList", "type=outputs")
18  Q_PROPERTY(QVariantMap outputList READ GetOutputList() NOTIFY OutputsChanged())
19  Q_PROPERTY(QStringList outputTypes READ GetOutputTypes() CONSTANT)
20 
21  public:
22  static TorcOutputs* gOutputs;
23 
24  public:
25  TorcOutputs();
26 
27  void Graph (QByteArray* Data);
28  QString GetUIName (void) override;
29 
30  // TorcDeviceHandler
31  void Create (const QVariantMap &Details) override;
32  void Destroy (void) override;
33 
34  public slots:
35  // TorcHTTPService
36  void SubscriberDeleted (QObject *Subscriber);
37 
38  QVariantMap GetOutputList (void);
39  QStringList GetOutputTypes (void);
40 
41  signals:
42  void OutputsChanged (void);
43 
44  public:
45  void AddOutput (TorcOutput *Output);
46  void RemoveOutput (TorcOutput *Output);
47 
48  private:
49  QList<TorcOutput*> outputList;
50  QStringList outputTypes;
51  QMap<QString,TorcOutput*> m_createdOutputs;
52 
53  private:
54  Q_DISABLE_COPY(TorcOutputs)
55 };
56 
57 #endif // TORCOUTPUTS_H
void Graph(QByteArray *Data)
Definition: torcoutputs.cpp:90
QVariantMap GetOutputList(void)
Return a map of known outputs.
QStringList GetOutputTypes(void)
QString GetUIName(void) override
Definition: torcoutputs.cpp:85
void OutputsChanged(void)
void SubscriberDeleted(QObject *Subscriber)
QVariantMap outputList
Definition: torcoutputs.h:18
void Destroy(void) override
void RemoveOutput(TorcOutput *Output)
void Create(const QVariantMap &Details) override
void AddOutput(TorcOutput *Output)