final (?) fix for editor mixer strip handling when route is removed

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4791 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2009-03-11 17:57:18 +00:00
parent 799e4b7c98
commit 2f9800638c
4 changed files with 23 additions and 15 deletions

View File

@ -82,7 +82,6 @@ Editor::handle_new_route (Session::RouteList& routes)
}
route->gui_changed.connect (mem_fun(*this, &Editor::handle_gui_changes));
cerr << "Connect to GA for " << tv << " named " << tv->name() << endl;
tv->GoingAway.connect (bind (mem_fun(*this, &Editor::remove_route), tv));
}
@ -160,21 +159,15 @@ Editor::remove_route (TimeAxisView *tv)
if (current_mixer_strip->route() == route) {
cerr << "CMS is the one being deleted\n";
if (next_tv) {
cerr << "move to " << next_tv->name() << endl;
set_selected_mixer_strip (*next_tv);
} else {
cerr << "no next TV, hide editor mixer strip\n";
/* make the editor mixer strip go away setting the
/* make the editor mixer strip go away by setting the
* button to inactive (which also unticks the menu option)
*/
ActionManager::uncheck_toggleaction ("<Actions>/Editor/show-editor-mixer");
}
} else {
cerr << "CMS differs from the deleted one\n";
}
}

View File

@ -102,6 +102,14 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, bool in_mixer)
{
init ();
if (!_mixer_owned) {
/* the editor mixer strip: don't destroy it every time
the underlying route goes away.
*/
self_destruct = false;
}
}
MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, boost::shared_ptr<Route> rt, bool in_mixer)
@ -1177,16 +1185,16 @@ MixerStrip::width_clicked ()
void
MixerStrip::hide_clicked ()
{
// LAME fix to reset the button status for when it is redisplayed (part 1)
hide_button.set_sensitive(false);
// LAME fix to reset the button status for when it is redisplayed (part 1)
hide_button.set_sensitive(false);
if (_embedded) {
Hiding(); /* EMIT_SIGNAL */
Hiding(); /* EMIT_SIGNAL */
} else {
_mixer.hide_strip (this);
}
// (part 2)
// (part 2)
hide_button.set_sensitive(true);
}

View File

@ -70,6 +70,7 @@ RouteUI::RouteUI (boost::shared_ptr<ARDOUR::Route> rt,
void
RouteUI::init ()
{
self_destruct = true;
xml_node = 0;
mute_menu = 0;
solo_menu = 0;
@ -149,7 +150,9 @@ RouteUI::set_route (boost::shared_ptr<Route> rp)
up when the route is destroyed.
*/
new PairedShiva<Route,RouteUI> (*_route, *this);
if (self_destruct) {
new PairedShiva<Route,RouteUI> (*_route, *this);
}
mute_button->set_controllable (&_route->mute_control());
mute_button->set_label (m_name);
@ -189,7 +192,9 @@ RouteUI::set_route (boost::shared_ptr<Route> rp)
RouteUI::~RouteUI()
{
GoingAway (); /* EMIT SIGNAL */
/* derived classes should emit GoingAway so that they receive the signal
when the object is still a legal derived instance.
*/
if (solo_menu) {
delete solo_menu;

View File

@ -170,6 +170,8 @@ class RouteUI : public virtual AxisView
std::string m_name;
std::string r_name;
bool self_destruct;
void init ();
void reset ();