Fix potential crash at exit/close.
[ardour.git] / gtk2_ardour / shuttle_control.h
index 20fe46096f0e9f8254b483e19423939e5d9aa922..74b837fdc7acfc889126b7066f72f076187502e7 100644 (file)
 #include "gtkmm2ext/cairo_widget.h"
 
 #include "pbd/controllable.h"
+
 #include "ardour/session_handle.h"
+#include "ardour/types.h"
+
+#include "ardour_button.h"
 
 namespace Gtk {
        class Menu;
 }
 
-#include "ardour/types.h"
-
 class ShuttleControl : public CairoWidget, public ARDOUR::SessionHandlePtr
 {
-  public:
+public:
        ShuttleControl ();
        ~ShuttleControl ();
 
@@ -49,31 +51,36 @@ 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;
        };
 
        boost::shared_ptr<ShuttleControllable> controllable() const { return _controllable; }
+       void set_colors ();
+
+       ArdourButton* info_button () { return &_info_button; }
 
-  protected:
+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<ShuttleControllable> _controllable;
        cairo_pattern_t* pattern;
        cairo_pattern_t* shine_pattern;
        ARDOUR::microseconds_t last_shuttle_request;
        PBD::ScopedConnection parameter_connection;
+       ArdourButton _info_button;
        Gtk::Menu*        shuttle_unit_menu;
        Gtk::Menu*        shuttle_style_menu;
        Gtk::Menu*        shuttle_context_menu;
        BindingProxy      binding_proxy;
-
+       float bg_r, bg_g, bg_b;
        void build_shuttle_context_menu ();
        void show_shuttle_context_menu ();
        void shuttle_style_changed();
@@ -93,8 +100,8 @@ class ShuttleControl : public CairoWidget, public ARDOUR::SessionHandlePtr
        void on_size_allocate (Gtk::Allocation&);
        bool on_query_tooltip (int, int, bool, const Glib::RefPtr<Gtk::Tooltip>&);
 
-        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);