summaryrefslogtreecommitdiff
path: root/src/settings.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2017-03-12 09:09:07 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2017-03-12 09:09:07 +0100
commit75de9c0ac782fa6fecb92f3a22f311b517856abb (patch)
treed54b8e9165eaec49f0104caa3dc9eb936a708526 /src/settings.h
parentfaf80b071b54f2f736df2390171f7b3b939d03c2 (diff)
Add reload_counter to Settings and use it in DrumKitLoader to reload a drumkit whenever it changes (ie. increments).
Diffstat (limited to 'src/settings.h')
-rw-r--r--src/settings.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/settings.h b/src/settings.h
index cb707ef..8a646a1 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -50,12 +50,13 @@ struct Settings
Atomic<LoadStatus> drumkit_load_status{LoadStatus::Idle};
//! The maximum amount of memory in bytes that the AudioCache
- //! is allowed to use for preloading
- //! The default std::numeric_limits<std::size_t>::max() means "unlimited"
- //Atomic<std::size_t> cache_upper_limit{std::numeric_limits<std::size_t>::max()};
- Atomic<std::size_t> disk_cache_upper_limit{1024*1024*1024};
+ //! is allowed to use for preloading. Default is 1GB.
+ Atomic<std::size_t> disk_cache_upper_limit{1024 * 1024 * 1024};
Atomic<bool> disk_cache_enable{true};
+ //! Increment this in order to invoke a reload of the current drumkit.
+ Atomic<std::size_t> reload_counter{0};
+
Atomic<std::string> midimap_file{""};
Atomic<LoadStatus> midimap_load_status{LoadStatus::Idle};
@@ -83,6 +84,7 @@ struct SettingsGetter
SettingRef<std::size_t> disk_cache_upper_limit;
SettingRef<bool> disk_cache_enable;
+ SettingRef<std::size_t> reload_counter;
SettingRef<std::string> midimap_file;
SettingRef<LoadStatus> midimap_load_status;
@@ -107,6 +109,7 @@ struct SettingsGetter
, drumkit_load_status(settings.drumkit_load_status)
, disk_cache_upper_limit(settings.disk_cache_upper_limit)
, disk_cache_enable(settings.disk_cache_enable)
+ , reload_counter(settings.reload_counter)
, midimap_file(settings.midimap_file)
, midimap_load_status(settings.midimap_load_status)
, enable_velocity_modifier{settings.enable_velocity_modifier}
@@ -132,6 +135,7 @@ public:
Notifier<std::size_t> disk_cache_upper_limit;
Notifier<bool> disk_cache_enable;
+ Notifier<std::size_t> reload_counter;
Notifier<std::string> midimap_file;
Notifier<LoadStatus> midimap_load_status;
@@ -160,6 +164,7 @@ public:
EVAL(disk_cache_upper_limit);
EVAL(disk_cache_enable);
+ EVAL(reload_counter);
EVAL(midimap_file);
EVAL(midimap_load_status);