show ShuttleControl GUI some love.
[ardour.git] / gtk2_ardour / shuttle_control.h
index a8c2e71d59807f8e06d31f82d7e1bcacdcacf01e..31be53c976c9f40c8ac886aa037e37ccae9cdf4f 100644 (file)
@@ -22,6 +22,7 @@
 #include <gtkmm/drawingarea.h>
 
 #include "gtkmm2ext/binding_proxy.h"
+#include "gtkmm2ext/cairo_widget.h"
 
 #include "pbd/controllable.h"
 #include "ardour/session_handle.h"
@@ -39,14 +40,13 @@ class ShuttleControl : public CairoWidget, public ARDOUR::SessionHandlePtr
        ~ShuttleControl ();
 
        void map_transport_state ();
-       void update_speed_display ();
-        void set_shuttle_fract (double, bool zero_ok = false);
+       void set_shuttle_fract (double, bool zero_ok = false);
        double get_shuttle_fract () const { return shuttle_fract; }
        void set_session (ARDOUR::Session*);
 
        struct ShuttleControllable : public PBD::Controllable {
                ShuttleControllable (ShuttleControl&);
-               void set_value (double);
+               void set_value (double, PBD::Controllable::GroupControlDisposition group_override);
                double get_value (void) const;
 
                 double lower() const { return -1.0; }
@@ -56,6 +56,7 @@ class ShuttleControl : public CairoWidget, public ARDOUR::SessionHandlePtr
        };
 
        boost::shared_ptr<ShuttleControllable> controllable() const { return _controllable; }
+       void set_colors ();
 
   protected:
        bool _hovering;
@@ -73,12 +74,17 @@ class ShuttleControl : public CairoWidget, public ARDOUR::SessionHandlePtr
        Gtk::Menu*        shuttle_style_menu;
        Gtk::Menu*        shuttle_context_menu;
        BindingProxy      binding_proxy;
-
+       Glib::RefPtr<Pango::Layout> left_text;
+       Glib::RefPtr<Pango::Layout> right_text;
+       Pango::AttrList text_attributes;
+       Pango::AttrColor* text_color;
+       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 ();
 
        bool on_enter_notify_event (GdkEventCrossing*);
        bool on_leave_notify_event (GdkEventCrossing*);
@@ -87,7 +93,7 @@ class ShuttleControl : public CairoWidget, public ARDOUR::SessionHandlePtr
        bool on_scroll_event (GdkEventScroll*);
        bool on_motion_notify_event(GdkEventMotion*);
 
-       void render (cairo_t *);
+       void render (cairo_t *, cairo_rectangle_t*);
 
        void on_size_allocate (Gtk::Allocation&);
        bool on_query_tooltip (int, int, bool, const Glib::RefPtr<Gtk::Tooltip>&);