mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Added simple QT-based grabber.
Moved ImageToLedsMap from include to libsrc. Moved instantiation of objects to Hyperion (no JSON required outside this class).
This commit is contained in:
55
include/hyperion/PriorityMuxer.h
Normal file
55
include/hyperion/PriorityMuxer.h
Normal file
@@ -0,0 +1,55 @@
|
||||
#pragma once
|
||||
|
||||
// STL includes
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
|
||||
// QT includes
|
||||
#include <QMap>
|
||||
|
||||
// Utils includes
|
||||
#include <utils/RgbColor.h>
|
||||
|
||||
// Hyperion includes
|
||||
#include <hyperion/LedDevice.h>
|
||||
|
||||
class PriorityMuxer
|
||||
{
|
||||
public:
|
||||
struct InputInfo
|
||||
{
|
||||
int priority;
|
||||
|
||||
int64_t timeoutTime_ms;
|
||||
std::vector<RgbColor> ledColors;
|
||||
};
|
||||
|
||||
PriorityMuxer();
|
||||
|
||||
~PriorityMuxer();
|
||||
|
||||
int getCurrentPriority() const;
|
||||
|
||||
bool hasPriority(const int priority) const;
|
||||
|
||||
QList<int> getPriorities() const;
|
||||
|
||||
const InputInfo& getInputInfo(const int priority) const;
|
||||
|
||||
void setInput(const int priority, const std::vector<RgbColor>& ledColors, const int64_t timeoutTime_ms=-1);
|
||||
|
||||
void clearInput(const int priority);
|
||||
|
||||
void clearAll();
|
||||
|
||||
void setCurrentTime(const int64_t& now);
|
||||
|
||||
private:
|
||||
int mCurrentPriority;
|
||||
|
||||
QMap<int, InputInfo> mActiveInputs;
|
||||
|
||||
const static int MAX_PRIORITY = std::numeric_limits<int>::max();
|
||||
};
|
Reference in New Issue
Block a user