From 3898b5746b4198c0dc50d263f39fedbb9d0ac267 Mon Sep 17 00:00:00 2001 From: nikolay Date: Fri, 12 Sep 2014 11:37:33 +0300 Subject: [PATCH] [Summary] Reworked disable tracks rename until it is recording [Reviewed] GZharun --- gtk2_ardour/mixer_strip.cc | 20 +++++++++++--------- gtk2_ardour/mixer_strip.h | 5 ++--- gtk2_ardour/route_time_axis.cc | 19 ++++++++++--------- gtk2_ardour/route_time_axis.h | 3 ++- gtk2_ardour/route_ui.h | 2 +- 5 files changed, 26 insertions(+), 23 deletions(-) diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 8b10419c9d..7ea4103f84 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -440,9 +440,19 @@ MixerStrip::begin_name_edit () _name_entry.start_editing (0); } +void +MixerStrip::route_rec_enable_changed () +{ + RouteUI::route_rec_enable_changed (); + on_record_state_changed (); +} + void MixerStrip::on_record_state_changed () { + if ( !ARDOUR_UI::instance()->the_session() ) + return; + if ( (ARDOUR_UI::instance()->the_session()->record_status()==Session::Recording) && (_route->record_enabled()) ) end_name_edit (RESPONSE_CANCEL); } @@ -497,15 +507,7 @@ void MixerStrip::set_route (boost::shared_ptr rt) { RouteUI::set_route (rt); - - boost::shared_ptr t; - if ((t = boost::dynamic_pointer_cast(rt)) != 0) { - t->RecordEnableChanged.connect (_route_state_connections, - invalidator (*this), - boost::bind (&MixerStrip::on_record_state_changed, this), - gui_context() ); - } - + /* ProcessorBox needs access to _route so that it can read GUI object state. */ diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h index 7e47227d7d..dc03d6fbd6 100644 --- a/gtk2_ardour/mixer_strip.h +++ b/gtk2_ardour/mixer_strip.h @@ -128,6 +128,8 @@ class MixerStrip : public RouteUI static const char* XMLColor[15]; + void route_rec_enable_changed(); + protected: friend class Mixer_UI; void set_packed (bool yn); @@ -172,11 +174,8 @@ class MixerStrip : public RouteUI void selection_click (GdkEventButton* ev); WavesButton& name_button; - - PBD::ScopedConnectionList _route_state_connections; void on_record_state_changed (); - Gtk::Entry& _name_entry; void begin_name_edit (); void end_name_edit (int); diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index e003e3b4db..675c4d7abb 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -128,15 +128,6 @@ RouteTimeAxisView::set_route (boost::shared_ptr rt) disable_header_dnd (); RouteUI::set_route (rt); - - boost::shared_ptr t; - if ((t = boost::dynamic_pointer_cast(rt)) != 0) { - t->RecordEnableChanged.connect (_route_state_connections, - invalidator (*this), - boost::bind (&RouteTimeAxisView::on_record_state_changed, this), - gui_context() ); - } - CANVAS_DEBUG_NAME (_canvas_display, string_compose ("main for %1", rt->name())); CANVAS_DEBUG_NAME (selection_group, string_compose ("selections for %1", rt->name())); @@ -2710,9 +2701,19 @@ RouteTimeAxisView::control_ebox_resize_ended() } } +void +RouteTimeAxisView::route_rec_enable_changed() +{ + RouteUI::route_rec_enable_changed (); + on_record_state_changed (); +} + void RouteTimeAxisView::on_record_state_changed () { + if ( !ARDOUR_UI::instance()->the_session() ) + return; + if ( (ARDOUR_UI::instance()->the_session()->record_status()==Session::Recording) && (_route->record_enabled()) ) end_name_edit (RESPONSE_CANCEL); } diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h index f65339ffbc..05d8f51d11 100644 --- a/gtk2_ardour/route_time_axis.h +++ b/gtk2_ardour/route_time_axis.h @@ -157,6 +157,8 @@ public: PBD::Signal3 relative_tracks_reorder_request; + void route_rec_enable_changed(); + protected: friend class StreamView; @@ -331,7 +333,6 @@ private: void display_route_color (); void on_record_state_changed (); - PBD::ScopedConnectionList _route_state_connections; }; #endif /* __ardour_route_time_axis_h__ */ diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h index b2076b0ebd..3ed7cdaacc 100644 --- a/gtk2_ardour/route_ui.h +++ b/gtk2_ardour/route_ui.h @@ -185,7 +185,7 @@ class RouteUI : public Gtk::EventBox, public WavesUI, public virtual AxisView void mute_changed(void*); void listen_changed(void*); virtual void processors_changed (ARDOUR::RouteProcessorChange) {} - void route_rec_enable_changed(); + virtual void route_rec_enable_changed(); void session_rec_enable_changed(); void build_solo_menu ();