mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
midi_region_view: adopt midi_model renaming (gtk patch_change part)
* apply_diff_command_as_commit explicitly tells us we don't need the begin/commit pair here
This commit is contained in:
parent
f9d73957ce
commit
f9c9fd099d
1 changed files with 6 additions and 16 deletions
|
|
@ -2094,7 +2094,6 @@ void
|
||||||
MidiRegionView::change_patch_change (PatchChange& pc, const MIDI::Name::PatchPrimaryKey& new_patch)
|
MidiRegionView::change_patch_change (PatchChange& pc, const MIDI::Name::PatchPrimaryKey& new_patch)
|
||||||
{
|
{
|
||||||
string name = _("alter patch change");
|
string name = _("alter patch change");
|
||||||
trackview.editor().begin_reversible_command (name);
|
|
||||||
|
|
||||||
MidiModel::PatchChangeDiffCommand* c = _model->new_patch_change_diff_command (name);
|
MidiModel::PatchChangeDiffCommand* c = _model->new_patch_change_diff_command (name);
|
||||||
|
|
||||||
|
|
@ -2107,8 +2106,7 @@ MidiRegionView::change_patch_change (PatchChange& pc, const MIDI::Name::PatchPri
|
||||||
c->change_bank (pc.patch (), new_bank);
|
c->change_bank (pc.patch (), new_bank);
|
||||||
}
|
}
|
||||||
|
|
||||||
_model->apply_command (*trackview.session(), c);
|
_model->apply_diff_command_as_commit (*trackview.session(), c);
|
||||||
trackview.editor().commit_reversible_command ();
|
|
||||||
|
|
||||||
remove_canvas_patch_change (&pc);
|
remove_canvas_patch_change (&pc);
|
||||||
display_patch_changes ();
|
display_patch_changes ();
|
||||||
|
|
@ -2118,7 +2116,7 @@ void
|
||||||
MidiRegionView::change_patch_change (MidiModel::PatchChangePtr old_change, const Evoral::PatchChange<Temporal::Beats> & new_change)
|
MidiRegionView::change_patch_change (MidiModel::PatchChangePtr old_change, const Evoral::PatchChange<Temporal::Beats> & new_change)
|
||||||
{
|
{
|
||||||
string name = _("alter patch change");
|
string name = _("alter patch change");
|
||||||
trackview.editor().begin_reversible_command (name);
|
|
||||||
MidiModel::PatchChangeDiffCommand* c = _model->new_patch_change_diff_command (name);
|
MidiModel::PatchChangeDiffCommand* c = _model->new_patch_change_diff_command (name);
|
||||||
|
|
||||||
if (old_change->time() != new_change.time()) {
|
if (old_change->time() != new_change.time()) {
|
||||||
|
|
@ -2137,8 +2135,7 @@ MidiRegionView::change_patch_change (MidiModel::PatchChangePtr old_change, const
|
||||||
c->change_bank (old_change, new_change.bank());
|
c->change_bank (old_change, new_change.bank());
|
||||||
}
|
}
|
||||||
|
|
||||||
_model->apply_command (*trackview.session(), c);
|
_model->apply_diff_command_as_commit (*trackview.session(), c);
|
||||||
trackview.editor().commit_reversible_command ();
|
|
||||||
|
|
||||||
for (PatchChanges::iterator x = _patch_changes.begin(); x != _patch_changes.end(); ++x) {
|
for (PatchChanges::iterator x = _patch_changes.begin(); x != _patch_changes.end(); ++x) {
|
||||||
if (x->second->patch() == old_change) {
|
if (x->second->patch() == old_change) {
|
||||||
|
|
@ -2160,7 +2157,6 @@ MidiRegionView::add_patch_change (timecnt_t const & t, Evoral::PatchChange<Tempo
|
||||||
{
|
{
|
||||||
string name = _("add patch change");
|
string name = _("add patch change");
|
||||||
|
|
||||||
trackview.editor().begin_reversible_command (name);
|
|
||||||
MidiModel::PatchChangeDiffCommand* c = _model->new_patch_change_diff_command (name);
|
MidiModel::PatchChangeDiffCommand* c = _model->new_patch_change_diff_command (name);
|
||||||
|
|
||||||
c->add (MidiModel::PatchChangePtr (
|
c->add (MidiModel::PatchChangePtr (
|
||||||
|
|
@ -2168,8 +2164,7 @@ MidiRegionView::add_patch_change (timecnt_t const & t, Evoral::PatchChange<Tempo
|
||||||
(_region->source_relative_position (_region->position() + t).beats(),
|
(_region->source_relative_position (_region->position() + t).beats(),
|
||||||
patch.channel(), patch.program(), patch.bank())));
|
patch.channel(), patch.program(), patch.bank())));
|
||||||
|
|
||||||
_model->apply_command (*trackview.session(), c);
|
_model->apply_diff_command_as_commit (*trackview.session(), c);
|
||||||
trackview.editor().commit_reversible_command ();
|
|
||||||
|
|
||||||
display_patch_changes ();
|
display_patch_changes ();
|
||||||
}
|
}
|
||||||
|
|
@ -2177,11 +2172,9 @@ MidiRegionView::add_patch_change (timecnt_t const & t, Evoral::PatchChange<Tempo
|
||||||
void
|
void
|
||||||
MidiRegionView::move_patch_change (PatchChange& pc, Temporal::Beats t)
|
MidiRegionView::move_patch_change (PatchChange& pc, Temporal::Beats t)
|
||||||
{
|
{
|
||||||
trackview.editor().begin_reversible_command (_("move patch change"));
|
|
||||||
MidiModel::PatchChangeDiffCommand* c = _model->new_patch_change_diff_command (_("move patch change"));
|
MidiModel::PatchChangeDiffCommand* c = _model->new_patch_change_diff_command (_("move patch change"));
|
||||||
c->change_time (pc.patch (), t);
|
c->change_time (pc.patch (), t);
|
||||||
_model->apply_command (*trackview.session(), c);
|
_model->apply_diff_command_as_commit (*trackview.session(), c);
|
||||||
trackview.editor().commit_reversible_command ();
|
|
||||||
|
|
||||||
display_patch_changes ();
|
display_patch_changes ();
|
||||||
}
|
}
|
||||||
|
|
@ -2189,12 +2182,9 @@ MidiRegionView::move_patch_change (PatchChange& pc, Temporal::Beats t)
|
||||||
void
|
void
|
||||||
MidiRegionView::delete_patch_change (PatchChange* pc)
|
MidiRegionView::delete_patch_change (PatchChange* pc)
|
||||||
{
|
{
|
||||||
trackview.editor().begin_reversible_command (_("delete patch change"));
|
|
||||||
|
|
||||||
MidiModel::PatchChangeDiffCommand* c = _model->new_patch_change_diff_command (_("delete patch change"));
|
MidiModel::PatchChangeDiffCommand* c = _model->new_patch_change_diff_command (_("delete patch change"));
|
||||||
c->remove (pc->patch ());
|
c->remove (pc->patch ());
|
||||||
_model->apply_command (*trackview.session(), c);
|
_model->apply_diff_command_as_commit (*trackview.session(), c);
|
||||||
trackview.editor().commit_reversible_command ();
|
|
||||||
|
|
||||||
remove_canvas_patch_change (pc);
|
remove_canvas_patch_change (pc);
|
||||||
display_patch_changes ();
|
display_patch_changes ();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue