reorganize push 2 code and logic to better handle device arrival after program startup
[ardour.git] / libs / surfaces / push2 / push2.h
index ab98b92445ad4a6a7bd351925504274a325db94f..38421a10bce8d923782ee271bc627a0ef45fc2cf 100644 (file)
@@ -370,12 +370,19 @@ class Push2 : public ARDOUR::ControlProtocol
 
   private:
        libusb_device_handle *handle;
+       bool in_use;
        ModifierState _modifier_state;
 
        void do_request (Push2Request*);
-       int stop ();
-       int open ();
-       int close ();
+
+       int begin_using_device ();
+       int stop_using_device ();
+       int device_acquire ();
+       void device_release ();
+       int ports_acquire ();
+       void ports_release ();
+       void run_event_loop ();
+       void stop_event_loop ();
 
        void relax () {}
 
@@ -431,9 +438,6 @@ class Push2 : public ARDOUR::ControlProtocol
 
        bool midi_input_handler (Glib::IOCondition ioc, MIDI::Port* port);
 
-       sigc::connection periodic_connection;
-       bool periodic ();
-
        void thread_init ();
 
        PBD::ScopedConnectionList session_connections;