From e448c3f4aac203fef7880c271f97502295abfe1e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 23 Jun 2025 16:16:12 -0600 Subject: [PATCH] allow pianorolls not to show MIDI channel selector/dropdown pianorolls have the visibility channel control. at some point we want the same idea for the timeline, but it is not there yet --- gtk2_ardour/editing_context.cc | 8 +++++--- gtk2_ardour/editing_context.h | 2 +- gtk2_ardour/editor.cc | 2 +- gtk2_ardour/pianoroll.cc | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gtk2_ardour/editing_context.cc b/gtk2_ardour/editing_context.cc index 7a6bc31956..702aac7ca3 100644 --- a/gtk2_ardour/editing_context.cc +++ b/gtk2_ardour/editing_context.cc @@ -2133,15 +2133,17 @@ EditingContext::set_canvas_cursor (Gdk::Cursor* cursor) } void -EditingContext::pack_draw_box () +EditingContext::pack_draw_box (bool with_channel) { /* Draw - these MIDI tools are only visible when in Draw mode */ draw_box.set_spacing (2); draw_box.set_border_width (2); draw_box.pack_start (*manage (new Label (_("Len:"))), false, false); draw_box.pack_start (draw_length_selector, false, false, 4); - draw_box.pack_start (*manage (new Label (S_("MIDI|Ch:"))), false, false); - draw_box.pack_start (draw_channel_selector, false, false, 4); + if (with_channel) { + draw_box.pack_start (*manage (new Label (S_("MIDI|Ch:"))), false, false); + draw_box.pack_start (draw_channel_selector, false, false, 4); + } draw_box.pack_start (*manage (new Label (_("Vel:"))), false, false); draw_box.pack_start (draw_velocity_selector, false, false, 4); diff --git a/gtk2_ardour/editing_context.h b/gtk2_ardour/editing_context.h index 6a112e1463..1f87c71506 100644 --- a/gtk2_ardour/editing_context.h +++ b/gtk2_ardour/editing_context.h @@ -715,7 +715,7 @@ class EditingContext : public ARDOUR::SessionHandlePtr, public AxisViewProvider, ArdourWidgets::ArdourVSpacer _grid_box_spacer; ArdourWidgets::ArdourVSpacer _draw_box_spacer; - void pack_draw_box (); + void pack_draw_box (bool with_channel); void pack_snap_box (); Gtkmm2ext::BindingSet bindings; diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index f3b49b40ac..e996aaa477 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -2831,7 +2831,7 @@ Editor::setup_toolbar () grid_type_selector.set_name ("mouse mode button"); - pack_draw_box (); + pack_draw_box (true); HBox* follow_mode_hbox = manage (new HBox); follow_mode_hbox->set_spacing (spc ? 2 : 1); diff --git a/gtk2_ardour/pianoroll.cc b/gtk2_ardour/pianoroll.cc index cb6136b822..02dfe7dbe5 100644 --- a/gtk2_ardour/pianoroll.cc +++ b/gtk2_ardour/pianoroll.cc @@ -381,7 +381,7 @@ Pianoroll::build_upper_toolbar () mouse_mode_box->pack_start (*mouse_mode_align, false, false); pack_snap_box (); - pack_draw_box (); + pack_draw_box (false); Gtk::HBox* _toolbar_inner = manage (new Gtk::HBox); Gtk::HBox* _toolbar_outer = manage (new Gtk::HBox);