start of Blob-style for bar controller and use in panner GUI
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 30 Nov 2010 04:14:51 +0000 (04:14 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 30 Nov 2010 04:14:51 +0000 (04:14 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@8133 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/panner.cc
gtk2_ardour/panner_ui.cc
libs/gtkmm2ext/barcontroller.cc
libs/gtkmm2ext/gtkmm2ext/barcontroller.h

index 145ef020e3fc1deeecda716ecd1c22e24d208be5..2f223879b29294bb7183b8bb69ccb9b77c40ade5 100644 (file)
@@ -32,7 +32,7 @@ static const int triangle_size = 5;
 PannerBar::PannerBar (Adjustment& adj, boost::shared_ptr<PBD::Controllable> c)
        : BarController (adj, c)
 {
-       set_style (BarController::Line);
+       set_style (BarController::Blob);
 }
 
 PannerBar::~PannerBar ()
index 52c42cc63ceb5430f927a94fb95d27e903e707ed..b038ac6f06df859c459589626bd37a247ad3e77d 100644 (file)
@@ -492,7 +492,7 @@ PannerUI::setup_pan ()
                                 _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());
index 5c0d444be73578ac35a661074be7d1691865702d..8db8116ed66f2fdbea54c751df4859fad354efae 100644 (file)
@@ -244,9 +244,10 @@ BarController::mouse_control (double x, GdkWindow* window, double scaling)
 
        delta = x - grab_x;
        grab_x = x;
-
+        
        switch (_style) {
        case Line:
+       case Blob:
        case LeftToRight:
         case CenterOut:
                fract = scaling * (delta / (darea.get_width() - 2));
@@ -302,6 +303,31 @@ BarController::expose (GdkEventExpose* /*event*/)
                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;
index 1a0b78dabe3aa94f031a7f38e57b54f09cb84f95..e0e14f1c26d1625873a9711a9aa64d087b9f62a7 100644 (file)
@@ -37,6 +37,7 @@ class BarController : public Gtk::Frame
                LeftToRight,
                RightToLeft,
                Line,
+                Blob,
                CenterOut,
                
                TopToBottom,