From 60628a62be550132ccd86390ffa28bafec1dc339 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 12 Jan 2023 17:07:27 -0700 Subject: [PATCH] somewhat active lollipop event handling --- gtk2_ardour/editor.h | 1 + gtk2_ardour/editor_canvas_events.cc | 7 +++++++ gtk2_ardour/editor_items.h | 1 + gtk2_ardour/enums.cc | 1 + gtk2_ardour/public_editor.h | 1 + 5 files changed, 11 insertions(+) diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 0e02fefd41..6fd6043475 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1701,6 +1701,7 @@ private: bool canvas_scroll_event (GdkEventScroll* event, bool from_canvas); bool canvas_control_point_event (GdkEvent* event,ArdourCanvas::Item*, ControlPoint*); + bool canvas_velocity_event (GdkEvent* event,ArdourCanvas::Item*); bool canvas_line_event (GdkEvent* event,ArdourCanvas::Item*, AutomationLine*); bool canvas_selection_rect_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*); bool canvas_selection_start_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*); diff --git a/gtk2_ardour/editor_canvas_events.cc b/gtk2_ardour/editor_canvas_events.cc index e45e9f8875..baa641d207 100644 --- a/gtk2_ardour/editor_canvas_events.cc +++ b/gtk2_ardour/editor_canvas_events.cc @@ -671,6 +671,13 @@ Editor::canvas_control_point_event (GdkEvent *event, ArdourCanvas::Item* item, C return typed_event (item, event, ControlPointItem); } +bool +Editor::canvas_velocity_event (GdkEvent *event, ArdourCanvas::Item* item) +{ + std::cerr << "Velocity event: " << Gtkmm2ext::event_type_string (event->type) << std::endl; + return typed_event (item, event, VelocityItem); +} + bool Editor::canvas_line_event (GdkEvent *event, ArdourCanvas::Item* item, AutomationLine* al) { diff --git a/gtk2_ardour/editor_items.h b/gtk2_ardour/editor_items.h index abe2acbe77..c8e934b99c 100644 --- a/gtk2_ardour/editor_items.h +++ b/gtk2_ardour/editor_items.h @@ -68,6 +68,7 @@ enum ItemType { SamplesRulerItem, SelectionMarkerItem, DropZoneItem, + VelocityItem, /* don't remove this */ diff --git a/gtk2_ardour/enums.cc b/gtk2_ardour/enums.cc index d1ebd8f154..fc912e4569 100644 --- a/gtk2_ardour/enums.cc +++ b/gtk2_ardour/enums.cc @@ -184,6 +184,7 @@ setup_gtk_ardour_enums () REGISTER_ENUM (MinsecRulerItem); REGISTER_ENUM (BBTRulerItem); REGISTER_ENUM (SamplesRulerItem); + REGISTER_ENUM (VelocityItem); REGISTER (item_type); REGISTER_ENUM(MouseObject); diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 5d9887aeb3..2038b4316d 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -450,6 +450,7 @@ public: virtual bool canvas_scroll_event (GdkEventScroll* event, bool from_canvas) = 0; virtual bool canvas_control_point_event (GdkEvent* event, ArdourCanvas::Item*, ControlPoint*) = 0; + virtual bool canvas_velocity_event (GdkEvent* event, ArdourCanvas::Item*) = 0; virtual bool canvas_line_event (GdkEvent* event, ArdourCanvas::Item*, AutomationLine*) = 0; virtual bool canvas_selection_rect_event (GdkEvent* event, ArdourCanvas::Item*, SelectionRect*) = 0; virtual bool canvas_selection_start_trim_event (GdkEvent* event, ArdourCanvas::Item*, SelectionRect*) = 0;