summaryrefslogtreecommitdiffhomepage
path: root/logic
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-01-29 03:10:28 +0100
committerStanislaw Halik <sthalik@misaki.pl>2017-01-29 03:10:28 +0100
commit01210b7fba37356ee2c18420762eeeed52489d20 (patch)
tree9c2494842b9183d28b6b77ecf3b0d0760f05a922 /logic
parent0ea648f8254ff49942e7f83d9034155b50498ac9 (diff)
gui/mapping-window, spline-widget, logic/main-settings: limited mapping range
Diffstat (limited to 'logic')
-rw-r--r--logic/main-settings.hpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/logic/main-settings.hpp b/logic/main-settings.hpp
index 749f6d25..66146913 100644
--- a/logic/main-settings.hpp
+++ b/logic/main-settings.hpp
@@ -18,18 +18,30 @@ using namespace options;
struct axis_opts final
{
+ enum max_rotation : int
+ {
+ r180 = 180,
+ r90 = 90,
+ r60 = 60,
+ r45 = 45,
+ r30 = 30,
+ r20 = 25,
+ };
+
// note, these two bundles can be the same value with no issues
bundle b_settings_window, b_mapping_window;
value<double> zero;
value<int> src;
value<bool> invert, altp;
+ value<max_rotation> clamp;
axis_opts(bundle b_settings_window, bundle b_mapping_window, QString pfx, int idx) :
b_settings_window(b_settings_window),
b_mapping_window(b_mapping_window),
zero(b_settings_window, n(pfx, "zero-pos"), 0),
src(b_settings_window, n(pfx, "source-index"), idx),
invert(b_settings_window, n(pfx, "invert-sign"), false),
- altp(b_mapping_window, n(pfx, "alt-axis-sign"), false)
+ altp(b_mapping_window, n(pfx, "alt-axis-sign"), false),
+ clamp(b_mapping_window, n(pfx, "max-value"), idx == Pitch ? r90 : r180)
{}
private:
static inline QString n(QString pfx, QString name)