1 #ifndef ardour_tranzport_control_protocol_h
2 #define ardour_tranzport_control_protocol_h
8 #include <ardour/control_protocol.h>
9 #include <ardour/types.h>
13 class TranzportControlProtocol : public ControlProtocol {
15 TranzportControlProtocol (Session&);
16 virtual ~TranzportControlProtocol();
21 void send_route_feedback (std::list<Route*>&);
22 void send_global_feedback ();
25 static const int VENDORID = 0x165b;
26 static const int PRODUCTID = 0x8101;
27 static const int READ_ENDPOINT = 0x81;
28 static const int WRITE_ENDPOINT = 0x02;
29 const static int STATUS_OFFLINE = 0xff;
30 const static int STATUS_ONLINE = 0x01;
43 ButtonBattery = 0x00004000,
44 ButtonBacklight = 0x00008000,
45 ButtonTrackLeft = 0x04000000,
46 ButtonTrackRight = 0x40000000,
47 ButtonTrackRec = 0x00040000,
48 ButtonTrackMute = 0x00400000,
49 ButtonTrackSolo = 0x00000400,
50 ButtonUndo = 0x80000000,
51 ButtonIn = 0x02000000,
52 ButtonOut = 0x20000000,
53 ButtonPunch = 0x00800000,
54 ButtonLoop = 0x00080000,
55 ButtonPrev = 0x00020000,
56 ButtonAdd = 0x00200000,
57 ButtonNext = 0x00000200,
58 ButtonRewind = 0x01000000,
59 ButtonFastForward = 0x10000000,
60 ButtonStop = 0x00010000,
61 ButtonPlay = 0x00100000,
62 ButtonRecord = 0x00000100,
63 ButtonShift = 0x08000000
70 uint8_t _device_status;
73 uint32_t current_track_id;
74 char current_screen[2][20];
75 char next_screen[2][20];
78 std::vector<sigc::connection> track_connections;
85 jack_nframes_t last_where;
88 int read (uint32_t timeout_override = 0);
89 int write (uint8_t* cmd, uint32_t timeout_override = 0);
92 int open_core (struct usb_device*);
95 int lcd_write (uint8_t cell, const char *text);
97 int light_on (LightID);
98 int light_off (LightID);
101 void write_clock (const uint8_t* label);
103 void show_current_track ();
104 void show_transport_time ();
106 void track_solo_changed (void*);
107 void track_rec_changed (void*);
108 void track_mute_changed (void*);
110 static void* _thread_work (void* arg);
111 void* thread_work ();
113 void button_event_battery_press (bool shifted);
114 void button_event_battery_release (bool shifted);
115 void button_event_backlight_press (bool shifted);
116 void button_event_backlight_release (bool shifted);
117 void button_event_trackleft_press (bool shifted);
118 void button_event_trackleft_release (bool shifted);
119 void button_event_trackright_press (bool shifted);
120 void button_event_trackright_release (bool shifted);
121 void button_event_trackrec_press (bool shifted);
122 void button_event_trackrec_release (bool shifted);
123 void button_event_trackmute_press (bool shifted);
124 void button_event_trackmute_release (bool shifted);
125 void button_event_tracksolo_press (bool shifted);
126 void button_event_tracksolo_release (bool shifted);
127 void button_event_undo_press (bool shifted);
128 void button_event_undo_release (bool shifted);
129 void button_event_in_press (bool shifted);
130 void button_event_in_release (bool shifted);
131 void button_event_out_press (bool shifted);
132 void button_event_out_release (bool shifted);
133 void button_event_punch_press (bool shifted);
134 void button_event_punch_release (bool shifted);
135 void button_event_loop_press (bool shifted);
136 void button_event_loop_release (bool shifted);
137 void button_event_prev_press (bool shifted);
138 void button_event_prev_release (bool shifted);
139 void button_event_add_press (bool shifted);
140 void button_event_add_release (bool shifted);
141 void button_event_next_press (bool shifted);
142 void button_event_next_release (bool shifted);
143 void button_event_rewind_press (bool shifted);
144 void button_event_rewind_release (bool shifted);
145 void button_event_fastforward_press (bool shifted);
146 void button_event_fastforward_release (bool shifted);
147 void button_event_stop_press (bool shifted);
148 void button_event_stop_release (bool shifted);
149 void button_event_play_press (bool shifted);
150 void button_event_play_release (bool shifted);
151 void button_event_record_press (bool shifted);
152 void button_event_record_release (bool shifted);
157 #endif // ardour_tranzport_control_protocol_h