summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-06-06 14:26:43 +1000
committernick_m <mainsbridge@gmail.com>2016-06-06 14:26:43 +1000
commitf0f2e3bb713287a3e170ff6e9c8feb5b1b2188ca (patch)
tree7c77ceabe2c586c03ddca97d01fa94416b0dd6a6 /libs/ardour
parent01812f53c34bf0298430da42bc636ee29dcdfd6a (diff)
Consolidate notifications when MidiRegion changes length due to position change.
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/midi_region.cc7
-rw-r--r--libs/ardour/region.cc14
2 files changed, 14 insertions, 7 deletions
diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc
index bdf24f5e08..b1c332072e 100644
--- a/libs/ardour/midi_region.cc
+++ b/libs/ardour/midi_region.cc
@@ -192,10 +192,6 @@ void
MidiRegion::set_length_internal (framecnt_t len)
{
Region::set_length_internal (len);
- /* XX this seems wrong. we asked to set the length in
- frames without requesting a new beat.
- may cause beat drift due to frame rounding.
- */
update_length_beats ();
}
@@ -229,11 +225,10 @@ MidiRegion::set_position_internal (framepos_t pos, bool allow_bbt_recompute)
Region::set_position_internal (pos, allow_bbt_recompute);
/* leave _length_beats alone, and change _length to reflect the state of things
- at the new position (tempo map may dictate a different number of frames
+ at the new position (tempo map may dictate a different number of frames).
*/
BeatsFramesConverter converter (_session.tempo_map(), _position);
Region::set_length_internal (converter.to (_length_beats));
- send_change (Properties::length);
}
framecnt_t
diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc
index 1b9793313d..105aa3af59 100644
--- a/libs/ardour/region.cc
+++ b/libs/ardour/region.cc
@@ -578,7 +578,19 @@ Region::set_position (framepos_t pos)
/* do this even if the position is the same. this helps out
a GUI that has moved its representation already.
*/
- send_change (Properties::position);
+ PropertyChange p_and_l;
+
+ p_and_l.add (Properties::position);
+ /* Currently length change due to position change is only implemented
+ for MidiRegion (Region has no length in beats).
+ Notify a length change regardless (its more efficient for MidiRegions),
+ and when Region has a _length_beats we will need it here anyway).
+ */
+ if (position_lock_style() == MusicTime) {
+ p_and_l.add (Properties::length);
+ }
+
+ send_change (p_and_l);
}