From cc0f25cd2b9fc5856f16b71a412ce8c17edc39a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Sat, 22 Apr 2017 13:09:42 +0200 Subject: Include new information into the status frame. --- src/drumkit.cc | 5 +++++ src/drumkit.h | 1 + src/drumkitloader.cc | 8 +++++++- src/settings.h | 25 +++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/drumkit.cc b/src/drumkit.cc index abef1b8..e557de1 100644 --- a/src/drumkit.cc +++ b/src/drumkit.cc @@ -68,6 +68,11 @@ std::string DrumKit::getDescription() const return _description; } +VersionStr DrumKit::getVersion() const +{ + return _version; +} + std::size_t DrumKit::getSamplerate() const { return _samplerate; diff --git a/src/drumkit.h b/src/drumkit.h index f646b22..682dbff 100644 --- a/src/drumkit.h +++ b/src/drumkit.h @@ -44,6 +44,7 @@ public: std::string getName() const; std::string getDescription() const; + VersionStr getVersion() const; Instruments instruments; Channels channels; diff --git a/src/drumkitloader.cc b/src/drumkitloader.cc index e4d34f2..eed5a33 100644 --- a/src/drumkitloader.cc +++ b/src/drumkitloader.cc @@ -125,12 +125,18 @@ bool DrumKitLoader::loadkit(const std::string& file) "Trying to load it anyway...\n"); } + // Put some information about the kit into the settings + settings.drumkit_name = kit.getName(); + settings.drumkit_description = kit.getDescription(); + settings.drumkit_version = kit.getVersion(); + settings.drumkit_samplerate = kit.getSamplerate(); + loadKit(&kit); #ifdef WITH_RESAMPLER resamplers.setup(kit.getSamplerate(), settings.samplerate.load()); #endif/*WITH_RESAMPLER*/ - + settings.resampling_active.store(resamplers.isActive()); DEBUG(loadkit, "loadkit: Success\n"); diff --git a/src/settings.h b/src/settings.h index 3f9f9ae..61f92e7 100644 --- a/src/settings.h +++ b/src/settings.h @@ -48,6 +48,10 @@ struct Settings { Atomic drumkit_file{""}; Atomic drumkit_load_status{LoadStatus::Idle}; + Atomic drumkit_name{""}; + Atomic drumkit_description{""}; + Atomic drumkit_version{""}; + Atomic drumkit_samplerate{0}; //! The maximum amount of memory in bytes that the AudioCache //! is allowed to use for preloading. Default is 1GB. @@ -76,6 +80,7 @@ struct Settings Atomic samplerate{44100.0}; Atomic enable_resampling{true}; + Atomic resampling_active{false}; Atomic number_of_files{0}; Atomic number_of_files_loaded{0}; @@ -87,6 +92,10 @@ struct SettingsGetter { SettingRef drumkit_file; SettingRef drumkit_load_status; + SettingRef drumkit_name; + SettingRef drumkit_description; + SettingRef drumkit_version; + SettingRef drumkit_samplerate; SettingRef disk_cache_upper_limit; SettingRef disk_cache_chunk_size; @@ -107,6 +116,7 @@ struct SettingsGetter SettingRef samplerate; SettingRef enable_resampling; + SettingRef resampling_active; SettingRef number_of_files; SettingRef number_of_files_loaded; @@ -115,6 +125,10 @@ struct SettingsGetter SettingsGetter(Settings& settings) : drumkit_file(settings.drumkit_file) , drumkit_load_status(settings.drumkit_load_status) + , drumkit_name(settings.drumkit_name) + , drumkit_description(settings.drumkit_description) + , drumkit_version(settings.drumkit_version) + , drumkit_samplerate(settings.drumkit_samplerate) , disk_cache_upper_limit(settings.disk_cache_upper_limit) , disk_cache_chunk_size(settings.disk_cache_chunk_size) , disk_cache_enable(settings.disk_cache_enable) @@ -129,6 +143,7 @@ struct SettingsGetter , velocity_randomiser_weight{settings.velocity_randomiser_weight} , samplerate{settings.samplerate} , enable_resampling{settings.enable_resampling} + , resampling_active{settings.resampling_active} , number_of_files{settings.number_of_files} , number_of_files_loaded{settings.number_of_files_loaded} , current_file{settings.current_file} @@ -142,6 +157,10 @@ class SettingsNotifier public: Notifier drumkit_file; Notifier drumkit_load_status; + Notifier drumkit_name; + Notifier drumkit_description; + Notifier drumkit_version; + Notifier drumkit_samplerate; Notifier disk_cache_upper_limit; Notifier disk_cache_chunk_size; @@ -162,6 +181,7 @@ public: Notifier samplerate; Notifier enable_resampling; + Notifier resampling_active; Notifier number_of_files; Notifier number_of_files_loaded; @@ -173,6 +193,10 @@ public: EVAL(drumkit_file); EVAL(drumkit_load_status); + EVAL(drumkit_name); + EVAL(drumkit_description); + EVAL(drumkit_version); + EVAL(drumkit_samplerate); EVAL(disk_cache_upper_limit); EVAL(disk_cache_chunk_size); @@ -193,6 +217,7 @@ public: EVAL(samplerate); EVAL(enable_resampling); + EVAL(resampling_active); EVAL(number_of_files); EVAL(number_of_files_loaded); -- cgit v1.2.3