hyperion.ng
ComponentRegister.h
1 #pragma once
2 
3 #include <utils/Components.h>
4 #include <utils/Logger.h>
5 
6 // STL includes
7 #include <map>
8 
9 #include <QObject>
10 
11 class Hyperion;
12 
17 class ComponentRegister : public QObject
18 {
19  Q_OBJECT
20 
21 public:
24 
31  bool setHyperionEnable(const bool& state);
32 
38  int isComponentEnabled(const hyperion::Components& comp) const;
39 
41  std::map<hyperion::Components, bool> getRegister() { return _componentStates; };
42 
43 signals:
49  void updatedComponentState(const hyperion::Components comp, const bool state);
50 
51 public slots:
57  void componentStateChanged(const hyperion::Components comp, const bool activated);
58 
59 private:
61  Hyperion * _hyperion;
63  Logger * _log;
65  std::map<hyperion::Components, bool> _componentStates;
67  std::map<hyperion::Components, bool> _prevComponentStates;
68 };
Definition: Logger.h:32
The component register reflects and manages the current state of all components and Hyperion as a who...
Definition: ComponentRegister.h:17
The main class of Hyperion.
Definition: Hyperion.h:57
Provide utility methods for Hyperion class.
Definition: BlackBorderDetector.h:7
void updatedComponentState(const hyperion::Components comp, const bool state)
Emits whenever a component changed (really) the state.
Components
Enumeration of components in Hyperion.
Definition: Components.h:10
void componentStateChanged(const hyperion::Components comp, const bool activated)
is called whenever a component change a state, DO NOT CALL FROM API (use hyperion->setComponentState(...
Definition: ComponentRegister.cpp:63
bool setHyperionEnable(const bool &state)
Enable or disable Hyperion (all components)
Definition: ComponentRegister.cpp:25
std::map< hyperion::Components, bool > getRegister()
contains all components and their state
Definition: ComponentRegister.h:41
int isComponentEnabled(const hyperion::Components &comp) const
Check if a component is currently enabled.
Definition: ComponentRegister.cpp:58