crossfade hack and slash. removed overlap checks, overlap mode, default length,...
[ardour.git] / gtk2_ardour / shuttle_control.h
index 427120a755b84f9dc64d4fd501b66dcd606fc0d3..c16328e3848c969020529c60424e8faf21d9e4bd 100644 (file)
@@ -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 ();
@@ -48,21 +48,22 @@ class ShuttleControl : public Gtk::DrawingArea, public ARDOUR::SessionHandlePtr
                ShuttleControllable (ShuttleControl&);
                void set_value (double);
                double get_value (void) const;
-               
-               void set_id (const std::string&);
-               
+
                ShuttleControl& sc;
        };
 
        boost::shared_ptr<ShuttleControllable> controllable() const { return _controllable; }
 
   protected:
+       bool _hovering;
        float  shuttle_max_speed;
        float  last_speed_displayed;
        bool   shuttle_grabbed;
-       double shuttle_fract;
+       double shuttle_speed_on_grab;
+       float shuttle_fract;
        boost::shared_ptr<ShuttleControllable> _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;
@@ -76,11 +77,15 @@ 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 *);
+
        void on_size_allocate (Gtk::Allocation&);
        bool on_query_tooltip (int, int, bool, const Glib::RefPtr<Gtk::Tooltip>&);
 
@@ -90,6 +95,12 @@ class ShuttleControl : public Gtk::DrawingArea, public ARDOUR::SessionHandlePtr
 
        void set_shuttle_units (ARDOUR::ShuttleUnits);
        void set_shuttle_style (ARDOUR::ShuttleBehaviour);
+
+       int speed_as_semitones (float, bool&);
+       int fract_as_semitones (float, bool&);
+
+       float semitones_as_speed (int, bool);
+       float semitones_as_fract (int, bool);
 };
 
 #endif /* __gtk2_ardour_shuttle_control_h__ */