summaryrefslogtreecommitdiff
path: root/gtk2_ardour
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
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')
-rw-r--r--gtk2_ardour/editor.h1
-rw-r--r--gtk2_ardour/editor_mixer.cc74
-rw-r--r--gtk2_ardour/redirect_box.cc6
3 files changed, 53 insertions, 28 deletions
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index d8b9c66dbf..570ac76a86 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -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);
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);
}
diff --git a/gtk2_ardour/redirect_box.cc b/gtk2_ardour/redirect_box.cc
index de84a07db8..fb21601fd1 100644
--- a/gtk2_ardour/redirect_box.cc
+++ b/gtk2_ardour/redirect_box.cc
@@ -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()) {