fix one of 3 editing context refactoring warnings

This commit is contained in:
Paul Davis 2025-07-11 13:27:55 -06:00
parent 854e999436
commit ff988eec37
4 changed files with 21 additions and 10 deletions

View file

@ -759,3 +759,21 @@ MidiRegionView::trim_front_ending ()
midi_region()->fix_negative_start (_editing_context.history());
}
}
bool
MidiRegionView::post_paste (Temporal::timepos_t const & pos, const ::Selection& selection, PasteContext& ctx)
{
// Paste control points to automation children, if available
typedef RouteTimeAxisView::AutomationTracks ATracks;
ATracks const & atracks = dynamic_cast<StripableTimeAxisView*>(&trackview)->automation_tracks();
bool commit = false;
for (auto & at : atracks) {
if (at.second->paste(pos, selection, ctx)) {
commit = true;
}
}
return commit;
}

View file

@ -149,6 +149,7 @@ public:
void region_resized (const PBD::PropertyChange&);
bool canvas_group_event (GdkEvent*);
void add_control_points_to_selection (Temporal::timepos_t const &, Temporal::timepos_t const &, double y0, double y1);
bool post_paste (Temporal::timepos_t const & pos, const ::Selection& selection, PasteContext& ctx);
private:

View file

@ -4167,16 +4167,7 @@ MidiView::paste (timepos_t const & pos, const ::Selection& selection, PasteConte
paste_internal (pos, ctx.count, ctx.times, **m);
}
#warning paul fix MRV/MV
#if 0
// Paste control points to automation children, if available
for (auto & at : midi_view()->automation_tracks()) {
if (at.second->paste(pos, selection, ctx)) {
commit = true;
}
}
#endif
return commit;
return post_paste (pos, selection, ctx) || commit;
}
/** undo commands were initiated at the 'action' level. ::paste and ::paste_internal should implement subcommands */

View file

@ -695,6 +695,7 @@ class MidiView : public virtual sigc::trackable, public LineMerger
virtual void add_control_points_to_selection (Temporal::timepos_t const &, Temporal::timepos_t const &, double y0, double y1) {}
void color_note (NoteBase*, int channel);
virtual bool post_paste (Temporal::timepos_t const & pos, const ::Selection& selection, PasteContext& ctx) { return false; }
};