11 #include <QJsonObject> 14 #include <QFileSystemWatcher> 18 #include <utils/Image.h> 19 #include <utils/ColorRgb.h> 20 #include <utils/Logger.h> 21 #include <utils/Components.h> 22 #include <utils/VideoMode.h> 25 #include <hyperion/LedString.h> 26 #include <hyperion/PriorityMuxer.h> 27 #include <hyperion/ColorAdjustment.h> 28 #include <hyperion/ComponentRegister.h> 31 #include <effectengine/EffectDefinition.h> 32 #include <effectengine/ActiveEffectDefinition.h> 33 #include <effectengine/EffectSchema.h> 36 #include <utils/settings.h> 68 BLACK, WHITE, RED, GREEN, BLUE, CYAN, MAGENTA, YELLOW, INVALID
115 QJsonDocument
getSetting(
const settings::type& type);
123 bool saveSettings(QJsonObject config,
const bool& correct =
false);
171 bool saveEffect(
const QJsonObject& obj, QString& resultMsg);
179 bool deleteEffect(
const QString& effectName, QString& resultMsg);
183 const std::list<EffectDefinition> &
getEffects()
const;
214 void registerInput(
const int priority,
const hyperion::Components& component,
const QString& origin =
"System",
const QString& owner =
"",
unsigned smooth_cfg = 0);
247 bool configModified() {
return _configMod; };
249 bool configWriteable() {
return _configWrite; };
258 const QString &
getId(){
return _id; };
260 void setId(QString
id){ _id = id; };
262 int getLatchTime()
const;
265 unsigned addSmoothingConfig(
int settlingTime_ms,
double ledUpdateFrequency_hz=25.0,
unsigned updateDelay=0);
267 const VideoMode & getCurrentVideoMode();
285 bool setInput(
const int priority,
const std::vector<ColorRgb>& ledColors,
const int timeout_ms = -1,
const bool& clearEffect =
true);
315 void setColor(
int priority,
const ColorRgb &ledColor,
const int timeout_ms = -1,
const QString& origin =
"System" ,
bool clearEffects =
true);
339 bool clear(
int priority);
344 void clearall(
bool forceClearAll=
false);
350 int setEffect(
const QString & effectName,
int priority,
int timeout = -1,
const QString & origin=
"System");
358 ,
const QJsonObject &args
361 ,
const QString &pythonScript =
"" 362 ,
const QString &origin=
"System" 363 ,
const QString &imageData =
"" 434 void settingsChanged(
const settings::type& type,
const QJsonDocument& data);
454 void rawLedColors(
const std::vector<ColorRgb>& ledValues);
464 void checkConfigState(QString cfile = NULL);
478 void handleSettingsUpdate(
const settings::type& type,
const QJsonDocument& config);
487 Hyperion(
HyperionDaemon* daemon,
const quint8& instance,
const QString configFile,
const QString rootPath);
507 std::vector<ColorOrder> _ledStringColorOrder;
540 unsigned _hwLedCount;
542 QByteArray _configHash;
550 QFileSystemWatcher _fsWatcher;
554 bool _prevConfigMod =
false;
555 bool _prevConfigWrite =
true;
558 bool _configMod =
false;
559 bool _configWrite =
true;
567 std::vector<ColorRgb> _ledBuffer;
bool setInputInactive(const quint8 &priority)
Set the given priority to inactive.
Definition: Hyperion.cpp:417
bool sourceAutoSelectEnabled()
gets current state of automatic/priorized source selection
Definition: Hyperion.cpp:363
The component register reflects and manages the current state of all components and Hyperion as a who...
Definition: ComponentRegister.h:17
void setVideoMode(const VideoMode &mode)
Set the video mode (2D/3D)
Definition: Hyperion.cpp:548
const int & getLedMappingType()
gets the methode how image is maped to leds
Definition: Hyperion.cpp:543
QString getConfigFilePath()
get path+filename of configfile
Definition: Hyperion.h:199
const std::list< ActiveEffectDefinition > & getActiveEffects()
Get the list of active effects.
Definition: Hyperion.cpp:509
void forwardV4lProtoMessage(const QString, const Image< ColorRgb >)
Signal which is emitted, when a new V4l proto image should be forwarded.
Definition: ColorAdjustment.h:10
The main class of Hyperion.
Definition: Hyperion.h:57
void setId(QString id)
set unique id
Definition: Hyperion.h:260
The LedColorTransform is responsible for performing color transformation from 'raw' colors received a...
Definition: MultiColorAdjustment.h:16
PriorityMuxer * getMuxerInstance()
Get a pointer to the priorityMuxer instance.
Definition: Hyperion.h:106
void setComponentState(const hyperion::Components component, const bool state)
Enable/Disable components during runtime, called from external API (requests)
Definition: Hyperion.cpp:373
void setColor(int priority, const ColorRgb &ledColor, const int timeout_ms=-1, const QString &origin="System", bool clearEffects=true)
Writes a single color to all the leds for the given time and priority Registers comp color or provide...
Definition: Hyperion.cpp:422
Capture Control class which is a interface to the HyperionDaemon native capture classes.
Definition: CaptureCont.h:15
static Hyperion * getInstance()
Get a pointer of this Hyperion instance.
Definition: Hyperion.cpp:64
const QString & getActiveDevice()
Get the current active led device.
Definition: Hyperion.cpp:558
void adjustmentsUpdated()
Tell Hyperion that the corrections have changed and the leds need to be updated.
Definition: Hyperion.cpp:448
void clearall(bool forceClearAll=false)
Clears all priority channels.
Definition: Hyperion.cpp:466
void forwardJsonMessage(QJsonObject)
Signal which is emitted, when a new json message should be forwarded.
void ledDeviceData(const std::vector< ColorRgb > &ledValues)
Emits whenever new data should be pushed to the LedDeviceWrapper which forwards it to the threaded Le...
void currentImage(const Image< ColorRgb > &image)
Emits whenever the visible priority delivers a image which is applied in update() priorities with led...
unsigned addSmoothingConfig(int settlingTime_ms, double ledUpdateFrequency_hz=25.0, unsigned updateDelay=0)
forward smoothing config
Definition: Hyperion.cpp:308
void videoMode(const VideoMode &mode)
Is emitted from clients who request a videoMode change.
void registerInput(const int priority, const hyperion::Components &component, const QString &origin="System", const QString &owner="", unsigned smooth_cfg=0)
Register a new input by priority, the priority is not active (timeout -100 isn't muxer recognized) un...
Definition: Hyperion.cpp:378
QList< int > getActivePriorities() const
Returns a list of all registered priorities.
Definition: Hyperion.cpp:484
RgbChannel
RGB-Color channel enumeration.
Definition: Hyperion.h:66
QString getConfigFileName() const
get filename of configfile
Definition: Hyperion.cpp:297
bool isCurrentPriority(const int priority) const
Returns true if current priority is given priority.
Definition: Hyperion.cpp:479
const std::list< EffectDefinition > & getEffects() const
Get the list of available effects.
Definition: Hyperion.cpp:504
void imageToLedsMappingChanged(const int &mappingType)
Emits whenever the imageToLedsMapping has changed.
EffectEngine * getEffectEngineInstance()
Get a pointer to the effect engine.
Definition: Hyperion.h:100
void freeObjects(bool emitCloseSignal=false)
free all alocated objects, should be called only from constructor or before restarting hyperion ...
Definition: Hyperion.cpp:172
void channelCleared(int priority)
Signal which is emitted when a priority channel is actively cleared This signal will not be emitted w...
int setEffect(const QString &effectName, int priority, int timeout=-1, const QString &origin="System")
Run the specified effect on the given priority channel and optionally specify a timeout.
Definition: Hyperion.cpp:524
bool setInput(const int priority, const std::vector< ColorRgb > &ledColors, const int timeout_ms=-1, const bool &clearEffect=true)
Update the current color of a priority (prev registered with registerInput()) DO NOT use this togethe...
Definition: Hyperion.cpp:383
The PriorityMuxer handles the priority channels.
Definition: PriorityMuxer.h:30
const QStringList & getAdjustmentIds() const
Returns the list with unique adjustment identifiers.
Definition: Hyperion.cpp:438
Creates and destroys LedDevice instances with LedDeviceFactory and moves the device to a thread...
Definition: LedDeviceWrapper.h:17
void allChannelsCleared()
Signal which is emitted when all priority channels are actively cleared This signal will not be emitt...
bool setInputImage(const int priority, const Image< ColorRgb > &image, int64_t timeout_ms=-1, const bool &clearEffect=true)
Update the current image of a priority (prev registered with registerInput()) DO NOT use this togethe...
Definition: Hyperion.cpp:400
void setSourceAutoSelectEnabled(bool enabled)
enable/disable automatic/priorized source selection
Definition: Hyperion.cpp:352
const std::list< EffectSchema > & getEffectSchemas()
Get the list of available effect schema files.
Definition: Hyperion.cpp:514
int getCurrentPriority() const
Returns the current priority.
Definition: Hyperion.cpp:474
void settingsChanged(const settings::type &type, const QJsonDocument &data)
Emits whenever a config part changed.
Components
Enumeration of components in Hyperion.
Definition: Components.h:10
bool setCurrentSourcePriority(int priority)
set current input source to visible
Definition: Hyperion.cpp:358
bool clear(int priority)
Clears the given priority channel.
Definition: Hyperion.cpp:454
void componentStateChanged(const hyperion::Components component, bool enabled)
Emits whenever a user request a component state change, it's up the component to listen and update th...
The ImageProcessor translates an RGB-image to RGB-values for the leds.
Definition: ImageProcessor.h:26
Definition: MessageForwarder.h:32
Definition: EffectEngine.h:24
Linear Smooting class.
Definition: LinearColorSmoothing.h:24
const QString & getId()
get unique id per instance
Definition: Hyperion.h:258
ColorAdjustment * getAdjustment(const QString &id)
Returns the ColorAdjustment with the given identifier.
Definition: Hyperion.cpp:443
bool saveEffect(const QJsonObject &obj, QString &resultMsg)
Save an effect.
Definition: Hyperion.cpp:494
void adjustmentChanged()
Emits whenever the adjustments have been updated.
Definition: hyperiond.h:67
Manage the settings read write from/to config file, on settings changed will emit a signal to update ...
Definition: SettingsManager.h:14
void newVideoMode(const VideoMode &mode)
A new videoMode was requested (called from Daemon!)
Handle the background Effect settings, reacts on runtime to settings changes.
Definition: BGEffectHandler.h:10
const QJsonObject & getQJsonConfig()
gets the current json config object from SettingsManager
Definition: Hyperion.cpp:519
void forwardSystemProtoMessage(const QString, const Image< ColorRgb >)
Signal which is emitted, when a new system proto image should be forwarded.
unsigned getLedCount() const
Returns the number of attached leds.
Definition: Hyperion.cpp:313
QJsonDocument getSetting(const settings::type &type)
Get a setting by settings::type from SettingsManager.
Definition: Hyperion.cpp:287
~Hyperion()
Destructor; cleans up resources.
Definition: Hyperion.cpp:167
void rawLedColors(const std::vector< ColorRgb > &ledValues)
Emits whenever new untransformed ledColos data is available, reflects the current visible device...
const InputInfo getPriorityInfo(const int priority) const
Returns the information of a specific priorrity channel.
Definition: Hyperion.cpp:489
This class creates a TCP server which accepts connections from boblight clients.
Definition: BoblightServer.h:24
bool saveSettings(QJsonObject config, const bool &correct=false)
Save a complete json config.
Definition: Hyperion.cpp:292
QSize getLedGridSize() const
Return the size of led grid.
Definition: Hyperion.h:133
const QString & getRootPath()
get the root path for all hyperion user data files
Definition: Hyperion.h:255
The LedString contains the image integration information of the leds.
Definition: LedString.h:111
bool deleteEffect(const QString &effectName, QString &resultMsg)
Delete an effect by name.
Definition: Hyperion.cpp:499
PriorityMuxer::InputInfo InputInfo
Type definition of the info structure used by the priority muxer.
Definition: Hyperion.h:62
void setLedMappingType(const int &mappingType)
sets the methode how image is maped to leds at ImageProcessor
Definition: Hyperion.cpp:534
void effectListUpdated()
Signal pipe from EffectEngine to external, emits when effect list has been updated.
Plain-Old-Data structure containing the red-green-blue color specification.
Definition: ColorRgb.h:13
void setNewComponentState(const hyperion::Components &component, const bool &state)
Called from components to update their current state.
Definition: Hyperion.cpp:368
static Hyperion * initInstance(HyperionDaemon *daemon, const quint8 &instance, const QString configFile, const QString rootPath)
creates a new Hyperion instance, usually called from the Hyperion Daemon
Definition: Hyperion.cpp:55