summaryrefslogtreecommitdiff
path: root/gtk2_ardour/panner_ui.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-01-07 21:38:22 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-01-07 21:38:22 +0000
commitcb8f069e7717db78394d68fddc9a19d7e8cd1eb6 (patch)
treeac5f7940ae93242d7d68f84a2780fbcb807b483f /gtk2_ardour/panner_ui.cc
parentadf9ac516db2456f0ec797a3bce93d5b4e49dfaf (diff)
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
Diffstat (limited to 'gtk2_ardour/panner_ui.cc')
-rw-r--r--gtk2_ardour/panner_ui.cc35
1 files changed, 9 insertions, 26 deletions
diff --git a/gtk2_ardour/panner_ui.cc b/gtk2_ardour/panner_ui.cc
index 390e47d096..61247d26cc 100644
--- a/gtk2_ardour/panner_ui.cc
+++ b/gtk2_ardour/panner_ui.cc
@@ -220,6 +220,7 @@ PannerUI::build_astyle_menu ()
boost::shared_ptr<PBD::Controllable>
PannerUI::get_controllable()
{
+ assert (!pan_bars.empty());
return pan_bars[0]->get_controllable();
}
@@ -374,6 +375,8 @@ PannerUI::setup_pan ()
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;
}
@@ -424,35 +427,16 @@ PannerUI::setup_pan ()
while ((p = pan_bars.size()) < npans) {
- float x, rx;
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));
-#if 0
- if (asz) {
- bc->StartGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::start_touch),
- boost::weak_ptr<AutomationControl> (ac)));
- bc->StopGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::stop_touch),
- boost::weak_ptr<AutomationControl>(ac)));
- }
-#endif
+ mp->StartGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::start_touch),
+ boost::weak_ptr<AutomationControl> (ac)));
+ mp->StopGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::stop_touch),
+ boost::weak_ptr<AutomationControl>(ac)));
+
mp->signal_button_release_event().connect
(sigc::bind (sigc::mem_fun(*this, &PannerUI::pan_button_event), (uint32_t) p));
@@ -467,7 +451,6 @@ PannerUI::setup_pan ()
automation state.
*/
-
update_pan_sensitive ();
panning_viewport.add (pan_bar_packer);
}