fix botched setting of editor mixer strip width, which in turn affected plugin name display

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3999 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2008-10-23 12:48:54 +00:00
parent b4989d6703
commit e5cfd1924a
3 changed files with 53 additions and 28 deletions

View file

@ -290,6 +290,7 @@ class Editor : public PublicEditor
Width editor_mixer_strip_width;
void maybe_add_mixer_strip_width (XMLNode&);
void show_editor_mixer (bool yn);
void create_editor_mixer ();
void set_selected_mixer_strip (TimeAxisView&);
void hide_track_in_display (TimeAxisView& tv, bool temporary = false);
void show_track_in_display (TimeAxisView& tv);

View file

@ -97,33 +97,31 @@ Editor::show_editor_mixer (bool yn)
}
if (r) {
bool created;
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));
create_editor_mixer ();
created = true;
} else {
created = false;
}
current_mixer_strip->set_route (r);
if (created) {
current_mixer_strip->set_width (editor_mixer_strip_width, (void*) this);
}
}
if (current_mixer_strip->get_parent() == 0) {
current_mixer_strip->set_embedded (true);
current_mixer_strip->Hiding.connect (mem_fun(*this, &Editor::current_mixer_strip_hidden));
current_mixer_strip->GoingAway.connect (mem_fun(*this, &Editor::current_mixer_strip_removed));
current_mixer_strip->set_width (editor_mixer_strip_width, (void*) this);
global_hpacker.pack_start (*current_mixer_strip, Gtk::PACK_SHRINK );
global_hpacker.reorder_child (*current_mixer_strip, 0);
current_mixer_strip->show_all ();
}
} else {
if (current_mixer_strip) {
editor_mixer_strip_width = current_mixer_strip->get_width ();
if (current_mixer_strip->get_parent() != 0) {
global_hpacker.remove (*current_mixer_strip);
}
@ -138,38 +136,60 @@ Editor::show_editor_mixer (bool yn)
#endif
}
void
Editor::create_editor_mixer ()
{
current_mixer_strip = new MixerStrip (*ARDOUR_UI::instance()->the_mixer(),
*session,
false);
current_mixer_strip->Hiding.connect (mem_fun(*this, &Editor::current_mixer_strip_hidden));
current_mixer_strip->GoingAway.connect (mem_fun(*this, &Editor::current_mixer_strip_removed));
current_mixer_strip->set_embedded (true);
}
void
Editor::set_selected_mixer_strip (TimeAxisView& view)
{
AudioTimeAxisView* at;
bool show = false;
bool created;
if (!session || (at = dynamic_cast<AudioTimeAxisView*>(&view)) == 0) {
return;
}
if (current_mixer_strip) {
/* might be nothing to do */
if (current_mixer_strip->route() == at->route()) {
Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (X_("Editor"), X_("show-editor-mixer"));
if (act) {
Glib::RefPtr<Gtk::ToggleAction> tact = Glib::RefPtr<Gtk::ToggleAction>::cast_dynamic(act);
if (!tact || !tact->get_active()) {
/* not showing mixer strip presently */
return;
}
}
if (current_mixer_strip->get_parent()) {
show = true;
}
if (current_mixer_strip == 0) {
create_editor_mixer ();
created = true;
} else {
current_mixer_strip = new MixerStrip (*ARDOUR_UI::instance()->the_mixer(),
*session,
false);
current_mixer_strip->GoingAway.connect (mem_fun(*this, &Editor::cms_deleted));
created = false;
}
/* might be nothing to do */
if (current_mixer_strip->route() == at->route()) {
return;
}
if (current_mixer_strip->get_parent()) {
show = true;
}
current_mixer_strip->set_route (at->route());
if (created) {
current_mixer_strip->set_width (editor_mixer_strip_width, (void*) this);
}
if (show) {
show_editor_mixer (true);
}

View file

@ -200,7 +200,9 @@ RedirectBox::set_width (Width w)
return;
}
_width = w;
if (w == -1) {
abort ();
}
redisplay_redirects (0);
}
@ -572,6 +574,7 @@ RedirectBox::add_redirect_to_display (boost::shared_ptr<Redirect> redirect)
}
Gtk::TreeModel::Row row = *(model->append());
row[columns.text] = redirect_name (redirect);
row[columns.redirect] = redirect;
@ -682,6 +685,7 @@ RedirectBox::show_redirect_active (boost::weak_ptr<Redirect> weak_redirect)
boost::shared_ptr<Redirect> r = (*iter)[columns.redirect];
if (r == redirect) {
(*iter)[columns.text] = redirect_name (r);
if (redirect->active()) {