refactoring

This commit is contained in:
Jakob Gegeniger committed 2026-09-09 00:43:01 +02:00
1 parent eb1c84cf05
commit 92423c52de
8 files changed
+655 -57

No files matched your search

+21 -36
View File
@@ -28,7 +28,6 @@
#include "textUtils.hpp"
#include "thread.hpp"
class LinMot {
public:
LinMot(OutputPort& o1, OutputPort& o2)
@@ -79,45 +78,31 @@ class DeviceIoState {
bool Mute{false};
};
class SwordConfig {
public:
std::string getSoundPromo() { return soundPromo; }
std::string getSoundDeny() { return soundDeny; }
std::string getSoundAllow() { return soundAllow; }
std::string getBrockerUrl() { return brockerUrl; }
std::string getMqttUser() { return mqttUser; }
std::string getMqttPassword() { return mqttPassword; }
std::string getStationPath() { return stationPath; }
void setVar(std::string base,
struct SwordConfig {
SwordConfig(std::string base,
std::string brocker, std::string topic,
std::string user, std::string passwd) {
if (wasSet) {
return;
}
soundPromo = base + soundPromo;
soundDeny = base + soundDeny;
soundAllow = base + soundAllow;
std::string user, std::string passwd)
: AssetBase(base),
SoundPromo{base + "/promo.wav"},
SoundPromoShort{base + "/promoShort.wav"},
SoundDeny{base + "/deny.wav"},
SoundAllow{base + "/allow.wav"},
BrockerUrl(brocker),
StationPath(topic),
MqttUser(user),
MqttPassword(passwd) {}
brockerUrl = brocker;
stationPath = topic;
mqttUser = user;
mqttPassword = passwd;
wasSet = true;
}
const std::string AssetBase;
private:
bool wasSet{};
std::string assetBase{};
std::string soundPromo{"/promo.wav"};
std::string soundPromoShort{"/promoShort.wav"};
std::string soundDeny{"/deny.wav"};
std::string soundAllow{"/allow.wav"};
const std::string SoundPromo;
const std::string SoundPromoShort;
const std::string SoundDeny;
const std::string SoundAllow;
std::string brockerUrl;
std::string mqttUser;
std::string mqttPassword;
std::string stationPath;
const std::string BrockerUrl;
const std::string StationPath;
const std::string MqttUser;
const std::string MqttPassword;
};
class MediaPlayer {