diff options
author | Roland Reichwein <mail@reichwein.it> | 2025-01-04 09:22:17 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2025-01-04 09:22:17 +0100 |
commit | 9351c6d9812523b0b8027f2b2e0de54c27004bc2 (patch) | |
tree | 6cbf97a8a699630f83bdc1bc93a51736874e82bb /config.cpp | |
parent | 0399f008b22482c46d37fa15e6be205b85681011 (diff) |
Fix config
Diffstat (limited to 'config.cpp')
-rw-r--r-- | config.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -15,6 +15,16 @@ std::string config_filename = "click.cfg"; Config::Config() { + recover(); +} + +Config::~Config() +{ + persist(); +} + +void Config::recover() +{ try { // presets / defaults m_midi_channel = CLICK_CHANNEL; @@ -41,7 +51,7 @@ Config::Config() } } -Config::~Config() +void Config::persist() { std::string config = fmt::format("midi_channel={}\n", m_midi_channel) + fmt::format("midi_note={}\n", m_midi_note) + |