PannerBar::PannerBar (Adjustment& adj, boost::shared_ptr<PBD::Controllable> c)
: BarController (adj, c)
{
- set_style (BarController::Line);
+ set_style (BarController::Blob);
}
PannerBar::~PannerBar ()
_position_fader = new BarController (_position_adjustment, _panner->direction_control());
_position_fader->set_size_request (-1, pan_bar_height/2);
_position_fader->set_name ("PanSlider");
- _position_fader->set_style (BarController::Line);
+ _position_fader->set_style (BarController::Blob);
ARDOUR_UI::instance()->set_tip (_position_fader, _("Pan Position"));
_position_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &PannerUI::position_adjusted));
_panner->direction_control()->Changed.connect (connections, invalidator (*this), boost::bind (&PannerUI::show_position, this), gui_context());
delta = x - grab_x;
grab_x = x;
-
+
switch (_style) {
case Line:
+ case Blob:
case LeftToRight:
case CenterOut:
fract = scaling * (delta / (darea.get_width() - 2));
win->draw_line (get_style()->get_fg_gc (get_state()), x1, 0, x1, h);
break;
+ case Blob:
+ w = darea.get_width() - 1;
+ h = darea.get_height();
+ x1 = (gint) floor (w * fract);
+ x2 = min (w-2,h-2);
+
+ if (use_parent) {
+ parent = get_parent();
+
+ if (parent) {
+ win->draw_rectangle (parent->get_style()->get_fg_gc (parent->get_state()),
+ true,
+ 0, 0, darea.get_width(), darea.get_height());
+ }
+
+ } else {
+
+ win->draw_rectangle (get_style()->get_bg_gc (get_state()),
+ true,
+ 0, 0, darea.get_width() - ((darea.get_width()+1) % 2), darea.get_height());
+ }
+
+ win->draw_arc (get_style()->get_fg_gc (get_state()), true, x1, ((h-2)/2)-1, x2, x2, 0, 360 * 64);
+ break;
+
case CenterOut:
w = darea.get_width();
h = darea.get_height()-2;