summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/drumkit.cc5
-rw-r--r--src/drumkit.h1
-rw-r--r--src/drumkitloader.cc8
-rw-r--r--src/settings.h25
4 files changed, 38 insertions, 1 deletions
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<std::string> drumkit_file{""};
Atomic<LoadStatus> drumkit_load_status{LoadStatus::Idle};
+ Atomic<std::string> drumkit_name{""};
+ Atomic<std::string> drumkit_description{""};
+ Atomic<std::string> drumkit_version{""};
+ Atomic<std::size_t> 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<double> samplerate{44100.0};
Atomic<bool> enable_resampling{true};
+ Atomic<bool> resampling_active{false};
Atomic<std::size_t> number_of_files{0};
Atomic<std::size_t> number_of_files_loaded{0};
@@ -87,6 +92,10 @@ struct SettingsGetter
{
SettingRef<std::string> drumkit_file;
SettingRef<LoadStatus> drumkit_load_status;
+ SettingRef<std::string> drumkit_name;
+ SettingRef<std::string> drumkit_description;
+ SettingRef<std::string> drumkit_version;
+ SettingRef<std::size_t> drumkit_samplerate;
SettingRef<std::size_t> disk_cache_upper_limit;
SettingRef<std::size_t> disk_cache_chunk_size;
@@ -107,6 +116,7 @@ struct SettingsGetter
SettingRef<double> samplerate;
SettingRef<bool> enable_resampling;
+ SettingRef<bool> resampling_active;
SettingRef<std::size_t> number_of_files;
SettingRef<std::size_t> 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<std::string> drumkit_file;
Notifier<LoadStatus> drumkit_load_status;
+ Notifier<std::string> drumkit_name;
+ Notifier<std::string> drumkit_description;
+ Notifier<std::string> drumkit_version;
+ Notifier<std::size_t> drumkit_samplerate;
Notifier<std::size_t> disk_cache_upper_limit;
Notifier<std::size_t> disk_cache_chunk_size;
@@ -162,6 +181,7 @@ public:
Notifier<double> samplerate;
Notifier<bool> enable_resampling;
+ Notifier<bool> resampling_active;
Notifier<std::size_t> number_of_files;
Notifier<std::size_t> 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);