hyperion.ng
JsonCB.h
1 #pragma once
2 
3 // qt incl
4 #include <QObject>
5 #include <QJsonObject>
6 
7 // components def
8 #include <utils/Components.h>
9 // bonjour
10 #include <bonjour/bonjourrecord.h>
11 // videModes
12 #include <utils/VideoMode.h>
13 // settings
14 #include <utils/settings.h>
15 
16 class Hyperion;
17 class ComponentRegister;
19 class PriorityMuxer;
20 
21 class JsonCB : public QObject
22 {
23  Q_OBJECT
24 
25 public:
26  JsonCB(QObject* parent);
27 
33  bool subscribeFor(const QString& cmd);
34 
39  QStringList getCommands() { return _availableCommands; };
44  QStringList getSubscribedCommands() { return _subscribedCommands; };
45 signals:
50  void newCallback(QJsonObject);
51 
52 private slots:
56  void handleComponentState(const hyperion::Components comp, const bool state);
57 
62  void handleBonjourChange(const QMap<QString,BonjourRecord>& bRegisters);
63 
67  void handlePriorityUpdate();
68 
72  void handleImageToLedsMappingChange(const int& mappingType);
73 
77  void handleAdjustmentChange();
78 
83  void handleVideoModeChange(const VideoMode& mode);
84 
88  void handleEffectListChange();
89 
95  void handleSettingsChange(const settings::type& type, const QJsonDocument& data);
96 
97 private:
99  Hyperion* _hyperion;
101  ComponentRegister* _componentRegister;
103  BonjourBrowserWrapper* _bonjour;
105  PriorityMuxer* _prioMuxer;
107  QStringList _availableCommands;
109  QStringList _subscribedCommands;
111  void doCallback(const QString& cmd, const QVariant& data);
112 };
The component register reflects and manages the current state of all components and Hyperion as a who...
Definition: ComponentRegister.h:17
bool subscribeFor(const QString &cmd)
Subscribe to future data updates given by cmd.
Definition: JsonCB.cpp:31
The main class of Hyperion.
Definition: Hyperion.h:57
QStringList getCommands()
Get all possible commands to subscribe for.
Definition: JsonCB.h:39
Definition: JsonCB.h:21
The PriorityMuxer handles the priority channels.
Definition: PriorityMuxer.h:30
QStringList getSubscribedCommands()
Get all subscribed commands.
Definition: JsonCB.h:44
Components
Enumeration of components in Hyperion.
Definition: Components.h:10
Definition: bonjourbrowserwrapper.h:13
void newCallback(QJsonObject)
Emits whenever a new json mesage callback is ready to send.