globally remove all trailing whitespace from ardour code base.
[ardour.git] / libs / surfaces / tranzport / tranzport_base.h
1 /*
2  *   Copyright (C) 2006 Paul Davis
3  *   Copyright (C) 2007 Michael Taht
4  *
5  *   This program is free software; you can redistribute it and/or modify
6  *   it under the terms of the GNU General Public License as published by
7  *   the Free Software Foundation; either version 2 of the License, or
8  *   (at your option) any later version.
9  *
10  *   This program is distributed in the hope that it will be useful,
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *   GNU General Public License for more details.
14  *
15  *   You should have received a copy of the GNU General Public License
16  *   along with this program; if not, write to the Free Software
17  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  *
19  *   */
20
21 /* This header file is basically where all the tranzport debuggable options go.
22    Try to only check it in with minimal debugging enabled so production
23    systems don't have to fiddle with it. */
24
25 /* Design notes: The tranzport is a unique device, basically a
26    20x2 character lcd gui with (almost) 22 shift keys and 8 blinking lights.
27
28    As such it has several unique constraints. In the libusb driver,
29    the device exerts flow control
30    by having a usb write fail. It is pointless to retry madly at that point,
31    the device is busy, and it's not going to become unbusy very quickly.
32
33    So writes need to be either "mandatory" or "unreliable", and therein
34    lies the rub, as the kernel can also drop writes, and missing an
35    interrupt in userspace is also generally bad.
36
37    However, the kernel driver retries writes for you and also buffers and
38    compresses incoming wheel events - it will rarely, if ever, drop data.
39
40    A more complex surface might have hundreds of lights and several displays.
41
42    mike@taht.net
43 */
44
45 #ifndef ardour_tranzport_base
46 #define ardour_tranzport_base
47
48 #define DEFAULT_USB_TIMEOUT 10
49 #define MAX_RETRY 1
50 #define MAX_TRANZPORT_INFLIGHT 4
51 #define DEBUG_TRANZPORT 0
52
53 #ifndef HAVE_TRANZPORT_KERNEL_DRIVER
54 #define HAVE_TRANZPORT_KERNEL_DRIVER 0
55 #endif
56
57 #ifndef HAVE_TRANZPORT_MIDI_DRIVER
58 #define HAVE_TRANZPORT_MIDI_DRIVER 0
59 #endif
60
61 // for now, this is what the device is called
62 #define TRANZPORT_DEVICE "/dev/tranzport0"
63
64 #if DEBUG_TRANZPORT > 0
65 #define DEBUG_TRANZPORT_SCREEN 10
66 #define DEBUG_TRANZPORT_BITS 10
67 #define DEBUG_TRANZPORT_LIGHTS 10
68 #define DEBUG_TRANZPORT_STATE 10
69 #else
70 #define DEBUG_TRANZPORT 0
71 #define DEBUG_TRANZPORT_BITS 0
72 #define DEBUG_TRANZPORT_SCREEN 0
73 #define DEBUG_TRANZPORT_LIGHTS 0
74 #define DEBUG_TRANZPORT_STATE 0
75 #endif
76 #endif /* ardour_tranzport_base */
77