From 1b830f2604f18149d88b3f2c34cb64660f46d7aa Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 30 Sep 2016 11:22:30 -0400 Subject: reorganize push 2 code and logic to better handle device arrival after program startup Note: we do not handle device departure correctly yet, mostly because the shadow (pad) port has a retained reference somewhere --- libs/surfaces/push2/push2.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'libs/surfaces/push2/push2.h') diff --git a/libs/surfaces/push2/push2.h b/libs/surfaces/push2/push2.h index ab98b92445..38421a10bc 100644 --- a/libs/surfaces/push2/push2.h +++ b/libs/surfaces/push2/push2.h @@ -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; -- cgit v1.2.3