X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fpanner_ui.cc;h=c04ca055b26f1d599bcd78bab761c3911ed1d6de;hb=4b5426eddefd742caa13f9539260ab97bc528a68;hp=7f1475fabc7b95a8f26c9d3e58d9e67bf650330b;hpb=cc8598b0712dfc756fd62f002b1fa1ea0e3cda25;p=ardour.git diff --git a/gtk2_ardour/panner_ui.cc b/gtk2_ardour/panner_ui.cc index 7f1475fabc..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 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); @@ -229,13 +230,13 @@ PannerUI::get_controllable() } bool -PannerUI::panning_link_button_press (GdkEventButton* ev) +PannerUI::panning_link_button_press (GdkEventButton*) { return true; } bool -PannerUI::panning_link_button_release (GdkEventButton* ev) +PannerUI::panning_link_button_release (GdkEventButton*) { if (!ignore_toggle) { _panner->set_linked (!_panner->linked()); @@ -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()) {