summaryrefslogtreecommitdiff
path: root/libs/surfaces/frontier
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-10-04 14:51:05 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2015-10-04 14:51:05 -0400
commit4dc63966f0872efe768dad61eb9b8785d06b92d1 (patch)
treee54104d57d6c2da7840979181368151fd0819c96 /libs/surfaces/frontier
parent297e80e020da94a56984b20782584bb1dd96ea34 (diff)
globally remove all trailing whitespace from ardour code base.
Paul Davis was responsible for introducing almost all of this.
Diffstat (limited to 'libs/surfaces/frontier')
-rw-r--r--libs/surfaces/frontier/kernel_drivers/tests/tranzport.c2
-rw-r--r--libs/surfaces/frontier/kernel_drivers/tranzport.c46
-rw-r--r--libs/surfaces/frontier/tranzport/interface.cc4
-rw-r--r--libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc176
-rw-r--r--libs/surfaces/frontier/tranzport/tranzport_control_protocol.h6
5 files changed, 117 insertions, 117 deletions
diff --git a/libs/surfaces/frontier/kernel_drivers/tests/tranzport.c b/libs/surfaces/frontier/kernel_drivers/tests/tranzport.c
index 2ef5b6c910..96bc3f95ef 100644
--- a/libs/surfaces/frontier/kernel_drivers/tests/tranzport.c
+++ b/libs/surfaces/frontier/kernel_drivers/tests/tranzport.c
@@ -197,7 +197,7 @@ int tranzport_read(tranzport_t *z, uint8_t *status, uint32_t *buttons, uint8_t *
if (val < 0) {
printf("errno: %d\n",errno);
switch(errno) {
- case ENOENT: ;
+ case ENOENT: ;
case ECONNRESET: ;
case ESHUTDOWN: printf("dying\n"); exit(1); break;
}
diff --git a/libs/surfaces/frontier/kernel_drivers/tranzport.c b/libs/surfaces/frontier/kernel_drivers/tranzport.c
index b7b6709d56..951be979d0 100644
--- a/libs/surfaces/frontier/kernel_drivers/tranzport.c
+++ b/libs/surfaces/frontier/kernel_drivers/tranzport.c
@@ -7,7 +7,7 @@
*
* Copyright (C) 2004 Greg Kroah-Hartman (greg@kroah.com)
* Copyright (C) 2005 Michael Hund <mhund@ld-didactic.de>
- *
+ *
* The ldusb driver was, in turn, derived from Lego USB Tower driver
* Copyright (C) 2003 David Glance <advidgsf@sourceforge.net>
* 2001-2004 Juergen Stuber <starblue@users.sourceforge.net>
@@ -25,10 +25,10 @@
*/
/* Note: this currently uses a dumb ringbuffer for reads and writes.
- * A more optimal driver would cache and kill off outstanding urbs that are
+ * A more optimal driver would cache and kill off outstanding urbs that are
* now invalid, and ignore ones that already were in the queue but valid
* as we only have 17 commands for the tranzport. In particular this is
- * key for getting lights to flash in time as otherwise many commands
+ * key for getting lights to flash in time as otherwise many commands
* can be buffered up before the light change makes it to the interface.
*/
@@ -171,7 +171,7 @@ static int write_buffer_size = WRITE_BUFFER_SIZE;
module_param(write_buffer_size, int, S_IRUGO);
MODULE_PARM_DESC(write_buffer_size, "Write buffer size");
-/*
+/*
* Increase the interval for debugging purposes.
* or set to 1 to use the standard interval from the endpoint descriptors.
*/
@@ -221,7 +221,7 @@ struct usb_tranzport {
int event; /* alternate interface to events */
int wheel; /* - for negative, 0 for none, + for positive */
- int lights;
+ int lights;
unsigned char dump_state; /* 0 if disabled 1 if enabled */
unsigned char enable; /* 0 if disabled 1 if enabled */
unsigned char offline; /* if the device is out of range or asleep */
@@ -391,10 +391,10 @@ static void usb_tranzport_interrupt_in_callback(struct urb *urb)
goto resubmit; /* maybe we can recover */
}
}
-
+
if (urb->actual_length != 8) {
dev_warn(&dev->intf->dev,
- "Urb length was %d bytes!! Do something intelligent \n", urb->actual_length);
+ "Urb length was %d bytes!! Do something intelligent \n", urb->actual_length);
} else {
dbg_info(&dev->intf->dev, "%s: received: %02x%02x%02x%02x%02x%02x%02x%02x\n",
__FUNCTION__, dev->interrupt_in_buffer[0],dev->interrupt_in_buffer[1],dev->interrupt_in_buffer[2],dev->interrupt_in_buffer[3],dev->interrupt_in_buffer[4],dev->interrupt_in_buffer[5],dev->interrupt_in_buffer[6],dev->interrupt_in_buffer[7]);
@@ -406,7 +406,7 @@ static void usb_tranzport_interrupt_in_callback(struct urb *urb)
if(dev->offline > 0 && dev->interrupt_in_buffer[1] != 0xff) { dev->offline = 0; }
if(dev->offline == 0 && dev->interrupt_in_buffer[1] == 0xff) { dev->offline = 1; }
-#endif
+#endif
dbg_info(&dev->intf->dev, "%s: head, tail are %x, %x\n", __FUNCTION__,dev->ring_head,dev->ring_tail);
next_ring_head = (dev->ring_head+1) % ring_buffer_size;
@@ -422,17 +422,17 @@ static void usb_tranzport_interrupt_in_callback(struct urb *urb)
urb->actual_length);
memset(dev->interrupt_in_buffer, 0, urb->actual_length);
}
- }
+ }
resubmit:
/* resubmit if we're still running */
if (dev->interrupt_in_running && dev->intf) {
- retval = usb_submit_urb(dev->interrupt_in_urb, GFP_ATOMIC);
+ retval = usb_submit_urb(dev->interrupt_in_urb, GFP_ATOMIC);
if (retval)
dev_err(&dev->intf->dev,
"usb_submit_urb failed (%d)\n", retval);
}
-
+
exit:
dev->interrupt_in_done = 1;
wake_up_interruptible(&dev->read_wait);
@@ -662,7 +662,7 @@ static ssize_t usb_tranzport_read(struct file *file, char __user *buffer, size_t
retval = wait_event_interruptible(dev->read_wait, dev->interrupt_in_done);
if (retval < 0) {
goto unlock_exit;
- }
+ }
}
dbg_info(&dev->intf->dev, "%s: copying to userspace: %02x%02x%02x%02x%02x%02x%02x%02x\n",
@@ -673,10 +673,10 @@ static ssize_t usb_tranzport_read(struct file *file, char __user *buffer, size_t
while((c < count) && (dev->ring_tail != dev->ring_head)) {
/* This started off in the lower level service routine, and I moved it here. Then my brain died. Not done yet. */
-#if COMPRESS_WHEEL_EVENTS
+#if COMPRESS_WHEEL_EVENTS
next_tail = (dev->ring_tail+1) % ring_buffer_size;
if(dev->compress_wheel) cancompress = 1;
- while(dev->ring_head != next_tail && cancompress == 1 ) {
+ while(dev->ring_head != next_tail && cancompress == 1 ) {
newwheel = (*dev->ring_buffer)[next_tail].cmd[6];
oldwheel = (*dev->ring_buffer)[dev->ring_tail].cmd[6];
// if both are wheel events, and no buttons have changes (FIXME, do I have to check?),
@@ -688,9 +688,9 @@ static ssize_t usb_tranzport_read(struct file *file, char __user *buffer, size_t
__FUNCTION__, (*dev->ring_buffer)[dev->ring_tail].cmd[0],(*dev->ring_buffer)[dev->ring_tail].cmd[1],(*dev->ring_buffer)[dev->ring_tail].cmd[2],(*dev->ring_buffer)[dev->ring_tail].cmd[3],(*dev->ring_buffer)[dev->ring_tail].cmd[4],(*dev->ring_buffer)[dev->ring_tail].cmd[5],(*dev->ring_buffer)[dev->ring_tail].cmd[6],(*dev->ring_buffer)[dev->ring_tail].cmd[7]);
- if(((*dev->ring_buffer)[dev->ring_tail].cmd[6] != 0 &&
- (*dev->ring_buffer)[next_tail].cmd[6] != 0 ) &&
- ((newwheel > 0 && oldwheel > 0) ||
+ if(((*dev->ring_buffer)[dev->ring_tail].cmd[6] != 0 &&
+ (*dev->ring_buffer)[next_tail].cmd[6] != 0 ) &&
+ ((newwheel > 0 && oldwheel > 0) ||
(newwheel < 0 && oldwheel < 0)) &&
((*dev->ring_buffer)[dev->ring_tail].cmd[2] == (*dev->ring_buffer)[next_tail].cmd[2]) &&
((*dev->ring_buffer)[dev->ring_tail].cmd[3] == (*dev->ring_buffer)[next_tail].cmd[3]) &&
@@ -702,15 +702,15 @@ static ssize_t usb_tranzport_read(struct file *file, char __user *buffer, size_t
newwheel += oldwheel;
if(oldwheel > 0 && !(newwheel > 0)) {
- newwheel = 0x7f;
+ newwheel = 0x7f;
cancompress = 0;
}
if(oldwheel < 0 && !(newwheel < 0)) {
- newwheel = 0x80;
+ newwheel = 0x80;
cancompress = 0;
}
- (*dev->ring_buffer)[next_tail].cmd[6] = newwheel;
+ (*dev->ring_buffer)[next_tail].cmd[6] = newwheel;
dev->ring_tail = next_tail;
next_tail = (dev->ring_tail+1) % ring_buffer_size;
} else {
@@ -729,7 +729,7 @@ static ssize_t usb_tranzport_read(struct file *file, char __user *buffer, size_t
dbg_info(&dev->intf->dev, "%s: head, tail are %x, %x\n", __FUNCTION__,dev->ring_head,dev->ring_tail);
}
retval = c;
-
+
#else
if (copy_to_user(buffer, &(*dev->ring_buffer)[dev->ring_tail], 8)) {
retval = -EFAULT;
@@ -916,13 +916,13 @@ static int usb_tranzport_probe(struct usb_interface *intf, const struct usb_devi
true_size = min(ring_buffer_size,RING_BUFFER_SIZE);
/* FIXME - there are more usb_alloc routines for dma correctness. Needed? */
- dev->ring_buffer = kmalloc((true_size*sizeof(struct tranzport_cmd))+8, GFP_KERNEL);
+ dev->ring_buffer = kmalloc((true_size*sizeof(struct tranzport_cmd))+8, GFP_KERNEL);
if (!dev->ring_buffer) {
dev_err(&intf->dev, "Couldn't allocate ring_buffer of size %d\n",true_size);
goto error;
}
- dev->interrupt_in_buffer = kmalloc(dev->interrupt_in_endpoint_size, GFP_KERNEL);
+ dev->interrupt_in_buffer = kmalloc(dev->interrupt_in_endpoint_size, GFP_KERNEL);
if (!dev->interrupt_in_buffer) {
dev_err(&intf->dev, "Couldn't allocate interrupt_in_buffer\n");
goto error;
diff --git a/libs/surfaces/frontier/tranzport/interface.cc b/libs/surfaces/frontier/tranzport/interface.cc
index feb4a951c8..e60524d24c 100644
--- a/libs/surfaces/frontier/tranzport/interface.cc
+++ b/libs/surfaces/frontier/tranzport/interface.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012 Paul Davis
+ Copyright (C) 2012 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -62,7 +62,7 @@ static ControlProtocolDescriptor tranzport_descriptor = {
extern "C" {
-ControlProtocolDescriptor*
+ControlProtocolDescriptor*
protocol_descriptor () {
return &tranzport_descriptor;
}
diff --git a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc
index f83e55c9d9..773ac2d5a1 100644
--- a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc
+++ b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006 Paul Davis
+ Copyright (C) 2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,14 +17,14 @@
*/
-/* Design notes: The tranzport is a unique device, basically a
- 20 lcd gui with 22 shift keys and 8 blinking lights.
+/* Design notes: The tranzport is a unique device, basically a
+ 20 lcd gui with 22 shift keys and 8 blinking lights.
As such it has several unique constraints. The device exerts flow control
by having a usb write fail. It is pointless to retry madly at that point,
- the device is busy, and it's not going to become unbusy very quickly.
+ the device is busy, and it's not going to become unbusy very quickly.
- So writes need to be either "mandatory" or "unreliable", and therein
+ So writes need to be either "mandatory" or "unreliable", and therein
lies the rub, as the kernel can also drop writes, and missing an
interrupt in userspace is also generally bad.
@@ -81,7 +81,7 @@ static const uint8_t cmd_light_on[] = { 0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00
static const uint8_t cmd_light_off[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
static const uint8_t cmd_write_screen[] = { 0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00 };
-static inline double
+static inline double
gain_to_slider_position (ARDOUR::gain_t g)
{
if (g == 0) return 0;
@@ -89,7 +89,7 @@ gain_to_slider_position (ARDOUR::gain_t g)
}
-static inline ARDOUR::gain_t
+static inline ARDOUR::gain_t
slider_position_to_gain (double pos)
{
/* XXX Marcus writes: this doesn't seem right to me. but i don't have a better answer ... */
@@ -127,30 +127,30 @@ TranzportControlProtocol::TranzportControlProtocol (Session& s)
print(1,0,"!Peace through Music!");
}
-void TranzportControlProtocol::light_validate (LightID light)
+void TranzportControlProtocol::light_validate (LightID light)
{
lights_invalid[light] = 0;
}
-void TranzportControlProtocol::light_invalidate (LightID light)
+void TranzportControlProtocol::light_invalidate (LightID light)
{
lights_invalid[light] = 1;
}
-void TranzportControlProtocol::lights_validate ()
+void TranzportControlProtocol::lights_validate ()
{
- memset (lights_invalid, 0, sizeof (lights_invalid));
+ memset (lights_invalid, 0, sizeof (lights_invalid));
}
-void TranzportControlProtocol::lights_invalidate ()
+void TranzportControlProtocol::lights_invalidate ()
{
- memset (lights_invalid, 1, sizeof (lights_invalid));
+ memset (lights_invalid, 1, sizeof (lights_invalid));
}
void TranzportControlProtocol::lights_init()
{
for (uint32_t i = 0; i < sizeof(lights_current)/sizeof(lights_current[0]); i++) {
- lights_invalid[i] = lights_current[i] =
+ lights_invalid[i] = lights_current[i] =
lights_pending[i] = lights_flash[i] = false;
}
}
@@ -165,9 +165,9 @@ TranzportControlProtocol::lights_flush ()
// Figure out iterators one day soon
// for (LightID i = i.start(), i = i.end(); i++) {
// if (lights_pending[i] != lights_current[i] || lights_invalid[i]) {
- // if (light_set(i, lights_pending[i])) {
+ // if (light_set(i, lights_pending[i])) {
// return i-1;
- // }
+ // }
// }
//}
if ((lights_pending[LightRecord] != lights_current[LightRecord]) || lights_invalid[LightRecord]) {
@@ -217,7 +217,7 @@ void
TranzportControlProtocol::screen_clear ()
{
const char *blank = " ";
- print(0,0,blank);
+ print(0,0,blank);
print(1,0,blank);
}
@@ -252,35 +252,35 @@ TranzportControlProtocol::screen_flush ()
for (row = 0; row < 2 && pending == 0; row++) {
for (col_base = 0, col = 0; col < 20 && pending == 0; ) {
- if ((screen_pending[row][col] != screen_current[row][col])
+ if ((screen_pending[row][col] != screen_current[row][col])
|| screen_invalid[row][col]) {
/* something in this cell is different, so dump the cell to the device. */
- uint8_t cmd[8];
- cmd[0] = 0x00;
- cmd[1] = 0x01;
- cmd[2] = cell;
- cmd[3] = screen_pending[row][col_base];
+ uint8_t cmd[8];
+ cmd[0] = 0x00;
+ cmd[1] = 0x01;
+ cmd[2] = cell;
+ cmd[3] = screen_pending[row][col_base];
cmd[4] = screen_pending[row][col_base+1];
- cmd[5] = screen_pending[row][col_base+2];
+ cmd[5] = screen_pending[row][col_base+2];
cmd[6] = screen_pending[row][col_base+3];
cmd[7] = 0x00;
if(write(cmd) != 0) {
/* try to update this cell on the next go-round */
#if DEBUG_TRANZPORT > 4
- printf("usb screen update failed for some reason... why? \ncmd and data were %02x %02x %02x %02x %02x %02x %02x %02x\n",
- cmd[0],cmd[1],cmd[2], cmd[3], cmd[4], cmd[5],cmd[6],cmd[7]);
+ printf("usb screen update failed for some reason... why? \ncmd and data were %02x %02x %02x %02x %02x %02x %02x %02x\n",
+ cmd[0],cmd[1],cmd[2], cmd[3], cmd[4], cmd[5],cmd[6],cmd[7]);
#endif
pending += 1;
// Shouldn't need to do this
- // screen_invalid[row][col_base] = screen_invalid[row][col_base+1] =
+ // screen_invalid[row][col_base] = screen_invalid[row][col_base+1] =
// screen_invalid[row][col_base+2] = screen_invalid[row][col_base+3] = true;
} else {
/* successful write: copy to current cached display */
- screen_invalid[row][col_base] = screen_invalid[row][col_base+1] =
+ screen_invalid[row][col_base] = screen_invalid[row][col_base+1] =
screen_invalid[row][col_base+2] = screen_invalid[row][col_base+3] = false;
memcpy (&screen_current[row][col_base], &screen_pending[row][col_base], 4);
}
@@ -308,7 +308,7 @@ TranzportControlProtocol::screen_flush ()
// Tranzport specific
-void TranzportControlProtocol::invalidate()
+void TranzportControlProtocol::invalidate()
{
lcd_damage(); lights_invalidate(); screen_invalidate(); // one of these days lcds can be fine but screens not
}
@@ -347,7 +347,7 @@ TranzportControlProtocol::set_active (bool yn)
close ();
_active = false;
cerr << "End tranzport shutdown\n";
- }
+ }
}
return 0;
@@ -359,13 +359,13 @@ TranzportControlProtocol::show_track_gain ()
if (route_table[0]) {
gain_t g = route_get_gain (0);
if ((g != last_track_gain) || lcd_isdamaged(0,9,8)) {
- char buf[16];
+ char buf[16];
snprintf (buf, sizeof (buf), "%6.1fdB", coefficient_to_dB (route_get_effective_gain (0)));
- print (0, 9, buf);
+ print (0, 9, buf);
last_track_gain = g;
}
} else {
- print (0, 9, " ");
+ print (0, 9, " ");
}
}
@@ -399,7 +399,7 @@ TranzportControlProtocol::next_display_mode ()
enter_big_meter_mode();
break;
- case DisplayConfig:
+ case DisplayConfig:
case DisplayBling:
case DisplayBlingMeter:
enter_normal_display_mode();
@@ -480,7 +480,7 @@ log_meter (float db)
def = (db + 20.0f) * 2.5f + 50.0f;
}
- /* 115 is the deflection %age that would be
+ /* 115 is the deflection %age that would be
when db=6.0. this is an arbitrary
endpoint for our scaling.
*/
@@ -495,7 +495,7 @@ TranzportControlProtocol::show_meter ()
if (route_table[0] == 0) {
// Principle of least surprise
print (0, 0, "No audio to meter!!!");
- print (1, 0, "Select another track");
+ print (1, 0, "Select another track");
return;
}
@@ -531,7 +531,7 @@ TranzportControlProtocol::show_meter ()
for (i = 0; i < fill; ++i) {
buf[i] = 0x07; /* tranzport special code for 4 quadrant LCD block */
- }
+ }
/* add a possible half-step */
@@ -556,7 +556,7 @@ TranzportControlProtocol::show_meter ()
void
TranzportControlProtocol::show_bbt (framepos_t where)
-{
+{
if ((where != last_where) || lcd_isdamaged(1,9,8)) {
char buf[16];
Timecode::BBT_Time bbt;
@@ -618,7 +618,7 @@ TranzportControlProtocol::show_smpte (framepos_t where)
print (1, 15, buf);
sprintf (buf, "%02" PRIu32, smpte.frames);
- print_noretry (1, 18, buf);
+ print_noretry (1, 18, buf);
last_where = where;
}
@@ -630,7 +630,7 @@ TranzportControlProtocol::_monitor_work (void* arg)
return static_cast<TranzportControlProtocol*>(arg)->monitor_work ();
}
-// I note that these usb specific open, close, probe, read routines are basically
+// I note that these usb specific open, close, probe, read routines are basically
// pure boilerplate and could easily be abstracted elsewhere
#if !HAVE_TRANZPORT_KERNEL_DRIVER
@@ -649,7 +649,7 @@ TranzportControlProtocol::probe ()
for(dev = bus->devices; dev; dev = dev->next) {
if (dev->descriptor.idVendor == VENDORID && dev->descriptor.idProduct == PRODUCTID) {
- return true;
+ return true;
}
}
}
@@ -689,7 +689,7 @@ TranzportControlProtocol::open_core (struct usb_device* dev)
error << _("Tranzport: cannot open USB transport") << endmsg;
return -1;
}
-
+
if (usb_claim_interface (udev, 0) < 0) {
error << _("Tranzport: cannot claim USB interface") << endmsg;
usb_close (udev);
@@ -727,7 +727,7 @@ TranzportControlProtocol::close ()
return ret;
}
-int TranzportControlProtocol::read(uint8_t *buf, uint32_t timeout_override)
+int TranzportControlProtocol::read(uint8_t *buf, uint32_t timeout_override)
{
int val;
// Get smarter about handling usb errors soon. Like disconnect
@@ -735,7 +735,7 @@ int TranzportControlProtocol::read(uint8_t *buf, uint32_t timeout_override)
val = usb_interrupt_read (udev, READ_ENDPOINT, (char *) buf, 8, 10);
// pthread_testcancel();
return val;
-}
+}
int
@@ -803,18 +803,18 @@ TranzportControlProtocol::write (uint8_t* cmd, uint32_t timeout_override)
// We have a state "Unknown" - STOP USING SPACES FOR IT - switching to arrow character
// We have another state - no_retry. Misleading, as we still retry on the next pass
-// I think it's pointless to keep no_retry and instead we should throttle writes
+// I think it's pointless to keep no_retry and instead we should throttle writes
// We have an "displayed" screen
// We always draw into the pending screen, which could be any of several screens
// We have an active screen
-// Print arg - we have
+// Print arg - we have
// setactive
// so someday I think we need a screen object.
/*
screen_flash.clear();
screen_flash.print(0,0,"Undone:"); // Someday pull the undo stack from somewhere
-screen_flash.print(1,0,"Nextup:");
+screen_flash.print(1,0,"Nextup:");
if(flash_messages && lcd.getactive() != screen_flash) lcd.setactive(screen_flash,2000);
@@ -828,14 +828,14 @@ TranzportControlProtocol::flush ()
{
int pending = 0;
if(!(pending = lights_flush())) {
- pending = screen_flush();
- }
+ pending = screen_flush();
+ }
return pending;
}
// doing these functions made me realize that screen_invalid should be lcd_isdamaged FIXME soon
-bool TranzportControlProtocol::lcd_damage()
+bool TranzportControlProtocol::lcd_damage()
{
screen_invalidate();
return true;
@@ -845,7 +845,7 @@ bool TranzportControlProtocol::lcd_damage (int row, int col, int length)
{
bool result = false;
int endcol = col+length-1;
- if((endcol > 19)) { endcol = 19; }
+ if((endcol > 19)) { endcol = 19; }
if((row >= 0 && row < 2) && (col >=0 && col < 20)) {
for(int c = col; c < endcol; c++) {
screen_invalid[row][c] = true;
@@ -858,7 +858,7 @@ bool TranzportControlProtocol::lcd_damage (int row, int col, int length)
// Gotta switch to bitfields, this is collossally dumb
// Still working on the layering, arguably screen_invalid should be lcd_invalid
-bool TranzportControlProtocol::lcd_isdamaged ()
+bool TranzportControlProtocol::lcd_isdamaged ()
{
for(int r = 0; r < 2; r++) {
for(int c = 0; c < 20; c++) {
@@ -877,7 +877,7 @@ bool TranzportControlProtocol::lcd_isdamaged (int row, int col, int length)
{
bool result = 0;
int endcol = col+length;
- if((endcol > 19)) { endcol = 19; }
+ if((endcol > 19)) { endcol = 19; }
if((row >= 0 && row < 2) && (col >=0 && col < 20)) {
for(int c = col; c < endcol; c++) {
if(screen_invalid[row][c]) {
@@ -907,22 +907,22 @@ TranzportControlProtocol::lcd_clear ()
int
TranzportControlProtocol::lcd_flush ()
{
- return 0;
+ return 0;
}
-int
+int
TranzportControlProtocol::lcd_write(uint8_t* cmd, uint32_t timeout_override)
{
return write(cmd,timeout_override);
}
-void
-TranzportControlProtocol::lcd_fill (uint8_t fill_char)
+void
+TranzportControlProtocol::lcd_fill (uint8_t fill_char)
{
}
-void
-TranzportControlProtocol::lcd_print (int row, int col, const char* text)
+void
+TranzportControlProtocol::lcd_print (int row, int col, const char* text)
{
print(row,col,text);
}
@@ -937,18 +937,18 @@ void TranzportControlProtocol::lcd_print_noretry (int row, int col, const char*
void
TranzportControlProtocol::lights_on ()
{
- lights_pending[LightRecord] = lights_pending[LightTrackrec] =
- lights_pending[LightTrackmute] = lights_pending[LightTracksolo] =
- lights_pending[LightAnysolo] = lights_pending[LightLoop] =
+ lights_pending[LightRecord] = lights_pending[LightTrackrec] =
+ lights_pending[LightTrackmute] = lights_pending[LightTracksolo] =
+ lights_pending[LightAnysolo] = lights_pending[LightLoop] =
lights_pending[LightPunch] = true;
}
void
TranzportControlProtocol::lights_off ()
{
- lights_pending[LightRecord] = lights_pending[LightTrackrec] =
- lights_pending[LightTrackmute] = lights_pending[LightTracksolo] =
- lights_pending[LightAnysolo] = lights_pending[LightLoop] =
+ lights_pending[LightRecord] = lights_pending[LightTrackrec] =
+ lights_pending[LightTrackmute] = lights_pending[LightTracksolo] =
+ lights_pending[LightAnysolo] = lights_pending[LightLoop] =
lights_pending[LightPunch] = false;
}
@@ -982,7 +982,7 @@ TranzportControlProtocol::light_set (LightID light, bool offon)
}
}
-int TranzportControlProtocol::rtpriority_set(int priority)
+int TranzportControlProtocol::rtpriority_set(int priority)
{
struct sched_param rtparam;
int err;
@@ -990,19 +990,19 @@ int TranzportControlProtocol::rtpriority_set(int priority)
char *a = (char*) alloca(4096*2); a[0] = 'a'; a[4096] = 'b';
memset (&rtparam, 0, sizeof (rtparam));
rtparam.sched_priority = priority; /* XXX should be relative to audio (JACK) thread */
- // Note - try SCHED_RR with a low limit
+ // Note - try SCHED_RR with a low limit
// - we don't care if we can't write everything this ms
// and it will help if we lose the device
if ((err = pthread_setschedparam (pthread_self(), SCHED_FIFO, &rtparam)) != 0) {
PBD::info << string_compose (_("%1: thread not running with realtime scheduling (%2)"), name(), strerror (errno)) << endmsg;
return 1;
- }
+ }
return 0;
}
// Running with realtime privs is bad when you have problems
-int TranzportControlProtocol::rtpriority_unset(int priority)
+int TranzportControlProtocol::rtpriority_unset(int priority)
{
struct sched_param rtparam;
int err;
@@ -1011,7 +1011,7 @@ int TranzportControlProtocol::rtpriority_unset(int priority)
if ((err = pthread_setschedparam (pthread_self(), SCHED_FIFO, &rtparam)) != 0) {
PBD::info << string_compose (_("%1: can't stop realtime scheduling (%2)"), name(), strerror (errno)) << endmsg;
return 1;
- }
+ }
PBD::info << string_compose (_("%1: realtime scheduling stopped (%2)"), name(), strerror (errno)) << endmsg;
return 0;
}
@@ -1041,10 +1041,10 @@ TranzportControlProtocol::monitor_work ()
if (_device_status == STATUS_OFFLINE) {
first_time = true;
- if(offline++ == 1) {
+ if(offline++ == 1) {
cerr << "Transport has gone offline\n";
}
- } else {
+ } else {
offline = 0; // hate writing this
}
@@ -1075,7 +1075,7 @@ TranzportControlProtocol::monitor_work ()
// pending = flush();
if(pending == 0) {
- pending = flush();
+ pending = flush();
} else {
if(inflight > 0) {
pending = --inflight; // we just did a whole bunch of writes so wait
@@ -1084,13 +1084,13 @@ TranzportControlProtocol::monitor_work ()
}
}
// pending = 0;
- }
+ }
}
return (void*) 0;
}
-int TranzportControlProtocol::lights_show_recording()
+int TranzportControlProtocol::lights_show_recording()
{
// FIXME, flash recording light when recording and transport is moving
return lights_show_normal();
@@ -1098,7 +1098,7 @@ int TranzportControlProtocol::lights_show_recording()
// gotta do bling next!
-int TranzportControlProtocol::lights_show_bling()
+int TranzportControlProtocol::lights_show_bling()
{
switch (bling_mode) {
case BlingOff: break;
@@ -1111,14 +1111,14 @@ int TranzportControlProtocol::lights_show_bling()
return 0;
}
-int TranzportControlProtocol::lights_show_normal()
+int TranzportControlProtocol::lights_show_normal()
{
/* Track only */
if (route_table[0]) {
boost::shared_ptr<AudioTrack> at = boost::dynamic_pointer_cast<AudioTrack> (route_table[0]);
lights_pending[LightTrackrec] = at && at->record_enabled();
- lights_pending[LightTrackmute] = route_get_muted(0);
+ lights_pending[LightTrackmute] = route_get_muted(0);
lights_pending[LightTracksolo] = route_get_soloed(0);
} else {
lights_pending[LightTrackrec] = false;
@@ -1128,7 +1128,7 @@ int TranzportControlProtocol::lights_show_normal()
/* Global settings */
- lights_pending[LightLoop] = session->get_play_loop();
+ lights_pending[LightLoop] = session->get_play_loop();
lights_pending[LightPunch] = Config->get_punch_in() || Config->get_punch_out();
lights_pending[LightRecord] = session->get_record_enabled();
lights_pending[LightAnysolo] = session->soloing();
@@ -1136,9 +1136,9 @@ int TranzportControlProtocol::lights_show_normal()
return 0;
}
-int TranzportControlProtocol::lights_show_tempo()
+int TranzportControlProtocol::lights_show_tempo()
{
- // someday soon fiddle with the lights based on the tempo
+ // someday soon fiddle with the lights based on the tempo
return lights_show_normal();
}
@@ -1163,12 +1163,12 @@ TranzportControlProtocol::update_state ()
case DisplayRecording:
lights_show_recording();
- normal_update();
+ normal_update();
break;
case DisplayRecordingMeter:
lights_show_recording();
- show_meter();
+ show_meter();
break;
case DisplayBling:
@@ -1215,7 +1215,7 @@ TranzportControlProtocol::process (uint8_t* buf)
// SHIFT + STOP + PLAY for bling mode?
// if (button_changes & ButtonPlay & ButtonStop) {
- // bling_mode_toggle();
+ // bling_mode_toggle();
// } or something like that
TRANZPORT_BUTTON_HANDLER(button_event_battery,ButtonBattery);
@@ -1289,7 +1289,7 @@ TranzportControlProtocol::button_event_backlight_release (bool shifted)
lcd_clear();
last_where += 1; /* force time redisplay */
last_track_gain = FLT_MAX;
- normal_update(); // redraw_screen();
+ normal_update(); // redraw_screen();
}
}
@@ -1919,7 +1919,7 @@ TranzportControlProtocol::print_noretry (int row, int col, const char *text)
}
XMLNode&
-TranzportControlProtocol::get_state ()
+TranzportControlProtocol::get_state ()
{
return ControlProtocol::get_state();
}
@@ -1931,14 +1931,14 @@ TranzportControlProtocol::set_state (const XMLNode& node)
}
int
-TranzportControlProtocol::save (char *name)
+TranzportControlProtocol::save (char *name)
{
// Presently unimplemented
return 0;
}
int
-TranzportControlProtocol::load (char *name)
+TranzportControlProtocol::load (char *name)
{
// Presently unimplemented
return 0;
diff --git a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h
index 63e6ad4201..39addbbaca 100644
--- a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h
+++ b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h
@@ -94,7 +94,7 @@ class TranzportControlProtocol : public ARDOUR::ControlProtocol
WheelIncrSecond,
WheelIncrMinute
};
-
+
enum DisplayMode {
DisplayNormal,
DisplayRecording,
@@ -190,9 +190,9 @@ class TranzportControlProtocol : public ARDOUR::ControlProtocol
void screen_invalidate();
int screen_flush();
void screen_clear();
- // bool screen_isuptodate(); // think on this -
+ // bool screen_isuptodate(); // think on this -
- // Commands to write to the lcd
+ // Commands to write to the lcd
int lcd_init();
bool lcd_damage();