summaryrefslogtreecommitdiff
path: root/src/settings.h
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2019-03-22 01:09:15 +0100
committerAndré Nusser <andre.nusser@googlemail.com>2019-05-11 14:58:45 +0200
commit9c5efc23764522597a53a8745860cec54ea55d69 (patch)
treed672afdf2e11553d36370cc1abbef5033557f85e /src/settings.h
parent50b011c4740a5ec5338903b1d8b5fbb4b42f3df3 (diff)
Add settings and GUI for new sampling algorithm.
Diffstat (limited to 'src/settings.h')
-rw-r--r--src/settings.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/settings.h b/src/settings.h
index 4a7d904..6abbc72 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -75,13 +75,20 @@ struct Settings
static float constexpr velocity_modifier_falloff_default = 0.5f;
static float constexpr velocity_modifier_weight_default = 0.25f;
static float constexpr velocity_stddev_default = 1.0f;
+ static float constexpr sample_selection_f_distance_default = 2.f;
+ static float constexpr sample_selection_f_recent_default = .3f;
+ static float constexpr sample_selection_f_random_default = 0.05f;
Atomic<float> velocity_modifier_falloff{velocity_modifier_falloff_default};
Atomic<float> velocity_modifier_weight{velocity_modifier_weight_default};
- Atomic<float> velocity_stddev{velocity_stddev_default}; // [0.5; 3.0]
+ Atomic<float> velocity_stddev{velocity_stddev_default};
+ Atomic<float> sample_selection_f_distance{sample_selection_f_distance_default};
+ Atomic<float> sample_selection_f_recent{sample_selection_f_recent_default};
+ Atomic<float> sample_selection_f_random{sample_selection_f_random_default};
//! Control number of times to retry sample selection as long as the sample
//! is the same one as the last one.
//! 0: will do no retries, ie. just use the first sample found.
+ // FIXME: remove when new sample algorithm is introduced and also remove other occurences
static std::size_t constexpr sample_selection_retry_count_default = 3;
Atomic<std::size_t> sample_selection_retry_count{sample_selection_retry_count_default};
@@ -163,6 +170,9 @@ struct SettingsGetter
SettingRef<float> velocity_modifier_falloff;
SettingRef<float> velocity_modifier_weight;
SettingRef<float> velocity_stddev;
+ SettingRef<float> sample_selection_f_distance;
+ SettingRef<float> sample_selection_f_recent;
+ SettingRef<float> sample_selection_f_random;
SettingRef<std::size_t> sample_selection_retry_count;
@@ -214,6 +224,9 @@ struct SettingsGetter
, velocity_modifier_falloff{settings.velocity_modifier_falloff}
, velocity_modifier_weight{settings.velocity_modifier_weight}
, velocity_stddev{settings.velocity_stddev}
+ , sample_selection_f_distance{settings.sample_selection_f_distance}
+ , sample_selection_f_recent{settings.sample_selection_f_recent}
+ , sample_selection_f_random{settings.sample_selection_f_random}
, sample_selection_retry_count(settings.sample_selection_retry_count)
, velocity_modifier_current{settings.velocity_modifier_current}
, enable_velocity_randomiser{settings.enable_velocity_randomiser}
@@ -265,6 +278,9 @@ public:
Notifier<float> velocity_modifier_falloff;
Notifier<float> velocity_modifier_weight;
Notifier<float> velocity_stddev;
+ Notifier<float> sample_selection_f_distance;
+ Notifier<float> sample_selection_f_recent;
+ Notifier<float> sample_selection_f_random;
Notifier<std::size_t> sample_selection_retry_count;
Notifier<float> velocity_modifier_current;
@@ -320,6 +336,9 @@ public:
EVAL(velocity_modifier_falloff);
EVAL(velocity_modifier_weight);
EVAL(velocity_stddev);
+ EVAL(sample_selection_f_distance);
+ EVAL(sample_selection_f_recent);
+ EVAL(sample_selection_f_random);
EVAL(sample_selection_retry_count);
EVAL(velocity_modifier_current);