X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fgtkmm2ext%2Fgtkmm2ext%2Fbarcontroller.h;h=f3eb2f41cd264aec3672f10f6b24a4620e768fe9;hb=c38e02285fda1fd7966c9e4ad85994445247e6a6;hp=ba2e1f3f7b6b504a48c054ba620cd98c8441b7c7;hpb=24ccaac67e9d416b3f3c564a441934313f3e9a21;p=ardour.git diff --git a/libs/gtkmm2ext/gtkmm2ext/barcontroller.h b/libs/gtkmm2ext/gtkmm2ext/barcontroller.h index ba2e1f3f7b..f3eb2f41cd 100644 --- a/libs/gtkmm2ext/gtkmm2ext/barcontroller.h +++ b/libs/gtkmm2ext/gtkmm2ext/barcontroller.h @@ -23,22 +23,17 @@ #include #include -namespace ARDOUR { - class Controllable; -} namespace Gtkmm2ext { class BarController : public Gtk::Frame { public: - typedef sigc::slot LabelCallback; - - BarController (Gtk::Adjustment& adj, PBD::Controllable&, LabelCallback lc = LabelCallback()); + BarController (Gtk::Adjustment& adj, boost::shared_ptr); virtual ~BarController () {} - - enum Style { + + enum barStyle { LeftToRight, RightToLeft, Line, @@ -48,14 +43,13 @@ class BarController : public Gtk::Frame BottomToTop }; - Style style() const { return _style; } - void set_style (Style); - void set_with_text (bool yn); + barStyle style() const { return _style; } + void set_style (barStyle); void set_use_parent (bool yn); void set_sensitive (bool yn); - - Gtk::SpinButton& get_spin_button() { return spinner; } + + void set_logarithmic (bool yn) { logarithmic = yn; } sigc::signal StartGesture; sigc::signal StopGesture; @@ -64,23 +58,29 @@ class BarController : public Gtk::Frame Gtk::Widget& event_widget() { return darea; } + boost::shared_ptr get_controllable() { return binding_proxy.get_controllable(); } + void set_controllable(boost::shared_ptr c) { binding_proxy.set_controllable(c); } + protected: Gtk::Adjustment& adjustment; BindingProxy binding_proxy; Gtk::DrawingArea darea; - LabelCallback label_callback; Glib::RefPtr layout; - Style _style; + barStyle _style; bool grabbed; bool switching; bool switch_on_release; - bool with_text; double initial_value; double grab_x; GdkWindow* grab_window; Gtk::SpinButton spinner; bool use_parent; + bool logarithmic; + virtual std::string get_label (int& /*x*/) { + return ""; + } + virtual bool button_press (GdkEventButton *); virtual bool button_release (GdkEventButton *); virtual bool motion (GdkEventMotion *); @@ -95,6 +95,9 @@ class BarController : public Gtk::Frame void entry_activated (); void drop_grab (); + + int entry_input (double* new_value); + bool entry_output (); };