From 32878759a55f8b80d808a3647a5802984438d8c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Sat, 2 May 2020 13:02:29 +0200 Subject: Save powermap settings with session. --- plugin/drumgizmo_plugin.cc | 56 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/plugin/drumgizmo_plugin.cc b/plugin/drumgizmo_plugin.cc index 0e1021d..87ce160 100644 --- a/plugin/drumgizmo_plugin.cc +++ b/plugin/drumgizmo_plugin.cc @@ -633,6 +633,22 @@ std::string DrumGizmoPlugin::ConfigStringIO::get() float2str(settings.latency_stddev.load()) + "\n" " " + float2str(settings.latency_regain.load()) + "\n" + " " + + bool2str(settings.enable_powermap.load()) + "\n" + " " + + float2str(settings.powermap_fixed0_x.load()) + "\n" + " " + + float2str(settings.powermap_fixed0_y.load()) + "\n" + " " + + float2str(settings.powermap_fixed1_x.load()) + "\n" + " " + + float2str(settings.powermap_fixed1_y.load()) + "\n" + " " + + float2str(settings.powermap_fixed2_x.load()) + "\n" + " " + + float2str(settings.powermap_fixed2_y.load()) + "\n" + " " + + bool2str(settings.powermap_shelf.load()) + "\n" ""; } @@ -748,6 +764,46 @@ bool DrumGizmoPlugin::ConfigStringIO::set(std::string config_string) settings.latency_regain.store(str2float(p.value("latency_regain"))); } + if(p.value("enable_powermap") != "") + { + settings.enable_powermap.store(p.value("enable_powermap") == "true"); + } + + if(p.value("powermap_fixed0_x") != "") + { + settings.powermap_fixed0_x.store(str2float(p.value("powermap_fixed0_x"))); + } + + if(p.value("powermap_fixed0_y") != "") + { + settings.powermap_fixed0_y.store(str2float(p.value("powermap_fixed0_y"))); + } + + if(p.value("powermap_fixed1_x") != "") + { + settings.powermap_fixed1_x.store(str2float(p.value("powermap_fixed1_x"))); + } + + if(p.value("powermap_fixed1_y") != "") + { + settings.powermap_fixed1_y.store(str2float(p.value("powermap_fixed1_y"))); + } + + if(p.value("powermap_fixed2_x") != "") + { + settings.powermap_fixed2_x.store(str2float(p.value("powermap_fixed2_x"))); + } + + if(p.value("powermap_fixed2_y") != "") + { + settings.powermap_fixed2_y.store(str2float(p.value("powermap_fixed2_y"))); + } + + if(p.value("powermap_shelf") != "") + { + settings.powermap_shelf.store(p.value("powermap_shelf") == "true"); + } + std::string newkit = p.value("drumkitfile"); if(newkit != "") { -- cgit v1.2.3