diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2019-10-18 17:21:51 -0600 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2019-11-02 16:32:18 -0600 |
commit | b83ef099475c949ae37788ccb550067674c8210f (patch) | |
tree | 2d090eac0779e4147cee87288a32971522d2627f /libs/ardour/midi_region.cc | |
parent | 6128d1759c8659f00d21a9d80bd555837bc5b4f2 (diff) |
various adjustments so that a MidiPlaylist gets re-rendered whenever it changes.
This may still be missing a few changes (i.e. they do not cause re-rendering)
Diffstat (limited to 'libs/ardour/midi_region.cc')
-rw-r--r-- | libs/ardour/midi_region.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc index d1a1f672d7..ee5d6e86df 100644 --- a/libs/ardour/midi_region.cc +++ b/libs/ardour/midi_region.cc @@ -541,7 +541,7 @@ MidiRegion::render (Evoral::EventSink<samplepos_t>& dst, dst, // destination buffer _position - _start, // start position of the source in session samples _start + internal_offset, // where to start reading in the source - max_samplecnt, + _start + internal_offset + _length, 0, cursor, 0, @@ -670,7 +670,16 @@ MidiRegion::model_changed () ); model()->ContentsShifted.connect_same_thread (_model_shift_connection, boost::bind (&MidiRegion::model_shifted, this, _1)); + model()->ContentsChanged.connect_same_thread (_model_changed_connection, boost::bind (&MidiRegion::model_contents_changed, this)); } + +void +MidiRegion::model_contents_changed () +{ + std::cerr << "MIDI Region " << name() << " contents changed\n"; + send_change (Properties::contents); +} + void MidiRegion::model_shifted (double qn_distance) { @@ -685,6 +694,7 @@ MidiRegion::model_shifted (double qn_distance) _start = new_start; what_changed.add (Properties::start); what_changed.add (Properties::start_beats); + what_changed.add (Properties::contents); send_change (what_changed); } else { _ignore_shift = false; |