Add touch-events signal emission to ArdourKnob
authorRobin Gareus <robin@gareus.org>
Sun, 23 Jul 2017 17:40:20 +0000 (19:40 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 23 Jul 2017 17:40:20 +0000 (19:40 +0200)
libs/widgets/ardour_knob.cc
libs/widgets/widgets/ardour_knob.h

index 40adeb7d9083c5de341e7ebfca9457fa579130b3..6f673c5c67fae344c72fe8b5653d5cede2d54357 100644 (file)
@@ -393,6 +393,8 @@ ArdourKnob::on_button_press_event (GdkEventButton *ev)
        if (ev->type != GDK_BUTTON_PRESS) {
                if (_grabbed) {
                        remove_modal_grab();
+                       _grabbed = false;
+                       StopGesture ();
                        gdk_pointer_ungrab (GDK_CURRENT_TIME);
                }
                return true;
@@ -410,6 +412,7 @@ ArdourKnob::on_button_press_event (GdkEventButton *ev)
        _tooltip.start_drag();
        add_modal_grab();
        _grabbed = true;
+       StartGesture ();
        gdk_pointer_grab(ev->window,false,
                        GdkEventMask( Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK |Gdk::BUTTON_RELEASE_MASK),
                        NULL,NULL,ev->time);
@@ -421,6 +424,7 @@ ArdourKnob::on_button_release_event (GdkEventButton *ev)
 {
        _tooltip.stop_drag();
        _grabbed = false;
+       StopGesture ();
        remove_modal_grab();
        gdk_pointer_ungrab (GDK_CURRENT_TIME);
 
index c07b0447cba93d9069895af67243e8cd1a31215a..b424e13a8a0418130a80c0400cae3061bc94ede2 100644 (file)
@@ -91,6 +91,9 @@ public:
 
        void color_handler ();
 
+       sigc::signal<void> StartGesture;
+       sigc::signal<void> StopGesture;
+
   protected:
        void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*);
        void on_size_request (Gtk::Requisition* req);