fix event handling/routing from MidiView up to EditingContext
in particular, rename MidiView::canvas_group_event() to avoid confusion with TimeAxisViewItem::canvas_group_event() since a MidiRegionView inherits from both these classes.
This commit is contained in:
@@ -272,6 +272,7 @@ class EditingContext : public ARDOUR::SessionHandlePtr, public AxisViewProvider
|
||||
virtual bool canvas_control_point_event (GdkEvent* event, ArdourCanvas::Item*, ControlPoint*) = 0;
|
||||
virtual bool canvas_cue_start_event (GdkEvent* event, ArdourCanvas::Item*) { return true; }
|
||||
virtual bool canvas_cue_end_event (GdkEvent* event, ArdourCanvas::Item*) { return true; }
|
||||
virtual bool canvas_bg_event (GdkEvent* event, ArdourCanvas::Item*) { return true; }
|
||||
|
||||
Temporal::Beats get_grid_type_as_beats (bool& success, Temporal::timepos_t const & position) const;
|
||||
Temporal::Beats get_draw_length_as_beats (bool& success, Temporal::timepos_t const & position) const;
|
||||
|
||||
@@ -518,6 +518,12 @@ MidiCueEditor::current_page_samples() const
|
||||
return (samplecnt_t) _visible_canvas_width* samples_per_pixel;
|
||||
}
|
||||
|
||||
bool
|
||||
MidiCueEditor::canvas_bg_event (GdkEvent* event, ArdourCanvas::Item* item)
|
||||
{
|
||||
return typed_event (item, event, RegionItem);
|
||||
}
|
||||
|
||||
bool
|
||||
MidiCueEditor::canvas_control_point_event (GdkEvent* event, ArdourCanvas::Item* item, ControlPoint* cp)
|
||||
{
|
||||
|
||||
@@ -72,6 +72,7 @@ class MidiCueEditor : public CueEditor
|
||||
bool canvas_control_point_event (GdkEvent* event, ArdourCanvas::Item*, ControlPoint*);
|
||||
bool canvas_cue_start_event (GdkEvent* event, ArdourCanvas::Item*);
|
||||
bool canvas_cue_end_event (GdkEvent* event, ArdourCanvas::Item*);
|
||||
bool canvas_bg_event (GdkEvent* event, ArdourCanvas::Item*);
|
||||
|
||||
int32_t get_grid_beat_divisions (Editing::GridType gt) const { return 1; }
|
||||
int32_t get_grid_music_divisions (Editing::GridType gt, uint32_t event_state) const { return 1; }
|
||||
|
||||
@@ -69,7 +69,7 @@ MidiCueView::MidiCueView (std::shared_ptr<ARDOUR::MidiTrack> mt,
|
||||
event_rect->set_outline (false);
|
||||
CANVAS_DEBUG_NAME (event_rect, "cue event rect");
|
||||
|
||||
parent.Event.connect (sigc::mem_fun (*this, &MidiView::canvas_group_event));
|
||||
event_rect->Event.connect (sigc::mem_fun (*this, &MidiCueView::midi_canvas_group_event));
|
||||
|
||||
_note_group->raise_to_top ();
|
||||
|
||||
@@ -87,6 +87,14 @@ MidiCueView::~MidiCueView ()
|
||||
delete velocity_display;
|
||||
}
|
||||
|
||||
bool
|
||||
MidiCueView::midi_canvas_group_event (GdkEvent* ev)
|
||||
{
|
||||
MidiView::midi_canvas_group_event (ev);
|
||||
|
||||
_editing_context.canvas_bg_event (ev, event_rect);
|
||||
}
|
||||
|
||||
void
|
||||
MidiCueView::set_height (double h)
|
||||
{
|
||||
|
||||
@@ -123,4 +123,6 @@ class MidiCueView : public MidiView
|
||||
|
||||
bool internal_set_active_automation (Evoral::Parameter const &);
|
||||
void unset_active_automation ();
|
||||
|
||||
bool midi_canvas_group_event (GdkEvent*);
|
||||
};
|
||||
|
||||
@@ -308,7 +308,7 @@ MidiRegionView::canvas_group_event(GdkEvent* ev)
|
||||
return RegionView::canvas_group_event (ev);
|
||||
}
|
||||
|
||||
return MidiView::canvas_group_event (ev);
|
||||
return MidiView::midi_canvas_group_event (ev);
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
@@ -369,7 +369,7 @@ MidiView::set_model (std::shared_ptr<MidiModel> m)
|
||||
}
|
||||
|
||||
bool
|
||||
MidiView::canvas_group_event (GdkEvent* ev)
|
||||
MidiView::midi_canvas_group_event (GdkEvent* ev)
|
||||
{
|
||||
//For now, move the snapped cursor aside so it doesn't bother you during internal editing
|
||||
//_editing_context.set_snapped_cursor_position(_midi_region->position());
|
||||
|
||||
@@ -374,7 +374,7 @@ class MidiView : public virtual sigc::trackable, public LineMerger
|
||||
void show_start (bool yn);
|
||||
void show_end (bool yn);
|
||||
|
||||
virtual bool canvas_group_event(GdkEvent* ev);
|
||||
virtual bool midi_canvas_group_event(GdkEvent* ev);
|
||||
|
||||
protected:
|
||||
void init (std::shared_ptr<ARDOUR::MidiTrack>);
|
||||
|
||||
Reference in New Issue
Block a user