From f3e5c7531e3ea4cae9d66efe67945b0cd1ea36f3 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 16 Mar 2025 14:49:10 -0600 Subject: [PATCH] remove one #warning (of several left from the pianorule refactoring) --- gtk2_ardour/note_base.cc | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/gtk2_ardour/note_base.cc b/gtk2_ardour/note_base.cc index eb9af11836..7bbb38d39c 100644 --- a/gtk2_ardour/note_base.cc +++ b/gtk2_ardour/note_base.cc @@ -32,6 +32,7 @@ #include "editing_syms.inc.h" #include "keyboard.h" #include "midi_view.h" +#include "time_axis_view.h" /* clang-format off */ // Include last, when GRIDTYPE has been defined by editing.h via midi_region_view.h @@ -291,19 +292,17 @@ NoteBase::event_handler (GdkEvent* ev) return false; } -#warning paul fix this pianorule issue -#if 0 - /* notebase has a MidiView not a RegionView so get_time_axis_view() Is - missing etc. - */ - if (_region.get_time_axis_view ().layer_display () == Stacked) { - /* only allow edting notes in the topmost layer */ - if (_region.region()->layer() != _region.region()->playlist()->top_layer ()) { - /* this stll allows the draw tool to work, and edit cursor is updated */ - return false; + RegionView* rv; + if ((rv = dynamic_cast (&_region))) { + if (rv->get_time_axis_view ().layer_display () == Stacked) { + /* only allow edting notes in the topmost layer */ + if (rv->region()->layer() != rv->region()->playlist()->top_layer ()) { + /* this stll allows the draw tool to work, and edit cursor is updated */ + return false; + } } } -#endif + switch (ev->type) { case GDK_ENTER_NOTIFY: _region.note_entered (this);