1 #ifndef ardour_tranzport_control_protocol_h
2 #define ardour_tranzport_control_protocol_h
6 #include <ardour/control_protocol.h>
7 #include <ardour/types.h>
11 class TranzportControlProtocol : public ControlProtocol {
13 TranzportControlProtocol (Session&);
14 virtual ~TranzportControlProtocol();
19 void send_route_feedback (std::list<Route*>&);
20 void send_global_feedback ();
23 static const int VENDORID = 0x165b;
24 static const int PRODUCTID = 0x8101;
25 static const int READ_ENDPOINT = 0x81;
26 static const int WRITE_ENDPOINT = 0x02;
27 const static int STATUS_OFFLINE = 0xff;
28 const static int STATUS_ONLINE = 0x01;
41 ButtonBattery = 0x00004000,
42 ButtonBacklight = 0x00008000,
43 ButtonTrackLeft = 0x04000000,
44 ButtonTrackRight = 0x40000000,
45 ButtonTrackRec = 0x00040000,
46 ButtonTrackMute = 0x00400000,
47 ButtonTrackSolo = 0x00000400,
48 ButtonUndo = 0x80000000,
49 ButtonIn = 0x02000000,
50 ButtonOut = 0x20000000,
51 ButtonPunch = 0x00800000,
52 ButtonLoop = 0x00080000,
53 ButtonPrev = 0x00020000,
54 ButtonAdd = 0x00200000,
55 ButtonNext = 0x00000200,
56 ButtonRewind = 0x01000000,
57 ButtonFastForward = 0x10000000,
58 ButtonStop = 0x00010000,
59 ButtonPlay = 0x00100000,
60 ButtonRecord = 0x00000100,
61 ButtonShift = 0x08000000
68 uint8_t _device_status;
71 uint32_t current_track_id;
78 jack_nframes_t last_where;
82 int write (uint8_t* cmd);
85 int open_core (struct usb_device*);
88 int lcd_write (uint8_t cell, const char *text);
90 int light_on (LightID);
91 int light_off (LightID);
93 void show_current_track ();
95 static void* _thread_work (void* arg);
98 void button_event_battery_press (bool shifted);
99 void button_event_battery_release (bool shifted);
100 void button_event_backlight_press (bool shifted);
101 void button_event_backlight_release (bool shifted);
102 void button_event_trackleft_press (bool shifted);
103 void button_event_trackleft_release (bool shifted);
104 void button_event_trackright_press (bool shifted);
105 void button_event_trackright_release (bool shifted);
106 void button_event_trackrec_press (bool shifted);
107 void button_event_trackrec_release (bool shifted);
108 void button_event_trackmute_press (bool shifted);
109 void button_event_trackmute_release (bool shifted);
110 void button_event_tracksolo_press (bool shifted);
111 void button_event_tracksolo_release (bool shifted);
112 void button_event_undo_press (bool shifted);
113 void button_event_undo_release (bool shifted);
114 void button_event_in_press (bool shifted);
115 void button_event_in_release (bool shifted);
116 void button_event_out_press (bool shifted);
117 void button_event_out_release (bool shifted);
118 void button_event_punch_press (bool shifted);
119 void button_event_punch_release (bool shifted);
120 void button_event_loop_press (bool shifted);
121 void button_event_loop_release (bool shifted);
122 void button_event_prev_press (bool shifted);
123 void button_event_prev_release (bool shifted);
124 void button_event_add_press (bool shifted);
125 void button_event_add_release (bool shifted);
126 void button_event_next_press (bool shifted);
127 void button_event_next_release (bool shifted);
128 void button_event_rewind_press (bool shifted);
129 void button_event_rewind_release (bool shifted);
130 void button_event_fastforward_press (bool shifted);
131 void button_event_fastforward_release (bool shifted);
132 void button_event_stop_press (bool shifted);
133 void button_event_stop_release (bool shifted);
134 void button_event_play_press (bool shifted);
135 void button_event_play_release (bool shifted);
136 void button_event_record_press (bool shifted);
137 void button_event_record_release (bool shifted);
142 #endif // ardour_tranzport_control_protocol_h