summaryrefslogtreecommitdiff
path: root/libs/surfaces/push2/push2.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-09-16 08:39:28 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2016-09-27 14:59:31 -0500
commit7c9f3acc60fb29a562d28d1f43a9e22298545bf1 (patch)
tree7418a4922ff7670d6ffc08dce39432afd1e5669c /libs/surfaces/push2/push2.h
parent2810e5619a1926a286c6192143ada4973066efd8 (diff)
first compiling and theoretically correct version of Push2 canvas display.
Not tested with device at this point
Diffstat (limited to 'libs/surfaces/push2/push2.h')
-rw-r--r--libs/surfaces/push2/push2.h39
1 files changed, 13 insertions, 26 deletions
diff --git a/libs/surfaces/push2/push2.h b/libs/surfaces/push2/push2.h
index be4c116895..4704ce9a30 100644
--- a/libs/surfaces/push2/push2.h
+++ b/libs/surfaces/push2/push2.h
@@ -27,8 +27,6 @@
#include <libusb.h>
-#include <cairomm/refptr.h>
-
#define ABSTRACT_UI_EXPORTS
#include "pbd/abstract_ui.h"
@@ -42,11 +40,6 @@
#include "midi_byte_array.h"
#include "mode.h"
-namespace Cairo {
- class ImageSurface;
- class Context;
-}
-
namespace Pango {
class Layout;
}
@@ -74,6 +67,7 @@ public:
class P2GUI;
class Push2Menu;
class Push2Layout;
+class Push2Canvas;
class Push2 : public ARDOUR::ControlProtocol
, public AbstractUI<Push2Request>
@@ -341,6 +335,7 @@ class Push2 : public ARDOUR::ControlProtocol
bool in_key() const { return _in_key; }
Push2Layout* current_layout() const;
+ Push2Canvas* canvas() const { return _canvas; }
enum ModifierState {
None = 0,
@@ -357,33 +352,20 @@ class Push2 : public ARDOUR::ControlProtocol
uint8_t get_color_index (uint32_t rgb);
uint32_t get_color (ColorName);
- static const int cols;
- static const int rows;
-
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;
- uint8_t frame_header[16];
- uint16_t* device_frame_buffer;
- int device_buffer;
- Cairo::RefPtr<Cairo::ImageSurface> frame_buffer;
- sigc::connection vblank_connection;
- sigc::connection periodic_connection;
-
ModifierState _modifier_state;
- static const int pixels_per_row;
-
void do_request (Push2Request*);
int stop ();
int open ();
int close ();
- bool redraw ();
- int blit_to_device_frame_buffer ();
- bool vblank ();
void relax () {}
@@ -431,6 +413,8 @@ class Push2 : public ARDOUR::ControlProtocol
void handle_midi_sysex (MIDI::Parser&, MIDI::byte *, size_t count);
bool midi_input_handler (Glib::IOCondition ioc, MIDI::Port* port);
+
+ sigc::connection periodic_connection;
bool periodic ();
void thread_init ();
@@ -517,13 +501,16 @@ class Push2 : public ARDOUR::ControlProtocol
boost::shared_ptr<ARDOUR::Stripable> master;
boost::shared_ptr<ARDOUR::Stripable> monitor;
- /* Cairo graphics context */
-
- Cairo::RefPtr<Cairo::Context> context;
+ sigc::connection vblank_connection;
+ bool vblank ();
void splash ();
ARDOUR::microseconds_t splash_start;
+ /* the canvas */
+
+ Push2Canvas* _canvas;
+
/* Layouts */
mutable Glib::Threads::Mutex layout_lock;