summaryrefslogtreecommitdiff
path: root/gtk2_ardour/automation_time_axis.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-02-16 04:46:45 +0000
committerDavid Robillard <d@drobilla.net>2009-02-16 04:46:45 +0000
commit5f7b4de02414f00c98ede60db0dc1dddbbe051ae (patch)
treebb363e48024603462eacbefc5badb958bee1712a /gtk2_ardour/automation_time_axis.cc
parent0ef53a2d343da1b926df96550a426ed800ff479e (diff)
Time unit translation for AutomationLine (correctly display MIDI controller data).
git-svn-id: svn://localhost/ardour2/branches/3.0@4597 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/automation_time_axis.cc')
-rw-r--r--gtk2_ardour/automation_time_axis.cc30
1 files changed, 19 insertions, 11 deletions
diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc
index 48c79040a1..d46a3cdbaa 100644
--- a/gtk2_ardour/automation_time_axis.cc
+++ b/gtk2_ardour/automation_time_axis.cc
@@ -211,12 +211,14 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
/* no regions, just a single line for the entire track (e.g. bus gain) */
} else {
+ static const Evoral::IdentityConverter<double,nframes_t> null_converter;
boost::shared_ptr<AutomationLine> line(new AutomationLine (
ARDOUR::EventTypeMap::instance().to_symbol(_control->parameter()),
*this,
*_canvas_display,
- _control->alist()));
+ _control->alist(),
+ null_converter));
line->set_line_color (ARDOUR_UI::config()->canvasvar_ProcessorAutomationLine.get());
line->queue_reset ();
@@ -581,7 +583,7 @@ AutomationTimeAxisView::add_automation_event (ArdourCanvas::Item* item, GdkEvent
/* map using line */
- _line->view_to_model_y (y);
+ _line->view_to_model_coord (x, y);
_session.begin_reversible_command (_("add automation event"));
XMLNode& before = _control->alist()->get_state();
@@ -634,9 +636,11 @@ AutomationTimeAxisView::cut_copy_clear_one (AutomationLine& line, Selection& sel
if (what_we_got) {
for (AutomationList::iterator x = what_we_got->begin(); x != what_we_got->end(); ++x) {
- double foo = (*x)->value;
- line.model_to_view_y (foo);
- (*x)->value = foo;
+ double when = (*x)->when;
+ double val = (*x)->value;
+ line.model_to_view_coord (when, val);
+ (*x)->when = when;
+ (*x)->value = val;
}
}
@@ -714,9 +718,11 @@ AutomationTimeAxisView::cut_copy_clear_objects_one (AutomationLine& line, PointS
if (what_we_got) {
for (AutomationList::iterator x = what_we_got->begin(); x != what_we_got->end(); ++x) {
- double foo = (*x)->value;
- line.model_to_view_y (foo);
- (*x)->value = foo;
+ double when = (*x)->when;
+ double val = (*x)->value;
+ line.model_to_view_coord (when, val);
+ (*x)->when = when;
+ (*x)->value = val;
}
}
@@ -749,9 +755,11 @@ AutomationTimeAxisView::paste_one (AutomationLine& line, nframes_t pos, float ti
AutomationList copy (**p);
for (AutomationList::iterator x = copy.begin(); x != copy.end(); ++x) {
- double foo = (*x)->value;
- line.view_to_model_y (foo);
- (*x)->value = foo;
+ double when = (*x)->when;
+ double val = (*x)->value;
+ line.view_to_model_coord (when, val);
+ (*x)->when = when;
+ (*x)->value = val;
}
XMLNode &before = alist->get_state();