#include "ardour/session.h"
#include "ardour/panner.h"
#include "ardour/pannable.h"
+#include "ardour/panner_shell.h"
#include "ardour/route.h"
#include "i18n.h"
using namespace Gtkmm2ext;
using namespace Gtk;
-const int PannerUI::pan_bar_height = 40;
+const int PannerUI::pan_bar_height = 35;
PannerUI::PannerUI (Session* s)
: _current_nouts (-1)
}
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 ();
}
if (!_panner) {
return;
}
+
uint32_t const nouts = _panner->out().n_audio();
uint32_t const nins = _panner->in().n_audio();
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 */
void
PannerUI::update_pan_sensitive ()
{
- bool const sensitive = !(_panner->is_mono()) && !(_panner->pannable()->automation_state() & Play);
+ 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);
}
}
}
-void
-PannerUI::set_mono (bool yn)
-{
- _panner->set_mono (yn);
- update_pan_sensitive ();
-}
-
void
PannerUI::show_width ()
{