summaryrefslogtreecommitdiff
path: root/src/settings.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2019-07-25 17:49:16 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2019-09-28 20:37:47 +0200
commit9d1ea1e7cfa256c7f5cac027382d92f658734ccb (patch)
tree39ec7cdaa8ed571137430ccbbc0a391bb27427a3 /src/settings.h
parentcd9af98abdce1fe3759e786d6b010a7fe3395e2c (diff)
Add generic logger interface for propagating messages while loading drumkits to the commandline
and/or plugin UI.
Diffstat (limited to 'src/settings.h')
-rw-r--r--src/settings.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/settings.h b/src/settings.h
index 64d27b7..97b1cf1 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -145,6 +145,9 @@ struct Settings
Atomic<std::size_t> audition_counter{0};
Atomic<std::string> audition_instrument;
Atomic<float> audition_velocity;
+
+ // Notify UI about load errors
+ Atomic<std::string> load_status_text;
};
//! Settings getter class.
@@ -206,6 +209,8 @@ struct SettingsGetter
SettingRef<std::string> audition_instrument;
SettingRef<float> audition_velocity;
+ SettingRef<std::string> load_status_text;
+
SettingsGetter(Settings& settings)
: drumkit_file(settings.drumkit_file)
, drumkit_load_status(settings.drumkit_load_status)
@@ -250,6 +255,7 @@ struct SettingsGetter
, audition_counter{settings.audition_counter}
, audition_instrument{settings.audition_instrument}
, audition_velocity{settings.audition_velocity}
+ , load_status_text{settings.load_status_text}
{
}
};
@@ -312,6 +318,8 @@ public:
Notifier<std::string> audition_instrument;
Notifier<int> audition_velocity;
+ Notifier<std::string> load_status_text;
+
void evaluate()
{
#define EVAL(x) if(settings.x.hasChanged()) { x(settings.x.getValue()); }
@@ -369,6 +377,8 @@ public:
EVAL(audition_counter);
EVAL(audition_instrument);
EVAL(audition_velocity);
+
+ EVAL(load_status_text);
}
SettingsNotifier(Settings& settings)