13
0

panner UI: check URI and #of channels on re-configuration

This commit is contained in:
Robin Gareus 2014-02-07 18:05:47 +01:00
parent 5396459667
commit 46806c1595
2 changed files with 12 additions and 5 deletions

View File

@ -49,6 +49,7 @@ const int PannerUI::pan_bar_height = 35;
PannerUI::PannerUI (Session* s)
: _current_nouts (-1)
, _current_nins (-1)
, _current_uri ("")
, pan_automation_style_button ("")
, pan_automation_state_button ("")
, _panner_list()
@ -214,12 +215,17 @@ PannerUI::setup_pan ()
int const nouts = _panner ? _panner->out().n_audio() : -1;
int const nins = _panner ? _panner->in().n_audio() : -1;
if (nouts == _current_nouts && nins == _current_nins) {
if (nouts == _current_nouts
&& nins == _current_nins
&& _current_uri == _panshell->panner_gui_uri()
)
{
return;
}
_current_nins = nins;
_current_nouts = nouts;
_current_uri = _panshell->panner_gui_uri();
container_clear (pan_vbox);
@ -236,7 +242,7 @@ PannerUI::setup_pan ()
return;
}
if (_panshell->panner_gui_uri() == "http://ardour.org/plugin/panner_2in2out#ui")
if (_current_uri == "http://ardour.org/plugin/panner_2in2out#ui")
{
delete big_window;
big_window = 0;
@ -262,8 +268,8 @@ PannerUI::setup_pan ()
boost::weak_ptr<AutomationControl>(ac)));
_stereo_panner->signal_button_release_event().connect (sigc::mem_fun(*this, &PannerUI::pan_button_event));
}
else if (_panshell->panner_gui_uri() == "http://ardour.org/plugin/panner_1in2out#ui"
|| _panshell->panner_gui_uri() == "http://ardour.org/plugin/panner_balance#ui")
else if (_current_uri == "http://ardour.org/plugin/panner_1in2out#ui"
|| _current_uri == "http://ardour.org/plugin/panner_balance#ui")
{
delete big_window;
big_window = 0;
@ -284,7 +290,7 @@ PannerUI::setup_pan ()
update_pan_sensitive ();
pan_vbox.pack_start (*_mono_panner, false, false);
}
else if (_panshell->panner_gui_uri() == "http://ardour.org/plugin/panner_vbap#ui")
else if (_current_uri == "http://ardour.org/plugin/panner_vbap#ui")
{
if (!twod_panner) {
twod_panner = new Panner2d (_panshell, 61);

View File

@ -96,6 +96,7 @@ class PannerUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr
bool in_pan_update;
int _current_nouts;
int _current_nins;
std::string _current_uri;
static const int pan_bar_height;