summaryrefslogtreecommitdiff
path: root/gtk2_ardour/automation_line.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-11-01 23:29:10 -0400
committerDavid Robillard <d@drobilla.net>2014-11-02 02:10:24 -0500
commit8a128b33d38172ae525ac798c53bc105bc4e2c64 (patch)
tree226459f2fec72a9717d12f190d354f72175607dc /gtk2_ardour/automation_line.cc
parent6dfb11c2d08201f1a27818955707590b762f5a40 (diff)
Automation of LV2 plugin properties.
Work towards ParameterDescriptor being used more universally to describe control characteristics.
Diffstat (limited to 'gtk2_ardour/automation_line.cc')
-rw-r--r--gtk2_ardour/automation_line.cc18
1 files changed, 8 insertions, 10 deletions
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc
index b22681f1f8..c1549ecab3 100644
--- a/gtk2_ardour/automation_line.cc
+++ b/gtk2_ardour/automation_line.cc
@@ -69,8 +69,10 @@ using namespace Editing;
/** @param converter A TimeConverter whose origin_b is the start time of the AutomationList in session frames.
* This will not be deleted by AutomationLine.
*/
-AutomationLine::AutomationLine (const string& name, TimeAxisView& tv, ArdourCanvas::Item& parent,
- boost::shared_ptr<AutomationList> al,
+AutomationLine::AutomationLine (const string& name,
+ TimeAxisView& tv,
+ ArdourCanvas::Item& parent,
+ boost::shared_ptr<AutomationList> al,
Evoral::TimeConverter<double, framepos_t>* converter)
: trackview (tv)
, _name (name)
@@ -1160,7 +1162,7 @@ AutomationLine::view_to_model_coord (double& x, double& y) const
void
AutomationLine::view_to_model_coord_y (double& y) const
{
- /* TODO: This should be more generic ... */
+ /* TODO: This should be more generic (use ParameterDescriptor) */
if (alist->parameter().type() == GainAutomation ||
alist->parameter().type() == EnvelopeAutomation) {
y = slider_position_to_gain_with_max (y, Config->get_max_gain());
@@ -1171,17 +1173,15 @@ AutomationLine::view_to_model_coord_y (double& y) const
y = 1.0 - y;
} else if (alist->parameter().type() == PanWidthAutomation) {
y = 2.0 * y - 1.0;
- } else if (alist->parameter().type() == PluginAutomation) {
- y = y * (double)(alist->get_max_y()- alist->get_min_y()) + alist->get_min_y();
} else {
- y = rint (y * alist->parameter().max());
+ y = y * (double)(alist->get_max_y() - alist->get_min_y()) + alist->get_min_y();
}
}
void
AutomationLine::model_to_view_coord (double& x, double& y) const
{
- /* TODO: This should be more generic ... */
+ /* TODO: This should be more generic (use ParameterDescriptor) */
if (alist->parameter().type() == GainAutomation ||
alist->parameter().type() == EnvelopeAutomation) {
y = gain_to_slider_position_with_max (y, Config->get_max_gain());
@@ -1190,10 +1190,8 @@ AutomationLine::model_to_view_coord (double& x, double& y) const
y = 1.0 - y;
} else if (alist->parameter().type() == PanWidthAutomation) {
y = .5 + y * .5;
- } else if (alist->parameter().type() == PluginAutomation) {
- y = (y - alist->get_min_y()) / (double)(alist->get_max_y()- alist->get_min_y());
} else {
- y = y / (double)alist->parameter().max(); /* ... like this */
+ y = (y - alist->get_min_y()) / (double)(alist->get_max_y() - alist->get_min_y());
}
x = _time_converter->to (x) - _offset;