diff options
author | nick_m <mainsbridge@gmail.com> | 2016-06-07 06:12:41 +1000 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-06-07 06:12:41 +1000 |
commit | 86db26ff1635fad436945a2b7b6ce69a823bc7ca (patch) | |
tree | f99df56160b0e74739814ad47dc5fb76a4e8b22b /libs | |
parent | 9488201a2c08eaa66ef97c2f55d91166beac1dfb (diff) |
MidiRegion ctor inherits length_beats.
- fixes incorrect length on drag-copying and pasting
midi regions.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/midi_region.cc | 8 |
1 files changed, 3 insertions, 5 deletions
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<const MidiRegion> 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<const MidiRegion> other) MidiRegion::MidiRegion (boost::shared_ptr<const MidiRegion> 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); |