- public:
- SliderController (Glib::RefPtr<Gdk::Pixbuf> slider,
- Glib::RefPtr<Gdk::Pixbuf> rail,
- Gtk::Adjustment* adj,
- MIDI::Controllable*,
- bool with_numeric = true);
-
- virtual ~SliderController () {}
-
- void set_bind_button_state (guint button, guint statemask);
- void get_bind_button_state (guint &button, guint &statemask);
- void midicontrol_set_tip ();
- void midi_learn ();
-
- void set_value (float);
- // void set_sensitive (bool yn) {
- // spin.set_sensitive (yn);
- // }
-
- Gtk::SpinButton & get_spin_button () { return spin; }
-
- protected:
- Glib::RefPtr<Gdk::Pixbuf> slider;
- Glib::RefPtr<Gdk::Pixbuf> rail;
- Gtk::SpinButton spin;
- Gtk::Frame spin_frame;
- Gtk::HBox spin_hbox;
- Gtkmm2ext::PopUp prompter;
- MIDI::Controllable* midi_control;
-
- guint bind_button;
- guint bind_statemask;
- bool prompting, unprompting;
-
- bool button_press (GdkEventButton *);
- bool prompter_hiding (GdkEventAny *);
- void midicontrol_prompt ();
- void midicontrol_unprompt ();
- void update_midi_control ();
+ public:
+ SliderController (Gtk::Adjustment* adj, boost::shared_ptr<PBD::Controllable> mc, int orientation, int, int);
+
+ virtual ~SliderController () {}
+
+ Gtk::SpinButton& get_spin_button () { assert(_ctrl); return _spin; }
+ void set_controllable (boost::shared_ptr<PBD::Controllable> c) { _binding_proxy.set_controllable (c); }
+
+ protected:
+ bool on_button_press_event (GdkEventButton *ev);
+ void ctrl_adjusted();
+ void spin_adjusted();
+
+ BindingProxy _binding_proxy;
+ boost::shared_ptr<PBD::Controllable> _ctrl;
+ Gtk::Adjustment *_ctrl_adj;
+ Gtk::Adjustment _spin_adj;
+ Gtk::SpinButton _spin;
+ bool _ctrl_ignore;
+ bool _spin_ignore;