diff options
author | David Robillard <d@drobilla.net> | 2022-07-19 09:55:42 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-07-20 10:35:32 -0400 |
commit | 808a0cbc8d47f2c77fc69f2ad850d2e91dc9ca21 (patch) | |
tree | 1aae618f7f8fb79bf5a405e740dfb6a6bfbe7d23 /src/Configuration.hpp | |
parent | 2f6bec60c6bd0f4bac2a8a5f47b1994b65ed7ed0 (diff) | |
download | patchage-808a0cbc8d47f2c77fc69f2ad850d2e91dc9ca21.tar.gz patchage-808a0cbc8d47f2c77fc69f2ad850d2e91dc9ca21.tar.bz2 patchage-808a0cbc8d47f2c77fc69f2ad850d2e91dc9ca21.zip |
Use a uniform interface for changing settings in the UI
Diffstat (limited to 'src/Configuration.hpp')
-rw-r--r-- | src/Configuration.hpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Configuration.hpp b/src/Configuration.hpp index 6a59076..770a240 100644 --- a/src/Configuration.hpp +++ b/src/Configuration.hpp @@ -63,6 +63,23 @@ public: } } + // Set a global configuration setting + template<class S> + void set_setting(S new_setting) + { + set<S>(new_setting.value); + } + + // Set a global port color setting + void set_setting(setting::PortColor new_setting) + { + auto& color = _port_colors[static_cast<unsigned>(new_setting.type)]; + + if (color != new_setting.color) { + set_port_color(new_setting.type, new_setting.color); + } + } + // Get a global configuration setting template<class S> const decltype(S::value) get() const |