X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fshuttle_control.h;h=0b289c51801086058fdf5adaec0361e1b932821f;hb=e36f74e071d4c14862d23da5ff0d49df0940d536;hp=03ec0059587cea65b0e89367ec6e0f68db0127b5;hpb=ed626628b54e67dd9621c08d82a42afaed00c7ac;p=ardour.git diff --git a/gtk2_ardour/shuttle_control.h b/gtk2_ardour/shuttle_control.h index 03ec005958..0b289c5180 100644 --- a/gtk2_ardour/shuttle_control.h +++ b/gtk2_ardour/shuttle_control.h @@ -32,7 +32,7 @@ namespace Gtk { #include "ardour/types.h" -class ShuttleControl : public Gtk::DrawingArea, public ARDOUR::SessionHandlePtr +class ShuttleControl : public CairoWidget, public ARDOUR::SessionHandlePtr { public: ShuttleControl (); @@ -40,7 +40,7 @@ class ShuttleControl : public Gtk::DrawingArea, public ARDOUR::SessionHandlePtr void map_transport_state (); void update_speed_display (); - void set_shuttle_fract (double); + void set_shuttle_fract (double, bool zero_ok = false); double get_shuttle_fract () const { return shuttle_fract; } void set_session (ARDOUR::Session*); @@ -49,7 +49,8 @@ class ShuttleControl : public Gtk::DrawingArea, public ARDOUR::SessionHandlePtr void set_value (double); double get_value (void) const; - void set_id (const std::string&); + double lower() const { return -1.0; } + double upper() const { return 1.0; } ShuttleControl& sc; }; @@ -57,6 +58,7 @@ class ShuttleControl : public Gtk::DrawingArea, public ARDOUR::SessionHandlePtr boost::shared_ptr controllable() const { return _controllable; } protected: + bool _hovering; float shuttle_max_speed; float last_speed_displayed; bool shuttle_grabbed; @@ -64,6 +66,7 @@ class ShuttleControl : public Gtk::DrawingArea, public ARDOUR::SessionHandlePtr 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; @@ -77,16 +80,20 @@ class ShuttleControl : public Gtk::DrawingArea, public ARDOUR::SessionHandlePtr void shuttle_unit_clicked (); void set_shuttle_max_speed (float); + bool on_enter_notify_event (GdkEventCrossing*); + bool on_leave_notify_event (GdkEventCrossing*); bool on_button_press_event (GdkEventButton*); bool on_button_release_event(GdkEventButton*); bool on_scroll_event (GdkEventScroll*); bool on_motion_notify_event(GdkEventMotion*); - bool on_expose_event(GdkEventExpose*); + + void render (cairo_t *, 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); + 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);