2013-07-26 22:38:34 +02:00
# pragma once
2013-08-19 20:33:36 +02:00
// stl includes
# include <list>
2017-03-21 17:55:46 +01:00
# include <QMap>
2013-08-19 20:33:36 +02:00
2013-08-14 17:02:09 +02:00
// QT includes
2016-12-14 22:45:00 +01:00
# include <QString>
2017-03-21 17:55:46 +01:00
# include <QStringList>
2016-09-21 22:01:50 +02:00
# include <QSize>
2016-09-25 21:59:31 +02:00
# include <QJsonObject>
# include <QJsonValue>
# include <QJsonArray>
2017-07-30 14:36:23 +02:00
# include <QFileSystemWatcher>
2019-07-02 19:06:36 +02:00
# include <QMutex>
2013-08-14 17:02:09 +02:00
2013-07-26 22:38:34 +02:00
// hyperion-utils includes
2013-11-11 10:00:37 +01:00
# include <utils/Image.h>
2016-07-01 23:20:41 +02:00
# include <utils/ColorRgb.h>
# include <utils/Logger.h>
2016-08-04 13:10:53 +02:00
# include <utils/Components.h>
2017-08-04 23:08:15 +02:00
# include <utils/VideoMode.h>
2013-07-26 22:38:34 +02:00
2013-08-13 11:10:45 +02:00
// Hyperion includes
2013-07-26 22:38:34 +02:00
# include <hyperion/LedString.h>
2013-08-13 11:10:45 +02:00
# include <hyperion/PriorityMuxer.h>
2016-04-02 00:04:11 +02:00
# include <hyperion/ColorAdjustment.h>
2016-09-07 20:10:37 +02:00
# include <hyperion/ComponentRegister.h>
2013-08-13 11:10:45 +02:00
2013-12-01 14:09:01 +01:00
// Effect engine includes
# include <effectengine/EffectDefinition.h>
2016-04-24 17:07:31 +02:00
# include <effectengine/ActiveEffectDefinition.h>
2016-10-24 23:52:53 +02:00
# include <effectengine/EffectSchema.h>
2013-12-01 14:09:01 +01:00
2018-12-27 23:11:32 +01:00
// settings utils
# include <utils/settings.h>
2016-08-04 13:10:53 +02:00
2013-08-13 11:10:45 +02:00
// Forward class declaration
2018-12-27 23:11:32 +01:00
class QTimer ;
class HyperionDaemon ;
class ImageProcessor ;
class MessageForwarder ;
2016-09-08 16:32:42 +02:00
class LinearColorSmoothing ;
2013-11-24 16:10:48 +01:00
class EffectEngine ;
2016-04-02 00:04:11 +02:00
class MultiColorAdjustment ;
2018-12-27 23:11:32 +01:00
class ColorAdjustment ;
class SettingsManager ;
class BGEffectHandler ;
class CaptureCont ;
2018-12-28 18:12:45 +01:00
class BoblightServer ;
2019-01-01 19:47:07 +01:00
class LedDeviceWrapper ;
2017-08-04 12:01:45 +02:00
2013-09-06 21:26:58 +02:00
///
/// The main class of Hyperion. This gives other 'users' access to the attached LedDevice through
/// the priority muxer.
///
2013-08-14 17:02:09 +02:00
class Hyperion : public QObject
2013-07-26 22:38:34 +02:00
{
2013-08-14 17:02:09 +02:00
Q_OBJECT
2013-07-26 22:38:34 +02:00
public :
2013-09-06 21:26:58 +02:00
/// Type definition of the info structure used by the priority muxer
2013-08-19 20:33:36 +02:00
typedef PriorityMuxer : : InputInfo InputInfo ;
2013-09-06 21:26:58 +02:00
///
/// RGB-Color channel enumeration
///
2013-11-20 09:25:49 +01:00
enum RgbChannel
2013-08-19 19:57:35 +02:00
{
2016-12-29 17:02:37 +01:00
BLACK , WHITE , RED , GREEN , BLUE , CYAN , MAGENTA , YELLOW , INVALID
2013-08-19 19:57:35 +02:00
} ;
2013-09-06 21:26:58 +02:00
///
2016-10-11 19:51:20 +02:00
/// Destructor; cleans up resources
2013-09-06 21:26:58 +02:00
///
2013-07-26 22:38:34 +02:00
~ Hyperion ( ) ;
2016-10-10 23:08:01 +02:00
///
/// free all alocated objects, should be called only from constructor or before restarting hyperion
///
2017-01-22 19:36:52 +01:00
void freeObjects ( bool emitCloseSignal = false ) ;
2016-06-17 01:25:40 +02:00
2017-10-12 11:55:03 +02:00
///
/// @brief creates a new Hyperion instance, usually called from the Hyperion Daemon
2018-12-27 23:11:32 +01:00
/// @param[in] daemon The Hyperion daemon parent
/// @param[in] instance The instance id
2017-10-12 11:55:03 +02:00
/// @param[in] rootPath Root path of all hyperion userdata
/// @return Hyperion instance pointer
///
2018-12-27 23:11:32 +01:00
static Hyperion * initInstance ( HyperionDaemon * daemon , const quint8 & instance , const QString configFile , const QString rootPath ) ;
2017-10-12 11:55:03 +02:00
///
/// @brief Get a pointer of this Hyperion instance
2018-12-27 23:11:32 +01:00
/// @return Hyperion instance pointer
2017-10-12 11:55:03 +02:00
///
2016-06-17 01:25:40 +02:00
static Hyperion * getInstance ( ) ;
2018-12-27 23:11:32 +01:00
///
/// @brief Get a pointer to the effect engine
/// @return EffectEngine instance pointer
///
EffectEngine * getEffectEngineInstance ( ) { return _effectEngine ; } ;
///
/// @brief Get a pointer to the priorityMuxer instance
/// @return PriorityMuxer instance pointer
///
PriorityMuxer * getMuxerInstance ( ) { return & _muxer ; } ;
2018-12-28 18:12:45 +01:00
ImageProcessor * getImageProcessor ( ) { return _imageProcessor ; } ;
2018-12-27 23:11:32 +01:00
///
/// @brief Get a setting by settings::type from SettingsManager
/// @param type The settingsType from enum
/// @return Data Document
///
QJsonDocument getSetting ( const settings : : type & type ) ;
///
/// @brief Save a complete json config
/// @param config The entire config object
/// @param correct If true will correct json against schema before save
/// @return True on success else false
///
bool saveSettings ( QJsonObject config , const bool & correct = false ) ;
2013-09-06 21:26:58 +02:00
///
/// Returns the number of attached leds
///
2013-08-14 10:54:49 +02:00
unsigned getLedCount ( ) const ;
2016-09-21 22:01:50 +02:00
2018-12-27 23:11:32 +01:00
///
/// @brief Return the size of led grid
///
2016-12-19 23:59:50 +01:00
QSize getLedGridSize ( ) const { return _ledGridSize ; } ;
2016-09-21 22:01:50 +02:00
2016-05-30 22:39:12 +02:00
///
/// Returns the current priority
///
/// @return The current priority
///
int getCurrentPriority ( ) const ;
2017-06-24 11:52:22 +02:00
2017-09-01 08:50:37 +02:00
///
/// Returns true if current priority is given priority
///
/// @return bool
///
bool isCurrentPriority ( const int priority ) const ;
2013-11-29 23:22:49 +01:00
///
2018-12-28 18:12:45 +01:00
/// Returns a list of all registered priorities
2013-11-29 23:22:49 +01:00
///
/// @return The list with priorities
///
QList < int > getActivePriorities ( ) const ;
///
/// Returns the information of a specific priorrity channel
///
/// @param[in] priority The priority channel
///
2018-12-27 23:11:32 +01:00
/// @return The information of the given, a not found priority will return lowest priority as fallback
2013-11-29 23:22:49 +01:00
///
2018-12-27 23:11:32 +01:00
const InputInfo getPriorityInfo ( const int priority ) const ;
2013-11-29 23:22:49 +01:00
2018-12-31 15:48:29 +01:00
///
/// @brief Save an effect
/// @param obj The effect args
/// @param[out] resultMsg The feedback message
/// @return True on success else false
///
2019-06-05 18:19:08 +02:00
bool saveEffect ( const QJsonObject & obj , QString & resultMsg ) ;
2018-12-31 15:48:29 +01:00
///
/// @brief Delete an effect by name.
/// @param[in] effectName The effect name to delete
/// @param[out] resultMsg The message on error
/// @return True on success else false
///
2019-06-05 18:19:08 +02:00
bool deleteEffect ( const QString & effectName , QString & resultMsg ) ;
2016-11-20 18:41:10 +01:00
2013-11-29 23:22:49 +01:00
/// Get the list of available effects
/// @return The list of available effects
2013-12-01 14:09:01 +01:00
const std : : list < EffectDefinition > & getEffects ( ) const ;
2017-06-24 11:52:22 +02:00
2016-04-24 17:07:31 +02:00
/// Get the list of active effects
/// @return The list of active effects
const std : : list < ActiveEffectDefinition > & getActiveEffects ( ) ;
2017-06-24 11:52:22 +02:00
2016-10-24 23:52:53 +02:00
/// Get the list of available effect schema files
/// @return The list of available effect schema files
const std : : list < EffectSchema > & getEffectSchemas ( ) ;
2017-06-24 11:52:22 +02:00
2018-12-27 23:11:32 +01:00
/// gets the current json config object from SettingsManager
2016-07-15 23:08:55 +02:00
/// @return json config
2018-12-27 23:11:32 +01:00
const QJsonObject & getQJsonConfig ( ) ;
/// get path+filename of configfile
/// @return the current config path+filename
QString getConfigFilePath ( ) { return _configFile ; } ;
2016-07-15 23:08:55 +02:00
/// get filename of configfile
/// @return the current config filename
2018-12-27 23:11:32 +01:00
QString getConfigFileName ( ) const ;
2013-11-29 23:22:49 +01:00
2018-12-27 23:11:32 +01:00
///
/// @brief 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
/// @param[in] priority The priority of the channel
/// @param[in] component The component of the channel
/// @param[in] origin Who set the channel (CustomString@IP)
2019-01-27 13:41:21 +01:00
/// @param[in] owner Specific owner string, might be empty
2018-12-27 23:11:32 +01:00
/// @param[in] smooth_cfg The smooth id to use
///
void registerInput ( const int priority , const hyperion : : Components & component , const QString & origin = " System " , const QString & owner = " " , unsigned smooth_cfg = 0 ) ;
2017-06-24 11:52:22 +02:00
2016-07-31 22:21:35 +02:00
/// enable/disable automatic/priorized source selection
2016-10-11 19:51:20 +02:00
/// @param enabled the state
2016-07-31 22:21:35 +02:00
void setSourceAutoSelectEnabled ( bool enabled ) ;
2017-06-24 11:52:22 +02:00
2016-07-31 22:21:35 +02:00
/// set current input source to visible
/// @param priority the priority channel which should be vidible
/// @return true if success, false on error
bool setCurrentSourcePriority ( int priority ) ;
2017-06-24 11:52:22 +02:00
2016-07-31 22:21:35 +02:00
/// gets current state of automatic/priorized source selection
/// @return the state
2018-12-27 23:11:32 +01:00
bool sourceAutoSelectEnabled ( ) ;
2017-06-24 11:52:22 +02:00
2019-01-01 19:47:07 +01:00
///
/// @brief Called from components to update their current state. DO NOT CALL FROM USERS
/// @param[in] component The component from enum
/// @param[in] state The state of the component [true | false]
///
void setNewComponentState ( const hyperion : : Components & component , const bool & state ) ;
2016-08-04 13:10:53 +02:00
///
2018-12-27 23:11:32 +01:00
/// @brief Enable/Disable components during runtime, called from external API (requests)
///
/// @param component The component from enum
2016-08-04 13:10:53 +02:00
/// @param state The state of the component [true | false]
///
2016-08-11 07:13:55 +02:00
void setComponentState ( const hyperion : : Components component , const bool state ) ;
2016-09-07 20:10:37 +02:00
ComponentRegister & getComponentRegister ( ) { return _componentRegister ; } ;
2017-06-17 23:29:04 +02:00
bool configModified ( ) { return _configMod ; } ;
2016-09-14 13:51:28 +02:00
2017-06-17 23:29:04 +02:00
bool configWriteable ( ) { return _configWrite ; } ;
2016-12-14 22:45:00 +01:00
2016-12-20 19:55:54 +01:00
/// gets the methode how image is maped to leds
2018-12-27 23:11:32 +01:00
const int & getLedMappingType ( ) ;
2016-12-20 19:55:54 +01:00
2017-10-12 11:55:03 +02:00
/// get the root path for all hyperion user data files
2018-12-27 23:11:32 +01:00
const QString & getRootPath ( ) { return _rootPath ; } ;
2017-10-12 11:55:03 +02:00
2018-12-27 23:11:32 +01:00
/// get unique id per instance
const QString & getId ( ) { return _id ; } ;
/// set unique id
void setId ( QString id ) { _id = id ; } ;
2017-06-17 23:27:41 +02:00
2017-04-09 22:28:32 +02:00
int getLatchTime ( ) const ;
2017-10-12 11:55:03 +02:00
2017-08-04 12:01:45 +02:00
/// forward smoothing config
unsigned addSmoothingConfig ( int settlingTime_ms , double ledUpdateFrequency_hz = 25.0 , unsigned updateDelay = 0 ) ;
2017-04-09 22:28:32 +02:00
2018-12-27 23:11:32 +01:00
const VideoMode & getCurrentVideoMode ( ) ;
2017-08-04 23:08:15 +02:00
2013-09-06 21:26:58 +02:00
///
2018-12-27 23:11:32 +01:00
/// @brief Get the current active led device
/// @return The device nam
/// e
const QString & getActiveDevice ( ) ;
public slots :
2013-09-06 21:26:58 +02:00
///
2018-12-27 23:11:32 +01:00
/// @brief Update the current color of a priority (prev registered with registerInput())
/// DO NOT use this together with setInputImage() at the same time!
/// @param priority The priority to update
/// @param ledColors The colors
/// @param timeout_ms The new timeout (defaults to -1 endless)
/// @param clearEffect Should be true when NOT called from an effect
/// @return True on success, false when priority is not found
2013-09-06 21:26:58 +02:00
///
2019-06-05 18:19:08 +02:00
bool setInput ( const int priority , const std : : vector < ColorRgb > & ledColors , const int timeout_ms = - 1 , const bool & clearEffect = true ) ;
2013-08-18 13:33:56 +02:00
2013-09-06 21:26:58 +02:00
///
2018-12-27 23:11:32 +01:00
/// @brief Update the current image of a priority (prev registered with registerInput())
/// DO NOT use this together with setInput() at the same time!
/// @param priority The priority to update
/// @param image The new image
/// @param timeout_ms The new timeout (defaults to -1 endless)
/// @param clearEffect Should be true when NOT called from an effect
/// @return True on success, false when priority is not found
2013-09-06 21:26:58 +02:00
///
2019-06-05 18:19:08 +02:00
bool setInputImage ( const int priority , const Image < ColorRgb > & image , int64_t timeout_ms = - 1 , const bool & clearEffect = true ) ;
2013-08-18 13:33:56 +02:00
2018-12-28 18:12:45 +01:00
///
/// @brief Set the given priority to inactive
/// @param priority The priority
/// @return True on success false if not found
///
2019-06-05 18:19:08 +02:00
bool setInputInactive ( const quint8 & priority ) ;
2018-12-28 18:12:45 +01:00
2016-12-18 19:00:14 +01:00
///
2018-12-27 23:11:32 +01:00
/// Writes a single color to all the leds for the given time and priority
/// Registers comp color or provided type against muxer
/// Should be never used to update leds continuous
2016-12-18 19:00:14 +01:00
///
2018-12-27 23:11:32 +01:00
/// @param[in] priority The priority of the written color
/// @param[in] ledColor The color to write to the leds
/// @param[in] origin The setter
/// @param[in] timeout_ms The time the leds are set to the given color [ms]
2016-12-18 19:00:14 +01:00
///
2018-12-27 23:11:32 +01:00
void setColor ( int priority , const ColorRgb & ledColor , const int timeout_ms = - 1 , const QString & origin = " System " , bool clearEffects = true ) ;
2016-12-18 19:00:14 +01:00
2016-04-02 00:04:11 +02:00
///
/// Returns the list with unique adjustment identifiers
/// @return The list with adjustment identifiers
///
2017-03-04 22:17:42 +01:00
const QStringList & getAdjustmentIds ( ) const ;
2016-10-10 18:29:54 +02:00
2016-04-02 00:04:11 +02:00
///
/// Returns the ColorAdjustment with the given identifier
/// @return The adjustment with the given identifier (or nullptr if the identifier does not exist)
///
2017-03-04 22:17:42 +01:00
ColorAdjustment * getAdjustment ( const QString & id ) ;
2016-10-10 18:29:54 +02:00
2016-04-02 00:04:11 +02:00
/// Tell Hyperion that the corrections have changed and the leds need to be updated
void adjustmentsUpdated ( ) ;
2013-09-06 21:26:58 +02:00
///
/// Clears the given priority channel. This will switch the led-colors to the colors of the next
/// lower priority channel (or off if no more channels are set)
///
/// @param[in] priority The priority channel
2018-12-27 23:11:32 +01:00
/// @return True on success else false (not found)
2013-09-06 21:26:58 +02:00
///
2019-06-05 18:19:08 +02:00
bool clear ( int priority ) ;
2013-08-18 13:33:56 +02:00
2013-09-06 21:26:58 +02:00
///
2019-02-03 14:36:57 +01:00
/// @brief Clears all priority channels. This will switch the leds off until a new priority is written.
2013-09-06 21:26:58 +02:00
///
2017-08-12 07:55:32 +02:00
void clearall ( bool forceClearAll = false ) ;
2013-07-26 22:38:34 +02:00
2013-11-24 16:10:48 +01:00
/// Run the specified effect on the given priority channel and optionally specify a timeout
/// @param effectName Name of the effec to run
/// @param priority The priority channel of the effect
2016-10-11 19:51:20 +02:00
/// @param timeout The timeout of the effect (after the timout, the effect will be cleared)
2017-03-01 15:23:53 +01:00
int setEffect ( const QString & effectName , int priority , int timeout = - 1 , const QString & origin = " System " ) ;
2013-11-24 16:10:48 +01:00
2013-12-01 14:09:01 +01:00
/// Run the specified effect on the given priority channel and optionally specify a timeout
/// @param effectName Name of the effec to run
2013-12-01 16:35:45 +01:00
/// @param args arguments of the effect script
2013-12-01 14:09:01 +01:00
/// @param priority The priority channel of the effect
2016-10-11 19:51:20 +02:00
/// @param timeout The timeout of the effect (after the timout, the effect will be cleared)
2019-01-06 19:49:56 +01:00
int setEffect ( const QString & effectName
, const QJsonObject & args
, int priority
, int timeout = - 1
, const QString & pythonScript = " "
, const QString & origin = " System "
, const QString & imageData = " "
) ;
2013-12-01 14:09:01 +01:00
2018-12-27 23:11:32 +01:00
/// sets the methode how image is maped to leds at ImageProcessor
void setLedMappingType ( const int & mappingType ) ;
2017-06-24 11:52:22 +02:00
2017-08-04 23:08:15 +02:00
///
/// Set the video mode (2D/3D)
/// @param[in] mode The new video mode
///
2018-12-27 23:11:32 +01:00
void setVideoMode ( const VideoMode & mode ) ;
2017-10-12 11:55:03 +02:00
2013-11-24 16:10:48 +01:00
public :
2016-06-17 01:25:40 +02:00
static Hyperion * _hyperion ;
2013-11-24 16:10:48 +01:00
signals :
/// Signal which is emitted when a priority channel is actively cleared
/// This signal will not be emitted when a priority channel time out
void channelCleared ( int priority ) ;
/// Signal which is emitted when all priority channels are actively cleared
/// This signal will not be emitted when a priority channel time out
void allChannelsCleared ( ) ;
2018-12-27 23:11:32 +01:00
///
/// @brief Emits whenever a user request a component state change, it's up the component to listen
/// and update the component state at the componentRegister
/// @param component The component from enum
/// @param enabled The new state of the component
///
2016-08-11 07:13:55 +02:00
void componentStateChanged ( const hyperion : : Components component , bool enabled ) ;
2018-12-27 23:11:32 +01:00
///
/// @brief Emits whenever the imageToLedsMapping has changed
/// @param mappingType The new mapping type
///
void imageToLedsMappingChanged ( const int & mappingType ) ;
///
/// @brief Emits whenever the visible priority delivers a image which is applied in update()
/// priorities with ledColors won't emit this signal
/// @param image The current image
///
void currentImage ( const Image < ColorRgb > & image ) ;
2017-01-22 14:31:11 +01:00
void closing ( ) ;
2016-12-18 19:00:14 +01:00
2017-06-24 11:52:22 +02:00
/// Signal which is emitted, when a new json message should be forwarded
void forwardJsonMessage ( QJsonObject ) ;
2019-07-02 19:06:36 +02:00
/// Signal which is emitted, when a new system proto image should be forwarded
void forwardSystemProtoMessage ( const QString , const Image < ColorRgb > ) ;
/// Signal which is emitted, when a new V4l proto image should be forwarded
void forwardV4lProtoMessage ( const QString , const Image < ColorRgb > ) ;
2019-02-03 14:36:57 +01:00
2018-12-27 23:11:32 +01:00
///
/// @brief Is emitted from clients who request a videoMode change
///
void videoMode ( const VideoMode & mode ) ;
///
/// @brief A new videoMode was requested (called from Daemon!)
///
void newVideoMode ( const VideoMode & mode ) ;
///
/// @brief Emits whenever a config part changed. SIGNAL PIPE helper for SettingsManager -> HyperionDaemon
/// @param type The settings type from enum
/// @param data The data as QJsonDocument
///
void settingsChanged ( const settings : : type & type , const QJsonDocument & data ) ;
2017-06-17 23:29:04 +02:00
2018-12-27 23:11:32 +01:00
///
/// @brief Emits whenever the adjustments have been updated
///
void adjustmentChanged ( ) ;
2017-08-04 23:08:15 +02:00
2018-12-20 15:01:46 +01:00
///
2018-12-27 23:11:32 +01:00
/// @brief Signal pipe from EffectEngine to external, emits when effect list has been updated
2018-12-20 15:01:46 +01:00
///
2018-12-27 23:11:32 +01:00
void effectListUpdated ( ) ;
///
2019-01-01 19:47:07 +01:00
/// @brief Emits whenever new data should be pushed to the LedDeviceWrapper which forwards it to the threaded LedDevice
2018-12-27 23:11:32 +01:00
///
2019-01-01 19:47:07 +01:00
void ledDeviceData ( const std : : vector < ColorRgb > & ledValues ) ;
2018-12-20 15:01:46 +01:00
2018-12-31 15:48:29 +01:00
///
/// @brief Emits whenever new untransformed ledColos data is available, reflects the current visible device
///
void rawLedColors ( const std : : vector < ColorRgb > & ledValues ) ;
2013-08-14 17:02:09 +02:00
private slots :
2013-09-06 21:26:58 +02:00
///
/// Updates the priority muxer with the current time and (re)writes the led color with applied
/// transforms.
///
2013-08-14 17:02:09 +02:00
void update ( ) ;
2017-07-30 14:36:23 +02:00
/// check for configWriteable and modified changes, called by _fsWatcher or fallback _cTimer
void checkConfigState ( QString cfile = NULL ) ;
2017-06-17 23:29:04 +02:00
2018-12-27 23:11:32 +01:00
///
/// @brief Apply ComponentRegister emits for COMP_ALL. Enables/Disables core timers
/// @param comp The component
/// @param state The new state of the component
///
void updatedComponentState ( const hyperion : : Components comp , const bool state ) ;
///
/// @brief Apply settings updates for LEDS and COLOR
/// @param type The type from enum
/// @param config The configuration
///
void handleSettingsUpdate ( const settings : : type & type , const QJsonDocument & config ) ;
2013-07-26 22:38:34 +02:00
private :
2017-06-24 11:52:22 +02:00
2016-06-17 01:25:40 +02:00
///
/// Constructs the Hyperion instance based on the given Json configuration
///
2016-10-13 21:59:58 +02:00
/// @param[in] qjsonConfig The Json configuration
2016-06-17 01:25:40 +02:00
///
2018-12-27 23:11:32 +01:00
Hyperion ( HyperionDaemon * daemon , const quint8 & instance , const QString configFile , const QString rootPath ) ;
/// The parent Hyperion Daemon
HyperionDaemon * _daemon ;
/// Settings manager of this instance
SettingsManager * _settingsManager ;
/// Register that holds component states
ComponentRegister _componentRegister ;
2016-06-17 01:25:40 +02:00
2013-09-06 21:26:58 +02:00
/// The specifiation of the led frame construction and picture integration
2013-08-18 13:33:56 +02:00
LedString _ledString ;
2013-07-26 22:38:34 +02:00
2016-08-08 00:17:00 +02:00
/// specifiation of cloned leds
LedString _ledStringClone ;
2018-12-27 23:11:32 +01:00
/// Image Processor
ImageProcessor * _imageProcessor ;
2016-08-08 00:17:00 +02:00
std : : vector < ColorOrder > _ledStringColorOrder ;
2017-06-24 11:52:22 +02:00
2013-09-06 21:26:58 +02:00
/// The priority muxer
2013-08-18 13:33:56 +02:00
PriorityMuxer _muxer ;
2013-07-26 22:38:34 +02:00
2016-04-02 00:04:11 +02:00
/// The adjustment from raw colors to led colors
MultiColorAdjustment * _raw2ledAdjustment ;
2017-06-24 11:52:22 +02:00
2019-01-01 19:47:07 +01:00
/// The actual LedDeviceWrapper
LedDeviceWrapper * _ledDeviceWrapper ;
2013-08-14 17:02:09 +02:00
2016-09-08 16:32:42 +02:00
/// The smoothing LedDevice
LinearColorSmoothing * _deviceSmooth ;
2013-11-24 16:10:48 +01:00
/// Effect engine
EffectEngine * _effectEngine ;
2017-06-24 11:52:22 +02:00
2019-01-01 19:47:07 +01:00
// Message forwarder
2016-03-09 19:55:55 +01:00
MessageForwarder * _messageForwarder ;
2013-11-24 16:10:48 +01:00
2017-06-17 23:29:04 +02:00
/// the name of config file
2016-12-14 22:45:00 +01:00
QString _configFile ;
2016-06-14 20:14:06 +02:00
2017-10-12 11:55:03 +02:00
/// root path for all hyperion user data files
QString _rootPath ;
2018-12-27 23:11:32 +01:00
/// unique id per instance
QString _id ;
2016-07-30 13:07:53 +02:00
2016-07-01 23:20:41 +02:00
/// Logger instance
Logger * _log ;
2016-07-30 13:07:53 +02:00
2016-07-01 23:20:41 +02:00
/// count of hardware leds
unsigned _hwLedCount ;
2016-07-30 13:07:53 +02:00
2016-09-14 13:51:28 +02:00
QByteArray _configHash ;
2016-09-21 22:01:50 +02:00
QSize _ledGridSize ;
2017-06-24 11:52:22 +02:00
2018-12-27 23:11:32 +01:00
/// Store the previous compID for smarter update()
2017-03-21 17:55:46 +01:00
hyperion : : Components _prevCompId ;
2017-06-17 23:29:04 +02:00
2017-07-30 14:36:23 +02:00
/// Observe filesystem changes (_configFile), if failed use Timer
QFileSystemWatcher _fsWatcher ;
2018-12-27 23:11:32 +01:00
QTimer * _cTimer ;
2017-06-17 23:29:04 +02:00
/// holds the prev states of configWriteable and modified
bool _prevConfigMod = false ;
bool _prevConfigWrite = true ;
/// holds the current states of configWriteable and modified
bool _configMod = false ;
bool _configWrite = true ;
2017-06-24 11:52:22 +02:00
2018-12-27 23:11:32 +01:00
/// Background effect instance, kept active to react on setting changes
BGEffectHandler * _BGEffectHandler ;
/// Capture control for Daemon native capture
CaptureCont * _captureCont ;
2017-10-12 11:55:03 +02:00
2018-12-27 23:11:32 +01:00
/// buffer for leds (with adjustment)
std : : vector < ColorRgb > _ledBuffer ;
2018-12-28 18:12:45 +01:00
/// Boblight instance
BoblightServer * _boblightServer ;
2019-07-02 19:06:36 +02:00
/// mutex
QMutex _changes ;
2013-07-26 22:38:34 +02:00
} ;