summaryrefslogtreecommitdiff
path: root/src/settings.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-03-31 22:11:07 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2016-03-31 22:11:07 +0200
commit19691923340e5984e3ace837d39938f718fee608 (patch)
tree85dd4ddab8e9c9b5632a92710dc36441a0fc7f6b /src/settings.h
parent2e4175d84cc0ca765fdc0b03bf5c8420deeec268 (diff)
Removed the last Conf:: namespace usage and replaced it with Settings.
Diffstat (limited to 'src/settings.h')
-rw-r--r--src/settings.h36
1 files changed, 29 insertions, 7 deletions
diff --git a/src/settings.h b/src/settings.h
index ed031b2..2700e26 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -31,20 +31,34 @@
#include <cassert>
#include "atomic.h"
+//bool Conf::enable_velocity_modifier = true;
+//float Conf::velocity_modifier_falloff = 0.5;
+//float Conf::velocity_modifier_weight = 0.25;
+//
+//bool Conf::enable_velocity_randomiser = false;
+//float Conf::velocity_randomiser_weight = 0.1;
+//
+//int Conf::samplerate = 44100;
+//
+//bool Conf::enable_resampling = true;
+
+//operator Atomic<bool>
//! Engine settings
struct Settings
{
- Atomic<bool> enable_velocity_modifier;
- Atomic<float> velocity_modifier_falloff;
- Atomic<float> velocity_modifier_weight;
+ Atomic<std::string> foo{"foo"};
- Atomic<bool> enable_velocity_randomiser;
- Atomic<float> velocity_randomiser_weight;
+ Atomic<bool> enable_velocity_modifier{true};
+ Atomic<float> velocity_modifier_falloff{0.5};
+ Atomic<float> velocity_modifier_weight{0.25};
- Atomic<double> samplerate;
+ Atomic<bool> enable_velocity_randomiser{false};
+ Atomic<float> velocity_randomiser_weight{0.1};
- Atomic<bool> enable_resampling;
+ Atomic<double> samplerate{44100.0};
+
+ Atomic<bool> enable_resampling{true};
Atomic<int> number_of_files;
Atomic<int> number_of_files_loaded;
@@ -66,6 +80,13 @@ public:
{
T tmp = cache;
cache.exchange(value);
+
+ if(firstAccess)
+ {
+ firstAccess = false;
+ return true;
+ }
+
return tmp == cache;
}
@@ -75,6 +96,7 @@ public:
}
private:
+ bool firstAccess{true};
Atomic<T>& value;
Atomic<T> cache;
};