+ enum ColorName {
+ DarkBackground,
+ LightBackground,
+
+ ParameterName,
+ StripableName,
+ ClockText,
+
+ KnobArcBackground,
+ KnobArcStart,
+ KnobArcEnd,
+
+ KnobLine,
+ KnobLineShadow,
+
+ KnobForeground,
+ KnobBackground,
+ KnobShadow,
+ KnobBorder,
+ };
+
+ enum PressureMode {
+ AfterTouch,
+ PolyPressure,
+ };
+
+ public:
+ Push2 (ARDOUR::Session&);
+ ~Push2 ();
+
+ static bool probe ();
+ static void* request_factory (uint32_t);
+
+ std::list<boost::shared_ptr<ARDOUR::Bundle> > bundles ();
+
+ bool has_editor () const { return true; }
+ void* get_gui () const;
+ void tear_down_gui ();
+
+ int set_active (bool yn);
+ XMLNode& get_state();
+ int set_state (const XMLNode & node, int version);
+
+ PBD::Signal0<void> ConnectionChange;
+
+ boost::shared_ptr<ARDOUR::Port> input_port();
+ boost::shared_ptr<ARDOUR::Port> output_port();
+
+ 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;
+
+ MusicalMode::Type mode() const { return _mode; }
+ int scale_root() const { return _scale_root; }
+ int root_octave() const { return _root_octave; }
+ bool in_key() const { return _in_key; }
+
+ Push2Layout* current_layout() const;
+ void use_previous_layout ();
+
+ Push2Canvas* canvas() const { return _canvas; }
+
+ enum ModifierState {
+ None = 0,
+ ModShift = 0x1,
+ ModSelect = 0x2,
+ };
+
+ ModifierState modifier_state() const { return _modifier_state; }
+
+ Button* button_by_id (ButtonID);
+ static std::string button_name_by_id (ButtonID);
+
+ void strip_buttons_off ();
+
+ void write (const MidiByteArray&);
+
+ uint8_t get_color_index (ArdourCanvas::Color rgba);
+ ArdourCanvas::Color get_color (ColorName);
+
+ PressureMode pressure_mode () const { return _pressure_mode; }
+ void set_pressure_mode (PressureMode);
+ PBD::Signal1<void,PressureMode> PressureModeChange;
+
+ libusb_device_handle* usb_handle() const { return handle; }
+
+ private:
+ libusb_device_handle *handle;
+ ModifierState _modifier_state;
+
+ void do_request (Push2Request*);
+ int stop ();
+ int open ();
+ int close ();
+