summaryrefslogtreecommitdiff
path: root/gtk2_ardour/region_view.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-02-19 04:12:54 +0000
committerDavid Robillard <d@drobilla.net>2009-02-19 04:12:54 +0000
commit0f71728a925eb8f16c14c74f0dae9fdd53406a20 (patch)
tree01e056fde9fdcbe90c9bccdc03dce57b4bc043f9 /gtk2_ardour/region_view.cc
parent8f572c3d3f79a86e6b86ccb71f9bee772e6fe738 (diff)
Interpret tempo time based on read position (not source timeline position which is more or less meaningless).
Move time conversion into the region view rather than the source. Adapt MIDI (including controllers) regions to the destination tempo when moved (e.g. dragging a region to a location with half the tempo will make the notes twice as long). git-svn-id: svn://localhost/ardour2/branches/3.0@4635 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/region_view.cc')
-rw-r--r--gtk2_ardour/region_view.cc31
1 files changed, 17 insertions, 14 deletions
diff --git a/gtk2_ardour/region_view.cc b/gtk2_ardour/region_view.cc
index 54e0a9ef5e..1819df0401 100644
--- a/gtk2_ardour/region_view.cc
+++ b/gtk2_ardour/region_view.cc
@@ -65,25 +65,25 @@ RegionView::RegionView (ArdourCanvas::Group* parent,
double spu,
Gdk::Color& basic_color)
: TimeAxisViewItem (r->name(), *parent, tv, spu, basic_color, r->position(), r->length(), false,
-
- TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowNameText|
- TimeAxisViewItem::ShowNameHighlight|
- TimeAxisViewItem::ShowFrame))
- , _region (r)
- , sync_mark(0)
- , sync_line(0)
- , editor(0)
- , current_visible_sync_position(0.0)
- , valid(false)
- , _enable_display(false)
- , _pixel_width(1.0)
- , in_destructor(false)
- , wait_for_data(false)
+ TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowNameText|
+ TimeAxisViewItem::ShowNameHighlight| TimeAxisViewItem::ShowFrame))
+ , _region (r)
+ , sync_mark(0)
+ , sync_line(0)
+ , editor(0)
+ , current_visible_sync_position(0.0)
+ , valid(false)
+ , _enable_display(false)
+ , _pixel_width(1.0)
+ , in_destructor(false)
+ , wait_for_data(false)
+ , _time_converter(r->session(), r->position())
{
}
RegionView::RegionView (const RegionView& other)
: TimeAxisViewItem (other)
+ , _time_converter(other._time_converter)
{
/* derived concrete type will call init () */
@@ -96,6 +96,7 @@ RegionView::RegionView (const RegionView& other)
RegionView::RegionView (const RegionView& other, boost::shared_ptr<Region> other_region)
: TimeAxisViewItem (other)
+ , _time_converter(other._time_converter)
{
/* this is a pseudo-copy constructor used when dragging regions
around on the canvas.
@@ -128,6 +129,7 @@ RegionView::RegionView (ArdourCanvas::Group* parent,
, _pixel_width(1.0)
, in_destructor(false)
, wait_for_data(false)
+ , _time_converter(r->session(), r->position())
{
}
@@ -246,6 +248,7 @@ RegionView::region_resized (Change what_changed)
if (what_changed & ARDOUR::PositionChanged) {
set_position (_region->position(), 0);
+ _time_converter.set_origin(_region->position());
}
if (what_changed & Change (StartChanged|LengthChanged)) {