From af0c42ec4f9d46907299f704d0c70e25e0af6b96 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 23 Mar 2014 18:59:24 +0100 Subject: midi-controller, support log parameters - fixes #5890 --- libs/ardour/plugin_insert.cc | 4 ++++ libs/surfaces/generic_midi/midicontrollable.cc | 23 ++++++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index 2f90017498..ae018fb2a3 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -1184,6 +1184,10 @@ PluginInsert::PluginControl::PluginControl (PluginInsert* p, const Evoral::Param _logarithmic = desc.logarithmic; _sr_dependent = desc.sr_dependent; _toggled = desc.toggled; + + if (desc.toggled) { + set_flags(Controllable::Toggle); + } } /** @param val `user' value */ diff --git a/libs/surfaces/generic_midi/midicontrollable.cc b/libs/surfaces/generic_midi/midicontrollable.cc index d78dd5e644..a12b20b1a8 100644 --- a/libs/surfaces/generic_midi/midicontrollable.cc +++ b/libs/surfaces/generic_midi/midicontrollable.cc @@ -167,7 +167,7 @@ MIDIControllable::control_to_midi (float val) float control_min = controllable->lower (); float control_max = controllable->upper (); - const float control_range = control_max - control_min; + float control_range = control_max - control_min; if (controllable->is_toggle()) { if (val >= (control_min + (control_range/2.0f))) { @@ -175,6 +175,14 @@ MIDIControllable::control_to_midi (float val) } else { return 0; } + } else { + AutomationControl *actl = dynamic_cast (controllable); + if (actl) { + control_min = actl->internal_to_interface(control_min); + control_max = actl->internal_to_interface(control_max); + control_range = control_max - control_min; + val = actl->internal_to_interface(val); + } } return (val - control_min) / control_range * max_value_for_type (); @@ -196,8 +204,17 @@ MIDIControllable::midi_to_control (int val) float control_min = controllable->lower (); float control_max = controllable->upper (); - const float control_range = control_max - control_min; - + float control_range = control_max - control_min; + + AutomationControl *actl = dynamic_cast (controllable); + if (actl) { + if (fv == 0.f) return control_min; + if (fv == 1.f) return control_max; + control_min = actl->internal_to_interface(control_min); + control_max = actl->internal_to_interface(control_max); + control_range = control_max - control_min; + return actl->interface_to_internal((fv * control_range) + control_min); + } return (fv * control_range) + control_min; } -- cgit v1.2.3 From 65f5f17c18d224ce72b25789e9d00a300389d070 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 2 Apr 2014 18:48:28 +0200 Subject: fix typo --- gtk2_ardour/editor_regions.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk2_ardour/editor_regions.cc b/gtk2_ardour/editor_regions.cc index bf13bd5a65..69620d489f 100644 --- a/gtk2_ardour/editor_regions.cc +++ b/gtk2_ardour/editor_regions.cc @@ -114,7 +114,7 @@ EditorRegions::EditorRegions (Editor* e) { 3, _("Length"), _("Length of the region") }, { 4, _("Sync"), _("Position of region sync point, relative to start of the region") }, { 5, _("Fade In"), _("Length of region fade-in (units: secondary clock), () if disabled") }, - { 6, _("Fade Out"), _("Length of region fade-out (units: secondary clock), () if dsisabled") }, + { 6, _("Fade Out"), _("Length of region fade-out (units: secondary clock), () if disabled") }, { 7, _("L"), _("Region position locked?") }, { 8, _("G"), _("Region position glued to Bars|Beats time?") }, { 9, _("M"), _("Region muted?") }, -- cgit v1.2.3 From 2482361d8887915bcadc03a5e226753597c924cf Mon Sep 17 00:00:00 2001 From: Sakari Bergen Date: Mon, 7 Apr 2014 21:27:56 +0300 Subject: Fix buffer size mismatch in evoral tests --- libs/evoral/test/SequenceTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/evoral/test/SequenceTest.cpp b/libs/evoral/test/SequenceTest.cpp index 69931b8e0d..6e07776fdb 100644 --- a/libs/evoral/test/SequenceTest.cpp +++ b/libs/evoral/test/SequenceTest.cpp @@ -23,7 +23,7 @@ SequenceTest::preserveEventOrderingTest () seq->start_write(); for (Notes::const_iterator i = test_notes.begin(); i != test_notes.end(); ++i) { - uint8_t buffer[2]; + uint8_t buffer[3]; Event