X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fshuttle_control.h;h=bba5f17df13ac5fae18547e8106534e28d65eecc;hb=474d68c05132291fd8eb200006e7e63aebefdc8d;hp=31be53c976c9f40c8ac886aa037e37ccae9cdf4f;hpb=3d5491d0d0501acbcaafa1a5a5b811c5eeaf9c00;p=ardour.git diff --git a/gtk2_ardour/shuttle_control.h b/gtk2_ardour/shuttle_control.h index 31be53c976..bba5f17df1 100644 --- a/gtk2_ardour/shuttle_control.h +++ b/gtk2_ardour/shuttle_control.h @@ -21,21 +21,23 @@ #include -#include "gtkmm2ext/binding_proxy.h" -#include "gtkmm2ext/cairo_widget.h" - #include "pbd/controllable.h" + #include "ardour/session_handle.h" +#include "ardour/types.h" + +#include "gtkmm2ext/cairo_widget.h" + +#include "widgets/ardour_button.h" +#include "widgets/binding_proxy.h" namespace Gtk { class Menu; } -#include "ardour/types.h" - class ShuttleControl : public CairoWidget, public ARDOUR::SessionHandlePtr { - public: +public: ShuttleControl (); ~ShuttleControl (); @@ -49,8 +51,8 @@ class ShuttleControl : public CairoWidget, public ARDOUR::SessionHandlePtr void set_value (double, PBD::Controllable::GroupControlDisposition group_override); double get_value (void) const; - double lower() const { return -1.0; } - double upper() const { return 1.0; } + double lower() const { return -1.0; } + double upper() const { return 1.0; } ShuttleControl& sc; }; @@ -58,31 +60,29 @@ class ShuttleControl : public CairoWidget, public ARDOUR::SessionHandlePtr boost::shared_ptr controllable() const { return _controllable; } void set_colors (); - protected: + ArdourWidgets::ArdourButton* info_button () { return &_info_button; } + +protected: bool _hovering; float shuttle_max_speed; float last_speed_displayed; bool shuttle_grabbed; double shuttle_speed_on_grab; + double requested_speed; float shuttle_fract; boost::shared_ptr _controllable; cairo_pattern_t* pattern; cairo_pattern_t* shine_pattern; ARDOUR::microseconds_t last_shuttle_request; PBD::ScopedConnection parameter_connection; - Gtk::Menu* shuttle_unit_menu; - Gtk::Menu* shuttle_style_menu; - Gtk::Menu* shuttle_context_menu; - BindingProxy binding_proxy; - Glib::RefPtr left_text; - Glib::RefPtr right_text; - Pango::AttrList text_attributes; - Pango::AttrColor* text_color; + ArdourWidgets::ArdourButton _info_button; + Gtk::Menu* shuttle_unit_menu; + Gtk::Menu* shuttle_style_menu; + Gtk::Menu* shuttle_context_menu; + ArdourWidgets::BindingProxy binding_proxy; float bg_r, bg_g, bg_b; void build_shuttle_context_menu (); - void show_shuttle_context_menu (); void shuttle_style_changed(); - void shuttle_unit_clicked (); void set_shuttle_max_speed (float); void reset_speed (); @@ -93,13 +93,13 @@ class ShuttleControl : public CairoWidget, public ARDOUR::SessionHandlePtr bool on_scroll_event (GdkEventScroll*); bool on_motion_notify_event(GdkEventMotion*); - void render (cairo_t *, cairo_rectangle_t*); + void render (Cairo::RefPtr const&, cairo_rectangle_t*); void on_size_allocate (Gtk::Allocation&); bool on_query_tooltip (int, int, bool, const Glib::RefPtr&); - gint mouse_shuttle (double x, bool force); - void use_shuttle_fract (bool force, bool zero_ok = false); + gint mouse_shuttle (double x, bool force); + void use_shuttle_fract (bool force, bool zero_ok = false); void parameter_changed (std::string); void set_shuttle_units (ARDOUR::ShuttleUnits);