more cleanups of PannerUI, add start/end gesture support to mono panner
git-svn-id: svn://localhost/ardour2/branches/3.0@8478 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
adf9ac516d
commit
cb8f069e77
@ -301,9 +301,10 @@ MonoPanner::on_button_press_event (GdkEventButton* ev)
|
|||||||
if (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier)) {
|
if (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier)) {
|
||||||
/* handled by button release */
|
/* handled by button release */
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
dragging = true;
|
dragging = true;
|
||||||
|
StartGesture ();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -319,7 +320,7 @@ MonoPanner::on_button_release_event (GdkEventButton* ev)
|
|||||||
dragging = false;
|
dragging = false;
|
||||||
accumulated_delta = 0;
|
accumulated_delta = 0;
|
||||||
detented = false;
|
detented = false;
|
||||||
|
|
||||||
if (drag_data_window) {
|
if (drag_data_window) {
|
||||||
drag_data_window->hide ();
|
drag_data_window->hide ();
|
||||||
}
|
}
|
||||||
@ -327,6 +328,8 @@ MonoPanner::on_button_release_event (GdkEventButton* ev)
|
|||||||
if (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier)) {
|
if (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier)) {
|
||||||
/* reset to default */
|
/* reset to default */
|
||||||
position_control->set_value (0.5);
|
position_control->set_value (0.5);
|
||||||
|
} else {
|
||||||
|
StopGesture ();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -39,6 +39,9 @@ class MonoPanner : public Gtk::DrawingArea
|
|||||||
|
|
||||||
boost::shared_ptr<PBD::Controllable> get_controllable() const { return position_control; }
|
boost::shared_ptr<PBD::Controllable> get_controllable() const { return position_control; }
|
||||||
|
|
||||||
|
sigc::signal<void> StartGesture;
|
||||||
|
sigc::signal<void> StopGesture;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool on_expose_event (GdkEventExpose*);
|
bool on_expose_event (GdkEventExpose*);
|
||||||
bool on_button_press_event (GdkEventButton*);
|
bool on_button_press_event (GdkEventButton*);
|
||||||
|
@ -220,6 +220,7 @@ PannerUI::build_astyle_menu ()
|
|||||||
boost::shared_ptr<PBD::Controllable>
|
boost::shared_ptr<PBD::Controllable>
|
||||||
PannerUI::get_controllable()
|
PannerUI::get_controllable()
|
||||||
{
|
{
|
||||||
|
assert (!pan_bars.empty());
|
||||||
return pan_bars[0]->get_controllable();
|
return pan_bars[0]->get_controllable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -374,6 +375,8 @@ PannerUI::setup_pan ()
|
|||||||
uint32_t const nouts = _panner->nouts();
|
uint32_t const nouts = _panner->nouts();
|
||||||
uint32_t const npans = _panner->npanners();
|
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) {
|
if (int32_t (nouts) == _current_nouts && int32_t (npans) == _current_npans) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -424,35 +427,16 @@ PannerUI::setup_pan ()
|
|||||||
|
|
||||||
while ((p = pan_bars.size()) < npans) {
|
while ((p = pan_bars.size()) < npans) {
|
||||||
|
|
||||||
float x, rx;
|
|
||||||
MonoPanner* mp;
|
MonoPanner* mp;
|
||||||
|
boost::shared_ptr<AutomationControl> ac = _panner->pan_control (p);
|
||||||
|
|
||||||
/* initialize adjustment with 0.0 (L) or 1.0 (R) for the first and second panners,
|
|
||||||
which serves as a default, otherwise use current value
|
|
||||||
*/
|
|
||||||
|
|
||||||
rx = _panner->pan_control (p)->get_value();
|
|
||||||
|
|
||||||
if (npans == 1) {
|
|
||||||
x = 0.5;
|
|
||||||
} else if (p == 0) {
|
|
||||||
x = 0.0;
|
|
||||||
} else if (p == 1) {
|
|
||||||
x = 1.0;
|
|
||||||
} else {
|
|
||||||
x = rx;
|
|
||||||
}
|
|
||||||
|
|
||||||
mp = new MonoPanner (_panner->pan_control (p));
|
mp = new MonoPanner (_panner->pan_control (p));
|
||||||
|
|
||||||
#if 0
|
mp->StartGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::start_touch),
|
||||||
if (asz) {
|
boost::weak_ptr<AutomationControl> (ac)));
|
||||||
bc->StartGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::start_touch),
|
mp->StopGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::stop_touch),
|
||||||
boost::weak_ptr<AutomationControl> (ac)));
|
boost::weak_ptr<AutomationControl>(ac)));
|
||||||
bc->StopGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::stop_touch),
|
|
||||||
boost::weak_ptr<AutomationControl>(ac)));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
mp->signal_button_release_event().connect
|
mp->signal_button_release_event().connect
|
||||||
(sigc::bind (sigc::mem_fun(*this, &PannerUI::pan_button_event), (uint32_t) p));
|
(sigc::bind (sigc::mem_fun(*this, &PannerUI::pan_button_event), (uint32_t) p));
|
||||||
|
|
||||||
@ -467,7 +451,6 @@ PannerUI::setup_pan ()
|
|||||||
automation state.
|
automation state.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
update_pan_sensitive ();
|
update_pan_sensitive ();
|
||||||
panning_viewport.add (pan_bar_packer);
|
panning_viewport.add (pan_bar_packer);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user