Refactor event handling incl.CEC

This commit is contained in:
LordGrey
2023-11-06 21:40:12 +01:00
parent b1c8534cb7
commit 0d9a8b8a3a
39 changed files with 1306 additions and 1158 deletions

View File

@@ -63,23 +63,28 @@ void HyperionIManager::stopAll()
}
}
void HyperionIManager::suspend()
void HyperionIManager::handleEvent(Event event)
{
Info(_log,"Suspend all instances and enabled components");
QMap<quint8, Hyperion*> instCopy = _runningInstances;
for(const auto instance : instCopy)
{
emit instance->suspendRequest(true);
}
}
Debug(_log,"%s Event [%d] received", eventToString(event), event);
switch (event) {
case Event::Suspend:
toggleSuspend(true);
break;
void HyperionIManager::resume()
{
Info(_log,"Resume all instances and enabled components");
QMap<quint8, Hyperion*> instCopy = _runningInstances;
for(const auto instance : instCopy)
{
emit instance->suspendRequest(false);
case Event::Resume:
toggleSuspend(false);
break;
case Event::Idle:
toggleIdle(true);
break;
case Event::ResumeIdle:
toggleIdle(false);
break;
default:
break;
}
}

View File

@@ -91,10 +91,14 @@
{
"$ref": "schema-leds.json"
},
"systemEvents":
"osEvents":
{
"$ref": "schema-systemEvents.json"
}
"$ref": "schema-osEvents.json"
},
"cecEvents":
{
"$ref": "schema-cecEvents.json"
}
},
"additionalProperties" : false
}

View File

@@ -23,6 +23,7 @@
<file alias="schema-leds.json">schema/schema-leds.json</file>
<file alias="schema-instCapture.json">schema/schema-instCapture.json</file>
<file alias="schema-network.json">schema/schema-network.json</file>
<file alias="schema-systemEvents.json">schema/schema-systemEvents.json</file>
<file alias="schema-osEvents.json">schema/schema-osEvents.json</file>
<file alias="schema-cecEvents.json">schema/schema-cecEvents.json</file>
</qresource>
</RCC>

View File

@@ -0,0 +1,17 @@
{
"type" : "object",
"required" : true,
"title" : "edt_conf_cec_events_heading_title",
"properties" :
{
"enable" :
{
"type" : "boolean",
"required" : true,
"title" : "edt_conf_general_enable_title",
"default" : false,
"propertyOrder" : 1
}
},
"additionalProperties" : false
}

View File

@@ -1,26 +1,26 @@
{
"type" : "object",
"required" : true,
"title" : "edt_conf_system_events_heading_title",
"title" : "edt_conf_os_events_heading_title",
"properties": {
"suspendEnable": {
"type": "boolean",
"required": true,
"title": "edt_conf_system_events_suspendEnable_title",
"title": "edt_conf_os_events_suspendEnable_title",
"default": true,
"propertyOrder": 1
},
"lockEnable": {
"type": "boolean",
"required": true,
"title": "edt_conf_system_events_lockEnable_title",
"title": "edt_conf_os_events_lockEnable_title",
"default": true,
"propertyOrder": 2
},
"suspendOnLockEnable": {
"type": "boolean",
"required": false,
"title": "edt_conf_system_events_suspendOnLockEnable_title",
"title": "edt_conf_os_events_suspendOnLockEnable_title",
"default": false,
"options": {
"dependencies": {