#include "ardour/midi_source.h"
#include "ardour/midi_state_tracker.h"
#include "ardour/session.h"
-#include "ardour/smf_source.h"
#include "ardour/types.h"
#include "i18n.h"
unsigned int note;
XMLProperty* prop;
unsigned int channel;
- unsigned int time;
- unsigned int length;
+ MidiModel::TimeType time;
+ MidiModel::TimeType length;
unsigned int velocity;
gint id;
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
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) {