-PannerUI::pan_changed (void *src)
-{
- if (src == this) {
- return;
- }
-
- switch (_io->panner().size()) {
- case 0:
- panning_link_direction_button.set_sensitive (false);
- panning_link_button.set_sensitive (false);
- return;
- case 1:
- panning_link_direction_button.set_sensitive (false);
- panning_link_button.set_sensitive (false);
- break;
- default:
- panning_link_direction_button.set_sensitive (true);
- panning_link_button.set_sensitive (true);
- }
-
- uint32_t nouts = _io->n_outputs();
-
- switch (nouts) {
- case 0:
- case 1:
- /* relax */
- break;
-
- case 2:
- update_pan_bars (false);
- break;
-
- default:
- // panner->move_puck (pan_value (pans[0], pans[1]), 0.5);
- break;
- }
-}
-
-void
-PannerUI::pan_adjustment_changed (uint32_t which)
-{
- if (!in_pan_update && which < _io->panner().size()) {
-
- float xpos;
- float val = pan_adjustments[which]->get_value ();
- _io->panner()[which]->get_position (xpos);
-
- /* add a kinda-sorta detent for the middle */
-
- if (val != 0.5 && Panner::equivalent (val, 0.5)) {
- /* this is going to be reentrant, so just
- return after it.
- */
-
- in_pan_update = true;
- pan_adjustments[which]->set_value (0.5);
- in_pan_update = false;
- return;
- }
-
- if (!Panner::equivalent (val, xpos)) {
-
- _io->panner()[which]->set_position (val);
- /* XXX
- the panner objects have no access to the session,
- so do this here. ick.
- */
- _session.set_dirty();
- }
- }
-}
-
-void
-PannerUI::pan_value_changed (uint32_t which)
-{
- ENSURE_GUI_THREAD (bind (mem_fun(*this, &PannerUI::pan_value_changed), which));
-
- if (_io->n_outputs() > 1 && which < _io->panner().size()) {
- float xpos;
- float val = pan_adjustments[which]->get_value ();
-
- _io->panner()[which]->get_position (xpos);
-
- if (!Panner::equivalent (val, xpos)) {
- in_pan_update = true;
- pan_adjustments[which]->set_value (xpos);
- in_pan_update = false;
- }
- }
-}
-
-void
-PannerUI::update_pan_bars (bool only_if_aplay)