#include "ardour/session.h"
#include "ardour/panner.h"
#include "ardour/pannable.h"
+#include "ardour/panner_shell.h"
#include "ardour/route.h"
#include "i18n.h"
}
void
-PannerUI::set_panner (boost::shared_ptr<Panner> p)
+PannerUI::set_panner (boost::shared_ptr<PannerShell> ps, boost::shared_ptr<Panner> p)
{
+ /* note that the panshell might not change here (i.e. ps == _panshell)
+ */
+
connections.drop_connections ();
delete pan_astyle_menu;
delete pan_astate_menu;
pan_astate_menu = 0;
+ _panshell = ps;
_panner = p;
delete twod_panner;
return;
}
- _panner->Changed.connect (connections, invalidator (*this), boost::bind (&PannerUI::panner_changed, this, this), gui_context());
+ _panshell->Changed.connect (connections, invalidator (*this), boost::bind (&PannerUI::panshell_changed, this), gui_context());
_panner->StateChanged.connect (connections, invalidator (*this), boost::bind (&PannerUI::update_pan_state, this), gui_context());
/* new panner object, force complete reset of panner GUI
_current_nouts = 0;
_current_nins = 0;
- panner_changed (0);
+ setup_pan ();
update_pan_sensitive ();
pan_automation_state_changed ();
-
}
void
void
-PannerUI::panner_changed (void* src)
+PannerUI::panshell_changed ()
{
+ set_panner (_panshell, _panshell->panner());
setup_pan ();
}
uint32_t const nouts = _panner->out().n_audio();
uint32_t const nins = _panner->in().n_audio();
- cerr << "GUI Panner for " << _panner << " setup with " << nins << " feeding " << nouts
- << " current = " << _current_nins << " feeding " << _current_nouts
- << endl;
-
if (int32_t (nouts) == _current_nouts && int32_t (nins) == _current_nins) {
return;
}
+ _current_nins = nins;
+ _current_nouts = nouts;
+
container_clear (pan_vbox);
delete twod_panner;
twod_panner = 0;
delete _stereo_panner;
_stereo_panner = 0;
-
+
if (nouts == 0 || nouts == 1) {
delete _stereo_panner;
ac = pannable->pan_azimuth_control;
_stereo_panner->StartPositionGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::start_touch),
- boost::weak_ptr<AutomationControl> (ac)));
+ boost::weak_ptr<AutomationControl> (ac)));
_stereo_panner->StopPositionGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::stop_touch),
- boost::weak_ptr<AutomationControl>(ac)));
-
+ boost::weak_ptr<AutomationControl>(ac)));
+
ac = pannable->pan_width_control;
_stereo_panner->StartWidthGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::start_touch),
- boost::weak_ptr<AutomationControl> (ac)));
+ boost::weak_ptr<AutomationControl> (ac)));
_stereo_panner->StopWidthGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::stop_touch),
- boost::weak_ptr<AutomationControl>(ac)));
-
+ boost::weak_ptr<AutomationControl>(ac)));
+ _stereo_panner->signal_button_release_event().connect (sigc::mem_fun(*this, &PannerUI::pan_button_event));
+
} else if (nins == 1) {
/* 1-in/2out */
{
bool const sensitive = !(_panner->pannable()->automation_state() & Play);
-#ifdef PANNER_HACKS
pan_vbox.set_sensitive (sensitive);
-#endif
+
if (big_window) {
big_window->set_sensitive (sensitive);
}