uint32_t const nouts = _panner->nouts();
uint32_t const npans = _panner->npanners();
- cerr << "Pan setup, outs == " << nouts << " pans = " << npans << endl;
-
if (int32_t (nouts) == _current_nouts && int32_t (npans) == _current_npans) {
return;
}
_stereo_panner->set_size_request (-1, pan_bar_height);
panning_viewport.add (*_stereo_panner);
+ boost::shared_ptr<AutomationControl> ac;
+
+ ac = _panner->direction_control();
+ _stereo_panner->StartPositionGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::start_touch),
+ boost::weak_ptr<AutomationControl> (ac)));
+ _stereo_panner->StopPositionGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::stop_touch),
+ boost::weak_ptr<AutomationControl>(ac)));
+
+ ac = _panner->width_control();
+ _stereo_panner->StartWidthGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::start_touch),
+ boost::weak_ptr<AutomationControl> (ac)));
+ _stereo_panner->StopWidthGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::stop_touch),
+ boost::weak_ptr<AutomationControl>(ac)));
+
} else {
/* N-in/2out - just use a set of single-channel panners */
if (ev->y < 20) {
/* top section of widget is for position drags */
dragging_position = true;
+ StartPositionGesture ();
} else {
/* lower section is for dragging width */
dragging_right = true;
}
}
+ StartWidthGesture ();
}
dragging = true;
return false;
}
+ bool dp = dragging_position;
+
dragging = false;
dragging_position = false;
dragging_left = false;
/* reset to default */
position_control->set_value (0.5);
width_control->set_value (1.0);
+ } else {
+ if (dp) {
+ StopPositionGesture ();
+ } else {
+ StopWidthGesture ();
+ }
}
return true;
StereoPanner (boost::shared_ptr<PBD::Controllable> pos, boost::shared_ptr<PBD::Controllable> width);
~StereoPanner ();
+ sigc::signal<void> StartPositionGesture;
+ sigc::signal<void> StopPositionGesture;
+ sigc::signal<void> StartWidthGesture;
+ sigc::signal<void> StopWidthGesture;
+
protected:
bool on_expose_event (GdkEventExpose*);
bool on_button_press_event (GdkEventButton*);