+ update_length_beats ();
+ register_properties ();
+
+ assert(_name.val().find("/") == string::npos);
+ midi_source(0)->ModelChanged.connect_same_thread (_source_connection, boost::bind (&MidiRegion::model_changed, this));
+ model_changed ();
+}
+
+/** Create a new MidiRegion that is part of an existing one */
+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())
+{
+ BeatsFramesConverter bfc (_session.tempo_map(), _position);
+ Evoral::Beats const offset_beats = bfc.from (offset);
+
+ _start_beats = other->_start_beats.val() + offset_beats;
+ _length_beats = other->_length_beats.val() - offset_beats;
+
+ register_properties ();