summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-08-30 00:40:48 +0000
committerCarl Hetherington <carl@carlh.net>2009-08-30 00:40:48 +0000
commit1aa38f074f6dfaec52edd9be5a0421a82e39a7fb (patch)
tree7fb1a673cb9ffbab56804828b65e6bd01b43ccf4 /gtk2_ardour
parent95c4046ff90404cc4bc2ae54dde9e61188fd9a65 (diff)
Don't setup panner UI unless it has changed.
git-svn-id: svn://localhost/ardour2/branches/3.0@5606 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/mixer_strip.cc1
-rw-r--r--gtk2_ardour/mixer_ui.cc4
-rw-r--r--gtk2_ardour/panner_ui.cc13
-rw-r--r--gtk2_ardour/panner_ui.h1
4 files changed, 12 insertions, 7 deletions
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index 53411c1336..947ad61223 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -304,7 +304,6 @@ MixerStrip::init ()
set_flags (get_flags() | Gtk::CAN_FOCUS);
SwitchIO.connect (mem_fun (*this, &MixerStrip::switch_io));
-
}
MixerStrip::~MixerStrip ()
diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc
index 16f3089825..37cc14b8b0 100644
--- a/gtk2_ardour/mixer_ui.cc
+++ b/gtk2_ardour/mixer_ui.cc
@@ -311,14 +311,12 @@ Mixer_UI::add_strip (RouteList& routes)
if (route->is_hidden()) {
return;
}
-
+
strip = new MixerStrip (*this, *session, route);
strips.push_back (strip);
Config->get_default_narrow_ms() ? _strip_width = Narrow : _strip_width = Wide;
- Config->get_default_narrow_ms() ? _strip_width = Narrow : _strip_width = Wide;
-
if (strip->width_owner() != strip) {
strip->set_width_enum (_strip_width, this);
}
diff --git a/gtk2_ardour/panner_ui.cc b/gtk2_ardour/panner_ui.cc
index e133c1e0b9..c04ca055b2 100644
--- a/gtk2_ardour/panner_ui.cc
+++ b/gtk2_ardour/panner_ui.cc
@@ -51,6 +51,7 @@ const int PannerUI::pan_bar_height = 30;
PannerUI::PannerUI (Session& s)
: _session (s),
+ _current_nouts (-1),
hAdjustment(0.0, 0.0, 0.0),
vAdjustment(0.0, 0.0, 0.0),
panning_viewport(hAdjustment, vAdjustment),
@@ -154,7 +155,7 @@ PannerUI::set_panner (boost::shared_ptr<Panner> p)
connections.push_back (_panner->Changed.connect (mem_fun(*this, &PannerUI::panner_changed)));
connections.push_back (_panner->LinkStateChanged.connect (mem_fun(*this, &PannerUI::update_pan_linkage)));
connections.push_back (_panner->StateChanged.connect (mem_fun(*this, &PannerUI::update_pan_state)));
-
+
setup_pan ();
pan_changed (0);
@@ -335,14 +336,20 @@ PannerUI::update_pan_state ()
void
PannerUI::setup_pan ()
{
- cerr << "Setup pan for " << _panner->name() << endl;
-
if (!_panner) {
return;
}
uint32_t nouts = _panner->nouts();
+ if (nouts == _current_nouts) {
+ return;
+ }
+
+ _current_nouts = nouts;
+
+ cout << "Setup pan for " << _panner->name() << endl;
+
if (nouts == 0 || nouts == 1) {
while (!pan_adjustments.empty()) {
diff --git a/gtk2_ardour/panner_ui.h b/gtk2_ardour/panner_ui.h
index 95e1e6c688..119dda208c 100644
--- a/gtk2_ardour/panner_ui.h
+++ b/gtk2_ardour/panner_ui.h
@@ -83,6 +83,7 @@ class PannerUI : public Gtk::HBox
bool ignore_toggle;
bool in_pan_update;
+ int _current_nouts;
static const int pan_bar_height;