From 5f88eeb157b061978d665efa6a7d8ac5118e6753 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 11 Oct 2008 17:02:57 +0000 Subject: [PATCH] test another fix for solo-press-crashes git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3929 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_mixer.cc | 29 +++++++++++++++++------------ gtk2_ardour/route_ui.cc | 7 ++----- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/gtk2_ardour/editor_mixer.cc b/gtk2_ardour/editor_mixer.cc index b81ed79b07..42407100f0 100644 --- a/gtk2_ardour/editor_mixer.cc +++ b/gtk2_ardour/editor_mixer.cc @@ -56,6 +56,8 @@ Editor::cms_deleted () void Editor::show_editor_mixer (bool yn) { + boost::shared_ptr r; + show_editor_mixer_when_tracks_arrive = false; if (!session) { @@ -64,27 +66,18 @@ Editor::show_editor_mixer (bool yn) if (yn) { - if (current_mixer_strip == 0) { - - current_mixer_strip = new MixerStrip (*ARDOUR_UI::instance()->the_mixer(), - *session, - false); - current_mixer_strip->GoingAway.connect (mem_fun(*this, &Editor::cms_deleted)); - } - - if (selection->tracks.empty()) { if (track_views.empty()) { show_editor_mixer_when_tracks_arrive = true; return; } - + for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { AudioTimeAxisView* atv; if ((atv = dynamic_cast (*i)) != 0) { - current_mixer_strip->set_route (atv->route()); + r = atv->route(); break; } } @@ -97,11 +90,23 @@ Editor::show_editor_mixer (bool yn) AudioTimeAxisView* atv; if ((atv = dynamic_cast (*i)) != 0) { - current_mixer_strip->set_route (atv->route()); + r = atv->route(); break; } } } + + if (r) { + if (current_mixer_strip == 0) { + + current_mixer_strip = new MixerStrip (*ARDOUR_UI::instance()->the_mixer(), + *session, + false); + current_mixer_strip->GoingAway.connect (mem_fun(*this, &Editor::cms_deleted)); + } + + current_mixer_strip->set_route (r); + } if (current_mixer_strip->get_parent() == 0) { current_mixer_strip->set_embedded (true); diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index a529403f37..842e06953e 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -88,6 +88,8 @@ RouteUI::init () rec_enable_button = manage (new BindableToggleButton (0, "")); rec_enable_button->set_name ("RecordEnableButton"); rec_enable_button->set_self_managed (true); + + _session.SoloChanged.connect (mem_fun(*this, &RouteUI::solo_changed_so_update_mute)); } void @@ -131,11 +133,6 @@ RouteUI::set_button_names (const char* mute, const char* solo, const char* rec) void RouteUI::set_route (boost::shared_ptr rp) { - if (!_route) { - /* first time it is set */ - _session.SoloChanged.connect (mem_fun(*this, &RouteUI::solo_changed_so_update_mute)); - } - reset (); _route = rp;