summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_mixer.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-10-23 12:48:54 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-10-23 12:48:54 +0000
commite5cfd1924ae8d6f5aef276d0014b1a90f82ef5eb (patch)
tree2e0035ff26e024ba9168219638012af65e1bf43d /gtk2_ardour/editor_mixer.cc
parentb4989d670355c87cf8c5a458a4b03bf2d59fafa8 (diff)
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
Diffstat (limited to 'gtk2_ardour/editor_mixer.cc')
-rw-r--r--gtk2_ardour/editor_mixer.cc74
1 files changed, 47 insertions, 27 deletions
diff --git a/gtk2_ardour/editor_mixer.cc b/gtk2_ardour/editor_mixer.cc
index d58a202e1a..64eccf79fc 100644
--- a/gtk2_ardour/editor_mixer.cc
+++ b/gtk2_ardour/editor_mixer.cc
@@ -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);
}
@@ -139,37 +137,59 @@ Editor::show_editor_mixer (bool yn)
}
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);
}