mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
SIGUSR1/SIGUSR2 implemented again (#725)
Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>
This commit is contained in:
parent
aaa4235cab
commit
c3cf352b0c
@ -67,6 +67,12 @@ public slots:
|
||||
///
|
||||
bool stopInstance(const quint8& inst);
|
||||
|
||||
///
|
||||
/// @brief Toggle the state of all Hyperion instances
|
||||
/// @param pause If true all instances toggle to pause, else to resume
|
||||
///
|
||||
void toggleStateAllInstances(const bool& pause = false);
|
||||
|
||||
///
|
||||
/// @brief Create a new Hyperion instance entry in db
|
||||
/// @param name The friendly name of the instance
|
||||
|
@ -57,6 +57,16 @@ void HyperionIManager::stopAll()
|
||||
}
|
||||
}
|
||||
|
||||
void HyperionIManager::toggleStateAllInstances(const bool& pause)
|
||||
{
|
||||
// copy the instances due to loop corruption, even with .erase() return next iter
|
||||
QMap<quint8, Hyperion*> instCopy = _runningInstances;
|
||||
for(const auto instance : instCopy)
|
||||
{
|
||||
emit instance->compStateChangeRequest(hyperion::COMP_ALL, pause);
|
||||
}
|
||||
}
|
||||
|
||||
bool HyperionIManager::startInstance(const quint8& inst, const bool& block)
|
||||
{
|
||||
if(_instanceTable->instanceExist(inst))
|
||||
|
@ -115,8 +115,6 @@ unsigned int getProcessIdsByProcessName(const char* processName, QStringList &li
|
||||
|
||||
void signal_handler(const int signum)
|
||||
{
|
||||
// SIGUSR1 and SIGUSR2 must be rewritten
|
||||
|
||||
// Hyperion Managment instance
|
||||
HyperionIManager* _hyperion = HyperionIManager::getInstance();
|
||||
|
||||
@ -130,8 +128,7 @@ void signal_handler(const int signum)
|
||||
{
|
||||
if (_hyperion != nullptr)
|
||||
{
|
||||
// _hyperion->setComponentState(hyperion::COMP_SMOOTHING, false);
|
||||
// _hyperion->setComponentState(hyperion::COMP_LEDDEVICE, false);
|
||||
_hyperion->toggleStateAllInstances(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -139,8 +136,7 @@ void signal_handler(const int signum)
|
||||
{
|
||||
if (_hyperion != nullptr)
|
||||
{
|
||||
// _hyperion->setComponentState(hyperion::COMP_LEDDEVICE, true);
|
||||
// _hyperion->setComponentState(hyperion::COMP_SMOOTHING, true);
|
||||
_hyperion->toggleStateAllInstances(true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user