diff options
author | Robin Gareus <robin@gareus.org> | 2015-10-05 16:17:49 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-10-05 16:17:49 +0200 |
commit | 22b07e0233a29d9633ffa825a79503befaf2e16e (patch) | |
tree | 1d8b06056f8e12197158f5d906319767d3dedda5 /libs/surfaces | |
parent | e11ba7b79d68bc1070b170236c22123966d7bcc3 (diff) |
NOOP, remove trailing tabs/whitespace.
Diffstat (limited to 'libs/surfaces')
72 files changed, 468 insertions, 468 deletions
diff --git a/libs/surfaces/control_protocol/basic_ui.cc b/libs/surfaces/control_protocol/basic_ui.cc index de50235ee9..0d13c8f264 100644 --- a/libs/surfaces/control_protocol/basic_ui.cc +++ b/libs/surfaces/control_protocol/basic_ui.cc @@ -44,7 +44,7 @@ BasicUI::BasicUI () BasicUI::~BasicUI () { - + } void @@ -148,7 +148,7 @@ BasicUI::transport_play (bool from_last_start) if (session->get_play_range ()) { session->request_play_range (0); } - + if (from_last_start && rolling) { session->request_locate (session->last_transport_start(), true); @@ -186,7 +186,7 @@ void BasicUI::prev_marker () { framepos_t pos = session->locations()->first_mark_before (session->transport_frame()); - + if (pos >= 0) { session->request_locate (pos, session->transport_rolling()); } else { @@ -330,26 +330,26 @@ BasicUI::solo_press (boost::shared_ptr<Route> r, bool momentary, bool global, bo if (momentary) { _solo_release = new SoloMuteRelease (_route->soloed()); } - + if (global) { - + if (_solo_release) { _solo_release->routes = _session->get_routes (); } - + if (Config->get_solo_control_is_listen_control()) { _session->set_listen (_session->get_routes(), !_route->listening(), Session::rt_cleanup, true); } else { _session->set_solo (_session->get_routes(), !_route->soloed(), Session::rt_cleanup, true); } - + } else if (exclusive) { - + if (_solo_release) { _solo_release->exclusive = true; - + boost::shared_ptr<RouteList> routes = _session->get_routes(); - + for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) { if ((*i)->soloed ()) { _solo_release->routes_on->push_back (*i); @@ -358,51 +358,51 @@ BasicUI::solo_press (boost::shared_ptr<Route> r, bool momentary, bool global, bo } } } - + if (Config->get_solo_control_is_listen_control()) { /* ??? we need a just_one_listen() method */ } else { _session->set_just_one_solo (_route, true); } - + } else if (isolate) { - + // shift-click: toggle solo isolated status - + _route->set_solo_isolated (!_route->solo_isolated(), this); delete _solo_release; _solo_release = 0; - + } else if (solo_group) { - + /* Primary-button1: solo mix group. NOTE: Primary-button2 is MIDI learn. */ - + if (_route->route_group()) { - + if (_solo_release) { _solo_release->routes = _route->route_group()->route_list(); } - + if (Config->get_solo_control_is_listen_control()) { _session->set_listen (_route->route_group()->route_list(), !_route->listening(), Session::rt_cleanup, true); } else { _session->set_solo (_route->route_group()->route_list(), !_route->soloed(), Session::rt_cleanup, true); } } - + } else { - + /* click: solo this route */ - + boost::shared_ptr<RouteList> rl (new RouteList); rl->push_back (route()); - + if (_solo_release) { _solo_release->routes = rl; } - + if (Config->get_solo_control_is_listen_control()) { _session->set_listen (rl, !_route->listening()); } else { diff --git a/libs/surfaces/control_protocol/control_protocol.cc b/libs/surfaces/control_protocol/control_protocol.cc index b91308c7be..7a218e8532 100644 --- a/libs/surfaces/control_protocol/control_protocol.cc +++ b/libs/surfaces/control_protocol/control_protocol.cc @@ -166,7 +166,7 @@ ControlProtocol::set_route_table (uint32_t table_index, boost::shared_ptr<ARDOUR if (table_index >= route_table.size()) { return; } - + route_table[table_index] = r; // XXX SHAREDPTR need to handle r->GoingAway @@ -245,7 +245,7 @@ ControlProtocol::route_set_gain (uint32_t table_index, float gain) } boost::shared_ptr<Route> r = route_table[table_index]; - + if (r != 0) { r->set_gain (gain, this); } diff --git a/libs/surfaces/control_protocol/control_protocol/basic_ui.h b/libs/surfaces/control_protocol/control_protocol/basic_ui.h index d62a5da5ad..4c8a8ba28f 100644 --- a/libs/surfaces/control_protocol/control_protocol/basic_ui.h +++ b/libs/surfaces/control_protocol/control_protocol/basic_ui.h @@ -41,7 +41,7 @@ class LIBCONTROLCP_API BasicUI { public: BasicUI (ARDOUR::Session&); virtual ~BasicUI (); - + void add_marker (const std::string& = std::string()); void register_thread (std::string name); diff --git a/libs/surfaces/control_protocol/control_protocol/control_protocol.h b/libs/surfaces/control_protocol/control_protocol/control_protocol.h index 3a0eb41509..8edb3f39a7 100644 --- a/libs/surfaces/control_protocol/control_protocol/control_protocol.h +++ b/libs/surfaces/control_protocol/control_protocol/control_protocol.h @@ -88,7 +88,7 @@ class LIBCONTROLCP_API ControlProtocol : public PBD::Stateful, public PBD::Scope respond. Typically this will always be GUI->"others" - the GUI pays no attention to these signals. */ - + static PBD::Signal1<void,RouteNotificationListPtr> TrackSelectionChanged; /* the model here is as follows: @@ -163,7 +163,7 @@ extern "C" { bool (*probe)(ControlProtocolDescriptor*); ControlProtocol* (*initialize)(ControlProtocolDescriptor*,Session*); void (*destroy)(ControlProtocolDescriptor*,ControlProtocol*); - + }; } diff --git a/libs/surfaces/control_protocol/control_protocol/types.h b/libs/surfaces/control_protocol/control_protocol/types.h index 8c05953320..1d46753e51 100644 --- a/libs/surfaces/control_protocol/control_protocol/types.h +++ b/libs/surfaces/control_protocol/control_protocol/types.h @@ -26,7 +26,7 @@ namespace ARDOUR { class Route; - + typedef std::vector<boost::weak_ptr<ARDOUR::Route> > RouteNotificationList; typedef boost::shared_ptr<RouteNotificationList> RouteNotificationListPtr; diff --git a/libs/surfaces/frontier/kernel_drivers/tests/tranzport.c b/libs/surfaces/frontier/kernel_drivers/tests/tranzport.c index 96bc3f95ef..480c49c7b6 100644 --- a/libs/surfaces/frontier/kernel_drivers/tests/tranzport.c +++ b/libs/surfaces/frontier/kernel_drivers/tests/tranzport.c @@ -110,7 +110,7 @@ tranzport_t *open_tranzport_core() tranzport_t *open_tranzport() { -return open_tranzport_core(); +return open_tranzport_core(); } void close_tranzport(tranzport_t *z) @@ -191,7 +191,7 @@ int tranzport_read(tranzport_t *z, uint8_t *status, uint32_t *buttons, uint8_t * { uint8_t buf[8]; int val; - + memset(buf, 0xff, 8); val = read(z->udev, buf, 8); if (val < 0) { diff --git a/libs/surfaces/frontier/kernel_drivers/tests/tranzport_lights.c b/libs/surfaces/frontier/kernel_drivers/tests/tranzport_lights.c index 4096ee680d..f116c50a74 100644 --- a/libs/surfaces/frontier/kernel_drivers/tests/tranzport_lights.c +++ b/libs/surfaces/frontier/kernel_drivers/tests/tranzport_lights.c @@ -109,7 +109,7 @@ tranzport_t *open_tranzport_core() tranzport_t *open_tranzport() { -return open_tranzport_core(); +return open_tranzport_core(); } void close_tranzport(tranzport_t *z) @@ -190,7 +190,7 @@ int tranzport_read(tranzport_t *z, uint8_t *status, uint32_t *buttons, uint8_t * { uint8_t buf[8]; int val; - + memset(buf, 0xff, 8); val = read(z->udev, buf, 8); if (val < 0) { diff --git a/libs/surfaces/frontier/kernel_drivers/tranzport.c b/libs/surfaces/frontier/kernel_drivers/tranzport.c index 951be979d0..e7377cc65b 100644 --- a/libs/surfaces/frontier/kernel_drivers/tranzport.c +++ b/libs/surfaces/frontier/kernel_drivers/tranzport.c @@ -235,7 +235,7 @@ struct usb_tranzport { unsigned char LightPunch; unsigned char last_cmd[8]; unsigned char screen[40]; // We'll also have cells - + }; /* prevent races between open() and disconnect() */ @@ -405,12 +405,12 @@ static void usb_tranzport_interrupt_in_callback(struct urb *urb) /* Always pass one offline event up the stack */ 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 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; - + if (next_ring_head != dev->ring_tail) { memcpy(&((*dev->ring_buffer)[dev->ring_head]), dev->interrupt_in_buffer, urb->actual_length); dev->ring_head = next_ring_head; @@ -687,7 +687,7 @@ static ssize_t usb_tranzport_read(struct file *file, char __user *buffer, size_t dbg_info(&dev->intf->dev, "%s: trying to compress: %02x%02x%02x%02x%02x %02x %02x %02x\n", __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) || @@ -723,13 +723,13 @@ static ssize_t usb_tranzport_read(struct file *file, char __user *buffer, size_t retval = -EFAULT; goto unlock_exit; } - + dev->ring_tail = (dev->ring_tail+1) % ring_buffer_size; c+=8; 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; diff --git a/libs/surfaces/frontier/tests/tranzport_lights.c b/libs/surfaces/frontier/tests/tranzport_lights.c index 28a8462d84..07867d6dd0 100644 --- a/libs/surfaces/frontier/tests/tranzport_lights.c +++ b/libs/surfaces/frontier/tests/tranzport_lights.c @@ -109,7 +109,7 @@ tranzport_t *open_tranzport_core() tranzport_t *open_tranzport() { -return open_tranzport_core(); +return open_tranzport_core(); } void close_tranzport(tranzport_t *z) @@ -190,7 +190,7 @@ int tranzport_read(tranzport_t *z, uint8_t *status, uint32_t *buttons, uint8_t * { uint8_t buf[8]; int val; - + memset(buf, 0xff, 8); val = read(z->udev, buf, 8); if (val < 0) { diff --git a/libs/surfaces/frontier/tranzport/interface.cc b/libs/surfaces/frontier/tranzport/interface.cc index e60524d24c..f019c02f45 100644 --- a/libs/surfaces/frontier/tranzport/interface.cc +++ b/libs/surfaces/frontier/tranzport/interface.cc @@ -33,7 +33,7 @@ new_tranzport_protocol (ControlProtocolDescriptor* descriptor, Session* s) } return tcp; - + } void @@ -59,7 +59,7 @@ static ControlProtocolDescriptor tranzport_descriptor = { initialize : new_tranzport_protocol, destroy : delete_tranzport_protocol }; - + extern "C" { ControlProtocolDescriptor* diff --git a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc index 773ac2d5a1..f093287f50 100644 --- a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc +++ b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc @@ -273,7 +273,7 @@ TranzportControlProtocol::screen_flush () 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; + pending += 1; // Shouldn't need to do this // screen_invalid[row][col_base] = screen_invalid[row][col_base+1] = // screen_invalid[row][col_base+2] = screen_invalid[row][col_base+3] = true; @@ -592,7 +592,7 @@ void TranzportControlProtocol::show_transport_time () { show_bbt (session->transport_frame ()); -} +} void TranzportControlProtocol::show_smpte (framepos_t where) @@ -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); @@ -737,7 +737,7 @@ int TranzportControlProtocol::read(uint8_t *buf, uint32_t timeout_override) return val; } - + int TranzportControlProtocol::write_noretry (uint8_t* cmd, uint32_t timeout_override) { @@ -762,7 +762,7 @@ TranzportControlProtocol::write_noretry (uint8_t* cmd, uint32_t timeout_override return 0; -} +} int TranzportControlProtocol::write (uint8_t* cmd, uint32_t timeout_override) @@ -771,7 +771,7 @@ TranzportControlProtocol::write (uint8_t* cmd, uint32_t timeout_override) int val; int retry = 0; if(inflight > MAX_TRANZPORT_INFLIGHT) { return (-1); } - + while((val = usb_interrupt_write (udev, WRITE_ENDPOINT, (char*) cmd, 8, timeout_override ? timeout_override : timeout))!=8 && retry++ < MAX_RETRY) { printf("usb_interrupt_write failed, retrying: %d\n", val); } @@ -794,7 +794,7 @@ TranzportControlProtocol::write (uint8_t* cmd, uint32_t timeout_override) return (write_noretry(cmd,timeout_override)); #endif -} +} #else #error Kernel API not defined yet for Tranzport @@ -863,7 +863,7 @@ bool TranzportControlProtocol::lcd_isdamaged () for(int r = 0; r < 2; r++) { for(int c = 0; c < 20; c++) { if(screen_invalid[r][c]) { -#if DEBUG_TRANZPORT > 5 +#if DEBUG_TRANZPORT > 5 printf("row: %d,col: %d is damaged, should redraw it\n", r,c); #endif return true; @@ -881,7 +881,7 @@ bool TranzportControlProtocol::lcd_isdamaged (int row, int col, int length) if((row >= 0 && row < 2) && (col >=0 && col < 20)) { for(int c = col; c < endcol; c++) { if(screen_invalid[row][c]) { -#if DEBUG_TRANZPORT > 5 +#if DEBUG_TRANZPORT > 5 printf("row: %d,col: %d is damaged, should redraw it\n", row,c); #endif return true; @@ -1007,7 +1007,7 @@ int TranzportControlProtocol::rtpriority_unset(int priority) struct sched_param rtparam; int err; memset (&rtparam, 0, sizeof (rtparam)); - rtparam.sched_priority = priority; + rtparam.sched_priority = 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; @@ -1731,7 +1731,7 @@ TranzportControlProtocol::step_gain_up () if (gain_fraction > 2.0) { gain_fraction = 2.0; } - + route_set_gain (0, slider_position_to_gain (gain_fraction)); } @@ -1747,7 +1747,7 @@ TranzportControlProtocol::step_gain_down () if (gain_fraction < 0.0) { gain_fraction = 0.0; } - + route_set_gain (0, slider_position_to_gain (gain_fraction)); } @@ -1866,7 +1866,7 @@ TranzportControlProtocol::print_noretry (int row, int col, const char *text) uint32_t left = strlen (text); char tmp[5]; int base_col; - + if (row < 0 || row > 1) { return; } @@ -1899,24 +1899,24 @@ TranzportControlProtocol::print_noretry (int row, int col, const char *text) int offset = col % 4; /* copy current cell contents into tmp */ - + memcpy (tmp, &screen_pending[row][base_col], 4); - + /* overwrite with new text */ - + uint32_t tocopy = min ((4U - offset), left); - + memcpy (tmp+offset, text, tocopy); - + /* copy it back to pending */ - + memcpy (&screen_pending[row][base_col], tmp, 4); - + text += tocopy; left -= tocopy; col += tocopy; } -} +} XMLNode& TranzportControlProtocol::get_state () diff --git a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h index 39addbbaca..13df6915a2 100644 --- a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h +++ b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h @@ -76,7 +76,7 @@ class TranzportControlProtocol : public ARDOUR::ControlProtocol WheelShiftMaster, WheelShiftMarker }; - + enum WheelMode { WheelTimeline, WheelScrub, @@ -94,7 +94,7 @@ class TranzportControlProtocol : public ARDOUR::ControlProtocol WheelIncrSecond, WheelIncrMinute }; - + enum DisplayMode { DisplayNormal, DisplayRecording, @@ -113,7 +113,7 @@ class TranzportControlProtocol : public ARDOUR::ControlProtocol BlingRows, BlingFlashAll }; - + pthread_t thread; uint32_t buttonmask; uint32_t timeout; @@ -246,7 +246,7 @@ class TranzportControlProtocol : public ARDOUR::ControlProtocol void show_current_track (); void show_track_gain (); void show_transport_time (); - void show_bbt (framepos_t where); + void show_bbt (framepos_t where); void show_smpte (framepos_t where); void show_wheel_mode (); void show_gain (); diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc index f05e138f05..4b59151079 100644 --- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc +++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc @@ -168,11 +168,11 @@ GenericMidiControlProtocol::reload_maps () mi.name = prop->value (); mi.path = fullpath; - + map_info.push_back (mi); } } - + void GenericMidiControlProtocol::drop_all () { @@ -258,7 +258,7 @@ GenericMidiControlProtocol::send_feedback () } _send_feedback (); - + last_feedback_time = now; } @@ -282,7 +282,7 @@ GenericMidiControlProtocol::_send_feedback () if (!lm.locked ()) { return; } - + for (MIDIControllables::iterator r = controllables.begin(); r != controllables.end(); ++r) { MIDI::byte* end = (*r)->write_feedback (buf, bsize); if (end != buf) { @@ -314,7 +314,7 @@ GenericMidiControlProtocol::start_learning (Controllable* c) { Glib::Threads::Mutex::Lock lm (pending_lock); - + MIDIPendingControllables::iterator ptmp; for (MIDIPendingControllables::iterator i = pending_controllables.begin(); i != pending_controllables.end(); ) { ptmp = i; @@ -341,7 +341,7 @@ GenericMidiControlProtocol::start_learning (Controllable* c) if (!mc) { mc = new MIDIControllable (this, *_input_port->parser(), *c, false); } - + { Glib::Threads::Mutex::Lock lm (pending_lock); @@ -360,7 +360,7 @@ GenericMidiControlProtocol::learning_stopped (MIDIControllable* mc) { Glib::Threads::Mutex::Lock lm (pending_lock); Glib::Threads::Mutex::Lock lm2 (controllables_lock); - + MIDIPendingControllables::iterator tmp; for (MIDIPendingControllables::iterator i = pending_controllables.begin(); i != pending_controllables.end(); ) { @@ -401,7 +401,7 @@ GenericMidiControlProtocol::stop_learning (Controllable* c) break; } } - + delete dptr; } @@ -410,17 +410,17 @@ GenericMidiControlProtocol::delete_binding (PBD::Controllable* control) { if (control != 0) { Glib::Threads::Mutex::Lock lm2 (controllables_lock); - + for (MIDIControllables::iterator iter = controllables.begin(); iter != controllables.end();) { MIDIControllable* existingBinding = (*iter); - + if (control == (existingBinding->get_controllable())) { delete existingBinding; iter = controllables.erase (iter); } else { ++iter; } - + } } } @@ -431,10 +431,10 @@ GenericMidiControlProtocol::create_binding (PBD::Controllable* control, int pos, { if (control != NULL) { Glib::Threads::Mutex::Lock lm2 (controllables_lock); - + MIDI::channel_t channel = (pos & 0xf); MIDI::byte value = control_number; - + // Create a MIDIControllable MIDIControllable* mc = new MIDIControllable (this, *_input_port->parser(), *control, false); @@ -442,19 +442,19 @@ GenericMidiControlProtocol::create_binding (PBD::Controllable* control, int pos, // Note: can't use delete_binding() here because we don't know the specific controllable we want to remove, only the midi information for (MIDIControllables::iterator iter = controllables.begin(); iter != controllables.end();) { MIDIControllable* existingBinding = (*iter); - + if ((existingBinding->get_control_channel() & 0xf ) == channel && existingBinding->get_control_additional() == value && (existingBinding->get_control_type() & 0xf0 ) == MIDI::controller) { - + delete existingBinding; iter = controllables.erase (iter); } else { ++iter; } - + } - + // Update the MIDI Controllable based on the the pos param // Here is where a table lookup for user mappings could go; for now we'll just wing it... mc->bind_midi(channel, MIDI::controller, value); @@ -593,7 +593,7 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version) } boost::shared_ptr<Controllable> c; - + { Glib::Threads::Mutex::Lock lm (pending_lock); for (MIDIPendingControllables::iterator i = pending_controllables.begin(); i != pending_controllables.end(); ++i) { @@ -625,20 +625,20 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version) if (!nlist.empty()) { for (niter = nlist.begin(); niter != nlist.end(); ++niter) { - + if ((prop = (*niter)->property ("id")) != 0) { - + ID id = prop->value (); DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("Relearned binding for session: Control ID: %1\n", id.to_s())); Controllable* c = Controllable::by_id (id); - + if (c) { MIDIControllable* mc = new MIDIControllable (this, *_input_port->parser(), *c, false); - + if (mc->set_state (**niter, version) == 0) { controllables.push_back (mc); } - + } else { warning << string_compose ( _("Generic MIDI control: controllable %1 not found in session (ignored)"), @@ -697,7 +697,7 @@ GenericMidiControlProtocol::load_bindings (const string& xmlpath) sscanf (prop->value().c_str(), "%d.%d.%d", &major, &minor, µ); Stateful::loading_state_version = (major * 1000) + minor; } - + const XMLNodeList& children (root->children()); XMLNodeConstIterator citer; XMLNodeConstIterator gciter; @@ -708,7 +708,7 @@ GenericMidiControlProtocol::load_bindings (const string& xmlpath) DEBUG_TRACE (DEBUG::GenericMidi, "Loading bindings\n"); for (citer = children.begin(); citer != children.end(); ++citer) { - + if ((*citer)->name() == "DeviceInfo") { const XMLProperty* prop; @@ -736,7 +736,7 @@ GenericMidiControlProtocol::load_bindings (const string& xmlpath) if (child->property ("uri")) { /* controllable */ - + if ((mc = create_binding (*child)) != 0) { Glib::Threads::Mutex::Lock lm2 (controllables_lock); controllables.push_back (mc); @@ -760,7 +760,7 @@ GenericMidiControlProtocol::load_bindings (const string& xmlpath) } } } - + if ((prop = root->property ("name")) != 0) { _current_binding = prop->value (); } @@ -805,17 +805,17 @@ GenericMidiControlProtocol::create_binding (const XMLNode& node) } else { return 0; } - + if (sscanf (prop->value().c_str(), "%d", &intval) != 1) { return 0; } - + detail = (MIDI::byte) intval; if ((prop = node.property (X_("channel"))) == 0) { return 0; } - + if (sscanf (prop->value().c_str(), "%d", &intval) != 1) { return 0; } @@ -830,7 +830,7 @@ GenericMidiControlProtocol::create_binding (const XMLNode& node) } else { momentary = false; } - + prop = node.property (X_("uri")); uri = prop->value(); @@ -918,7 +918,7 @@ GenericMidiControlProtocol::create_function (const XMLNode& node) cnt = 0; stringstream ss (prop->value()); ss << hex; - + while (ss >> val) { cnt++; } @@ -930,12 +930,12 @@ GenericMidiControlProtocol::create_function (const XMLNode& node) data = new MIDI::byte[cnt]; data_size = cnt; - + { stringstream ss (prop->value()); ss << hex; cnt = 0; - + while (ss >> val) { data[cnt++] = (MIDI::byte) val; } @@ -950,13 +950,13 @@ GenericMidiControlProtocol::create_function (const XMLNode& node) if (sscanf (prop->value().c_str(), "%d", &intval) != 1) { return 0; } - + detail = (MIDI::byte) intval; if ((prop = node.property (X_("channel"))) == 0) { return 0; } - + if (sscanf (prop->value().c_str(), "%d", &intval) != 1) { return 0; } @@ -972,9 +972,9 @@ GenericMidiControlProtocol::create_function (const XMLNode& node) } prop = node.property (X_("function")); - + MIDIFunction* mf = new MIDIFunction (*_input_port->parser()); - + if (mf->setup (*this, prop->value(), argument, data, data_size)) { delete mf; return 0; @@ -1018,7 +1018,7 @@ GenericMidiControlProtocol::create_action (const XMLNode& node) cnt = 0; stringstream ss (prop->value()); ss << hex; - + while (ss >> val) { cnt++; } @@ -1030,12 +1030,12 @@ GenericMidiControlProtocol::create_action (const XMLNode& node) data = new MIDI::byte[cnt]; data_size = cnt; - + { stringstream ss (prop->value()); ss << hex; cnt = 0; - + while (ss >> val) { data[cnt++] = (MIDI::byte) val; } @@ -1050,13 +1050,13 @@ GenericMidiControlProtocol::create_action (const XMLNode& node) if (sscanf (prop->value().c_str(), "%d", &intval) != 1) { return 0; } - + detail = (MIDI::byte) intval; if ((prop = node.property (X_("channel"))) == 0) { return 0; } - + if (sscanf (prop->value().c_str(), "%d", &intval) != 1) { return 0; } @@ -1068,7 +1068,7 @@ GenericMidiControlProtocol::create_action (const XMLNode& node) } prop = node.property (X_("action")); - + MIDIAction* ma = new MIDIAction (*_input_port->parser()); if (ma->init (*this, prop->value(), data, data_size)) { diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.h b/libs/surfaces/generic_midi/generic_midi_control_protocol.h index c9d11c3e09..f09c8e4883 100644 --- a/libs/surfaces/generic_midi/generic_midi_control_protocol.h +++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.h @@ -30,7 +30,7 @@ namespace PBD { class Controllable; class ControllableDescriptor; -} +} namespace ARDOUR { class Session; @@ -73,7 +73,7 @@ class GenericMidiControlProtocol : public ARDOUR::ControlProtocol { void drop_bindings (); void check_used_event (int, int); - + std::string current_binding() const { return _current_binding; } struct MapInfo { @@ -89,7 +89,7 @@ class GenericMidiControlProtocol : public ARDOUR::ControlProtocol { void prev_bank (); void set_motorised (bool); - + bool motorised () const { return _motorised; } diff --git a/libs/surfaces/generic_midi/gmcp_gui.cc b/libs/surfaces/generic_midi/gmcp_gui.cc index 773cf36772..710b61be8e 100644 --- a/libs/surfaces/generic_midi/gmcp_gui.cc +++ b/libs/surfaces/generic_midi/gmcp_gui.cc @@ -40,7 +40,7 @@ class GMCPGUI : public Gtk::VBox public: GMCPGUI (GenericMidiControlProtocol&); ~GMCPGUI (); - + private: GenericMidiControlProtocol& cp; Gtk::ComboBoxText map_combo; @@ -110,7 +110,7 @@ GMCPGUI::GMCPGUI (GenericMidiControlProtocol& p) } set_popdown_strings (map_combo, popdowns); - + if (cp.current_binding().empty()) { map_combo.set_active_text (popdowns[0]); } else { @@ -126,7 +126,7 @@ GMCPGUI::GMCPGUI (GenericMidiControlProtocol& p) table->set_row_spacings (6); table->set_col_spacings (6); table->show (); - + int n = 0; Label* label = manage (new Label (_("MIDI Bindings:"))); @@ -134,10 +134,10 @@ GMCPGUI::GMCPGUI (GenericMidiControlProtocol& p) table->attach (*label, 0, 1, n, n + 1); table->attach (map_combo, 1, 2, n, n + 1); ++n; - + map_combo.show (); label->show (); - + bank_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &GMCPGUI::bank_changed)); label = manage (new Label (_("Current Bank:"))); @@ -145,7 +145,7 @@ GMCPGUI::GMCPGUI (GenericMidiControlProtocol& p) table->attach (*label, 0, 1, n, n + 1); table->attach (bank_spinner, 1, 2, n, n + 1); ++n; - + bank_spinner.show (); label->show (); diff --git a/libs/surfaces/generic_midi/interface.cc b/libs/surfaces/generic_midi/interface.cc index b9b0e36a4d..b7e7b63dd7 100644 --- a/libs/surfaces/generic_midi/interface.cc +++ b/libs/surfaces/generic_midi/interface.cc @@ -28,13 +28,13 @@ static ControlProtocol* new_generic_midi_protocol (ControlProtocolDescriptor* /*descriptor*/, Session* s) { GenericMidiControlProtocol* gmcp; - + try { gmcp = new GenericMidiControlProtocol (*s); } catch (failed_constructor& err) { return 0; } - + if (gmcp->set_active (true)) { delete gmcp; return 0; @@ -67,6 +67,6 @@ static ControlProtocolDescriptor generic_midi_descriptor = { /*initialize : */ new_generic_midi_protocol, /*destroy : */ delete_generic_midi_protocol }; - + extern "C" ARDOURSURFACE_API ControlProtocolDescriptor* protocol_descriptor () { return &generic_midi_descriptor; } diff --git a/libs/surfaces/generic_midi/midicontrollable.cc b/libs/surfaces/generic_midi/midicontrollable.cc index 4a9b89de80..9dca702e68 100644 --- a/libs/surfaces/generic_midi/midicontrollable.cc +++ b/libs/surfaces/generic_midi/midicontrollable.cc @@ -71,7 +71,7 @@ MIDIControllable::MIDIControllable (GenericMidiControlProtocol* s, MIDI::Parser& , _momentary (m) { set_controllable (&c); - + _learned = true; /* from controllable */ _encoder = No_enc; setting = false; @@ -123,7 +123,7 @@ MIDIControllable::set_controllable (Controllable* c) if (c == controllable) { return; } - + controllable_death_connection.disconnect (); controllable = c; @@ -478,7 +478,7 @@ MIDIControllable::bind_midi (channel_t chn, eventType ev, MIDI::byte additional) } _control_description = "MIDI control: NoteOn"; break; - + case MIDI::controller: _parser.channel_controller[chn_i].connect_same_thread (midi_sense_connection[0], boost::bind (&MIDIControllable::midi_sense_controller, this, _1, _2)); snprintf (buf, sizeof (buf), "MIDI control: Controller %d", control_additional); @@ -507,7 +507,7 @@ MIDIControllable::write_feedback (MIDI::byte* buf, int32_t& bufsize, bool /*forc if (!controllable || control_type == none || !feedback || bufsize <= 2) { return buf; } - + int const gm = control_to_midi (controllable->get_value()); if (gm == last_value) { @@ -611,7 +611,7 @@ int MIDIControllable::max_value_for_type () const { /* XXX: this is not complete */ - + if (control_type == MIDI::pitchbend) { return 16383; } diff --git a/libs/surfaces/generic_midi/midicontrollable.h b/libs/surfaces/generic_midi/midicontrollable.h index 5a4a762089..2e5d41c5d6 100644 --- a/libs/surfaces/generic_midi/midicontrollable.h +++ b/libs/surfaces/generic_midi/midicontrollable.h @@ -68,7 +68,7 @@ class MIDIControllable : public PBD::Stateful }; MIDI::byte* write_feedback (MIDI::byte* buf, int32_t& bufsize, bool force = false); - + void midi_rebind (MIDI::channel_t channel=-1); void midi_forget (); void learn_about_external_control (); @@ -104,7 +104,7 @@ class MIDIControllable : public PBD::Stateful MIDI::byte get_control_additional () { return control_additional; } int lookup_controllable(); - + private: int max_value_for_type () const; diff --git a/libs/surfaces/generic_midi/midiinvokable.cc b/libs/surfaces/generic_midi/midiinvokable.cc index 48d8497ce3..9d679b1e8e 100644 --- a/libs/surfaces/generic_midi/midiinvokable.cc +++ b/libs/surfaces/generic_midi/midiinvokable.cc @@ -141,7 +141,7 @@ MIDIInvokable::bind_midi (channel_t chn, eventType ev, MIDI::byte additional) case MIDI::on: _parser.channel_note_on[chn_i].connect_same_thread (midi_sense_connection[0], boost::bind (&MIDIInvokable::midi_sense_note_on, this, _1, _2)); break; - + case MIDI::controller: _parser.channel_controller[chn_i].connect_same_thread (midi_sense_connection[0], boost::bind (&MIDIInvokable::midi_sense_controller, this, _1, _2)); break; diff --git a/libs/surfaces/generic_midi/midiinvokable.h b/libs/surfaces/generic_midi/midiinvokable.h index bde59b64de..dee87ed09c 100644 --- a/libs/surfaces/generic_midi/midiinvokable.h +++ b/libs/surfaces/generic_midi/midiinvokable.h @@ -50,7 +50,7 @@ class MIDIInvokable : public PBD::Stateful MIDI::channel_t get_control_channel () { return control_channel; } MIDI::eventType get_control_type () { return control_type; } MIDI::byte get_control_additional () { return control_additional; } - + protected: GenericMidiControlProtocol* _ui; std::string _invokable_name; diff --git a/libs/surfaces/mackie/button.cc b/libs/surfaces/mackie/button.cc index c9ae1f5d71..53a43de5ba 100644 --- a/libs/surfaces/mackie/button.cc +++ b/libs/surfaces/mackie/button.cc @@ -104,9 +104,9 @@ Button::name_to_id (const std::string& name) if (!g_ascii_strcasecmp (name.c_str(), "Scrub")) { return Scrub; } if (!g_ascii_strcasecmp (name.c_str(), "User A")) { return UserA; } if (!g_ascii_strcasecmp (name.c_str(), "User B")) { return UserB; } - + /* Strip buttons */ - + if (!g_ascii_strcasecmp (name.c_str(), "Record Enable")) { return RecEnable; } if (!g_ascii_strcasecmp (name.c_str(), "Solo")) { return Solo; } if (!g_ascii_strcasecmp (name.c_str(), "Mute")) { return Mute; } diff --git a/libs/surfaces/mackie/button.h b/libs/surfaces/mackie/button.h index 61f09d7a03..42d2ec45b1 100644 --- a/libs/surfaces/mackie/button.h +++ b/libs/surfaces/mackie/button.h @@ -39,7 +39,7 @@ public: enum ID { /* Global Buttons */ - + Track, Send, Pan, @@ -111,7 +111,7 @@ public: CmdAlt, /* Strip buttons */ - + RecEnable, Solo, Mute, @@ -129,12 +129,12 @@ public: : Control (did, name, group) , _bid (bid) , _led (did, name + "_led", group) {} - + MidiByteArray zero() { return _led.zero (); } MidiByteArray set_state (LedState ls) { return _led.set_state (ls); } - + ID bid() const { return _bid; } - + static Control* factory (Surface& surface, Button::ID bid, int id, const std::string&, Group& group); static int name_to_id (const std::string& name); static std::string id_to_name (Button::ID); diff --git a/libs/surfaces/mackie/control_group.h b/libs/surfaces/mackie/control_group.h index 4955098225..e79a60f42f 100644 --- a/libs/surfaces/mackie/control_group.h +++ b/libs/surfaces/mackie/control_group.h @@ -19,21 +19,21 @@ public: : _name (name) {} virtual ~Group() {} - + virtual bool is_strip() const { return false; } virtual bool is_master() const { return false; } - + virtual void add (Control & control); - + const std::string & name() const { return _name; } void set_name (const std::string & rhs) { _name = rhs; } - + typedef std::vector<Control*> Controls; const Controls & controls() const { return _controls; } - + protected: Controls _controls; - + private: std::string _name; }; diff --git a/libs/surfaces/mackie/controls.cc b/libs/surfaces/mackie/controls.cc index 1c88c2b74c..bbe1029f30 100644 --- a/libs/surfaces/mackie/controls.cc +++ b/libs/surfaces/mackie/controls.cc @@ -101,7 +101,7 @@ Control::start_touch (double when) return normal_ac->start_touch (when); } } - + void Control::stop_touch (bool mark, double when) { @@ -109,7 +109,7 @@ Control::stop_touch (bool mark, double when) return normal_ac->stop_touch (mark, when); } } - + ostream & operator << (ostream & os, const ArdourSurface::Mackie::Control & control) { os << typeid (control).name(); @@ -120,7 +120,7 @@ ostream & operator << (ostream & os, const ArdourSurface::Mackie::Control & con os << ", "; os << "group: " << control.group().name(); os << " }"; - + return os; } diff --git a/libs/surfaces/mackie/controls.h b/libs/surfaces/mackie/controls.h index e8098ccf7e..38eb30fb65 100644 --- a/libs/surfaces/mackie/controls.h +++ b/libs/surfaces/mackie/controls.h @@ -48,14 +48,14 @@ class Control { public: Control (int id, std::string name, Group& group); virtual ~Control() {} - + int id() const { return _id; } const std::string & name() const { return _name; } Group & group() const { return _group; } bool in_use () const; void set_in_use (bool); - + // Keep track of the timeout so it can be updated with more incoming events sigc::connection in_use_connection; @@ -71,7 +71,7 @@ public: float get_value (); void set_value (float val); - + virtual void start_touch (double when); virtual void stop_touch (bool mark, double when); diff --git a/libs/surfaces/mackie/device_info.cc b/libs/surfaces/mackie/device_info.cc index 365ff1db9f..b0ce131e00 100644 --- a/libs/surfaces/mackie/device_info.cc +++ b/libs/surfaces/mackie/device_info.cc @@ -377,7 +377,7 @@ DeviceInfo::set_state (const XMLNode& node, int /* version */) } } } - + } } else if ((*i)->name() == "StripButton") { @@ -393,9 +393,9 @@ DeviceInfo::set_state (const XMLNode& node, int /* version */) } } } - + } - + } } } diff --git a/libs/surfaces/mackie/device_info.h b/libs/surfaces/mackie/device_info.h index c4cbd071c5..2f4f769127 100644 --- a/libs/surfaces/mackie/device_info.h +++ b/libs/surfaces/mackie/device_info.h @@ -62,7 +62,7 @@ class DeviceInfo LCXT = 0x11, HUI = 0x5 }; - + DeviceInfo(); ~DeviceInfo(); @@ -85,7 +85,7 @@ class DeviceInfo static std::map<std::string,DeviceInfo> device_info; static void reload_device_info(); - + std::string& get_global_button_name(Button::ID); GlobalButtonInfo& get_global_button(Button::ID); @@ -94,7 +94,7 @@ class DeviceInfo const GlobalButtonsInfo& global_buttons() const { return _global_buttons; } const StripButtonsInfo& strip_buttons() const { return _strip_buttons; } - + private: uint32_t _strip_cnt; uint32_t _extenders; diff --git a/libs/surfaces/mackie/device_profile.cc b/libs/surfaces/mackie/device_profile.cc index c4cd9bf1a8..2b9cbd5edb 100644 --- a/libs/surfaces/mackie/device_profile.cc +++ b/libs/surfaces/mackie/device_profile.cc @@ -339,7 +339,7 @@ DeviceProfile::save () } fullpath = Glib::build_filename (fullpath, legalize_for_path (_name) + ".profile"); - + XMLTree tree; tree.set_root (&get_state()); diff --git a/libs/surfaces/mackie/device_profile.h b/libs/surfaces/mackie/device_profile.h index 15702a6886..ab1e645e56 100644 --- a/libs/surfaces/mackie/device_profile.h +++ b/libs/surfaces/mackie/device_profile.h @@ -37,16 +37,16 @@ class DeviceProfile public: DeviceProfile (const std::string& name = ""); ~DeviceProfile(); - + std::string get_button_action (Button::ID, int modifier_state) const; void set_button_action (Button::ID, int modifier_state, const std::string&); - + const std::string& name() const; void set_path (const std::string&); static void reload_device_profiles (); static std::map<std::string,DeviceProfile> device_profiles; - + private: struct ButtonActions { std::string plain; @@ -56,13 +56,13 @@ class DeviceProfile std::string cmdalt; std::string shiftcontrol; }; - + typedef std::map<Button::ID,ButtonActions> ButtonActionMap; - + std::string _name; std::string _path; ButtonActionMap _button_map; - + int set_state (const XMLNode&, int version); XMLNode& get_state () const; diff --git a/libs/surfaces/mackie/fader.cc b/libs/surfaces/mackie/fader.cc index 5e40538096..33e1e4c29f 100644 --- a/libs/surfaces/mackie/fader.cc +++ b/libs/surfaces/mackie/fader.cc @@ -66,7 +66,7 @@ Fader::update_message () } last_update_position = posi; - + DEBUG_TRACE (DEBUG::MackieControl, string_compose ("generate fader message for position %1 (%2)\n", position, posi)); return MidiByteArray (3, 0xe0 + id(), posi & 0x7f, posi >> 7); } diff --git a/libs/surfaces/mackie/fader.h b/libs/surfaces/mackie/fader.h index e83e657e68..dae022c690 100644 --- a/libs/surfaces/mackie/fader.h +++ b/libs/surfaces/mackie/fader.h @@ -10,7 +10,7 @@ namespace Mackie { class Fader : public Control { public: - + Fader (int id, std::string name, Group & group) : Control (id, name, group) , position (0.0) @@ -20,11 +20,11 @@ class Fader : public Control MidiByteArray set_position (float); MidiByteArray zero() { return set_position (0.0); } - + MidiByteArray update_message (); static Control* factory (Surface&, int id, const char*, Group&); - + private: float position; int last_update_position; diff --git a/libs/surfaces/mackie/gui.cc b/libs/surfaces/mackie/gui.cc index 48bfa6cd8a..156070dbc8 100644 --- a/libs/surfaces/mackie/gui.cc +++ b/libs/surfaces/mackie/gui.cc @@ -89,7 +89,7 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p) Gtk::Label* l; Gtk::Alignment* align; int row = 0; - + set_border_width (12); Gtk::Table* table = Gtk::manage (new Gtk::Table (2, 12)); @@ -102,9 +102,9 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p) table->attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0)); table->attach (_surface_combo, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0); row++; - + vector<string> surfaces; - + for (std::map<std::string,DeviceInfo>::iterator i = DeviceInfo::device_info.begin(); i != DeviceInfo::device_info.end(); ++i) { surfaces.push_back (i->first); } @@ -127,7 +127,7 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p) send_string = _("Surface sends via:"); receive_string = _("Surface receives via:"); } - + l = manage (new Gtk::Label (send_string)); l->set_alignment (1.0, 0.5); table->attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0)); @@ -149,10 +149,10 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p) table->attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); table->attach (ipmidi_base_port_spinner, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); row++; - + ipmidi_base_port_spinner.set_sensitive (_cp.device_info().uses_ipmidi()); ipmidi_base_port_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &MackieControlProtocolGUI::ipmidi_spinner_changed)); - + /* leave an extra blank row */ row++; @@ -164,7 +164,7 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p) touch_sensitivity_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &MackieControlProtocolGUI::touch_sensitive_change)); touch_sensitivity_scale.set_update_policy (Gtk::UPDATE_DISCONTINUOUS); - + l = manage (new Gtk::Label (_("Button click"))); l->set_alignment (1.0, 0.5); table->attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); @@ -173,7 +173,7 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p) align->add (relay_click_button); table->attach (*align, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); row++; - + l = manage (new Gtk::Label (_("Backlight"))); l->set_alignment (1.0, 0.5); table->attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); @@ -182,7 +182,7 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p) align->add (backlight_button); table->attach (*align, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); row++; - + l = manage (new Gtk::Label (_("Send Fader Position Only When Touched"))); l->set_alignment (1.0, 0.5); table->attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); @@ -191,7 +191,7 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p) align->add (absolute_touch_mode_button); table->attach (*align, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); row++; - + l = manage (new Gtk::Label (_("Send Fader Position When Moved"))); l->set_alignment (1.0, 0.5); table->attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); @@ -200,7 +200,7 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p) align->add (touch_move_mode_button); table->attach (*align, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); row++; - + l = manage (new Gtk::Label (_("Fader Touch Sense Sensitivity"))); l->set_alignment (1.0, 0.5); table->attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); @@ -209,14 +209,14 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p) table->attach (touch_sensitivity_scale, 1, 2, 5, 6, AttachOptions(FILL|EXPAND), AttachOptions (0)); table->attach (recalibrate_fader_button, row, row+1, 6, 7, AttachOptions(FILL|EXPAND), AttachOptions (0)); row++; - + table->attach (discover_button, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); discover_button.signal_clicked().connect (sigc::mem_fun (*this, &MackieControlProtocolGUI::discover_clicked)); row++; - + vector<string> profiles; - + profiles.push_back ("default"); for (std::map<std::string,DeviceProfile>::iterator i = DeviceProfile::device_profiles.begin(); i != DeviceProfile::device_profiles.end(); ++i) { @@ -234,13 +234,13 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p) VBox* fkey_packer = manage (new VBox); HBox* profile_packer = manage (new HBox); HBox* observation_packer = manage (new HBox); - + l = manage (new Gtk::Label (_("Profile/Settings:"))); profile_packer->pack_start (*l, false, false); profile_packer->pack_start (_profile_combo, true, true); profile_packer->set_spacing (12); profile_packer->set_border_width (12); - + l = manage (new Gtk::Label (_("* Button available at the original Mackie MCU PRO or current device if enabled (NOT implemented yet). Device specific name presented."))); observation_packer->pack_start (*l, false, false); @@ -322,7 +322,7 @@ MackieControlProtocolGUI::build_available_action_menu () parent = *(rowp); parent[available_action_columns.name] = _("CmdAlt"); - + for (l = labels.begin(), k = keys.begin(), p = paths.begin(), t = tooltips.begin(); l != labels.end(); ++k, ++p, ++t, ++l) { TreeModel::Row row; @@ -395,7 +395,7 @@ MackieControlProtocolGUI::build_function_key_editor () col = manage (new TreeViewColumn (_("Plain"), *renderer)); col->add_attribute (renderer->property_text(), function_key_columns.plain); function_key_editor.append_column (*col); - + renderer = make_action_renderer (available_action_model, function_key_columns.shift); col = manage (new TreeViewColumn (_("Shift"), *renderer)); col->add_attribute (renderer->property_text(), function_key_columns.shift); @@ -461,7 +461,7 @@ MackieControlProtocolGUI::refresh_function_key_editor () /* Probably a key alias */ row[function_key_columns.plain] = action; } else { - + act = ActionManager::get_action (action.c_str()); if (act) { row[function_key_columns.plain] = act->get_label(); @@ -569,7 +569,7 @@ MackieControlProtocolGUI::action_changed (const Glib::ustring &sPath, const Glib if (row) { std::map<std::string,std::string>::iterator i = action_map.find (text); - + if (i == action_map.end()) { if (!remove) { return; diff --git a/libs/surfaces/mackie/gui.h b/libs/surfaces/mackie/gui.h index 7927d106b0..2bc17d306b 100644 --- a/libs/surfaces/mackie/gui.h +++ b/libs/surfaces/mackie/gui.h @@ -41,14 +41,14 @@ class MackieControlProtocolGUI : public Gtk::Notebook { public: MackieControlProtocolGUI (MackieControlProtocol &); - + private: MackieControlProtocol& _cp; Gtk::ComboBoxText _surface_combo; Gtk::ComboBoxText _profile_combo; Gtk::ComboBoxText _input_port_combo; Gtk::ComboBoxText _output_port_combo; - + struct AvailableActionColumns : public Gtk::TreeModel::ColumnRecord { AvailableActionColumns() { add (name); diff --git a/libs/surfaces/mackie/interface.cc b/libs/surfaces/mackie/interface.cc index bb0a4d0509..1a9760bcbe 100644 --- a/libs/surfaces/mackie/interface.cc +++ b/libs/surfaces/mackie/interface.cc @@ -35,7 +35,7 @@ static ControlProtocol* new_mackie_protocol (ControlProtocolDescriptor*, Session* s) { MackieControlProtocol* mcp = 0; - + try { mcp = new MackieControlProtocol (*s); /* do not set active here - wait for set_state() */ @@ -45,7 +45,7 @@ new_mackie_protocol (ControlProtocolDescriptor*, Session* s) delete mcp; mcp = 0; } - + return mcp; } @@ -90,6 +90,6 @@ static ControlProtocolDescriptor mackie_descriptor = { /*initialize : */ new_mackie_protocol, /*destroy : */ delete_mackie_protocol }; - + extern "C" ARDOURSURFACE_API ControlProtocolDescriptor* protocol_descriptor () { return &mackie_descriptor; } diff --git a/libs/surfaces/mackie/jog_wheel.h b/libs/surfaces/mackie/jog_wheel.h index 568589e54d..f54e3efeb3 100644 --- a/libs/surfaces/mackie/jog_wheel.h +++ b/libs/surfaces/mackie/jog_wheel.h @@ -18,7 +18,7 @@ class JogWheel { public: enum Mode { scroll }; - + JogWheel (MackieControlProtocol & mcp); /// As the wheel turns... diff --git a/libs/surfaces/mackie/led.cc b/libs/surfaces/mackie/led.cc index d103829a77..59b9f6cb20 100644 --- a/libs/surfaces/mackie/led.cc +++ b/libs/surfaces/mackie/led.cc @@ -48,18 +48,18 @@ Led::set_state (LedState new_state) MIDI::byte msg = 0; switch (state.state()) { - case LedState::on: + case LedState::on: msg = 0x7f; break; - case LedState::off: + case LedState::off: msg = 0x00; break; - case LedState::flashing: + case LedState::flashing: msg = 0x01; break; - case LedState::none: + case LedState::none: return MidiByteArray (); } - + return MidiByteArray (3, 0x90, id(), msg); } diff --git a/libs/surfaces/mackie/led.h b/libs/surfaces/mackie/led.h index 8361c4bb8d..19c48cb6a8 100644 --- a/libs/surfaces/mackie/led.h +++ b/libs/surfaces/mackie/led.h @@ -42,12 +42,12 @@ public: , state (off) { } - + Led & led() { return *this; } MidiByteArray set_state (LedState); MidiByteArray zero() { return set_state (off); } - + static Control* factory (Surface&, int id, const char*, Group&); private: diff --git a/libs/surfaces/mackie/mackie_control_exception.h b/libs/surfaces/mackie/mackie_control_exception.h index b40c5c3915..6dcca3dd39 100644 --- a/libs/surfaces/mackie/mackie_control_exception.h +++ b/libs/surfaces/mackie/mackie_control_exception.h @@ -30,14 +30,14 @@ public: : _msg( msg ) { } - + virtual ~MackieControlException() throw () {} - + const char * what() const throw () { return _msg.c_str(); } - + private: std::string _msg; }; diff --git a/libs/surfaces/mackie/mackie_control_protocol.h b/libs/surfaces/mackie/mackie_control_protocol.h index ac1ba53896..0536a0c764 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.h +++ b/libs/surfaces/mackie/mackie_control_protocol.h @@ -118,12 +118,12 @@ class MackieControlProtocol Swap, /* fader controls secondary, vpot controls primary */ Zero, /* fader controls primary, but doesn't move, vpot controls secondary */ }; - + MackieControlProtocol(ARDOUR::Session &); virtual ~MackieControlProtocol(); static MackieControlProtocol* instance() { return _instance; } - + const Mackie::DeviceInfo& device_info() const { return _device_info; } Mackie::DeviceProfile& device_profile() { return _device_profile; } @@ -148,9 +148,9 @@ class MackieControlProtocol we do not implement get/set_feedback() since this aspect of support for the protocol is not optional. */ - + static bool probe(); - + Glib::Threads::Mutex surfaces_lock; typedef std::list<boost::shared_ptr<Mackie::Surface> > Surfaces; Surfaces surfaces; @@ -159,9 +159,9 @@ class MackieControlProtocol void set_master_on_surface_strip (uint32_t surface, uint32_t strip); void set_monitor_on_surface_strip (uint32_t surface, uint32_t strip); - + uint32_t n_strips (bool with_locked_strips = true) const; - + bool has_editor () const { return true; } void* get_gui () const; void tear_down_gui (); @@ -174,7 +174,7 @@ class MackieControlProtocol void recalibrate_faders (); void toggle_backlight (); void set_touch_sensitivity (int); - + /// rebuild the current bank. Called on route added/removed and /// remote id changed. void refresh_current_bank(); @@ -191,7 +191,7 @@ class MackieControlProtocol /// Turn timecode on and beats off, or vice versa, depending /// on state of _timecode_type void update_timecode_beats_led(); - + /// this is called to generate the midi to send in response to a button press. void update_led(Mackie::Surface&, Mackie::Button & button, Mackie::LedState); @@ -209,7 +209,7 @@ class MackieControlProtocol void add_down_button (ARDOUR::AutomationType, int surface, int strip); void remove_down_button (ARDOUR::AutomationType, int surface, int strip); ControlList down_controls (ARDOUR::AutomationType); - + void add_down_select_button (int surface, int strip); void remove_down_select_button (int surface, int strip); void select_range (); @@ -221,7 +221,7 @@ class MackieControlProtocol void not_session_load () { _session_load = false; } void midi_connectivity_established (); - + protected: // shut down the surface void close(); @@ -229,14 +229,14 @@ class MackieControlProtocol // This sets up the notifications and sets the // controls to the correct values void update_surfaces(); - + // connects global (not strip) signals from the Session to here // so the surface can be notified of changes from the other UIs. void connect_session_signals(); - + // set all controls to their zero position void zero_all(); - + /** Fetch the set of routes to be considered for control by the surface. Excluding master, hidden and control routes, and inactive routes @@ -254,7 +254,7 @@ class MackieControlProtocol std::string format_bbt_timecode (ARDOUR::framepos_t now_frame); std::string format_timecode_timecode (ARDOUR::framepos_t now_frame); - + void do_request (MackieControlUIRequest*); int stop (); @@ -267,7 +267,7 @@ class MackieControlProtocol struct ButtonHandlers { Mackie::LedState (MackieControlProtocol::*press) (Mackie::Button&); Mackie::LedState (MackieControlProtocol::*release) (Mackie::Button&); - + ButtonHandlers (Mackie::LedState (MackieControlProtocol::*p) (Mackie::Button&), Mackie::LedState (MackieControlProtocol::*r) (Mackie::Button&)) : press (p) @@ -277,7 +277,7 @@ class MackieControlProtocol typedef std::map<Mackie::Button::ID,ButtonHandlers> ButtonMap; static MackieControlProtocol* _instance; - + Mackie::DeviceInfo _device_info; Mackie::DeviceProfile _device_profile; sigc::connection periodic_connection; diff --git a/libs/surfaces/mackie/mcp_buttons.cc b/libs/surfaces/mackie/mcp_buttons.cc index c2d3680ff0..5bf52ce4c4 100644 --- a/libs/surfaces/mackie/mcp_buttons.cc +++ b/libs/surfaces/mackie/mcp_buttons.cc @@ -189,7 +189,7 @@ LedState MackieControlProtocol::cursor_right_press (Button& ) { if (zoom_mode()) { - + if (main_modifier_state() & MODIFIER_OPTION) { /* reset selected tracks to default vertical zoom */ } else { @@ -209,7 +209,7 @@ MackieControlProtocol::cursor_right_press (Button& ) ScrollTimeline (page_fraction); } - + return off; } @@ -223,7 +223,7 @@ LedState MackieControlProtocol::cursor_up_press (Button&) { if (zoom_mode()) { - + if (main_modifier_state() & MODIFIER_CONTROL) { VerticalZoomInSelected (); /* EMIT SIGNAL */ } else { diff --git a/libs/surfaces/mackie/meter.cc b/libs/surfaces/mackie/meter.cc index 91de8d6ef6..27171aff16 100644 --- a/libs/surfaces/mackie/meter.cc +++ b/libs/surfaces/mackie/meter.cc @@ -43,24 +43,24 @@ Meter::factory (Surface& surface, int id, const char* name, Group& group) void Meter::notify_metering_state_changed(Surface& surface, bool transport_is_rolling, bool metering_active) -{ +{ MidiByteArray msg; - + // sysex header msg << surface.sysex_hdr(); - + // code for Channel Meter Enable Message msg << 0x20; - + // Channel identification msg << id(); - + // Enable (0x07) / Disable (0x00) level meter on LCD, peak hold display on horizontal meter and signal LED msg << ((transport_is_rolling && metering_active) ? 0x07 : 0x00); - + // sysex trailer msg << MIDI::eox; - + surface.write (msg); } @@ -70,7 +70,7 @@ Meter::send_update (Surface& surface, float dB) float def = 0.0f; /* Meter deflection %age */ // DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Meter ID %1 dB %2\n", id(), dB)); - + if (dB < -70.0f) { def = 0.0f; } else if (dB < -60.0f) { @@ -88,19 +88,19 @@ Meter::send_update (Surface& surface, float dB) } else { def = 115.0f; } - + /* 115 is the deflection %age that would be when dB=6.0. this is an arbitrary endpoint for our scaling. */ MidiByteArray msg; - + if (def > 100.0f) { if (!overload_on) { overload_on = true; surface.write (MidiByteArray (2, 0xd0, (id() << 4) | 0xe)); - + } } else { if (overload_on) { @@ -108,11 +108,11 @@ Meter::send_update (Surface& surface, float dB) surface.write (MidiByteArray (2, 0xd0, (id() << 4) | 0xf)); } } - + /* we can use up to 13 segments */ int segment = lrintf ((def/115.0) * 13.0); - + surface.write (MidiByteArray (2, 0xd0, (id()<<4) | segment)); } diff --git a/libs/surfaces/mackie/meter.h b/libs/surfaces/mackie/meter.h index 1cbeeac0af..9a5d88ed23 100644 --- a/libs/surfaces/mackie/meter.h +++ b/libs/surfaces/mackie/meter.h @@ -35,7 +35,7 @@ public: Meter (int id, std::string name, Group & group) : Control (id, name, group) , overload_on (false) {} - + void send_update (Surface&, float dB); MidiByteArray zero(); diff --git a/libs/surfaces/mackie/midi_byte_array.cc b/libs/surfaces/mackie/midi_byte_array.cc index 1e94e781c0..ffb94a03a9 100644 --- a/libs/surfaces/mackie/midi_byte_array.cc +++ b/libs/surfaces/mackie/midi_byte_array.cc @@ -34,7 +34,7 @@ MidiByteArray::MidiByteArray (size_t size, MIDI::byte array[]) for (size_t i = 0; i < size; ++i) { push_back (array[i]); - } + } } MidiByteArray::MidiByteArray (size_t count, MIDI::byte first, ...) diff --git a/libs/surfaces/mackie/midi_byte_array.h b/libs/surfaces/mackie/midi_byte_array.h index 372e48ab90..3d3bcecd28 100644 --- a/libs/surfaces/mackie/midi_byte_array.h +++ b/libs/surfaces/mackie/midi_byte_array.h @@ -49,14 +49,14 @@ class MidiByteArray : public std::vector<MIDI::byte> { public: MidiByteArray() : std::vector<MIDI::byte>() {} - + MidiByteArray( size_t count, MIDI::byte array[] ); /** Accepts a preceding count, and then a list of bytes */ MidiByteArray( size_t count, MIDI::byte first, ... ); - + /// copy the given number of bytes from the given array void copy( size_t count, MIDI::byte arr[] ); }; diff --git a/libs/surfaces/mackie/pot.cc b/libs/surfaces/mackie/pot.cc index e1ddae82f8..3ac991116f 100644 --- a/libs/surfaces/mackie/pot.cc +++ b/libs/surfaces/mackie/pot.cc @@ -45,7 +45,7 @@ Pot::set (float val, bool onoff, Mode mode) // center on if val is "very close" to 0.50 MIDI::byte msg = (val > 0.48 && val < 0.58 ? 1 : 0) << 6; - + // Pot/LED mode msg |= (mode << 4); @@ -57,7 +57,7 @@ Pot::set (float val, bool onoff, Mode mode) if (val < 0){ val = val * -1; } - + // val, but only if off hasn't explicitly been set if (onoff) { if (mode == spread) { @@ -73,4 +73,4 @@ Pot::set (float val, bool onoff, Mode mode) return MidiByteArray (3, 0xb0, 0x20 + id(), msg); } - + diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc index ca5c79e9e0..4528e7b155 100644 --- a/libs/surfaces/mackie/strip.cc +++ b/libs/surfaces/mackie/strip.cc @@ -111,7 +111,7 @@ Strip::Strip (Surface& s, const std::string& name, int index, const map<Button:: _surface->number(), index, Button::id_to_name (bb->bid()), bb->id(), b->second.base_id)); } -} +} Strip::~Strip () { @@ -161,7 +161,7 @@ Strip::set_route (boost::shared_ptr<Route> r, bool /*with_messages*/) } route_connections.drop_connections (); - + _solo->set_control (boost::shared_ptr<AutomationControl>()); _mute->set_control (boost::shared_ptr<AutomationControl>()); _select->set_control (boost::shared_ptr<AutomationControl>()); @@ -181,12 +181,12 @@ Strip::set_route (boost::shared_ptr<Route> r, bool /*with_messages*/) DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Surface %1 strip %2 now mapping route %3\n", _surface->number(), _index, _route->name())); - + _solo->set_control (_route->solo_control()); _mute->set_control (_route->mute_control()); set_vpot_parameter (PanAzimuthAutomation); - + _route->solo_changed.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_solo_changed, this), ui_context()); _route->listen_changed.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_solo_changed, this), ui_context()); @@ -200,28 +200,28 @@ Strip::set_route (boost::shared_ptr<Route> r, bool /*with_messages*/) } _route->gain_control()->Changed.connect(route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_gain_changed, this, false), ui_context()); _route->PropertyChanged.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_property_changed, this, _1), ui_context()); - + boost::shared_ptr<Track> trk = boost::dynamic_pointer_cast<ARDOUR::Track>(_route); - + if (trk) { _recenable->set_control (trk->rec_enable_control()); trk->rec_enable_control()->Changed .connect(route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_record_enable_changed, this), ui_context()); - + } - + // TODO this works when a currently-banked route is made inactive, but not // when a route is activated which should be currently banked. - + _route->active_changed.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_active_changed, this), ui_context()); _route->DropReferences.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_route_deleted, this), ui_context()); - + /* Update */ - + notify_all (); /* setup legal VPot modes for this route */ - + build_input_list (_route->input()->n_ports()); build_output_list (_route->output()->n_ports()); @@ -232,11 +232,11 @@ Strip::set_route (boost::shared_ptr<Route> r, bool /*with_messages*/) if (panner) { set<Evoral::Parameter> automatable = panner->what_can_be_automated (); set<Evoral::Parameter>::iterator a; - + if ((a = automatable.find (PanAzimuthAutomation)) != automatable.end()) { possible_pot_parameters.push_back (PanAzimuthAutomation); } - + if ((a = automatable.find (PanWidthAutomation)) != automatable.end()) { possible_pot_parameters.push_back (PanWidthAutomation); } @@ -305,7 +305,7 @@ void Strip::notify_gain_changed (bool force_update) { if (_route) { - + Control* control; if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) { @@ -315,13 +315,13 @@ Strip::notify_gain_changed (bool force_update) } boost::shared_ptr<AutomationControl> ac = _route->gain_control(); - + float gain_coefficient = ac->get_value(); float normalized_position = ac->internal_to_interface (gain_coefficient); if (force_update || normalized_position != _last_gain_position_written) { - + if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) { if (!control->in_use()) { _surface->write (_vpot->set (normalized_position, true, Pot::wrap)); @@ -350,13 +350,13 @@ Strip::notify_property_changed (const PropertyChange& what_changed) if (_route) { string line1; string fullname = _route->name(); - + if (fullname.length() <= 6) { line1 = fullname; } else { line1 = PBD::short_version (fullname, 6); } - + _surface->write (display (0, line1)); } } @@ -382,7 +382,7 @@ Strip::notify_panner_azi_changed (bool force_update) } double pos = pannable->pan_azimuth_control->internal_to_interface (pannable->pan_azimuth_control->get_value()); - + if (force_update || pos != _last_pan_azi_position_written) { if (control == _fader) { @@ -392,7 +392,7 @@ Strip::notify_panner_azi_changed (bool force_update) } else if (control == _vpot) { _surface->write (_vpot->set (pos, true, Pot::dot)); } - + queue_parameter_display (PanAzimuthAutomation, pos); queue_display_reset (2000); _last_pan_azi_position_written = pos; @@ -419,12 +419,12 @@ Strip::notify_panner_width_changed (bool force_update) if (!control) { return; - } - + } + double pos = pannable->pan_width_control->internal_to_interface (pannable->pan_width_control->get_value()); - + if (force_update || pos != _last_pan_azi_position_written) { - + if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) { if (control == _fader) { @@ -436,7 +436,7 @@ Strip::notify_panner_width_changed (bool force_update) } else if (control == _vpot) { _surface->write (_vpot->set (pos, true, Pot::spread)); } - + queue_parameter_display (PanWidthAutomation, pos); queue_display_reset (2000); _last_pan_azi_position_written = pos; @@ -448,9 +448,9 @@ void Strip::select_event (Button&, ButtonState bs) { DEBUG_TRACE (DEBUG::MackieControl, "select button\n"); - + if (bs == press) { - + int ms = _surface->mcp().main_modifier_state(); if (ms & MackieControlProtocol::MODIFIER_CMDALT) { @@ -459,7 +459,7 @@ Strip::select_event (Button&, ButtonState bs) queue_display_reset (1000); return; } - + if (ms & MackieControlProtocol::MODIFIER_SHIFT) { /* reset to default */ boost::shared_ptr<AutomationControl> ac = _fader->control (); @@ -468,14 +468,14 @@ Strip::select_event (Button&, ButtonState bs) } return; } - + DEBUG_TRACE (DEBUG::MackieControl, "add select button on press\n"); - _surface->mcp().add_down_select_button (_surface->number(), _index); + _surface->mcp().add_down_select_button (_surface->number(), _index); _surface->mcp().select_range (); - + } else { DEBUG_TRACE (DEBUG::MackieControl, "remove select button on release\n"); - _surface->mcp().remove_down_select_button (_surface->number(), _index); + _surface->mcp().remove_down_select_button (_surface->number(), _index); } } @@ -485,13 +485,13 @@ Strip::vselect_event (Button&, ButtonState bs) if (bs == press) { int ms = _surface->mcp().main_modifier_state(); - + if (ms & MackieControlProtocol::MODIFIER_SHIFT) { boost::shared_ptr<AutomationControl> ac = _vpot->control (); - + if (ac) { - + /* reset to default/normal value */ ac->set_value (ac->normal()); } @@ -509,7 +509,7 @@ void Strip::fader_touch_event (Button&, ButtonState bs) { DEBUG_TRACE (DEBUG::MackieControl, string_compose ("fader touch, press ? %1\n", (bs == press))); - + if (bs == press) { boost::shared_ptr<AutomationControl> ac = _fader->control (); @@ -522,20 +522,20 @@ Strip::fader_touch_event (Button&, ButtonState bs) _fader->set_in_use (true); _fader->start_touch (_surface->mcp().transport_frame()); - + if (ac) { queue_parameter_display ((AutomationType) ac->parameter().type(), ac->internal_to_interface (ac->get_value())); queue_display_reset (2000); } } - + } else { - + _fader->set_in_use (false); _fader->stop_touch (_surface->mcp().transport_frame(), true); - + } -} +} void @@ -550,12 +550,12 @@ Strip::handle_button (Button& button, ButtonState bs) } DEBUG_TRACE (DEBUG::MackieControl, string_compose ("strip %1 handling button %2 press ? %3\n", _index, button.bid(), (bs == press))); - + switch (button.bid()) { case Button::Select: select_event (button, bs); break; - + case Button::VSelect: vselect_event (button, bs); break; @@ -569,34 +569,34 @@ Strip::handle_button (Button& button, ButtonState bs) if (bs == press) { DEBUG_TRACE (DEBUG::MackieControl, "add button on press\n"); _surface->mcp().add_down_button ((AutomationType) control->parameter().type(), _surface->number(), _index); - + float new_value; int ms = _surface->mcp().main_modifier_state(); - + if (ms & MackieControlProtocol::MODIFIER_SHIFT) { /* reset to default/normal value */ new_value = control->normal(); } else { new_value = control->get_value() ? 0.0 : 1.0; } - + /* get all controls that either have their * button down or are within a range of * several down buttons */ - + MackieControlProtocol::ControlList controls = _surface->mcp().down_controls ((AutomationType) control->parameter().type()); - - + + DEBUG_TRACE (DEBUG::MackieControl, string_compose ("there are %1 buttons down for control type %2, new value = %3\n", controls.size(), control->parameter().type(), new_value)); /* apply change */ - + for (MackieControlProtocol::ControlList::iterator c = controls.begin(); c != controls.end(); ++c) { (*c)->set_value (new_value); } - + } else { DEBUG_TRACE (DEBUG::MackieControl, "remove button on release\n"); _surface->mcp().remove_down_button ((AutomationType) control->parameter().type(), _surface->number(), _index); @@ -629,7 +629,7 @@ Strip::do_parameter_display (AutomationType type, float val) float dB = accurate_coefficient_to_dB (val); snprintf (buf, sizeof (buf), "%6.1f", dB); _surface->write (display (1, buf)); - } + } break; case PanAzimuthAutomation: @@ -691,7 +691,7 @@ Strip::handle_pot (Pot& pot, float delta) /* Pots only emit events when they move, not when they stop moving. So to get a stop event, we need to use a timeout. */ - + boost::shared_ptr<AutomationControl> ac = pot.control(); double p = pot.get_value (); p += delta; @@ -786,12 +786,12 @@ Strip::display (uint32_t line_number, const std::string& line) // sysex header retval << _surface->sysex_hdr(); - + // code for display retval << 0x12; // offset (0 to 0x37 first line, 0x38 to 0x6f for second line) retval << (_index * 7 + (line_number * 0x38)); - + // ascii data to display. @param line is UTF-8 string ascii = Glib::convert_with_fallback (line, "UTF-8", "ISO-8859-1", "_"); string::size_type len = ascii.length(); @@ -804,7 +804,7 @@ Strip::display (uint32_t line_number, const std::string& line) for (int i = len; i < 6; ++i) { retval << ' '; } - + // column spacer, unless it's the right-hand column if (_index < 7) { retval << ' '; @@ -812,7 +812,7 @@ Strip::display (uint32_t line_number, const std::string& line) // sysex trailer retval << MIDI::eox; - + return retval; } @@ -845,7 +845,7 @@ string Strip::vpot_mode_string () const { boost::shared_ptr<AutomationControl> ac = _vpot->control(); - + if (!ac) { return string(); } @@ -900,10 +900,10 @@ Strip::queue_display_reset (uint32_t msecs) struct timeval delta; struct timeval when; gettimeofday (&now, 0); - + delta.tv_sec = msecs/1000; delta.tv_usec = (msecs - ((msecs/1000) * 1000)) * 1000; - + timeradd (&now, &delta, &when); _reset_display_at = (when.tv_sec * 1000000) + when.tv_usec; @@ -923,10 +923,10 @@ Strip::reset_display () } else { _surface->write (blank_display (1)); } - + clear_display_reset (); } - + struct RouteCompareByName { bool operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) { return a->name().compare (b->name()) < 0; @@ -951,19 +951,19 @@ Strip::build_input_list (const ChanCount& channels) input_bundles.clear (); /* give user bundles first chance at being in the menu */ - + for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) { if (boost::dynamic_pointer_cast<UserBundle> (*i)) { maybe_add_to_bundle_map (input_bundles, *i, true, channels); } } - + for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) { if (boost::dynamic_pointer_cast<UserBundle> (*i) == 0) { maybe_add_to_bundle_map (input_bundles, *i, true, channels); } } - + boost::shared_ptr<ARDOUR::RouteList> routes = _surface->mcp().get_session().get_routes (); RouteList copy = *routes; copy.sort (RouteCompareByName ()); @@ -982,19 +982,19 @@ Strip::build_output_list (const ChanCount& channels) output_bundles.clear (); /* give user bundles first chance at being in the menu */ - + for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) { if (boost::dynamic_pointer_cast<UserBundle> (*i)) { maybe_add_to_bundle_map (output_bundles, *i, false, channels); } } - + for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) { if (boost::dynamic_pointer_cast<UserBundle> (*i) == 0) { maybe_add_to_bundle_map (output_bundles, *i, false, channels); } } - + boost::shared_ptr<ARDOUR::RouteList> routes = _surface->mcp().get_session().get_routes (); RouteList copy = *routes; copy.sort (RouteCompareByName ()); @@ -1141,21 +1141,21 @@ Strip::notify_metering_state_changed() if (!_route || !_meter) { return; } - + bool transport_is_rolling = (_surface->mcp().get_transport_speed () != 0.0f); bool metering_active = _surface->mcp().metering_active (); - + if ((_transport_is_rolling == transport_is_rolling) && (_metering_active == metering_active)) { return; } - + _meter->notify_metering_state_changed (*_surface, transport_is_rolling, metering_active); - + if (!transport_is_rolling || !metering_active) { notify_property_changed (PBD::PropertyChange (ARDOUR::Properties::name)); notify_panner_azi_changed (true); } - + _transport_is_rolling = transport_is_rolling; _metering_active = metering_active; } diff --git a/libs/surfaces/mackie/strip.h b/libs/surfaces/mackie/strip.h index 4099dce8af..c2cbfc2ee6 100644 --- a/libs/surfaces/mackie/strip.h +++ b/libs/surfaces/mackie/strip.h @@ -56,7 +56,7 @@ public: void add (Control & control); int index() const { return _index; } // zero based - + void set_route (boost::shared_ptr<ARDOUR::Route>, bool with_messages = true); // call all signal handlers manually @@ -117,7 +117,7 @@ private: void notify_panner_width_changed (bool force_update = true); void notify_active_changed (); void notify_route_deleted (); - + void update_automation (); void update_meter (); @@ -136,7 +136,7 @@ private: void do_parameter_display (ARDOUR::AutomationType, float val); void queue_parameter_display (ARDOUR::AutomationType, float val); - + typedef std::map<std::string,boost::shared_ptr<ARDOUR::Bundle> > BundleMap; BundleMap input_bundles; BundleMap output_bundles; diff --git a/libs/surfaces/mackie/surface.cc b/libs/surfaces/mackie/surface.cc index 51b03f86a3..5bbb081487 100644 --- a/libs/surfaces/mackie/surface.cc +++ b/libs/surfaces/mackie/surface.cc @@ -90,7 +90,7 @@ Surface::Surface (MackieControlProtocol& mcp, const std::string& device_name, ui , _last_master_gain_written (-0.0f) { DEBUG_TRACE (DEBUG::MackieControl, "Surface::Surface init\n"); - + try { _port = new SurfacePort (*this); } catch (...) { @@ -114,12 +114,12 @@ Surface::Surface (MackieControlProtocol& mcp, const std::string& device_name, ui } uint32_t n = _mcp.device_info().strip_cnt(); - + if (n) { init_strips (n); DEBUG_TRACE (DEBUG::MackieControl, "init_strips done\n"); } - + connect_to_signals (); DEBUG_TRACE (DEBUG::MackieControl, "Surface::Surface done\n"); @@ -135,12 +135,12 @@ Surface::~Surface () for (Groups::iterator it = groups.begin(); it != groups.end(); ++it) { delete it->second; } - + // delete controls for (Controls::iterator it = controls.begin(); it != controls.end(); ++it) { delete *it; } - + delete _jog_wheel; delete _port; @@ -205,7 +205,7 @@ void Surface::init_controls() { Group* group; - + DEBUG_TRACE (DEBUG::MackieControl, "Surface::init_controls: creating groups\n"); groups["assignment"] = new Group ("assignment"); groups["automation"] = new Group ("automation"); @@ -220,7 +220,7 @@ Surface::init_controls() groups["transport"] = new Group ("transport"); groups["user"] = new Group ("user"); groups["utilities"] = new Group ("utilities"); - + DEBUG_TRACE (DEBUG::MackieControl, "Surface::init_controls: creating jog wheel\n"); if (_mcp.device_info().has_jog_wheel()) { _jog_wheel = new Mackie::JogWheel (_mcp); @@ -251,11 +251,11 @@ Surface::init_strips (uint32_t n) for (uint32_t i = 0; i < n; ++i) { char name[32]; - + snprintf (name, sizeof (name), "strip_%d", (8* _number) + i); Strip* strip = new Strip (*this, name, i, strip_buttons); - + groups[name] = strip; strips.push_back (strip); } @@ -265,17 +265,17 @@ void Surface::setup_master () { boost::shared_ptr<Route> m; - + if ((m = _mcp.get_session().monitor_out()) == 0) { m = _mcp.get_session().master_out(); } - + if (!m) { return; } _master_fader = dynamic_cast<Fader*> (Fader::factory (*this, _mcp.device_info().strip_cnt(), "master", *groups["master"])); - + _master_fader->set_control (m->gain_control()); m->gain_control()->Changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&Surface::master_gain_changed, this), ui_context()); @@ -384,7 +384,7 @@ Surface::connect_to_signals () } // Master fader p->channel_pitchbend[_mcp.device_info().strip_cnt()].connect_same_thread (*this, boost::bind (&Surface::handle_midi_pitchbend_message, this, _1, _2, _mcp.device_info().strip_cnt())); - + _connected = true; } } @@ -402,7 +402,7 @@ Surface::handle_midi_pitchbend_message (MIDI::Parser&, MIDI::pitchbend_t pb, uin DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Surface::handle_midi_pitchbend_message on port %3, fader = %1 value = %2 (%4)\n", fader_id, pb, _number, pb/16384.0)); - + if (_mcp.device_info().no_handshake()) { turn_it_on (); } @@ -437,7 +437,7 @@ void Surface::handle_midi_note_on_message (MIDI::Parser &, MIDI::EventTwoBytes* ev) { DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Surface::handle_midi_note_on_message %1 = %2\n", (int) ev->note_number, (int) ev->velocity)); - + if (_mcp.device_info().no_handshake()) { turn_it_on (); } @@ -445,7 +445,7 @@ Surface::handle_midi_note_on_message (MIDI::Parser &, MIDI::EventTwoBytes* ev) if (_mcp.device_info().device_type() == DeviceInfo::HUI && ev->note_number == 0 && ev->velocity == 127) { turn_it_on (); } - + /* fader touch sense is given by "buttons" 0xe..0xe7 and 0xe8 for the * master. */ @@ -516,7 +516,7 @@ Surface::handle_midi_controller_message (MIDI::Parser &, MIDI::EventTwoBytes* ev } else { delta = sign * (ticks / (float) 0x3f); } - + if (!pot) { if (ev->controller_number == Jog::ID && _jog_wheel) { @@ -595,16 +595,16 @@ calculate_challenge_response (MidiByteArray::iterator begin, MidiByteArray::iter MidiByteArray l; back_insert_iterator<MidiByteArray> back (l); copy (begin, end, back); - + MidiByteArray retval; - + // this is how to calculate the response to the challenge. // from the Logic docs. retval << (0x7f & (l[0] + (l[1] ^ 0xa) - l[3])); retval << (0x7f & ( (l[2] >> l[3]) ^ (l[0] + l[3]))); retval << (0x7f & ((l[3] - (l[2] << 2)) ^ (l[0] | l[1]))); retval << (0x7f & (l[1] - l[2] + (0xf0 ^ (l[3] << 4)))); - + return retval; } @@ -613,7 +613,7 @@ MidiByteArray Surface::host_connection_query (MidiByteArray & bytes) { MidiByteArray response; - + if (bytes[4] != 0x10 && bytes[4] != 0x11) { /* not a Logic Control device - no response required */ return response; @@ -621,7 +621,7 @@ Surface::host_connection_query (MidiByteArray & bytes) // handle host connection query DEBUG_TRACE (DEBUG::MackieControl, string_compose ("host connection query: %1\n", bytes)); - + if (bytes.size() != 18) { cerr << "expecting 18 bytes, read " << bytes << " from " << _port->input_port().name() << endl; return response; @@ -639,14 +639,14 @@ MidiByteArray Surface::host_connection_confirmation (const MidiByteArray & bytes) { DEBUG_TRACE (DEBUG::MackieControl, string_compose ("host_connection_confirmation: %1\n", bytes)); - + // decode host connection confirmation if (bytes.size() != 14) { ostringstream os; os << "expecting 14 bytes, read " << bytes << " from " << _port->input_port().name(); throw MackieControlException (os.str()); } - + // send version request return MidiByteArray (2, 0x13, 0x00); } @@ -725,7 +725,7 @@ Surface::zero_all () if (_mcp.device_info().has_timecode_display ()) { display_timecode (string (10, '0'), string (10, ' ')); } - + if (_mcp.device_info().has_two_character_display()) { show_two_char_display (string (2, '0'), string (2, ' ')); } @@ -839,13 +839,13 @@ Surface::show_two_char_display (const std::string & msg, const std::string & dot if (_stype != mcu || !_mcp.device_info().has_two_character_display() || msg.length() != 2 || dots.length() != 2) { return; } - + MidiByteArray right (3, 0xb0, 0x4b, 0x00); MidiByteArray left (3, 0xb0, 0x4a, 0x00); - + right[2] = translate_seven_segment (msg[0]) + (dots[0] == '.' ? 0x40 : 0x00); left[2] = translate_seven_segment (msg[1]) + (dots[1] == '.' ? 0x40 : 0x00); - + _port->write (right); _port->write (left); } @@ -866,7 +866,7 @@ Surface::display_timecode (const std::string & timecode, const std::string & las } // if there's no change, send nothing, not even sysex header if (timecode == last_timecode) return; - + // length sanity checking string local_timecode = timecode; @@ -879,7 +879,7 @@ Surface::display_timecode (const std::string & timecode, const std::string & las while (local_timecode.length() < 10) { local_timecode += " "; } - + // translate characters. // Only the characters that actually changed are sent. int position = 0x3f; @@ -949,7 +949,7 @@ Surface::update_view_mode_display () } if (id >= 0) { - + /* we are attempting to turn a global button/LED on */ map<int,Control*>::iterator x = controls_by_device_independent_id.find (id); @@ -999,7 +999,7 @@ Surface::next_jog_mode () void Surface::set_jog_mode (JogWheel::Mode) { -} +} bool Surface::route_is_locked_to_strip (boost::shared_ptr<Route> r) const @@ -1065,13 +1065,13 @@ Surface::recalibrate_faders () msg[4] = 0x11; /* reset Logic Control XT */ _port->write (msg); } -} +} void Surface::set_touch_sensitivity (int sensitivity) { /* NOTE: assumed called from GUI code, hence sleep() */ - + /* sensitivity already clamped by caller */ if (_port) { diff --git a/libs/surfaces/mackie/surface.h b/libs/surfaces/mackie/surface.h index 7ca620d3b6..1c989ec518 100644 --- a/libs/surfaces/mackie/surface.h +++ b/libs/surfaces/mackie/surface.h @@ -62,7 +62,7 @@ public: std::map<int,Led*> leds; std::map<int,Meter*> meters; std::map<int,Control*> controls_by_device_independent_id; - + Mackie::JogWheel* jog_wheel() const { return _jog_wheel; } Fader* master_fader() const { return _master_fader; } @@ -88,7 +88,7 @@ public: void periodic (uint64_t now_usecs); void redisplay (); void hui_heartbeat (); - + void handle_midi_pitchbend_message (MIDI::Parser&, MIDI::pitchbend_t, uint32_t channel_id); void handle_midi_controller_message (MIDI::Parser&, MIDI::EventTwoBytes*); void handle_midi_note_on_message (MIDI::Parser&, MIDI::EventTwoBytes*); @@ -105,7 +105,7 @@ public: /// display an indicator of the first switched-in Route. Do nothing by default. void display_bank_start (uint32_t /*current_bank*/); - + /// called from MackieControlProtocol::zero_all to turn things off void zero_all (); void zero_controls (); @@ -122,7 +122,7 @@ public: void recalibrate_faders (); void toggle_backlight (); void set_touch_sensitivity (int); - + /** This is used to calculate the clicks per second that define a transport speed of 1.0 for the jog wheel. 100.0 is 10 clicks @@ -144,7 +144,7 @@ public: // be two characters void show_two_char_display (const std::string & msg, const std::string & dots = " "); void show_two_char_display (unsigned int value, const std::string & dots = " "); - + void update_view_mode_display (); void update_flip_mode_display (); @@ -162,7 +162,7 @@ public: int set_state (const XMLNode&, int version); protected: - + private: MackieControlProtocol& _mcp; SurfacePort* _port; diff --git a/libs/surfaces/mackie/surface_port.cc b/libs/surfaces/mackie/surface_port.cc index 4a8cff6e16..3129b5a1fd 100644 --- a/libs/surfaces/mackie/surface_port.cc +++ b/libs/surfaces/mackie/surface_port.cc @@ -57,7 +57,7 @@ SurfacePort::SurfacePort (Surface& s) _output_port = _input_port; } else { - + _async_in = AudioEngine::instance()->register_input_port (DataType::MIDI, string_compose (_("%1 in"), _surface->name()), true); _async_out = AudioEngine::instance()->register_output_port (DataType::MIDI, string_compose (_("%1 out"), _surface->name()), true); @@ -81,7 +81,7 @@ SurfacePort::~SurfacePort() AudioEngine::instance()->unregister_port (_async_in); _async_in.reset ((ARDOUR::Port*) 0); } - + if (_async_out) { _output_port->drain (10000); DEBUG_TRACE (DEBUG::MackieControl, string_compose ("unregistering output port %1\n", _async_out->name())); @@ -106,7 +106,7 @@ SurfacePort::get_state () child = new XMLNode (X_("Input")); child->add_child_nocopy (_async_in->get_state()); node->add_child_nocopy (*child); - + child = new XMLNode (X_("Output")); child->add_child_nocopy (_async_out->get_state()); @@ -150,7 +150,7 @@ string fetch_errmsg (int error_number) char * msg = strerror (error_number); return msg; } - + int SurfacePort::write (const MidiByteArray & mba) { @@ -164,7 +164,7 @@ SurfacePort::write (const MidiByteArray & mba) if (mba[0] != 0xf0 && mba.size() > 3) { std::cerr << "TOO LONG WRITE: " << mba << std::endl; } - + /* this call relies on std::vector<T> using contiguous storage. not * actually guaranteed by the standard, but way, way beyond likely. */ diff --git a/libs/surfaces/mackie/surface_port.h b/libs/surfaces/mackie/surface_port.h index d22e46f4bf..2c78e692a7 100644 --- a/libs/surfaces/mackie/surface_port.h +++ b/libs/surfaces/mackie/surface_port.h @@ -58,7 +58,7 @@ public: /// an easier way to output bytes via midi int write (const MidiByteArray&); - + MIDI::Port& input_port() const { return *_input_port; } MIDI::Port& output_port() const { return *_output_port; } @@ -73,7 +73,7 @@ private: MIDI::Port* _output_port; boost::shared_ptr<ARDOUR::Port> _async_in; boost::shared_ptr<ARDOUR::Port> _async_out; -}; +}; std::ostream& operator << (std::ostream& , const SurfacePort& port); diff --git a/libs/surfaces/mackie/timer.h b/libs/surfaces/mackie/timer.h index 31470a92c3..423b962ce8 100644 --- a/libs/surfaces/mackie/timer.h +++ b/libs/surfaces/mackie/timer.h @@ -36,7 +36,7 @@ namespace Mackie class Timer { public: - + /** start the timer running if true, or just create the object if false. @@ -46,7 +46,7 @@ public: if ( shouldStart ) start(); } - + /** Start the timer running. Return the current timestamp, in milliseconds */ @@ -81,7 +81,7 @@ public: return (_stop - _start) / 1000; } } - + /** Call stop and then start. Return the value from stop. */ diff --git a/libs/surfaces/mackie/types.h b/libs/surfaces/mackie/types.h index fd1b225c65..87676ae0f6 100644 --- a/libs/surfaces/mackie/types.h +++ b/libs/surfaces/mackie/types.h @@ -41,19 +41,19 @@ public: LedState (state_t state): _state (state) {} LedState& operator= (state_t s) { _state = s; return *this; } - + bool operator == (const LedState & other) const { return state() == other.state(); } - + bool operator != (const LedState & other) const { return state() != other.state(); } - + state_t state() const { return _state; } - + private: state_t _state; }; @@ -72,27 +72,27 @@ enum ButtonState { neither = -1, release = 0, press = 1 }; struct ControlState { ControlState(): pos(0.0), sign(0), delta(0.0), ticks(0), led_state(off), button_state(neither) {} - + ControlState (LedState ls): pos(0.0), delta(0.0), led_state(ls), button_state(neither) {} - + // Note that this sets both pos and delta to the flt value ControlState (LedState ls, float flt): pos(flt), delta(flt), ticks(0), led_state(ls), button_state(neither) {} ControlState (float flt): pos(flt), delta(flt), ticks(0), led_state(none), button_state(neither) {} ControlState (float flt, unsigned int tcks): pos(flt), delta(flt), ticks(tcks), led_state(none), button_state(neither) {} ControlState (ButtonState bs): pos(0.0), delta(0.0), ticks(0), led_state(none), button_state(bs) {} - + /// For faders. Between 0 and 1. float pos; - + /// For pots. Sign. Either -1 or 1; int sign; /// For pots. Signed value of total movement. Between 0 and 1 float delta; - + /// For pots. Unsigned number of ticks. Usually between 1 and 16. unsigned int ticks; - + LedState led_state; ButtonState button_state; }; diff --git a/libs/surfaces/osc/interface.cc b/libs/surfaces/osc/interface.cc index 568e03edff..d26a31788e 100644 --- a/libs/surfaces/osc/interface.cc +++ b/libs/surfaces/osc/interface.cc @@ -28,7 +28,7 @@ static ControlProtocol* new_osc_protocol (ControlProtocolDescriptor* /*descriptor*/, Session* s) { OSC* osc = new OSC (*s, Config->get_osc_port()); - + osc->set_active (true); return osc; diff --git a/libs/surfaces/osc/osc.h b/libs/surfaces/osc/osc.h index f046053091..38aad2945f 100644 --- a/libs/surfaces/osc/osc.h +++ b/libs/surfaces/osc/osc.h @@ -44,7 +44,7 @@ namespace ARDOUR { class Session; class Route; } - + /* this is mostly a placeholder because I suspect that at some point we will want to add more members to accomodate certain types of requests to the OSC UI @@ -85,7 +85,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest> GSource* local_server; GSource* remote_server; - + bool osc_input_handler (Glib::IOCondition, lo_server); private: @@ -102,7 +102,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest> void register_callbacks (); void route_added (ARDOUR::RouteList&); - + // Handlers for "Application Hook" signals void session_loaded (ARDOUR::Session&); void session_exported (std::string, std::string); @@ -114,9 +114,9 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest> void send_current_value (const char* path, lo_arg** argv, int argc, lo_message msg); void current_value_query (const char* path, size_t len, lo_arg **argv, int argc, lo_message msg); - + int current_value (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data); - + int catchall (const char *path, const char *types, lo_arg **argv, int argc, void *data); static int _catchall (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data); @@ -131,10 +131,10 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest> name (data); \ return 0; \ } - + PATH_CALLBACK_MSG(routes_list); PATH_CALLBACK_MSG(transport_frame); - + #define PATH_CALLBACK(name) \ static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \ return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \ @@ -238,18 +238,18 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest> int route_set_send_gain_dB (int rid, int sid, float val); int route_plugin_parameter (int rid, int piid,int par, float val); int route_plugin_parameter_print (int rid, int piid,int par); - + void listen_to_route (boost::shared_ptr<ARDOUR::Route>, lo_address); void end_listen (boost::shared_ptr<ARDOUR::Route>, lo_address); void drop_route (boost::weak_ptr<ARDOUR::Route>); - + void route_name_changed (const PBD::PropertyChange&, boost::weak_ptr<ARDOUR::Route> r, lo_address addr); - + void update_clock (); typedef std::list<OSCRouteObserver*> RouteObservers; - + RouteObservers route_observers; static OSC* _instance; diff --git a/libs/surfaces/osc/osc_controllable.cc b/libs/surfaces/osc/osc_controllable.cc index ce86c8aee7..2cd4c31080 100644 --- a/libs/surfaces/osc/osc_controllable.cc +++ b/libs/surfaces/osc/osc_controllable.cc @@ -63,7 +63,7 @@ void OSCControllable::send_change_message () { lo_message msg = lo_message_new (); - + lo_message_add_float (msg, (float) controllable->get_value()); /* XXX thread issues */ @@ -72,7 +72,7 @@ OSCControllable::send_change_message () lo_message_free (msg); } -/*------------------------------------------------------------*/ +/*------------------------------------------------------------*/ OSCRouteControllable::OSCRouteControllable (lo_address a, const std::string& p, boost::shared_ptr<Controllable> c, boost::shared_ptr<Route> r) diff --git a/libs/surfaces/osc/osc_route_observer.cc b/libs/surfaces/osc/osc_route_observer.cc index b7075e1d27..8bb511b94f 100644 --- a/libs/surfaces/osc/osc_route_observer.cc +++ b/libs/surfaces/osc/osc_route_observer.cc @@ -37,7 +37,7 @@ OSCRouteObserver::OSCRouteObserver (boost::shared_ptr<Route> r, lo_address a) : _route (r) { addr = lo_address_new (lo_address_get_hostname(a) , lo_address_get_port(a)); - + _route->PropertyChanged.connect (name_changed_connection, MISSING_INVALIDATOR, boost::bind (&OSCRouteObserver::name_changed, this, boost::lambda::_1), OSC::instance()); if (boost::dynamic_pointer_cast<AudioTrack>(_route) || boost::dynamic_pointer_cast<MidiTrack>(_route)) { @@ -47,7 +47,7 @@ OSCRouteObserver::OSCRouteObserver (boost::shared_ptr<Route> r, lo_address a) rec_controllable->Changed.connect (rec_changed_connection, MISSING_INVALIDATOR, bind (&OSCRouteObserver::send_change_message, this, X_("/route/rec"), track->rec_enable_control()), OSC::instance()); } - + boost::shared_ptr<Controllable> mute_controllable = boost::dynamic_pointer_cast<Controllable>(_route->mute_control()); mute_controllable->Changed.connect (mute_changed_connection, MISSING_INVALIDATOR, bind (&OSCRouteObserver::send_change_message, this, X_("/route/mute"), _route->mute_control()), OSC::instance()); @@ -75,11 +75,11 @@ OSCRouteObserver::name_changed (const PBD::PropertyChange& what_changed) if (!what_changed.contains (ARDOUR::Properties::name)) { return; } - + if (!_route) { return; } - + lo_message msg = lo_message_new (); lo_message_add_int32 (msg, _route->remote_control_id()); diff --git a/libs/surfaces/osc/osc_route_observer.h b/libs/surfaces/osc/osc_route_observer.h index b83b0f1e64..7153da7329 100644 --- a/libs/surfaces/osc/osc_route_observer.h +++ b/libs/surfaces/osc/osc_route_observer.h @@ -42,13 +42,13 @@ class OSCRouteObserver private: boost::shared_ptr<ARDOUR::Route> _route; //boost::shared_ptr<Controllable> _controllable; - + PBD::ScopedConnection name_changed_connection; PBD::ScopedConnection rec_changed_connection; PBD::ScopedConnection mute_changed_connection; PBD::ScopedConnection solo_changed_connection; PBD::ScopedConnection gain_changed_connection; - + lo_address addr; std::string path; diff --git a/libs/surfaces/tranzport/bling.cc b/libs/surfaces/tranzport/bling.cc index ea2ef56d42..308430af68 100644 --- a/libs/surfaces/tranzport/bling.cc +++ b/libs/surfaces/tranzport/bling.cc @@ -109,7 +109,7 @@ bling::scrollmsg() { // Based on the current bling mode, do whatever it is you are going to do bling::run() { - + } // etc diff --git a/libs/surfaces/tranzport/buttons.cc b/libs/surfaces/tranzport/buttons.cc index 99bcccc902..a35f025489 100644 --- a/libs/surfaces/tranzport/buttons.cc +++ b/libs/surfaces/tranzport/buttons.cc @@ -55,7 +55,7 @@ TranzportControlProtocol::process (uint8_t* buf) this_button_mask |= buf[4] << 8; this_button_mask |= buf[5]; _datawheel = buf[6]; - + #if DEBUG_TRANZPORT_STATE > 1 // Is the state machine incomplete? const unsigned int knownstates = 0x00004000|0x00008000| diff --git a/libs/surfaces/tranzport/general.cc b/libs/surfaces/tranzport/general.cc index d051b36d1d..35d2f2bb3b 100644 --- a/libs/surfaces/tranzport/general.cc +++ b/libs/surfaces/tranzport/general.cc @@ -76,7 +76,7 @@ int TranzportControlProtocol::lights_show_bling() case BlingPairs: break; // Show pairs of lights case BlingRows: break; // light each row in sequence case BlingFlashAll: break; // Flash everything randomly - case BlingEnter: lights_on(); // Show intro + case BlingEnter: lights_on(); // Show intro case BlingExit: lights_off(); break; @@ -93,7 +93,7 @@ int TranzportControlProtocol::screen_show_bling() case BlingPairs: break; // Show pairs of lights case BlingRows: break; // light each row in sequence case BlingFlashAll: break; // Flash everything randomly - case BlingEnter: // Show intro + case BlingEnter: // Show intro print(0,0,"!!Welcome to Ardour!"); print(1,0,"Peace through Music!"); break; @@ -182,7 +182,7 @@ void TranzportControlProtocol::prev_marker () { Location *location = session->locations()->first_location_before (session->transport_frame()); - + if (location) { session->request_locate (location->start(), session->transport_rolling()); notify(location->name().c_str()); @@ -242,7 +242,7 @@ TranzportControlProtocol::step_gain (float increment) if (fabsf(gain_fraction) > 2.0) { gain_fraction = 2.0*sign(gain_fraction); } - + route_set_gain (0, slider_position_to_gain (gain_fraction)); } #endif @@ -259,7 +259,7 @@ TranzportControlProtocol::step_gain_up () if (gain_fraction > 2.0) { gain_fraction = 2.0; } - + route_set_gain (0, slider_position_to_gain (gain_fraction)); } @@ -275,7 +275,7 @@ TranzportControlProtocol::step_gain_down () if (gain_fraction < 0.0) { gain_fraction = 0.0; } - + route_set_gain (0, slider_position_to_gain (gain_fraction)); } diff --git a/libs/surfaces/tranzport/init.cc b/libs/surfaces/tranzport/init.cc index 3a01185407..459da81cbc 100644 --- a/libs/surfaces/tranzport/init.cc +++ b/libs/surfaces/tranzport/init.cc @@ -65,7 +65,7 @@ int TranzportControlProtocol::rtpriority_unset(int priority) struct sched_param rtparam; int err; memset (&rtparam, 0, sizeof (rtparam)); - rtparam.sched_priority = priority; + rtparam.sched_priority = 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; @@ -208,7 +208,7 @@ TranzportControlProtocol::monitor_work () case 3: val = read(buf,DEFAULT_USB_TIMEOUT*2); break; // Hoo, boy, we're in trouble default: break; // not reached } - + #if DEBUG_TRANZPORT_BITS > 9 if(_device_status != STATUS_OFFLINE && _device_status != STATUS_ONLINE && _device_status != STATUS_OK) { printf("The device has more status bits than off or online: %d\n",_device_status); @@ -265,7 +265,7 @@ TranzportControlProtocol::monitor_work () printf("OFFLINE : %02x %02x %02x %02x %02x %02x %02x %02x\n", buf[0],buf[1],buf[2], buf[3], buf[4], buf[5],buf[6],buf[7]); } - + if(_device_status == STATUS_OK) { printf("OK : %02x %02x %02x %02x %02x %02x %02x %02x\n", buf[0],buf[1],buf[2], buf[3], buf[4], buf[5],buf[6],buf[7]); diff --git a/libs/surfaces/tranzport/interface.cc b/libs/surfaces/tranzport/interface.cc index ac4341cde8..514cfbe4fb 100644 --- a/libs/surfaces/tranzport/interface.cc +++ b/libs/surfaces/tranzport/interface.cc @@ -34,7 +34,7 @@ new_tranzport_protocol (ControlProtocolDescriptor* descriptor, Session* s) } return tcp; - + } static void @@ -60,7 +60,7 @@ static ControlProtocolDescriptor tranzport_descriptor = { initialize : new_tranzport_protocol, destroy : delete_tranzport_protocol }; - + extern "C" ARDOURSURFACE_API ControlProtocolDescriptor* protocol_descriptor () { return &tranzport_descriptor; } diff --git a/libs/surfaces/tranzport/io.cc b/libs/surfaces/tranzport/io.cc index 39be2c2e51..3fe1b554ca 100644 --- a/libs/surfaces/tranzport/io.cc +++ b/libs/surfaces/tranzport/io.cc @@ -67,10 +67,10 @@ TranzportControlProtocol::lights_flush () printf("LPEND : %s\n", lights_pending.to_string().c_str()); printf("LCURR : %s\n", lights_current.to_string().c_str()); #endif - + // if ever we thread reads/writes STATUS_OK will have to move into the loop int i; - + if ( _device_status == STATUS_OK || _device_status == STATUS_ONLINE) { for (i = 0; i<LIGHTS; i++) { if(light_state[i]) { @@ -90,6 +90,6 @@ TranzportControlProtocol::lights_flush () #if DEBUG_TRANZPORT_LIGHTS > 2 printf("Did %d light writes, left: %d\n",i, light_state.count()); #endif - + return light_state.count(); } diff --git a/libs/surfaces/tranzport/io_kernel.cc b/libs/surfaces/tranzport/io_kernel.cc index 0532ee7e6b..6c2bc37922 100644 --- a/libs/surfaces/tranzport/io_kernel.cc +++ b/libs/surfaces/tranzport/io_kernel.cc @@ -92,7 +92,7 @@ int TranzportControlProtocol::read(uint8_t *buf, uint32_t timeout_override) return last_read_error; } - + int TranzportControlProtocol::write_noretry (uint8_t* cmd, uint32_t timeout_override) { @@ -131,13 +131,13 @@ TranzportControlProtocol::write_noretry (uint8_t* cmd, uint32_t timeout_override return 0; -} +} int TranzportControlProtocol::write (uint8_t* cmd, uint32_t timeout_override) { return (write_noretry(cmd,timeout_override)); -} +} // FIXME - install poll semantics #endif /* HAVE_TRANZPORT_KERNEL_DRIVER */ diff --git a/libs/surfaces/tranzport/io_usb.cc b/libs/surfaces/tranzport/io_usb.cc index 5d4e75f7d1..56d270b62a 100644 --- a/libs/surfaces/tranzport/io_usb.cc +++ b/libs/surfaces/tranzport/io_usb.cc @@ -97,7 +97,7 @@ TranzportControlProtocol::open_core (struct usb_device* dev) cerr << _("Tranzport: cannot open USB transport") << endmsg; return -1; } - + if (usb_claim_interface (udev, 0) < 0) { cerr << _("Tranzport: cannot claim USB interface") << endmsg; usb_close (udev); @@ -158,7 +158,7 @@ int TranzportControlProtocol::read(uint8_t *buf, uint32_t timeout_override) return last_read_error; } - + int TranzportControlProtocol::write_noretry (uint8_t* cmd, uint32_t timeout_override) { @@ -195,7 +195,7 @@ TranzportControlProtocol::write_noretry (uint8_t* cmd, uint32_t timeout_override return 0; -} +} int TranzportControlProtocol::write (uint8_t* cmd, uint32_t timeout_override) @@ -204,7 +204,7 @@ TranzportControlProtocol::write (uint8_t* cmd, uint32_t timeout_override) int val; int retry = 0; if(inflight > MAX_TRANZPORT_INFLIGHT) { return (-1); } - + while((val = usb_interrupt_write (udev, WRITE_ENDPOINT, (char*) cmd, 8, timeout_override ? timeout_override : timeout))!=8 && retry++ < MAX_RETRY) { printf("usb_interrupt_write failed, retrying: %d\n", val); } @@ -227,6 +227,6 @@ TranzportControlProtocol::write (uint8_t* cmd, uint32_t timeout_override) return (write_noretry(cmd,timeout_override)); #endif -} +} #endif diff --git a/libs/surfaces/tranzport/lcd.cc b/libs/surfaces/tranzport/lcd.cc index 592bf7cf00..7e9e03c8f2 100644 --- a/libs/surfaces/tranzport/lcd.cc +++ b/libs/surfaces/tranzport/lcd.cc @@ -44,7 +44,7 @@ bool TranzportControlProtocol::lcd_damage (int row, int col, int length) bool TranzportControlProtocol::lcd_isdamaged () { if(screen_invalid.any()) { -#if DEBUG_TRANZPORT > 5 +#if DEBUG_TRANZPORT > 5 printf("LCD is damaged somewhere, should redraw it\n"); #endif return true; @@ -60,7 +60,7 @@ bool TranzportControlProtocol::lcd_isdamaged (int row, int col, int length) std::bitset<ROWS*COLUMNS> mask(mask1 << (row*COLUMNS+col)); mask &= screen_invalid; if(mask.any()) { -#if DEBUG_TRANZPORT > 5 +#if DEBUG_TRANZPORT > 5 printf("row: %d,col: %d is damaged, should redraw it\n", row,col); #endif return true; diff --git a/libs/surfaces/tranzport/show.cc b/libs/surfaces/tranzport/show.cc index 6d97abf43a..544bb3df96 100644 --- a/libs/surfaces/tranzport/show.cc +++ b/libs/surfaces/tranzport/show.cc @@ -169,7 +169,7 @@ void TranzportControlProtocol::show_mini_meter() } last_meter_fill_l = fill_left; last_meter_fill_r = fill_right; - + // give some feedback when overdriving - override yellow and red lights if (fraction_l > 0.96 || fraction_r > 0.96) { @@ -179,7 +179,7 @@ void TranzportControlProtocol::show_mini_meter() if (fraction_l == 1.0 || fraction_r == 1.0) { light_on (LightTrackrec); } - + const uint8_t char_map[16] = { ' ', TRANZ_UL, TRANZ_U, TRANZ_U, TRANZ_BL, TRANZ_Q2, @@ -196,7 +196,7 @@ void TranzportControlProtocol::show_mini_meter() ((fill_right >=j) << 2) | ((fill_right >= j+1) << 3); buf[i] = char_map[val]; } - + /* print() requires this */ buf[meter_size/2] = '\0'; @@ -204,11 +204,11 @@ void TranzportControlProtocol::show_mini_meter() print (1, 0, buf); /* Add a peak bar, someday do falloff */ - + // char peak[2]; peak[0] = ' '; peak[1] = '\0'; // if(fraction_l == 1.0 || fraction_r == 1.0) peak[0] = 'P'; // print (1,8,peak); // Put a peak meter - P in if we peaked. - + } void @@ -261,7 +261,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 */ if (i < 20 && add_single_level) { @@ -349,7 +349,7 @@ void TranzportControlProtocol::show_transport_time () { show_bbt (session->transport_frame ()); -} +} void TranzportControlProtocol::show_timecode (framepos_t where) diff --git a/libs/surfaces/tranzport/state.cc b/libs/surfaces/tranzport/state.cc index f5718174be..59eaef0460 100644 --- a/libs/surfaces/tranzport/state.cc +++ b/libs/surfaces/tranzport/state.cc @@ -60,7 +60,7 @@ TranzportControlProtocol::set_state (const XMLNode& node) int retval = 0; // I think I want to make these strings rather than numbers -#if 0 +#if 0 // fetch current display mode if ( node.property( X_("display_mode") ) != 0 ) { diff --git a/libs/surfaces/tranzport/tranzport_control_protocol.h b/libs/surfaces/tranzport/tranzport_control_protocol.h index aa60d5399f..32d88aaf5e 100644 --- a/libs/surfaces/tranzport/tranzport_control_protocol.h +++ b/libs/surfaces/tranzport/tranzport_control_protocol.h @@ -106,7 +106,7 @@ private: WheelShiftMaster, WheelShiftMarker }; - + enum WheelMode { WheelTimeline, WheelScrub, @@ -124,7 +124,7 @@ private: WheelIncrSecond, WheelIncrMinute }; - + enum DisplayMode { DisplayNormal, DisplayRecording, @@ -301,7 +301,7 @@ private: void show_current_track (); void show_track_gain (); void show_transport_time (); - void show_bbt (framepos_t where); + void show_bbt (framepos_t where); void show_timecode (framepos_t where); void show_wheel_mode (); void show_gain (); diff --git a/libs/surfaces/tranzport/wheel.cc b/libs/surfaces/tranzport/wheel.cc index 8122b8a77d..d90e0e2b6e 100644 --- a/libs/surfaces/tranzport/wheel.cc +++ b/libs/surfaces/tranzport/wheel.cc @@ -55,7 +55,7 @@ TranzportControlProtocol::datawheel () if ((buttonmask & ButtonTrackRight) || (buttonmask & ButtonTrackLeft)) { /* track scrolling */ - + if (_datawheel < WheelDirectionThreshold) { next_track (); } else { @@ -63,7 +63,7 @@ TranzportControlProtocol::datawheel () } last_wheel_motion = 0; - + } else if ((buttonmask & ButtonPrev) || (buttonmask & ButtonNext)) { if (_datawheel < WheelDirectionThreshold) { @@ -71,13 +71,13 @@ TranzportControlProtocol::datawheel () } else { prev_marker (); } - + last_wheel_motion = 0; - + } else if (buttonmask & ButtonShift) { - + /* parameter control */ - + if (route_table[0]) { switch (wheel_shift_mode) { case WheelShiftGain: @@ -94,29 +94,29 @@ TranzportControlProtocol::datawheel () step_pan_left (); } break; - + case WheelShiftMarker: break; - + case WheelShiftMaster: break; - + } } - + last_wheel_motion = 0; - + } else { - + switch (wheel_mode) { case WheelTimeline: scroll (); break; - + case WheelScrub: scrub (); break; - + case WheelShuttle: shuttle (); break; @@ -151,35 +151,35 @@ TranzportControlProtocol::scrub () float speed; uint64_t now; int dir; - + now = g_get_monotonic_time(); - + if (_datawheel < WheelDirectionThreshold) { dir = 1; } else { dir = -1; } - + if (dir != last_wheel_dir) { /* changed direction, start over */ speed = 0.1f; } else { if (last_wheel_motion != 0) { /* 10 clicks per second => speed == 1.0 */ - + speed = 100000.0f / (float) (now - last_wheel_motion) - + } else { - + /* start at half-speed and see where we go from there */ - + speed = 0.5f; } } - + last_wheel_motion = now; last_wheel_dir = dir; - + set_transport_speed (speed * dir); } diff --git a/libs/surfaces/tranzport/wheel_modes.cc b/libs/surfaces/tranzport/wheel_modes.cc index 565a68de20..6880218ff0 100644 --- a/libs/surfaces/tranzport/wheel_modes.cc +++ b/libs/surfaces/tranzport/wheel_modes.cc @@ -102,7 +102,7 @@ TranzportControlProtocol::show_wheel_mode () if(session->transport_speed() != 0) { show_mini_meter(); } else { - + switch (wheel_mode) { case WheelTimeline: text = "Time"; @@ -114,25 +114,25 @@ TranzportControlProtocol::show_wheel_mode () text = "Shtl"; break; } - + switch (wheel_shift_mode) { case WheelShiftGain: text += ":Gain"; break; - + case WheelShiftPan: text += ":Pan "; break; - + case WheelShiftMaster: text += ":Mstr"; break; - + case WheelShiftMarker: text += ":Mrkr"; break; } - + print (1, 0, text.c_str()); } } |