From de1ebcc1490e083c18af7c6cccaf956a30038161 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 15 Nov 2014 02:58:39 -0500 Subject: Fix entering/editing MIDI region "automation" (controllers). Two issues: 1) AutomationRegionView not receiving events (CC breakage). 2) Entered values must be rounded to integer for MIDI controllers. This should be done more generically with ParameterDescriptor for all controls (also supporting boolean toggles and such), once ParameterDescriptor becomes more pervasive and takes over Evoral::Parameter, but this will do for now. --- gtk2_ardour/automation_line.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gtk2_ardour/automation_line.cc') diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index 2e9f988bfa..b7c39f888f 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -39,6 +39,7 @@ #include "ardour/automation_list.h" #include "ardour/dB.h" #include "ardour/debug.h" +#include "ardour/parameter_types.h" #include "ardour/tempo.h" #include "evoral/Curve.hpp" @@ -1171,6 +1172,9 @@ AutomationLine::view_to_model_coord_y (double& y) const y = 2.0 * y - 1.0; } else { y = y * (double)(alist->get_max_y() - alist->get_min_y()) + alist->get_min_y(); + if (ARDOUR::parameter_is_midi((ARDOUR::AutomationType)alist->parameter().type())) { + y = round(y); + } } } -- cgit v1.2.3