From f80395fc2fbe9264daf389c591d0ef4597ef36fb Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 27 Jun 2024 16:22:27 -0600 Subject: [PATCH] use MidiModel::ContentsChanged to drive MIDI cue edit swaps (GUI version) No need for a special method called post-edit --- gtk2_ardour/midi_cue_view.cc | 8 -------- gtk2_ardour/midi_cue_view.h | 2 -- gtk2_ardour/midi_view.cc | 7 ------- gtk2_ardour/midi_view.h | 2 -- 4 files changed, 19 deletions(-) diff --git a/gtk2_ardour/midi_cue_view.cc b/gtk2_ardour/midi_cue_view.cc index 273e590a44..57c981653e 100644 --- a/gtk2_ardour/midi_cue_view.cc +++ b/gtk2_ardour/midi_cue_view.cc @@ -125,11 +125,3 @@ MidiCueView::set_samples_per_pixel (double spp) reset_width_dependent_items (_editing_context.duration_to_pixels (duration)); } -void -MidiCueView::post_edit () -{ - std::cerr << "Post-edit\n"; - std::shared_ptr tb = _midi_track->triggerbox (); - assert (tb); - std::dynamic_pointer_cast(tb->trigger (_slot_index))->edited (); -} diff --git a/gtk2_ardour/midi_cue_view.h b/gtk2_ardour/midi_cue_view.h index 802a203620..cac731bf41 100644 --- a/gtk2_ardour/midi_cue_view.h +++ b/gtk2_ardour/midi_cue_view.h @@ -55,8 +55,6 @@ class MidiCueView : public MidiView std::shared_ptr tempo_map; ArdourCanvas::Rectangle* event_rect; uint32_t _slot_index; - - void post_edit (); }; diff --git a/gtk2_ardour/midi_view.cc b/gtk2_ardour/midi_view.cc index deefbc6a2a..58dd8e5005 100644 --- a/gtk2_ardour/midi_view.cc +++ b/gtk2_ardour/midi_view.cc @@ -917,7 +917,6 @@ MidiView::apply_note_diff (bool as_subcommand, bool was_copy) if (!as_subcommand) { _editing_context.commit_reversible_command (); /*instead, we can explicitly commit the command in progress */ - post_edit (); } _note_diff_command = nullptr; @@ -2748,7 +2747,6 @@ MidiView::note_dropped (NoteBase *, timecnt_t const & d_qn, int8_t dnote, bool c apply_note_diff (true /*subcommand, we don't want this to start a new commit*/, copy); _editing_context.commit_reversible_command (); - post_edit (); // care about notes being moved beyond the upper/lower bounds on the canvas if (lowest_note_in_selection < _midi_context.lowest_note() || @@ -3246,7 +3244,6 @@ MidiView::set_velocities_for_notes (std::vector& notes, std::vectoradd_command (cmd); _editing_context.commit_reversible_command (); - post_edit (); _editing_context.session()->set_dirty (); } diff --git a/gtk2_ardour/midi_view.h b/gtk2_ardour/midi_view.h index c6c314c647..dcbc22d0cd 100644 --- a/gtk2_ardour/midi_view.h +++ b/gtk2_ardour/midi_view.h @@ -640,8 +640,6 @@ class MidiView : public virtual sigc::trackable void join_notes_on_channel (int channel); void add_split_notes (); - - virtual void post_edit () {} };