13
0

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
This commit is contained in:
Carl Hetherington 2011-12-27 00:22:21 +00:00
parent 75a3964c10
commit d771ca6b0e

View File

@ -1868,7 +1868,7 @@ MidiModel::midi_source ()
return _midi_source.lock (); 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. * Adds commands to the session's current undo stack to reflect the movements.
*/ */
void void
@ -1889,6 +1889,18 @@ MidiModel::insert_silence_at_start (TimeType t)
apply_command_as_subcommand (s->session(), c); 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 */ /* Controllers */
for (Controls::iterator i = controls().begin(); i != controls().end(); ++i) { for (Controls::iterator i = controls().begin(); i != controls().end(); ++i) {