summaryrefslogtreecommitdiff
path: root/libs/ardour/midi_model.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-12-27 00:22:21 +0000
committerCarl Hetherington <carl@carlh.net>2011-12-27 00:22:21 +0000
commitd771ca6b0e67d54d96378b69480e7dd291a73dc3 (patch)
tree214dce0795082f0a9bf54d27573461d44d86a4b1 /libs/ardour/midi_model.cc
parent75a3964c1073832249d1d8776f46fedbd9f97035 (diff)
Move patch changes when inserting silence at the start of a model.
git-svn-id: svn://localhost/ardour2/branches/3.0@11084 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/midi_model.cc')
-rw-r--r--libs/ardour/midi_model.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/libs/ardour/midi_model.cc b/libs/ardour/midi_model.cc
index e6ff05c7b7..40d2f600c8 100644
--- a/libs/ardour/midi_model.cc
+++ b/libs/ardour/midi_model.cc
@@ -1868,7 +1868,7 @@ MidiModel::midi_source ()
return _midi_source.lock ();
}
-/** Moves notes, controllers and sys-ex to insert silence at the start of the model.
+/** Moves notes, patch changes, controllers and sys-ex to insert silence at the start of the model.
* Adds commands to the session's current undo stack to reflect the movements.
*/
void
@@ -1889,6 +1889,18 @@ MidiModel::insert_silence_at_start (TimeType t)
apply_command_as_subcommand (s->session(), c);
}
+ /* Patch changes */
+
+ if (!patch_changes().empty ()) {
+ PatchChangeDiffCommand* c = new_patch_change_diff_command ("insert silence");
+
+ for (PatchChanges::const_iterator i = patch_changes().begin(); i != patch_changes().end(); ++i) {
+ c->change_time (*i, (*i)->time() + t);
+ }
+
+ apply_command_as_subcommand (s->session(), c);
+ }
+
/* Controllers */
for (Controls::iterator i = controls().begin(); i != controls().end(); ++i) {