14 #include <utils/ColorRgb.h> 15 #include <utils/Image.h> 16 #include <utils/Components.h> 19 #define SMOOTHING_MODE_DEFAULT 0 20 #define SMOOTHING_MODE_PAUSE 1 154 bool setInput(
const int priority,
const std::vector<ColorRgb>&
ledColors, int64_t timeout_ms = -1);
183 void clearAll(
bool forceClearAll=
false);
238 void setCurrentTime(
void);
245 int _currentPriority;
248 int _manualSelectedPriority;
251 QMap<int, InputInfo> _activeInputs;
257 bool _sourceAutoSelectEnabled;
260 QTimer* _updateTimer;
void clearAll(bool forceClearAll=false)
Clears all priority channels.
Definition: PriorityMuxer.cpp:258
void updateLedColorsLength(const int &ledCount)
Update all ledColos with min length of >= 1 to fit the new led length.
Definition: PriorityMuxer.cpp:99
void autoSelectChanged(const bool &state)
Emits whenever the auto selection state has been changed.
bool clearInput(const uint8_t priority)
Clears the specified priority channel and update _currentPriority on success.
Definition: PriorityMuxer.cpp:244
void setEnable(const bool &enable)
Start/Stop the PriorityMuxer update timer; On disabled no priority and timeout updates will be perfor...
Definition: PriorityMuxer.cpp:58
void timeRunner()
Signal which emits when a effect or color with timeout > -1 is running, once per second.
QList< int > getPriorities() const
Returns the number of active priorities.
Definition: PriorityMuxer.cpp:111
void registerInput(const int priority, const hyperion::Components &component, const QString &origin="System", const QString &owner="", unsigned smooth_cfg=SMOOTHING_MODE_DEFAULT)
Register a new input by priority, the priority is not active (timeout -100 isn't muxer recognized) un...
Definition: PriorityMuxer.cpp:136
static const int LOWEST_PRIORITY
The lowest possible priority, which is used when no priority channels are active. ...
Definition: PriorityMuxer.h:58
void priorityChanged(const quint8 &priority, const bool &state)
A priority has been added (registerInput()) or deleted, method clear or timeout clear.
void signalTimeTrigger()
internal used signal to resolve treading issues with timer
int getCurrentPriority() const
Returns the current priority.
Definition: PriorityMuxer.h:110
The PriorityMuxer handles the priority channels.
Definition: PriorityMuxer.h:30
void activeStateChanged(const quint8 &priority, const bool &state)
Emits whenever a priority changes active state.
Components
Enumeration of components in Hyperion.
Definition: Components.h:10
void visiblePriorityChanged(const quint8 &priority)
Emits whenever the visible priority has changed.
bool setInput(const int priority, const std::vector< ColorRgb > &ledColors, int64_t timeout_ms=-1)
Update the current color of a priority (prev registered with registerInput())
Definition: PriorityMuxer.cpp:160
PriorityMuxer(int ledCount)
Constructs the PriorityMuxer for the given number of leds (used to switch to black when there are no ...
Definition: PriorityMuxer.cpp:17
bool setPriority(const uint8_t priority)
Overwrite current lowest piority with manual selection; On success disables aito selection.
Definition: PriorityMuxer.cpp:87
~PriorityMuxer()
Destructor.
Definition: PriorityMuxer.cpp:54
bool setInputImage(const int priority, const Image< ColorRgb > &image, int64_t timeout_ms=-1)
Update the current image of a priority (prev registered with registerInput())
Definition: PriorityMuxer.cpp:199
bool setSourceAutoSelectEnabled(const bool &enabel, const bool &update=true)
Enable or disable auto source selection.
Definition: PriorityMuxer.cpp:63
void prioritiesChanged(void)
Emits whenever something changes which influences the priorities listing Emits also in 1s interval wh...
bool hasPriority(const int priority) const
Returns the state (enabled/disabled) of a specific priority channel.
Definition: PriorityMuxer.cpp:116
const InputInfo getInputInfo(const int priority) const
Returns the information of a specified priority channel.
Definition: PriorityMuxer.cpp:121
bool setInputInactive(const quint8 &priority)
Set the given priority to inactive.
Definition: PriorityMuxer.cpp:238
bool isSourceAutoSelectEnabled() const
Get the state of source auto selection.
Definition: PriorityMuxer.h:90