From 86db26ff1635fad436945a2b7b6ce69a823bc7ca Mon Sep 17 00:00:00 2001 From: nick_m Date: Tue, 7 Jun 2016 06:12:41 +1000 Subject: MidiRegion ctor inherits length_beats. - fixes incorrect length on drag-copying and pasting midi regions. --- libs/ardour/midi_region.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'libs') diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc index 05037d4af3..5d952824ea 100644 --- a/libs/ardour/midi_region.cc +++ b/libs/ardour/midi_region.cc @@ -91,9 +91,9 @@ MidiRegion::MidiRegion (const SourceList& srcs) MidiRegion::MidiRegion (boost::shared_ptr other) : Region (other) , _start_beats (Properties::start_beats, other->_start_beats) - , _length_beats (Properties::length_beats, Evoral::Beats()) + , _length_beats (Properties::length_beats, other->_length_beats) { - update_length_beats (); + //update_length_beats (); register_properties (); assert(_name.val().find("/") == string::npos); @@ -105,14 +105,12 @@ MidiRegion::MidiRegion (boost::shared_ptr other) MidiRegion::MidiRegion (boost::shared_ptr other, frameoffset_t offset) : Region (other, offset) , _start_beats (Properties::start_beats, Evoral::Beats()) - , _length_beats (Properties::length_beats, Evoral::Beats()) + , _length_beats (Properties::length_beats, other->_length_beats) { BeatsFramesConverter bfc (_session.tempo_map(), other->_position); Evoral::Beats const offset_beats = bfc.from (offset); _start_beats = other->_start_beats.val() + offset_beats; - _length_beats = Evoral::Beats (_session.tempo_map().beat_at_frame (other->length() - offset)); - register_properties (); assert(_name.val().find("/") == string::npos); -- cgit v1.2.3