mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
* Allow to enable/disable suspend & lock event handling * Fix Windows * Refactor event handling incl.CEC * Revert "Auxiliary commit to revert individual files from 0d9a8b8a3a4a09609a339f54c7d8a9384c561282" This reverts commit 80737d926ad151a07b2493dd1685ed502975cb2e. * Support Events for Grabbers generically * Have CECEvent to actions configurable, further clean-ups * Remove handleEvent from V4L2grabber, as grabber will be stopped on suspend * Validate that one CEC Event can only trigger one action * MacOS lock/unlock added * fast windows fix * Corrections * Fix CodeQL findings * add macos lock/unlock handler * Migration of CEC-config and have default actions * Correct target_link_libraries * Include Foundation * macOS include AppKit * Support Scheduled Events, cleanups. * Fix destructing * Fix coredump during free * Consider additional error sceanrio * Fix missing code * install desktop icons * correct bash logic --------- Co-authored-by: Paulchen-Panther <16664240+Paulchen-Panther@users.noreply.github.com>
112 lines
3.6 KiB
C++
112 lines
3.6 KiB
C++
#pragma once
|
|
#include <QString>
|
|
#include <QJsonDocument>
|
|
|
|
///
|
|
/// @brief Provide util methods to work with SettingsManager class
|
|
///
|
|
namespace settings {
|
|
// all available settings sections
|
|
enum type {
|
|
BGEFFECT,
|
|
FGEFFECT,
|
|
BLACKBORDER,
|
|
BOBLSERVER,
|
|
COLOR,
|
|
DEVICE,
|
|
EFFECTS,
|
|
NETFORWARD,
|
|
SYSTEMCAPTURE,
|
|
GENERAL,
|
|
V4L2,
|
|
AUDIO,
|
|
JSONSERVER,
|
|
LEDCONFIG,
|
|
LEDS,
|
|
LOGGER,
|
|
SMOOTHING,
|
|
WEBSERVER,
|
|
INSTCAPTURE,
|
|
NETWORK,
|
|
FLATBUFSERVER,
|
|
PROTOSERVER,
|
|
OSEVENTS,
|
|
CECEVENTS,
|
|
SCHEDEVENTS,
|
|
INVALID
|
|
};
|
|
|
|
///
|
|
/// @brief Convert settings::type to string representation
|
|
/// @param type The settings::type from enum
|
|
/// @return The settings type as string
|
|
///
|
|
inline QString typeToString(type type)
|
|
{
|
|
switch (type)
|
|
{
|
|
case BGEFFECT: return "backgroundEffect";
|
|
case FGEFFECT: return "foregroundEffect";
|
|
case BLACKBORDER: return "blackborderdetector";
|
|
case BOBLSERVER: return "boblightServer";
|
|
case COLOR: return "color";
|
|
case DEVICE: return "device";
|
|
case EFFECTS: return "effects";
|
|
case NETFORWARD: return "forwarder";
|
|
case SYSTEMCAPTURE: return "framegrabber";
|
|
case GENERAL: return "general";
|
|
case V4L2: return "grabberV4L2";
|
|
case AUDIO: return "grabberAudio";
|
|
case JSONSERVER: return "jsonServer";
|
|
case LEDCONFIG: return "ledConfig";
|
|
case LEDS: return "leds";
|
|
case LOGGER: return "logger";
|
|
case SMOOTHING: return "smoothing";
|
|
case WEBSERVER: return "webConfig";
|
|
case INSTCAPTURE: return "instCapture";
|
|
case NETWORK: return "network";
|
|
case FLATBUFSERVER: return "flatbufServer";
|
|
case PROTOSERVER: return "protoServer";
|
|
case OSEVENTS: return "osEvents";
|
|
case CECEVENTS: return "cecEvents";
|
|
case SCHEDEVENTS: return "schedEvents";
|
|
default: return "invalid";
|
|
}
|
|
}
|
|
|
|
///
|
|
/// @brief Convert string to settings::type representation
|
|
/// @param type The string to convert
|
|
/// @return The settings type from enum
|
|
///
|
|
inline type stringToType(const QString& type)
|
|
{
|
|
if (type == "backgroundEffect") return BGEFFECT;
|
|
else if (type == "foregroundEffect") return FGEFFECT;
|
|
else if (type == "blackborderdetector") return BLACKBORDER;
|
|
else if (type == "boblightServer") return BOBLSERVER;
|
|
else if (type == "color") return COLOR;
|
|
else if (type == "device") return DEVICE;
|
|
else if (type == "effects") return EFFECTS;
|
|
else if (type == "forwarder") return NETFORWARD;
|
|
else if (type == "framegrabber") return SYSTEMCAPTURE;
|
|
else if (type == "general") return GENERAL;
|
|
else if (type == "grabberV4L2") return V4L2;
|
|
else if (type == "grabberAudio") return AUDIO;
|
|
else if (type == "jsonServer") return JSONSERVER;
|
|
else if (type == "ledConfig") return LEDCONFIG;
|
|
else if (type == "leds") return LEDS;
|
|
else if (type == "logger") return LOGGER;
|
|
else if (type == "smoothing") return SMOOTHING;
|
|
else if (type == "webConfig") return WEBSERVER;
|
|
else if (type == "instCapture") return INSTCAPTURE;
|
|
else if (type == "network") return NETWORK;
|
|
else if (type == "flatbufServer") return FLATBUFSERVER;
|
|
else if (type == "protoServer") return PROTOSERVER;
|
|
else if (type == "osEvents") return OSEVENTS;
|
|
else if (type == "cecEvents") return CECEVENTS;
|
|
else if (type == "schedEvents") return SCHEDEVENTS;
|
|
else return INVALID;
|
|
}
|
|
}
|