Don't crash if get_action() is called before the UI manager is created. Sort-of...
[ardour.git] / libs / gtkmm2ext / slider_controller.cc
index 93dfb27ae2568baa2a1847e512b4498ff05aa052..f86fd19820224ce02b8bb698aeccd9d071075314 100644 (file)
 using namespace Gtkmm2ext;
 using namespace PBD;
 
-SliderController::SliderController (Glib::RefPtr<Gdk::Pixbuf> image,
-                                   Gtk::Adjustment *adj,  int orientation,
-                                   Controllable& c,
-                                   bool with_numeric)
+SliderController::SliderController (Glib::RefPtr<Gdk::Pixbuf> image, Gtk::Adjustment *adj, int orientation, int fader_length)
 
-       : PixFader (image, *adj, orientation),
-         binding_proxy (c),
+       : PixFader (image, *adj, orientation, fader_length),
          spin (*adj, 0, 2)
 {                        
        spin.set_name ("SliderControllerValue");
@@ -55,15 +51,15 @@ SliderController::on_button_press_event (GdkEventButton *ev)
        if (binding_proxy.button_press_handler (ev)) {
                return true;
        }
+
        return PixFader::on_button_press_event (ev);
 }
 
 VSliderController::VSliderController (Glib::RefPtr<Gdk::Pixbuf> image,
-                                     Gtk::Adjustment *adj,
-                                     Controllable& control,
+                                     Gtk::Adjustment *adj, int fader_length,
                                      bool with_numeric)
 
-       : SliderController (image, adj, VERT, control, with_numeric)
+       : SliderController (image, adj, VERT, fader_length)
 {
        if (with_numeric) {
                spin_frame.add (spin);
@@ -75,11 +71,10 @@ VSliderController::VSliderController (Glib::RefPtr<Gdk::Pixbuf> image,
 }
 
 HSliderController::HSliderController (Glib::RefPtr<Gdk::Pixbuf> image,
-                                     Gtk::Adjustment *adj,
-                                     Controllable& control,
+                                     Gtk::Adjustment *adj, int fader_length,
                                      bool with_numeric)
        
-       : SliderController (image, adj, HORIZ, control, with_numeric)
+       : SliderController (image, adj, HORIZ, fader_length)
 {
        if (with_numeric) {
                spin_frame.add (spin);