From 35da261f8c056eb6032a14ede7d3b9198c77e902 Mon Sep 17 00:00:00 2001 From: itmuckel Date: Wed, 25 May 2022 22:06:29 +0200 Subject: [PATCH 1/2] Remove unused includes --- gtk2_ardour/ardour_ui.cc | 31 ------------------------------ gtk2_ardour/editor_audiotrack.cc | 4 ---- gtk2_ardour/editor_group_tabs.cc | 4 ---- gtk2_ardour/editor_ops.cc | 6 ------ gtk2_ardour/editor_route_groups.cc | 10 ---------- gtk2_ardour/editor_summary.cc | 3 --- gtk2_ardour/midi_region_view.cc | 4 ---- gtk2_ardour/midi_time_axis.h | 4 +--- gtk2_ardour/route_time_axis.cc | 5 ----- gtk2_ardour/route_time_axis.h | 1 - gtk2_ardour/route_ui.cc | 5 ----- gtk2_ardour/streamview.cc | 3 --- 12 files changed, 1 insertion(+), 79 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 908b2dfa616..1bc23832ef8 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -39,14 +39,9 @@ #include #include #include -#include #include -#ifndef PLATFORM_WINDOWS -#include -#endif - #ifdef __FreeBSD__ #include #include @@ -54,7 +49,6 @@ #include #include -#include #include #include @@ -67,26 +61,18 @@ #include #include "pbd/error.h" -#include "pbd/basename.h" #include "pbd/compose.h" #include "pbd/convert.h" #include "pbd/failed_constructor.h" -#include "pbd/file_archive.h" -#include "pbd/enumwriter.h" #include "pbd/memento_command.h" #include "pbd/openuri.h" -#include "pbd/stl_delete.h" #include "pbd/types_convert.h" -#include "pbd/unwind.h" #include "pbd/file_utils.h" -#include "pbd/localtime_r.h" #include "pbd/pthread_utils.h" #include "pbd/replace_all.h" #include "pbd/scoped_file_descriptor.h" #include "pbd/xml++.h" -#include "temporal/tempo.h" - #include "gtkmm2ext/application.h" #include "gtkmm2ext/bindings.h" #include "gtkmm2ext/gtk_ui.h" @@ -102,30 +88,22 @@ #include "ardour/audio_track.h" #include "ardour/audioengine.h" #include "ardour/audiofilesource.h" -#include "ardour/automation_watch.h" #include "ardour/disk_reader.h" #include "ardour/disk_writer.h" -#include "ardour/filename_extensions.h" #include "ardour/filesystem_paths.h" -#include "ardour/ltc_file_reader.h" #include "ardour/monitor_control.h" #include "ardour/midi_track.h" #include "ardour/port.h" #include "ardour/plugin_manager.h" #include "ardour/process_thread.h" #include "ardour/profile.h" -#include "ardour/recent_sessions.h" -#include "ardour/record_enable_control.h" #include "ardour/revision.h" #include "ardour/session_directory.h" #include "ardour/session_route.h" -#include "ardour/session_state_utils.h" -#include "ardour/session_utils.h" #include "ardour/source_factory.h" #include "ardour/transport_master.h" #include "ardour/transport_master_manager.h" #include "ardour/triggerbox.h" -#include "ardour/system_exec.h" #include "ardour/track.h" #include "ardour/vca_manager.h" #include "ardour/utils.h" @@ -147,11 +125,9 @@ #include "temporal/time.h" #include "about.h" -#include "editing.h" #include "enums_convert.h" #include "actions.h" #include "add_route_dialog.h" -#include "ambiguous_file_dialog.h" #include "ardour_message.h" #include "ardour_ui.h" #include "audio_clock.h" @@ -164,7 +140,6 @@ #include "debug.h" #include "engine_dialog.h" #include "export_video_dialog.h" -#include "gain_meter.h" #include "global_port_matrix.h" #include "gui_object.h" #include "gui_thread.h" @@ -176,15 +151,12 @@ #include "lua_script_manager.h" #include "luawindow.h" #include "main_clock.h" -#include "missing_file_dialog.h" #include "missing_plugin_dialog.h" #include "mixer_ui.h" #include "meterbridge.h" -#include "meter_patterns.h" #include "mouse_cursors.h" #include "nsm.h" #include "opts.h" -#include "pingback.h" #include "plugin_dspload_window.h" #include "plugin_manager_ui.h" #include "processor_box.h" @@ -210,11 +182,8 @@ #include "trigger_page.h" #include "triggerbox_ui.h" #include "utils.h" -#include "utils_videotl.h" -#include "video_server_dialog.h" #include "virtual_keyboard_window.h" #include "add_video_dialog.h" -#include "transcode_video_dialog.h" #include "plugin_selector.h" #include "pbd/i18n.h" diff --git a/gtk2_ardour/editor_audiotrack.cc b/gtk2_ardour/editor_audiotrack.cc index 1b6df99fba8..8abf08142b9 100644 --- a/gtk2_ardour/editor_audiotrack.cc +++ b/gtk2_ardour/editor_audiotrack.cc @@ -18,13 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "ardour/rc_configuration.h" - #include "canvas/canvas.h" #include "editor.h" -#include "editing.h" -#include "audio_time_axis.h" #include "route_time_axis.h" #include "audio_region_view.h" #include "selection.h" diff --git a/gtk2_ardour/editor_group_tabs.cc b/gtk2_ardour/editor_group_tabs.cc index ee5d75316fa..08e29a145df 100644 --- a/gtk2_ardour/editor_group_tabs.cc +++ b/gtk2_ardour/editor_group_tabs.cc @@ -19,8 +19,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "gtkmm2ext/utils.h" - #include "ardour/route_group.h" #include "gtkmm2ext/colors.h" @@ -29,10 +27,8 @@ #include "editor_group_tabs.h" #include "editor_route_groups.h" #include "editor_routes.h" -#include "rgb_macros.h" #include "route_time_axis.h" #include "ui_config.h" -#include "utils.h" #include "pbd/i18n.h" diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 0b88b7bb76a..2b00947ac39 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -35,7 +35,6 @@ #include #include #include -#include #include #include @@ -84,15 +83,12 @@ #include "ardour/triggerbox.h" #include "ardour/vca_manager.h" -#include "canvas/canvas.h" - #include "actions.h" #include "ardour_message.h" #include "ardour_ui.h" #include "audio_region_view.h" #include "audio_streamview.h" #include "audio_time_axis.h" -#include "automation_region_view.h" #include "automation_time_axis.h" #include "control_point.h" #include "debug.h" @@ -111,14 +107,12 @@ #include "midi_region_view.h" #include "mixer_ui.h" #include "mixer_strip.h" -#include "mouse_cursors.h" #include "normalize_dialog.h" #include "note.h" #include "paste_context.h" #include "patch_change_dialog.h" #include "quantize_dialog.h" #include "region_gain_line.h" -#include "rgb_macros.h" #include "route_time_axis.h" #include "selection.h" #include "selection_templates.h" diff --git a/gtk2_ardour/editor_route_groups.cc b/gtk2_ardour/editor_route_groups.cc index 4c0f5c37200..a19c6ff5523 100644 --- a/gtk2_ardour/editor_route_groups.cc +++ b/gtk2_ardour/editor_route_groups.cc @@ -19,14 +19,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifdef WAF_BUILD -#include "gtk2ardour-config.h" -#endif - #include -#include - -#include "fix_carbon.h" #include @@ -36,7 +29,6 @@ #include "widgets/tooltips.h" #include "ardour/route_group.h" -#include "ardour/route.h" #include "ardour/session.h" #include "ardour_ui.h" @@ -46,9 +38,7 @@ #include "editor_routes.h" #include "gui_thread.h" #include "keyboard.h" -#include "marker.h" #include "route_group_dialog.h" -#include "route_time_axis.h" #include "time_axis_view.h" #include "utils.h" diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc index 388ea16391e..c3495e96d8d 100644 --- a/gtk2_ardour/editor_summary.cc +++ b/gtk2_ardour/editor_summary.cc @@ -25,13 +25,10 @@ #include "ardour/session.h" -#include "canvas/debug.h" - #include #include #include "context_menu_helper.h" -#include "time_axis_view.h" #include "streamview.h" #include "editor_summary.h" #include "gui_thread.h" diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 8f57b6db06a..ce572d19ed0 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -37,9 +37,7 @@ #include "midi++/midnam_patch.h" -#include "pbd/memento_command.h" #include "pbd/stateful_diff_command.h" -#include "pbd/stacktrace.h" #include "pbd/unwind.h" #include "ardour/debug.h" @@ -57,7 +55,6 @@ #include "evoral/midi_util.h" #include "canvas/debug.h" -#include "canvas/text.h" #include "automation_region_view.h" #include "automation_time_axis.h" @@ -77,7 +74,6 @@ #include "midi_time_axis.h" #include "midi_util.h" #include "midi_velocity_dialog.h" -#include "mouse_cursors.h" #include "note_player.h" #include "paste_context.h" #include "public_editor.h" diff --git a/gtk2_ardour/midi_time_axis.h b/gtk2_ardour/midi_time_axis.h index e993d39a450..b0ae8a529d1 100644 --- a/gtk2_ardour/midi_time_axis.h +++ b/gtk2_ardour/midi_time_axis.h @@ -45,13 +45,11 @@ #include "route_time_axis.h" #include "midi_streamview.h" -namespace MIDI { -namespace Name { +namespace MIDI::Name { class MasterDeviceNames; class CustomDeviceMode; struct PatchPrimaryKey; } -} namespace ARDOUR { class Session; diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index d6ac9fa5167..dbd12195d6e 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -27,7 +27,6 @@ */ #include -#include #include #include @@ -43,9 +42,7 @@ #include #include "pbd/error.h" -#include "pbd/stl_delete.h" #include "pbd/whitespace.h" -#include "pbd/memento_command.h" #include "pbd/enumwriter.h" #include "pbd/stateful_diff_command.h" @@ -53,7 +50,6 @@ #include "ardour/amp.h" #include "ardour/meter.h" -#include "ardour/event_type_map.h" #include "ardour/pannable.h" #include "ardour/panner.h" #include "ardour/plugin_insert.h" @@ -87,7 +83,6 @@ #include "point_selection.h" #include "public_editor.h" #include "region_view.h" -#include "rgb_macros.h" #include "selection.h" #include "streamview.h" #include "ui_config.h" diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h index ecf22c20e09..fdf30cc5c73 100644 --- a/gtk2_ardour/route_time_axis.h +++ b/gtk2_ardour/route_time_axis.h @@ -70,7 +70,6 @@ class RegionSelection; class Selectable; class AutomationTimeAxisView; class AutomationLine; -class ProcessorAutomationLine; class TimeSelection; class RouteGroupMenu; class ItemCounts; diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index fcaf231b885..40e3450ea01 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -32,7 +32,6 @@ #include -#include "pbd/memento_command.h" #include "pbd/controllable.h" #include "pbd/enumwriter.h" @@ -61,22 +60,18 @@ #include "gtkmm2ext/gtk_ui.h" #include "gtkmm2ext/doi.h" -#include "gtkmm2ext/gtk_ui.h" #include "gtkmm2ext/utils.h" #include "widgets/ardour_button.h" #include "widgets/binding_proxy.h" #include "widgets/prompter.h" -#include "ardour_dialog.h" #include "ardour_ui.h" -#include "automation_time_axis.h" #include "editor.h" #include "group_tabs.h" #include "gui_object.h" #include "gui_thread.h" #include "keyboard.h" -#include "latency_gui.h" #include "mixer_strip.h" #include "mixer_ui.h" #include "patch_change_widget.h" diff --git a/gtk2_ardour/streamview.cc b/gtk2_ardour/streamview.cc index 1847c993c41..fd607c7b559 100644 --- a/gtk2_ardour/streamview.cc +++ b/gtk2_ardour/streamview.cc @@ -31,10 +31,8 @@ #include #include -#include "ardour/playlist.h" #include "ardour/region.h" #include "ardour/track.h" -#include "ardour/session.h" #include "pbd/compose.h" @@ -48,7 +46,6 @@ #include "selection.h" #include "public_editor.h" #include "timers.h" -#include "rgb_macros.h" #include "gui_thread.h" #include "ui_config.h" #include "utils.h" From 190017245e622c9ac164d93a428e980efd3e7427 Mon Sep 17 00:00:00 2001 From: itmuckel Date: Fri, 27 May 2022 13:45:49 +0200 Subject: [PATCH 2/2] Repurpose track numbers as color bars --- gtk2_ardour/mixer_strip.cc | 1 - gtk2_ardour/route_time_axis.cc | 62 ++++++++++++++++------------------ gtk2_ardour/route_time_axis.h | 1 - 3 files changed, 30 insertions(+), 34 deletions(-) diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 79d38c786ea..fcfb45fdb6d 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -2045,7 +2045,6 @@ MixerStrip::set_meter_type (MeterType t) void MixerStrip::update_track_number_visibility () { - DisplaySuspender ds; bool show_label = _session->config.get_track_name_number(); if (_route && _route->is_master()) { diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index dbd12195d6e..b978922dadd 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -105,26 +105,27 @@ sigc::signal RouteTimeAxisView::signal_ctrl_touched; RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session* sess, ArdourCanvas::Canvas& canvas) : RouteUI(sess) , StripableTimeAxisView(ed, sess, canvas) - , _view (0) + , _view (nullptr) , button_table (3, 3) , route_group_button (S_("RTAV|G")) , playlist_button (S_("RTAV|P")) , automation_button (S_("RTAV|A")) - , automation_action_menu (0) - , plugins_submenu_item (0) - , route_group_menu (0) - , overlaid_menu_item (0) - , stacked_menu_item (0) + , automation_action_menu (nullptr) + , route_group_menu (nullptr) + , overlaid_menu_item (nullptr) + , stacked_menu_item (nullptr) , gm (sess, true, 75, 14) , _ignore_set_layer_display (false) - , pan_automation_item(NULL) + , pan_automation_item(nullptr) { subplugin_menu.set_name ("ArdourContextMenu"); number_label.set_name("tracknumber label"); - number_label.set_elements((ArdourButton::Element)(ArdourButton::Edge|ArdourButton::Body|ArdourButton::Text|ArdourButton::Inactive)); + number_label.set_elements((ArdourButton::Element)(ArdourButton::Body|ArdourButton::Text|ArdourButton::Inactive)); number_label.set_alignment(.5, .5); number_label.set_fallthrough_to_parent (true); + name_label.set_padding (2, 0); + sess->config.ParameterChanged.connect (*this, invalidator (*this), boost::bind (&RouteTimeAxisView::parameter_changed, this, _1), gui_context()); UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &RouteTimeAxisView::parameter_changed)); @@ -258,7 +259,7 @@ RouteTimeAxisView::set_route (boost::shared_ptr rt) controls_table.attach (gm.get_gain_slider(), 3, 5, 2, 3, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 1, 0); } else { controls_table.attach (route_group_button, 4, 5, 2, 3, Gtk::SHRINK, Gtk::SHRINK, 0, 0); - controls_table.attach (gm.get_gain_slider(), 0, 2, 2, 3, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 1, 0); + controls_table.attach (gm.get_gain_slider(), 2, 2, 2, 3, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 1, 0); } set_tooltip(*solo_button,_("Solo")); @@ -434,7 +435,8 @@ RouteTimeAxisView::label_view () inactive_label.show (); const int64_t track_number = _route->track_number (); - if (track_number == 0) { + bool show_label = _session->config.get_track_name_number(); + if (track_number == 0 || !show_label) { number_label.set_text (""); } else { number_label.set_text (PBD::to_string (abs(_route->track_number ()))); @@ -444,34 +446,30 @@ RouteTimeAxisView::label_view () void RouteTimeAxisView::update_track_number_visibility () { - DisplaySuspender ds; - bool show_label = _session->config.get_track_name_number(); - - if (_route && _route->is_master()) { - show_label = false; - } - if (number_label.get_parent()) { number_label.get_parent()->remove (number_label); } + + if (!_route->active ()) { + inactive_table.attach (number_label, 0, 1, 0, 3, Gtk::SHRINK, Gtk::EXPAND | Gtk::FILL, 1, 0); + } else if (ARDOUR::Profile->get_mixbus ()) { + controls_table.attach (number_label, 3, 4, 0, 1, Gtk::SHRINK, Gtk::EXPAND | Gtk::FILL, 1, 0); + } else { + controls_table.attach (number_label, 0, 1, 0, 3, Gtk::SHRINK, Gtk::FILL, 1, 0); + } + + // see ArdourButton::on_size_request(), we should probably use a global size-group here instead. + // except the width of the number label is subtracted from the name-hbox, so we + // need to explicitly calculate it anyway until the name-label & entry become ArdourWidgets. + bool show_label = _session->config.get_track_name_number(); if (show_label) { - if (!_route->active()) { - inactive_table.attach (number_label, 0, 1, 0, 1, Gtk::SHRINK, Gtk::EXPAND|Gtk::FILL, 1, 0); - } else if (ARDOUR::Profile->get_mixbus()) { - controls_table.attach (number_label, 3, 4, 0, 1, Gtk::SHRINK, Gtk::EXPAND|Gtk::FILL, 1, 0); - } else { - controls_table.attach (number_label, 0, 1, 0, 1, Gtk::SHRINK, Gtk::EXPAND|Gtk::FILL, 1, 0); - } - // see ArdourButton::on_size_request(), we should probably use a global size-group here instead. - // except the width of the number label is subtracted from the name-hbox, so we - // need to explicitly calculate it anyway until the name-label & entry become ArdourWidgets. - int tnw = (2 + std::max(2u, _session->track_number_decimals())) * number_label.char_pixel_width(); - if (tnw & 1) --tnw; - number_label.set_size_request(tnw, -1); - number_label.show (); + number_label.set_size_request (static_cast(15 * UIConfiguration::instance().get_ui_scale()), -1); } else { - number_label.hide (); + number_label.set_size_request (static_cast(3 * UIConfiguration::instance().get_ui_scale()), -1); } + number_label.show (); + + label_view (); } void diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h index fdf30cc5c73..e094fdb1475 100644 --- a/gtk2_ardour/route_time_axis.h +++ b/gtk2_ardour/route_time_axis.h @@ -260,7 +260,6 @@ class RouteTimeAxisView : public RouteUI, public StripableTimeAxisView Gtk::Menu subplugin_menu; Gtk::Menu* automation_action_menu; - Gtk::MenuItem* plugins_submenu_item; RouteGroupMenu* route_group_menu; Gtk::MenuItem* overlaid_menu_item; Gtk::MenuItem* stacked_menu_item;