From d8d737adc4408fd731254aa7e5e09b262358be68 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Mon, 20 Jan 2020 16:03:22 -0600 Subject: Make it more obvious when a track is Inactive Inactive tracks will now hide all controls and display only the track name in parenthesis. Color-change is not sufficient by itself to distinguish an inactive track from an active one (consider the case of just 2 tracks...) --- gtk2_ardour/audio_time_axis.cc | 9 +++++++++ gtk2_ardour/axis_view.h | 4 ++++ gtk2_ardour/midi_time_axis.cc | 9 +++++++++ gtk2_ardour/route_time_axis.cc | 4 ++++ gtk2_ardour/time_axis_view.cc | 8 ++++++++ 5 files changed, 34 insertions(+) diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc index 61c7b25cfc..1e56fbc312 100644 --- a/gtk2_ardour/audio_time_axis.cc +++ b/gtk2_ardour/audio_time_axis.cc @@ -290,6 +290,15 @@ void AudioTimeAxisView::route_active_changed () { update_control_names (); + + if (!_route->active()) { + controls_table.hide(); + inactive_table.show_all(); + RouteTimeAxisView::hide_all_automation(); + } else { + inactive_table.hide(); + controls_table.show(); + } } void diff --git a/gtk2_ardour/axis_view.h b/gtk2_ardour/axis_view.h index 3c72a78c84..3a3d901317 100644 --- a/gtk2_ardour/axis_view.h +++ b/gtk2_ardour/axis_view.h @@ -28,6 +28,7 @@ #include #include +#include #include #include "pbd/xml++.h" @@ -123,6 +124,9 @@ protected: Gtk::Label name_label; + Gtk::Label inactive_label; + Gtk::Table inactive_table; + mutable boost::unordered_map property_hashtable; }; /* class AxisView */ diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 888bf3ee02..8b8fadfbed 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -1361,6 +1361,15 @@ MidiTimeAxisView::route_active_changed () { RouteUI::route_active_changed (); update_control_names(); + + if (!_route->active()) { + controls_table.hide(); + inactive_table.show_all(); + RouteTimeAxisView::hide_all_automation(); + } else { + inactive_table.hide(); + controls_table.show(); + } } void diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 8c659c6c3e..db5edd27d8 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -288,6 +288,7 @@ RouteTimeAxisView::set_route (boost::shared_ptr rt) } update_track_number_visibility(); + route_active_changed(); label_view (); if (ARDOUR::Profile->get_mixbus()) { @@ -424,6 +425,9 @@ RouteTimeAxisView::label_view () if (x != name_label.get_text ()) { name_label.set_text (x); } + + inactive_label.set_text (string_compose("(%1)", x)); + const int64_t track_number = _route->track_number (); if (track_number == 0) { number_label.set_text (""); diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 6ae0c3c5b8..f5b3cce11f 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -158,6 +158,10 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie name_label.set_width_chars (12); set_tooltip (name_label, _("Track/Bus name (double click to edit)")); + inactive_label.set_name (X_("TrackNameEditor")); + inactive_label.set_alignment (0.0, 0.5); + set_tooltip (inactive_label, _("This track is inactive. (right-click to activate)")); + { boost::scoped_ptr an_entry (new FocusEntry); an_entry->set_name (X_("TrackNameEditor")); @@ -185,6 +189,10 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie controls_table.show_all (); controls_table.set_no_show_all (); + inactive_table.set_border_width (4); //try to match the offset of the label on an "active" track + inactive_table.attach (inactive_label, 0, 1, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 0, 0); + controls_vbox.pack_start (inactive_table, false, false); + controls_vbox.pack_start (controls_table, false, false); controls_vbox.show (); -- cgit v1.2.3