ptformat: Update the lib to 9d0b64f (upstream ptformat)
[ardour.git] / libs / surfaces / push2 / push2.h
index e2da7e7ff21d78e915a6e4ac74282804fbbf3013..bb34f7c016d6cef14163ff48f9f4f2e4814dda96 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "midi++/types.h"
 
+#include "ardour/mode.h"
 #include "ardour/types.h"
 
 #include "control_protocol/control_protocol.h"
@@ -40,7 +41,6 @@
 #include "canvas/colors.h"
 
 #include "midi_byte_array.h"
-#include "mode.h"
 
 namespace Pango {
        class Layout;
@@ -329,6 +329,8 @@ class Push2 : public ARDOUR::ControlProtocol
        int pad_note (int row, int col) const;
        PBD::Signal0<void> PadChange;
 
+       void update_selection_color ();
+
        void set_pad_scale (int root, int octave, MusicalMode::Type mode, bool inkey);
        PBD::Signal0<void> ScaleChange;
 
@@ -368,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 () {}
 
@@ -429,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;
@@ -470,6 +476,8 @@ class Push2 : public ARDOUR::ControlProtocol
        void button_add_track ();
        void button_stop ();
        void button_master ();
+       void button_quantize ();
+       void button_duplicate ();
        void button_shift_press ();
        void button_shift_release ();
        void button_shift_long_press ();
@@ -512,10 +520,9 @@ class Push2 : public ARDOUR::ControlProtocol
        void other_vpot (int, int);
        void other_vpot_touch (int, bool);
 
-       /* special Stripables */
+       /* special Stripable */
 
        boost::shared_ptr<ARDOUR::Stripable> master;
-       boost::shared_ptr<ARDOUR::Stripable> monitor;
 
        sigc::connection vblank_connection;
        bool vblank ();
@@ -595,6 +602,8 @@ class Push2 : public ARDOUR::ControlProtocol
 
        uint8_t selection_color;
        uint8_t contrast_color;
+
+       bool in_range_select;
 };
 
 } /* namespace */