diff options
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) + |