The PriorityMuxer handles the priority channels.
More...
#include <PriorityMuxer.h>
|
struct | InputInfo |
| The information structure for a single priority channel. More...
|
|
|
void | timeRunner () |
| Signal which emits when a effect or color with timeout > -1 is running, once per second.
|
|
void | priorityChanged (const quint8 &priority, const bool &state) |
| A priority has been added (registerInput()) or deleted, method clear or timeout clear. More...
|
|
void | visiblePriorityChanged (const quint8 &priority) |
| Emits whenever the visible priority has changed. More...
|
|
void | activeStateChanged (const quint8 &priority, const bool &state) |
| Emits whenever a priority changes active state. More...
|
|
void | autoSelectChanged (const bool &state) |
| Emits whenever the auto selection state has been changed. More...
|
|
void | prioritiesChanged (void) |
| Emits whenever something changes which influences the priorities listing Emits also in 1s interval when a COLOR or EFFECT is running with a timeout > -1.
|
|
void | signalTimeTrigger () |
| internal used signal to resolve treading issues with timer
|
|
|
| PriorityMuxer (int ledCount) |
| Constructs the PriorityMuxer for the given number of leds (used to switch to black when there are no priority channels. More...
|
|
| ~PriorityMuxer () |
| Destructor.
|
|
void | setEnable (const bool &enable) |
| Start/Stop the PriorityMuxer update timer; On disabled no priority and timeout updates will be performend. More...
|
|
bool | setSourceAutoSelectEnabled (const bool &enabel, const bool &update=true) |
| Enable or disable auto source selection. More...
|
|
bool | isSourceAutoSelectEnabled () const |
| Get the state of source auto selection. More...
|
|
bool | setPriority (const uint8_t priority) |
| Overwrite current lowest piority with manual selection; On success disables aito selection. More...
|
|
void | updateLedColorsLength (const int &ledCount) |
| Update all ledColos with min length of >= 1 to fit the new led length. More...
|
|
int | getCurrentPriority () const |
| Returns the current priority. More...
|
|
bool | hasPriority (const int priority) const |
| Returns the state (enabled/disabled) of a specific priority channel. More...
|
|
QList< int > | getPriorities () const |
| Returns the number of active priorities. More...
|
|
const InputInfo | getInputInfo (const int priority) const |
| Returns the information of a specified priority channel. More...
|
|
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) until you start to update the data with setInput() A repeated call to update the base data of a known priority won't overwrite their current timeout. More...
|
|
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()) More...
|
|
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()) More...
|
|
bool | setInputInactive (const quint8 &priority) |
| Set the given priority to inactive. More...
|
|
bool | clearInput (const uint8_t priority) |
| Clears the specified priority channel and update _currentPriority on success. More...
|
|
void | clearAll (bool forceClearAll=false) |
| Clears all priority channels.
|
|
|
static const int | LOWEST_PRIORITY = std::numeric_limits<uint8_t>::max() |
| The lowest possible priority, which is used when no priority channels are active.
|
|
The PriorityMuxer handles the priority channels.
Led values input/ images are written to the priority map and the muxer keeps track of all active priorities. The current priority can be queried and per priority the led colors. Handles also manual/auto selection mode, provides a lot of signals to hook into priority related events
§ PriorityMuxer()
PriorityMuxer::PriorityMuxer |
( |
int |
ledCount | ) |
|
Constructs the PriorityMuxer for the given number of leds (used to switch to black when there are no priority channels.
- Parameters
-
ledCount | The number of leds |
§ activeStateChanged
void PriorityMuxer::activeStateChanged |
( |
const quint8 & |
priority, |
|
|
const bool & |
state |
|
) |
| |
|
signal |
Emits whenever a priority changes active state.
- Parameters
-
priority | The priority who changed the active state |
state | The new state, state true = active else false |
§ autoSelectChanged
void PriorityMuxer::autoSelectChanged |
( |
const bool & |
state | ) |
|
|
signal |
Emits whenever the auto selection state has been changed.
- Parameters
-
state | The new state of auto selection; True enabled else false |
§ clearInput()
bool PriorityMuxer::clearInput |
( |
const uint8_t |
priority | ) |
|
Clears the specified priority channel and update _currentPriority on success.
- Parameters
-
[in] | priority | The priority of the channel to clear |
- Returns
- True if priority has been cleared else false (not found)
§ getCurrentPriority()
int PriorityMuxer::getCurrentPriority |
( |
| ) |
const |
|
inline |
Returns the current priority.
- Returns
- The current priority
§ getInputInfo()
Returns the information of a specified priority channel.
If a priority is no longer available the _lowestPriorityInfo (255) is returned
- Parameters
-
priority | The priority channel |
- Returns
- The information for the specified priority channel
§ getPriorities()
QList< int > PriorityMuxer::getPriorities |
( |
| ) |
const |
Returns the number of active priorities.
- Returns
- The list with active priorities
§ hasPriority()
bool PriorityMuxer::hasPriority |
( |
const int |
priority | ) |
const |
Returns the state (enabled/disabled) of a specific priority channel.
- Parameters
-
priority | The priority channel |
- Returns
- True if the priority channel exists else false
§ isSourceAutoSelectEnabled()
bool PriorityMuxer::isSourceAutoSelectEnabled |
( |
| ) |
const |
|
inline |
Get the state of source auto selection.
- Returns
- True if enabled, else false
§ priorityChanged
void PriorityMuxer::priorityChanged |
( |
const quint8 & |
priority, |
|
|
const bool & |
state |
|
) |
| |
|
signal |
A priority has been added (registerInput()) or deleted, method clear or timeout clear.
- Parameters
-
priority | The priority which has changed |
state | If true it was added else it was removed! |
§ registerInput()
void PriorityMuxer::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) until you start to update the data with setInput() A repeated call to update the base data of a known priority won't overwrite their current timeout.
- Parameters
-
[in] | priority | The priority of the channel |
[in] | component | The component of the channel |
[in] | origin | Who set the channel (CustomString) |
[in] | owner | Speicifc owner string, might be empty |
[in] | smooth_cfg | The smooth id to use |
§ setEnable()
void PriorityMuxer::setEnable |
( |
const bool & |
enable | ) |
|
Start/Stop the PriorityMuxer update timer; On disabled no priority and timeout updates will be performend.
- Parameters
-
§ setInput()
bool PriorityMuxer::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())
- Parameters
-
priority | The priority to update |
ledColors | The colors |
timeout_ms | The new timeout (defaults to -1 endless) |
- Returns
- True on success, false when priority is not found
§ setInputImage()
bool PriorityMuxer::setInputImage |
( |
const int |
priority, |
|
|
const Image< ColorRgb > & |
image, |
|
|
int64_t |
timeout_ms = -1 |
|
) |
| |
Update the current image of a priority (prev registered with registerInput())
- Parameters
-
priority | The priority to update |
image | The new image |
timeout_ms | The new timeout (defaults to -1 endless) |
- Returns
- True on success, false when priority is not found
§ setInputInactive()
bool PriorityMuxer::setInputInactive |
( |
const quint8 & |
priority | ) |
|
Set the given priority to inactive.
- Parameters
-
- Returns
- True on success false if not found
§ setPriority()
bool PriorityMuxer::setPriority |
( |
const uint8_t |
priority | ) |
|
Overwrite current lowest piority with manual selection; On success disables aito selection.
- Parameters
-
- Returns
- True on success, false if priority not found
§ setSourceAutoSelectEnabled()
bool PriorityMuxer::setSourceAutoSelectEnabled |
( |
const bool & |
enabel, |
|
|
const bool & |
update = true |
|
) |
| |
Enable or disable auto source selection.
- Parameters
-
enable | True if it should be enabled else false |
update | True to update _currentPriority - INTERNAL usage. |
- Returns
- True if changed has been applied, false if the state is unchanged
§ updateLedColorsLength()
void PriorityMuxer::updateLedColorsLength |
( |
const int & |
ledCount | ) |
|
Update all ledColos with min length of >= 1 to fit the new led length.
- Parameters
-
[in] | ledCount | The count of leds |
§ visiblePriorityChanged
void PriorityMuxer::visiblePriorityChanged |
( |
const quint8 & |
priority | ) |
|
|
signal |
Emits whenever the visible priority has changed.
- Parameters
-
priority | The new visible priority |
The documentation for this class was generated from the following files: