From 437840dced759ea6f252db14907744a86a6e2a13 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 31 Oct 2021 18:17:01 +0100 Subject: [PATCH] NO-OP: whitespace, clang-format --- libs/ardour/port_manager.cc | 458 ++++++++++++++++++------------------ 1 file changed, 225 insertions(+), 233 deletions(-) diff --git a/libs/ardour/port_manager.cc b/libs/ardour/port_manager.cc index 67dbc76213..260ac21080 100644 --- a/libs/ardour/port_manager.cc +++ b/libs/ardour/port_manager.cc @@ -22,8 +22,8 @@ #include #ifdef COMPILER_MSVC -#include // Microsoft's nearest equivalent to #include +#include // Microsoft's nearest equivalent to #else #include #endif @@ -59,13 +59,14 @@ using std::vector; PortManager::AudioInputPort::AudioInputPort (samplecnt_t sz) : scope (AudioPortScope (new CircularSampleBuffer (sz))) , meter (AudioPortMeter (new DPM)) -{} +{ +} PortManager::MIDIInputPort::MIDIInputPort (samplecnt_t sz) : monitor (MIDIPortMonitor (new CircularEventBuffer (sz))) , meter (MIDIPortMeter (new MPM)) -{} - +{ +} PortManager::PortID::PortID (boost::shared_ptr b, DataType dt, bool in, std::string const& pn) : backend (b->name ()) @@ -76,7 +77,7 @@ PortManager::PortID::PortID (boost::shared_ptr b, DataType dt, boo if (dt == DataType::MIDI) { /* Audio device name is not applicable for MIDI ports */ device_name = ""; - } else if (b->use_separate_input_and_output_devices()) { + } else if (b->use_separate_input_and_output_devices ()) { device_name = in ? b->input_device_name () : b->output_device_name (); } else { device_name = b->device_name (); @@ -98,7 +99,7 @@ PortManager::PortID::PortID (XMLNode const& node, bool old_midi_format) if (old_midi_format) { err |= !node.get_property ("name", port_name); - data_type = DataType::MIDI; + data_type = DataType::MIDI; device_name = ""; } else { err |= !node.get_property ("device-name", device_name); @@ -114,7 +115,7 @@ PortManager::PortID::PortID (XMLNode const& node, bool old_midi_format) XMLNode& PortManager::PortID::state () const { - XMLNode* node = new XMLNode("PortID"); + XMLNode* node = new XMLNode ("PortID"); node->set_property ("backend", backend); node->set_property ("device-name", device_name); node->set_property ("port-name", port_name); @@ -154,7 +155,7 @@ PortManager::clear_pending_port_deletions () { Port* p; - DEBUG_TRACE (DEBUG::Ports, string_compose ("pending port deletions: %1\n", _port_deletions_pending.read_space())); + DEBUG_TRACE (DEBUG::Ports, string_compose ("pending port deletions: %1\n", _port_deletions_pending.read_space ())); while (_port_deletions_pending.read (&p, 1) == 1) { delete p; @@ -174,7 +175,7 @@ PortManager::remove_all_ports () */ { - RCUWriter writer (_ports); + RCUWriter writer (_ports); boost::shared_ptr ps = writer.get_copy (); ps->clear (); } @@ -191,7 +192,6 @@ PortManager::remove_all_ports () _port_deletions_pending.reset (); } - string PortManager::make_port_name_relative (const string& portname) const { @@ -205,8 +205,8 @@ PortManager::make_port_name_relative (const string& portname) const return portname; } - if (portname.substr (0, colon) == _backend->my_name()) { - return portname.substr (colon+1); + if (portname.substr (0, colon) == _backend->my_name ()) { + return portname.substr (colon + 1); } return portname; @@ -221,7 +221,7 @@ PortManager::make_port_name_non_relative (const string& portname) const return portname; } - str = _backend->my_name(); + str = _backend->my_name (); str += ':'; str += portname; @@ -229,7 +229,7 @@ PortManager::make_port_name_non_relative (const string& portname) const } std::string -PortManager::get_pretty_name_by_name(const std::string& portname) const +PortManager::get_pretty_name_by_name (const std::string& portname) const { PortEngine::PortHandle ph = _backend->get_port_by_name (portname); @@ -241,7 +241,7 @@ PortManager::get_pretty_name_by_name(const std::string& portname) const } } - return string(); + return string (); } bool @@ -251,7 +251,7 @@ PortManager::port_is_mine (const string& portname) const return true; } - string self = _backend->my_name(); + string self = _backend->my_name (); if (portname.find_first_of (':') != string::npos) { if (portname.substr (0, self.length ()) != self) { @@ -287,8 +287,7 @@ PortManager::filter_midi_ports (vector& ports, MidiPortFlags include, Mi Glib::Threads::Mutex::Lock lm (_port_info_mutex); fill_midi_port_info_locked (); - for (vector::iterator si = ports.begin(); si != ports.end(); ) { - + for (vector::iterator si = ports.begin (); si != ports.end ();) { PortInfo::iterator x; for (x = _port_info.begin (); x != _port_info.end (); ++x) { if (x->first.data_type != DataType::MIDI) { @@ -302,7 +301,7 @@ PortManager::filter_midi_ports (vector& ports, MidiPortFlags include, Mi } } - if (x == _port_info.end()) { + if (x == _port_info.end ()) { ++si; continue; } @@ -376,7 +375,7 @@ boost::shared_ptr PortManager::get_port_by_name (const string& portname) { if (!_backend) { - return boost::shared_ptr(); + return boost::shared_ptr (); } if (!port_is_mine (portname)) { @@ -384,17 +383,17 @@ PortManager::get_port_by_name (const string& portname) return boost::shared_ptr (); } - boost::shared_ptr pr = _ports.reader(); - std::string rel = make_port_name_relative (portname); - Ports::iterator x = pr->find (rel); + boost::shared_ptr pr = _ports.reader (); + std::string rel = make_port_name_relative (portname); + Ports::iterator x = pr->find (rel); - if (x != pr->end()) { + if (x != pr->end ()) { /* its possible that the port was renamed by some 3rd party and * we don't know about it. check for this (the check is quick * and cheap), and if so, rename the port (which will alter * the port map as a side effect). */ - const std::string check = make_port_name_relative (_backend->get_port_name (x->second->port_handle())); + const std::string check = make_port_name_relative (_backend->get_port_name (x->second->port_handle ())); if (check != rel) { x->second->set_name (check); } @@ -407,11 +406,11 @@ PortManager::get_port_by_name (const string& portname) void PortManager::port_renamed (const std::string& old_relative_name, const std::string& new_relative_name) { - RCUWriter writer (_ports); - boost::shared_ptr p = writer.get_copy(); - Ports::iterator x = p->find (old_relative_name); + RCUWriter writer (_ports); + boost::shared_ptr p = writer.get_copy (); + Ports::iterator x = p->find (old_relative_name); - if (x != p->end()) { + if (x != p->end ()) { boost::shared_ptr port = x->second; p->erase (x); p->insert (make_pair (new_relative_name, port)); @@ -421,19 +420,19 @@ PortManager::port_renamed (const std::string& old_relative_name, const std::stri int PortManager::get_ports (DataType type, PortList& pl) { - boost::shared_ptr plist = _ports.reader(); - for (Ports::iterator p = plist->begin(); p != plist->end(); ++p) { - if (p->second->type() == type) { + boost::shared_ptr plist = _ports.reader (); + for (Ports::iterator p = plist->begin (); p != plist->end (); ++p) { + if (p->second->type () == type) { pl.push_back (p->second); } } - return pl.size(); + return pl.size (); } int PortManager::get_ports (const string& port_name_pattern, DataType type, PortFlags flags, vector& s) { - s.clear(); + s.clear (); if (!_backend) { return 0; @@ -449,13 +448,12 @@ PortManager::port_registration_failure (const std::string& portname) return; } - string full_portname = _backend->my_name(); + string full_portname = _backend->my_name (); full_portname += ':'; full_portname += portname; - PortEngine::PortHandle p = _backend->get_port_by_name (full_portname); - string reason; + string reason; if (p) { reason = string_compose (_("a port with the name \"%1\" already exists: check for duplicated track/bus names"), portname); @@ -463,13 +461,13 @@ PortManager::port_registration_failure (const std::string& portname) reason = string_compose (_("No more ports are available. You will need to stop %1 and restart with more ports if you need this many tracks."), PROGRAM_NAME); } - throw PortRegistrationFailure (string_compose (_("AudioEngine: cannot register port \"%1\": %2"), portname, reason).c_str()); + throw PortRegistrationFailure (string_compose (_("AudioEngine: cannot register port \"%1\": %2"), portname, reason).c_str ()); } -struct PortDeleter -{ - void operator() (Port* p) { - AudioEngine::instance()->add_pending_port_deletion (p); +struct PortDeleter { + void operator() (Port* p) + { + AudioEngine::instance ()->add_pending_port_deletion (p); } }; @@ -480,34 +478,34 @@ PortManager::register_port (DataType dtype, const string& portname, bool input, /* limit the possible flags that can be set */ - flags = PortFlags (flags & (Hidden|Shadow|IsTerminal|TransportSyncPort)); + flags = PortFlags (flags & (Hidden | Shadow | IsTerminal | TransportSyncPort)); try { if (dtype == DataType::AUDIO) { DEBUG_TRACE (DEBUG::Ports, string_compose ("registering AUDIO port %1, input %2\n", - portname, input)); + portname, input)); newport.reset (new AudioPort (portname, PortFlags ((input ? IsInput : IsOutput) | flags)), - PortDeleter()); + PortDeleter ()); } else if (dtype == DataType::MIDI) { if (async) { DEBUG_TRACE (DEBUG::Ports, string_compose ("registering ASYNC MIDI port %1, input %2\n", - portname, input)); + portname, input)); newport.reset (new AsyncMIDIPort (portname, PortFlags ((input ? IsInput : IsOutput) | flags)), - PortDeleter()); + PortDeleter ()); _midi_info_dirty = true; } else { DEBUG_TRACE (DEBUG::Ports, string_compose ("registering MIDI port %1, input %2\n", - portname, input)); + portname, input)); newport.reset (new MidiPort (portname, PortFlags ((input ? IsInput : IsOutput) | flags)), - PortDeleter()); + PortDeleter ()); } } else { throw PortRegistrationFailure (string_compose ("unable to create port '%1': %2", portname, _("(unknown type)"))); } - newport->set_buffer_size (AudioEngine::instance()->samples_per_cycle()); + newport->set_buffer_size (AudioEngine::instance ()->samples_per_cycle ()); - RCUWriter writer (_ports); + RCUWriter writer (_ports); boost::shared_ptr ps = writer.get_copy (); ps->insert (make_pair (make_port_name_relative (portname), newport)); @@ -517,12 +515,12 @@ PortManager::register_port (DataType dtype, const string& portname, bool input, catch (PortRegistrationFailure& err) { throw err; } catch (std::exception& e) { - throw PortRegistrationFailure (string_compose ("unable to create port '%1': %2", portname, e.what()).c_str()); + throw PortRegistrationFailure (string_compose ("unable to create port '%1': %2", portname, e.what ()).c_str ()); } catch (...) { throw PortRegistrationFailure (string_compose ("unable to create port '%1': %2", portname, _("(unknown error)"))); } - DEBUG_TRACE (DEBUG::Ports, string_compose ("\t%2 port registration success, ports now = %1\n", _ports.reader()->size(), this)); + DEBUG_TRACE (DEBUG::Ports, string_compose ("\t%2 port registration success, ports now = %1\n", _ports.reader ()->size (), this)); return newport; } @@ -550,12 +548,12 @@ PortManager::unregister_port (boost::shared_ptr port) /* caller must hold process lock */ { - RCUWriter writer (_ports); + RCUWriter writer (_ports); boost::shared_ptr ps = writer.get_copy (); - Ports::iterator x = ps->find (make_port_name_relative (port->name())); + Ports::iterator x = ps->find (make_port_name_relative (port->name ())); - if (x != ps->end()) { - DEBUG_TRACE (DEBUG::Ports, string_compose ("removing %1 from port map (uc=%2)\n", port->name(), port.use_count())); + if (x != ps->end ()) { + DEBUG_TRACE (DEBUG::Ports, string_compose ("removing %1 from port map (uc=%2)\n", port->name (), port.use_count ())); ps->erase (x); } @@ -645,8 +643,8 @@ PortManager::connect (const string& source, const string& destination) if (ret > 0) { /* already exists - no error, no warning */ } else if (ret < 0) { - error << string_compose(_("AudioEngine: cannot connect %1 (%2) to %3 (%4)"), - source, s, destination, d) + error << string_compose (_("AudioEngine: cannot connect %1 (%2) to %3 (%4)"), + source, s, destination, d) << endmsg; } @@ -687,7 +685,7 @@ PortManager::disconnect (boost::shared_ptr port) } int -PortManager::disconnect (std::string const & name) +PortManager::disconnect (std::string const& name) { PortEngine::PortHandle ph = _backend->get_port_by_name (name); if (ph) { @@ -700,26 +698,25 @@ int PortManager::reestablish_ports () { Ports::iterator i; - _midi_info_dirty = true; + _midi_info_dirty = true; boost::shared_ptr p = _ports.reader (); - DEBUG_TRACE (DEBUG::Ports, string_compose ("reestablish %1 ports\n", p->size())); + DEBUG_TRACE (DEBUG::Ports, string_compose ("reestablish %1 ports\n", p->size ())); - for (i = p->begin(); i != p->end(); ++i) { + for (i = p->begin (); i != p->end (); ++i) { if (i->second->reestablish ()) { - error << string_compose (_("Re-establising port %1 failed"), i->second->name()) << endmsg; - std::cerr << string_compose (_("Re-establising port %1 failed"), i->second->name()) << std::endl; + error << string_compose (_("Re-establising port %1 failed"), i->second->name ()) << endmsg; + std::cerr << string_compose (_("Re-establising port %1 failed"), i->second->name ()) << std::endl; break; } } - if (i != p->end()) { + if (i != p->end ()) { /* failed */ remove_all_ports (); return -1; } - if (!_backend->info().already_configured ()) { - + if (!_backend->info ().already_configured ()) { std::vector port_names; get_physical_inputs (DataType::AUDIO, port_names); set_pretty_names (port_names, DataType::AUDIO, true); @@ -737,10 +734,9 @@ PortManager::reestablish_ports () set_pretty_names (port_names, DataType::MIDI, false); } - - if (Config->get_work_around_jack_no_copy_optimization () && AudioEngine::instance()->current_backend_name() == X_("JACK")) { - port_engine().register_port (X_("physical_audio_input_monitor_enable"), DataType::AUDIO, ARDOUR::PortFlags (IsInput|IsTerminal|Hidden)); - port_engine().register_port (X_("physical_midi_input_monitor_enable"), DataType::MIDI, ARDOUR::PortFlags (IsInput|IsTerminal|Hidden)); + if (Config->get_work_around_jack_no_copy_optimization () && AudioEngine::instance ()->current_backend_name () == X_("JACK")) { + port_engine ().register_port (X_("physical_audio_input_monitor_enable"), DataType::AUDIO, ARDOUR::PortFlags (IsInput | IsTerminal | Hidden)); + port_engine ().register_port (X_("physical_midi_input_monitor_enable"), DataType::MIDI, ARDOUR::PortFlags (IsInput | IsTerminal | Hidden)); } update_input_ports (true); @@ -751,7 +747,7 @@ void PortManager::set_pretty_names (std::vector const& port_names, DataType dt, bool input) { Glib::Threads::Mutex::Lock lm (_port_info_mutex); - for (std::vector::const_iterator p = port_names.begin(); p != port_names.end(); ++p) { + for (std::vector::const_iterator p = port_names.begin (); p != port_names.end (); ++p) { if (port_is_mine (*p)) { continue; } @@ -759,12 +755,12 @@ PortManager::set_pretty_names (std::vector const& port_names, DataT if (!ph) { continue; } - PortID pid (_backend, dt, input, *p); + PortID pid (_backend, dt, input, *p); PortInfo::iterator x = _port_info.find (pid); - if (x == _port_info.end()) { + if (x == _port_info.end ()) { continue; } - _backend->set_port_property (ph, "http://jackaudio.org/metadata/pretty-name", x->second.pretty_name, string()); + _backend->set_port_property (ph, "http://jackaudio.org/metadata/pretty-name", x->second.pretty_name, string ()); } } @@ -775,26 +771,26 @@ PortManager::reconnect_ports () /* re-establish connections */ - DEBUG_TRACE (DEBUG::Ports, string_compose ("reconnect %1 ports\n", p->size())); + DEBUG_TRACE (DEBUG::Ports, string_compose ("reconnect %1 ports\n", p->size ())); - for (Ports::iterator i = p->begin(); i != p->end(); ++i) { + for (Ports::iterator i = p->begin (); i != p->end (); ++i) { if (i->second->reconnect ()) { - PortConnectedOrDisconnected (i->second, i->first, boost::weak_ptr(), "", false); + PortConnectedOrDisconnected (i->second, i->first, boost::weak_ptr (), "", false); } } - if (Config->get_work_around_jack_no_copy_optimization () && AudioEngine::instance()->current_backend_name() == X_("JACK")) { - std::string const audio_port = AudioEngine::instance()->make_port_name_non_relative (X_("physical_audio_input_monitor_enable")); - std::string const midi_port = AudioEngine::instance()->make_port_name_non_relative (X_("physical_midi_input_monitor_enable")); + if (Config->get_work_around_jack_no_copy_optimization () && AudioEngine::instance ()->current_backend_name () == X_("JACK")) { + std::string const audio_port = AudioEngine::instance ()->make_port_name_non_relative (X_("physical_audio_input_monitor_enable")); + std::string const midi_port = AudioEngine::instance ()->make_port_name_non_relative (X_("physical_midi_input_monitor_enable")); std::vector audio_ports; std::vector midi_ports; get_physical_inputs (DataType::AUDIO, audio_ports); get_physical_inputs (DataType::MIDI, midi_ports); - for (std::vector::iterator p = audio_ports.begin(); p != audio_ports.end(); ++p) { - port_engine().connect (*p, audio_port); + for (std::vector::iterator p = audio_ports.begin (); p != audio_ports.end (); ++p) { + port_engine ().connect (*p, audio_port); } - for (std::vector::iterator p = midi_ports.begin(); p != midi_ports.end(); ++p) { - port_engine().connect (*p, midi_port); + for (std::vector::iterator p = midi_ports.begin (); p != midi_ports.end (); ++p) { + port_engine ().connect (*p, midi_port); } } @@ -806,18 +802,18 @@ PortManager::connect_callback (const string& a, const string& b, bool conn) { DEBUG_TRACE (DEBUG::BackendCallbacks, string_compose (X_("connect callback %1 + %2 connected ? %3\n"), a, b, conn)); - boost::shared_ptr port_a; - boost::shared_ptr port_b; - Ports::iterator x; + boost::shared_ptr port_a; + boost::shared_ptr port_b; + Ports::iterator x; boost::shared_ptr pr = _ports.reader (); x = pr->find (make_port_name_relative (a)); - if (x != pr->end()) { + if (x != pr->end ()) { port_a = x->second; } x = pr->find (make_port_name_relative (b)); - if (x != pr->end()) { + if (x != pr->end ()) { port_b = x->second; } @@ -836,10 +832,9 @@ PortManager::connect_callback (const string& a, const string& b, bool conn) } PortConnectedOrDisconnected ( - port_a, a, - port_b, b, - conn - ); /* EMIT SIGNAL */ + port_a, a, + port_b, b, + conn); /* EMIT SIGNAL */ } void @@ -859,18 +854,19 @@ PortManager::registration_callback () struct MIDIConnectCall { MIDIConnectCall (std::vector const& pl) : port_list (pl) - {} + { + } std::vector port_list; }; static void* -_midi_connect (void *arg) +_midi_connect (void* arg) { - MIDIConnectCall* mcl = static_cast (arg); - std::string const our_name = AudioEngine::instance()->make_port_name_non_relative (X_("physical_midi_input_monitor_enable")); + MIDIConnectCall* mcl = static_cast (arg); + std::string const our_name = AudioEngine::instance ()->make_port_name_non_relative (X_("physical_midi_input_monitor_enable")); for (vector::const_iterator p = mcl->port_list.begin (); p != mcl->port_list.end (); ++p) { - AudioEngine::instance()->connect (*p, our_name); + AudioEngine::instance ()->connect (*p, our_name); } delete mcl; return 0; @@ -897,7 +893,7 @@ PortManager::update_input_ports (bool clear) } else { boost::shared_ptr aip = _audio_input_ports.reader (); /* find new audio ports */ - for (std::vector::iterator p = audio_ports.begin(); p != audio_ports.end(); ++p) { + for (std::vector::iterator p = audio_ports.begin (); p != audio_ports.end (); ++p) { if (port_is_mine (*p) || !_backend->get_port_by_name (*p)) { continue; } @@ -907,7 +903,7 @@ PortManager::update_input_ports (bool clear) } /* find stale audio ports */ - for (AudioInputPorts::iterator p = aip->begin(); p != aip->end(); ++p) { + for (AudioInputPorts::iterator p = aip->begin (); p != aip->end (); ++p) { if (std::find (audio_ports.begin (), audio_ports.end (), p->first) == audio_ports.end ()) { old_audio.push_back (p->first); } @@ -915,7 +911,7 @@ PortManager::update_input_ports (bool clear) boost::shared_ptr mip = _midi_input_ports.reader (); /* find new MIDI ports */ - for (std::vector::iterator p = midi_ports.begin(); p != midi_ports.end(); ++p) { + for (std::vector::iterator p = midi_ports.begin (); p != midi_ports.end (); ++p) { if (port_is_mine (*p) || !_backend->get_port_by_name (*p)) { continue; } @@ -930,7 +926,7 @@ PortManager::update_input_ports (bool clear) } /* find stale audio ports */ - for (MIDIInputPorts::iterator p = mip->begin(); p != mip->end(); ++p) { + for (MIDIInputPorts::iterator p = mip->begin (); p != mip->end (); ++p) { if (std::find (midi_ports.begin (), midi_ports.end (), p->first) == midi_ports.end ()) { old_midi.push_back (p->first); } @@ -938,17 +934,17 @@ PortManager::update_input_ports (bool clear) } if (!new_audio.empty () || !old_audio.empty () || clear) { - RCUWriter apwr (_audio_input_ports); + RCUWriter apwr (_audio_input_ports); boost::shared_ptr apw = apwr.get_copy (); if (clear) { apw->clear (); } else { - for (std::vector::const_iterator p = old_audio.begin(); p != old_audio.end(); ++p) { + for (std::vector::const_iterator p = old_audio.begin (); p != old_audio.end (); ++p) { apw->erase (*p); _monitor_port.remove_port (*p, true); } } - for (std::vector::const_iterator p = new_audio.begin(); p != new_audio.end(); ++p) { + for (std::vector::const_iterator p = new_audio.begin (); p != new_audio.end (); ++p) { if (port_is_mine (*p) || !_backend->get_port_by_name (*p)) { continue; } @@ -959,16 +955,16 @@ PortManager::update_input_ports (bool clear) std::vector physical_midi_connection_list; if (!new_midi.empty () || !old_midi.empty () || clear) { - RCUWriter mpwr (_midi_input_ports); + RCUWriter mpwr (_midi_input_ports); boost::shared_ptr mpw = mpwr.get_copy (); if (clear) { mpw->clear (); } else { - for (std::vector::const_iterator p = old_midi.begin(); p != old_midi.end(); ++p) { + for (std::vector::const_iterator p = old_midi.begin (); p != old_midi.end (); ++p) { mpw->erase (*p); } } - for (std::vector::const_iterator p = new_midi.begin(); p != new_midi.end(); ++p) { + for (std::vector::const_iterator p = new_midi.begin (); p != new_midi.end (); ++p) { if (port_is_mine (*p) || !_backend->get_port_by_name (*p)) { continue; } @@ -979,7 +975,7 @@ PortManager::update_input_ports (bool clear) #endif mpw->insert (make_pair (*p, MIDIInputPort (32))); - if (Config->get_work_around_jack_no_copy_optimization () && AudioEngine::instance()->current_backend_name() == X_("JACK")) { + if (Config->get_work_around_jack_no_copy_optimization () && AudioEngine::instance ()->current_backend_name () == X_("JACK")) { physical_midi_connection_list.push_back (*p); } } @@ -999,7 +995,7 @@ PortManager::update_input_ports (bool clear) /* handle hotplug, connect in bg thread, because * "JACK: Cannot callback the server in notification thread!" */ - pthread_t thread; + pthread_t thread; MIDIConnectCall* mcl = new MIDIConnectCall (physical_midi_connection_list); pthread_create_and_store ("midi-connect", &thread, _midi_connect, mcl); pthread_detach (thread); @@ -1058,7 +1054,7 @@ PortManager::ensure_input_monitoring (const string& name, bool yn) const } uint32_t -PortManager::port_name_size() const +PortManager::port_name_size () const { if (!_backend) { return 0; @@ -1068,13 +1064,13 @@ PortManager::port_name_size() const } string -PortManager::my_name() const +PortManager::my_name () const { if (!_backend) { - return string(); + return string (); } - return _backend->my_name(); + return _backend->my_name (); } int @@ -1083,7 +1079,7 @@ PortManager::graph_order_callback () DEBUG_TRACE (DEBUG::BackendCallbacks, "graph order callback\n"); if (!_port_remove_in_progress) { - GraphReordered(); /* EMIT SIGNAL */ + GraphReordered (); /* EMIT SIGNAL */ } return 0; @@ -1118,16 +1114,16 @@ PortManager::cycle_start (pframes_t nframes, Session* s) */ if (s && s->rt_tasklist () && fabs (Port::speed_ratio ()) != 1.0) { RTTaskList::TaskList tl; - for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) { - if (!(p->second->flags() & TransportSyncPort)) { + for (Ports::iterator p = _cycle_ports->begin (); p != _cycle_ports->end (); ++p) { + if (!(p->second->flags () & TransportSyncPort)) { tl.push_back (boost::bind (&Port::cycle_start, p->second, nframes)); } } tl.push_back (boost::bind (&PortManager::run_input_meters, this, nframes, s ? s->nominal_sample_rate () : 0)); - s->rt_tasklist()->process (tl); + s->rt_tasklist ()->process (tl); } else { - for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) { - if (!(p->second->flags() & TransportSyncPort)) { + for (Ports::iterator p = _cycle_ports->begin (); p != _cycle_ports->end (); ++p) { + if (!(p->second->flags () & TransportSyncPort)) { p->second->cycle_start (nframes); } } @@ -1141,24 +1137,24 @@ PortManager::cycle_end (pframes_t nframes, Session* s) // see optimzation note in ::cycle_start() if (0 && s && s->rt_tasklist () && fabs (Port::speed_ratio ()) != 1.0) { RTTaskList::TaskList tl; - for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) { - if (!(p->second->flags() & TransportSyncPort)) { + for (Ports::iterator p = _cycle_ports->begin (); p != _cycle_ports->end (); ++p) { + if (!(p->second->flags () & TransportSyncPort)) { tl.push_back (boost::bind (&Port::cycle_end, p->second, nframes)); } } - s->rt_tasklist()->process (tl); + s->rt_tasklist ()->process (tl); } else { - for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) { - if (!(p->second->flags() & TransportSyncPort)) { + for (Ports::iterator p = _cycle_ports->begin (); p != _cycle_ports->end (); ++p) { + if (!(p->second->flags () & TransportSyncPort)) { p->second->cycle_end (nframes); } } } - for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) { + for (Ports::iterator p = _cycle_ports->begin (); p != _cycle_ports->end (); ++p) { /* AudioEngine::split_cycle flushes buffers until Port::port_offset. * Now only flush remaining events (after Port::port_offset) */ - p->second->flush_buffers (nframes * Port::speed_ratio() - Port::port_offset ()); + p->second->flush_buffers (nframes * Port::speed_ratio () - Port::port_offset ()); } _cycle_ports.reset (); @@ -1167,9 +1163,9 @@ PortManager::cycle_end (pframes_t nframes, Session* s) } void -PortManager::silence (pframes_t nframes, Session *s) +PortManager::silence (pframes_t nframes, Session* s) { - for (Ports::iterator i = _cycle_ports->begin(); i != _cycle_ports->end(); ++i) { + for (Ports::iterator i = _cycle_ports->begin (); i != _cycle_ports->end (); ++i) { if (s && i->second == s->mtc_output_port ()) { continue; } @@ -1179,11 +1175,11 @@ PortManager::silence (pframes_t nframes, Session *s) if (s && i->second == s->ltc_output_port ()) { continue; } - if (boost::dynamic_pointer_cast(i->second)) { + if (boost::dynamic_pointer_cast (i->second)) { continue; } - if (i->second->sends_output()) { - i->second->get_buffer(nframes).silence(nframes); + if (i->second->sends_output ()) { + i->second->get_buffer (nframes).silence (nframes); } } } @@ -1192,33 +1188,33 @@ void PortManager::silence_outputs (pframes_t nframes) { std::vector port_names; - if (get_ports("", DataType::AUDIO, IsOutput, port_names)) { - for (std::vector::iterator p = port_names.begin(); p != port_names.end(); ++p) { - if (!port_is_mine(*p)) { + if (get_ports ("", DataType::AUDIO, IsOutput, port_names)) { + for (std::vector::iterator p = port_names.begin (); p != port_names.end (); ++p) { + if (!port_is_mine (*p)) { continue; } PortEngine::PortHandle ph = _backend->get_port_by_name (*p); if (!ph) { continue; } - void *buf = _backend->get_buffer(ph, nframes); + void* buf = _backend->get_buffer (ph, nframes); if (!buf) { continue; } - memset (buf, 0, sizeof(float) * nframes); + memset (buf, 0, sizeof (float) * nframes); } } - if (get_ports("", DataType::MIDI, IsOutput, port_names)) { - for (std::vector::iterator p = port_names.begin(); p != port_names.end(); ++p) { - if (!port_is_mine(*p)) { + if (get_ports ("", DataType::MIDI, IsOutput, port_names)) { + for (std::vector::iterator p = port_names.begin (); p != port_names.end (); ++p) { + if (!port_is_mine (*p)) { continue; } PortEngine::PortHandle ph = _backend->get_port_by_name (*p); if (!ph) { continue; } - void *buf = _backend->get_buffer(ph, nframes); + void* buf = _backend->get_buffer (ph, nframes); if (!buf) { continue; } @@ -1230,11 +1226,10 @@ PortManager::silence_outputs (pframes_t nframes) void PortManager::check_monitoring () { - for (Ports::iterator i = _cycle_ports->begin(); i != _cycle_ports->end(); ++i) { - + for (Ports::iterator i = _cycle_ports->begin (); i != _cycle_ports->end (); ++i) { bool x; - if (i->second->last_monitor() != (x = i->second->monitoring_input ())) { + if (i->second->last_monitor () != (x = i->second->monitoring_input ())) { i->second->set_last_monitor (x); /* XXX I think this is dangerous, due to a likely mutex in the signal handlers ... @@ -1250,29 +1245,28 @@ PortManager::cycle_end_fade_out (gain_t base_gain, gain_t gain_step, pframes_t n // see optimzation note in ::cycle_start() if (0 && s && s->rt_tasklist () && fabs (Port::speed_ratio ()) != 1.0) { RTTaskList::TaskList tl; - for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) { - if (!(p->second->flags() & TransportSyncPort)) { + for (Ports::iterator p = _cycle_ports->begin (); p != _cycle_ports->end (); ++p) { + if (!(p->second->flags () & TransportSyncPort)) { tl.push_back (boost::bind (&Port::cycle_end, p->second, nframes)); } } - s->rt_tasklist()->process (tl); + s->rt_tasklist ()->process (tl); } else { - for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) { - if (!(p->second->flags() & TransportSyncPort)) { + for (Ports::iterator p = _cycle_ports->begin (); p != _cycle_ports->end (); ++p) { + if (!(p->second->flags () & TransportSyncPort)) { p->second->cycle_end (nframes); } } } - for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) { + for (Ports::iterator p = _cycle_ports->begin (); p != _cycle_ports->end (); ++p) { p->second->flush_buffers (nframes); - if (p->second->sends_output()) { - + if (p->second->sends_output ()) { boost::shared_ptr ap = boost::dynamic_pointer_cast (p->second); if (ap) { Sample* s = ap->engine_get_whole_audio_buffer (); - gain_t g = base_gain; + gain_t g = base_gain; for (pframes_t n = 0; n < nframes; ++n) { *s++ *= g; @@ -1286,7 +1280,7 @@ PortManager::cycle_end_fade_out (gain_t base_gain, gain_t gain_step, pframes_t n } PortEngine& -PortManager::port_engine() +PortManager::port_engine () { assert (_backend); return *_backend; @@ -1296,16 +1290,15 @@ bool PortManager::port_is_control_only (std::string const& name) { static regex_t compiled_pattern; - static string pattern; - - if (pattern.empty()) { + static string pattern; + if (pattern.empty ()) { /* This is a list of regular expressions that match ports * related to physical MIDI devices that we do not want to * expose as normal physical ports. */ - const char * const control_only_ports[] = { + const char* const control_only_ports[] = { X_(".*Ableton Push.*"), X_(".*FaderPort .*"), X_(".*FaderPort8 .*"), @@ -1317,7 +1310,7 @@ PortManager::port_is_control_only (std::string const& name) }; pattern = "("; - for (size_t n = 0; n < sizeof (control_only_ports)/sizeof (control_only_ports[0]); ++n) { + for (size_t n = 0; n < sizeof (control_only_ports) / sizeof (control_only_ports[0]); ++n) { if (n > 0) { pattern += '|'; } @@ -1325,16 +1318,17 @@ PortManager::port_is_control_only (std::string const& name) } pattern += ')'; - regcomp (&compiled_pattern, pattern.c_str(), REG_EXTENDED|REG_NOSUB); + regcomp (&compiled_pattern, pattern.c_str (), REG_EXTENDED | REG_NOSUB); } - return regexec (&compiled_pattern, name.c_str(), 0, 0, 0) == 0; + return regexec (&compiled_pattern, name.c_str (), 0, 0, 0) == 0; } -static bool ends_with (std::string const& str, std::string const& end) +static bool +ends_with (std::string const& str, std::string const& end) { const size_t str_size = str.size (); - const size_t end_size = end.size(); + const size_t end_size = end.size (); if (str_size < end_size) { return false; } @@ -1350,7 +1344,7 @@ PortManager::port_is_virtual_piano (std::string const& name) bool PortManager::port_is_physical_input_monitor_enable (std::string const& name) { - if (Config->get_work_around_jack_no_copy_optimization () && AudioEngine::instance()->current_backend_name() == X_("JACK")) { + if (Config->get_work_around_jack_no_copy_optimization () && AudioEngine::instance ()->current_backend_name () == X_("JACK")) { if (ends_with (name, X_(":physical_midi_input_monitor_enable"))) { return true; } @@ -1367,15 +1361,15 @@ PortManager::midi_port_metadata (std::string const& name) Glib::Threads::Mutex::Lock lm (_port_info_mutex); fill_midi_port_info_locked (); - PortID pid (_backend, DataType::MIDI, true, name); + PortID pid (_backend, DataType::MIDI, true, name); PortInfo::iterator x = _port_info.find (pid); - if (x != _port_info.end()) { + if (x != _port_info.end ()) { return x->second.properties; } pid.input = false; - x = _port_info.find (pid); - if (x != _port_info.end()) { + x = _port_info.find (pid); + if (x != _port_info.end ()) { return x->second.properties; } @@ -1394,11 +1388,11 @@ PortManager::get_configurable_midi_ports (vector& copy, bool for_input) fill_midi_port_info_locked (); } - PortFlags flags = PortFlags ((for_input ? IsOutput : IsInput) | IsPhysical); + PortFlags flags = PortFlags ((for_input ? IsOutput : IsInput) | IsPhysical); std::vector ports; - AudioEngine::instance()->get_ports (string(), DataType::MIDI, flags, ports); - for (vector::iterator p = ports.begin(); p != ports.end(); ++p) { + AudioEngine::instance ()->get_ports (string (), DataType::MIDI, flags, ports); + for (vector::iterator p = ports.begin (); p != ports.end (); ++p) { if (port_is_mine (*p) && !port_is_virtual_piano (*p)) { continue; } @@ -1436,11 +1430,11 @@ PortManager::set_port_pretty_name (string const& port, string const& pretty) /* port-manager only handles physical I/O names */ assert (_backend->get_port_flags (ph) & IsPhysical); - _backend->set_port_property (ph, "http://jackaudio.org/metadata/pretty-name", pretty, string()); + _backend->set_port_property (ph, "http://jackaudio.org/metadata/pretty-name", pretty, string ()); { /* backend IsOutput ports = capture = input ports for libardour */ - PortID pid (_backend, _backend->port_data_type (ph), _backend->get_port_flags (ph) & IsOutput, port); + PortID pid (_backend, _backend->port_data_type (ph), _backend->get_port_flags (ph) & IsOutput, port); Glib::Threads::Mutex::Lock lm (_port_info_mutex); fill_midi_port_info_locked (); @@ -1449,14 +1443,14 @@ PortManager::set_port_pretty_name (string const& port, string const& pretty) } else { /* remove empty */ PortInfo::iterator x = _port_info.find (pid); - if (x != _port_info.end() && x->second.properties == MidiPortFlags (0)) { + if (x != _port_info.end () && x->second.properties == MidiPortFlags (0)) { _port_info.erase (x); } } } save_port_info (); - MidiPortInfoChanged (); /* EMIT SIGNAL*/ + MidiPortInfoChanged (); /* EMIT SIGNAL*/ PortPrettyNameChanged (port); /* EMIT SIGNAL */ } @@ -1472,14 +1466,14 @@ PortManager::add_midi_port_flags (string const& port, MidiPortFlags flags) bool emit = false; { - PortID pid (_backend, _backend->port_data_type (ph), _backend->get_port_flags (ph) & IsOutput, port); + PortID pid (_backend, _backend->port_data_type (ph), _backend->get_port_flags (ph) & IsOutput, port); Glib::Threads::Mutex::Lock lm (_port_info_mutex); fill_midi_port_info_locked (); /* Add MIDI port if present */ if (_port_info[pid].properties != flags) { - _port_info[pid].properties = MidiPortFlags (_port_info[pid].properties | flags); - emit = true; + _port_info[pid].properties = MidiPortFlags (_port_info[pid].properties | flags); + emit = true; } } @@ -1508,15 +1502,15 @@ PortManager::remove_midi_port_flags (string const& port, MidiPortFlags flags) bool emit = false; { - PortID pid (_backend, _backend->port_data_type (ph), _backend->get_port_flags (ph) & IsOutput, port); + PortID pid (_backend, _backend->port_data_type (ph), _backend->get_port_flags (ph) & IsOutput, port); Glib::Threads::Mutex::Lock lm (_port_info_mutex); fill_midi_port_info_locked (); PortInfo::iterator x = _port_info.find (pid); - if (x != _port_info.end()) { + if (x != _port_info.end ()) { if (x->second.properties & flags) { // at least one is set x->second.properties = MidiPortFlags (x->second.properties & ~flags); - emit = true; + emit = true; } /* remove empty */ if (x->second.properties == MidiPortFlags (0) && x->second.pretty_name.empty ()) { @@ -1541,14 +1535,14 @@ PortManager::remove_midi_port_flags (string const& port, MidiPortFlags flags) string PortManager::port_info_file () { - return Glib::build_filename (user_config_directory(), X_("port_metadata")); + return Glib::build_filename (user_config_directory (), X_("port_metadata")); } #if CURRENT_SESSION_FILE_VERSION < 6999 string PortManager::midi_port_info_file () { - return Glib::build_filename (user_config_directory(), X_("midi_port_info")); + return Glib::build_filename (user_config_directory (), X_("midi_port_info")); } #endif @@ -1594,7 +1588,7 @@ PortManager::load_port_info () if (!tree.read (a6path)) { warning << string_compose (_("Cannot load/convert MIDI port info from '%1'."), a6path) << endmsg; } else { - for (XMLNodeConstIterator i = tree.root()->children().begin(); i != tree.root()->children().end(); ++i) { + for (XMLNodeConstIterator i = tree.root ()->children ().begin (); i != tree.root ()->children ().end (); ++i) { string name; string backend; bool input; @@ -1605,7 +1599,7 @@ PortManager::load_port_info () continue; } try { - PortID id (**i, true); + PortID id (**i, true); PortMetaData meta (**i); _port_info[id] = meta; } catch (...) { @@ -1617,7 +1611,7 @@ PortManager::load_port_info () #endif XMLTree tree; - string path = port_info_file (); + string path = port_info_file (); if (!Glib::file_test (path, Glib::FILE_TEST_EXISTS)) { return; } @@ -1626,9 +1620,9 @@ PortManager::load_port_info () return; } - for (XMLNodeConstIterator i = tree.root()->children().begin(); i != tree.root()->children().end(); ++i) { + for (XMLNodeConstIterator i = tree.root ()->children ().begin (); i != tree.root ()->children ().end (); ++i) { try { - PortID id (**i); + PortID id (**i); PortMetaData meta (**i); _port_info[id] = meta; } catch (...) { @@ -1638,13 +1632,13 @@ PortManager::load_port_info () } string -PortManager::short_port_name_from_port_name (std::string const & full_name) const +PortManager::short_port_name_from_port_name (std::string const& full_name) const { string::size_type colon = full_name.find_first_of (':'); - if (colon == string::npos || colon == full_name.length()) { + if (colon == string::npos || colon == full_name.length ()) { return full_name; } - return full_name.substr (colon+1); + return full_name.substr (colon + 1); } void @@ -1657,16 +1651,15 @@ PortManager::fill_midi_port_info_locked () } std::vector ports; - AudioEngine::instance()->get_ports (string(), DataType::MIDI, IsOutput, ports); - for (vector::iterator p = ports.begin(); p != ports.end(); ++p) { - + AudioEngine::instance ()->get_ports (string (), DataType::MIDI, IsOutput, ports); + for (vector::iterator p = ports.begin (); p != ports.end (); ++p) { if (port_is_mine (*p) && !port_is_virtual_piano (*p)) { continue; } - PortID pid (_backend, DataType::MIDI, true, *p); + PortID pid (_backend, DataType::MIDI, true, *p); PortInfo::iterator x = _port_info.find (pid); - if (x != _port_info.end()) { + if (x != _port_info.end ()) { continue; } @@ -1675,7 +1668,7 @@ PortManager::fill_midi_port_info_locked () if (port_is_control_only (*p)) { flags = MidiPortControl; } else if (port_is_virtual_piano (*p)) { - flags = MidiPortFlags(MidiPortSelection | MidiPortMusic); + flags = MidiPortFlags (MidiPortSelection | MidiPortMusic); } #ifdef HAVE_ALSA @@ -1689,16 +1682,15 @@ PortManager::fill_midi_port_info_locked () } } - AudioEngine::instance()->get_ports (string(), DataType::MIDI, IsInput, ports); - for (vector::iterator p = ports.begin(); p != ports.end(); ++p) { - + AudioEngine::instance ()->get_ports (string (), DataType::MIDI, IsInput, ports); + for (vector::iterator p = ports.begin (); p != ports.end (); ++p) { if (port_is_mine (*p)) { continue; } - PortID pid (_backend, DataType::MIDI, false, *p); + PortID pid (_backend, DataType::MIDI, false, *p); PortInfo::iterator x = _port_info.find (pid); - if (x != _port_info.end()) { + if (x != _port_info.end ()) { continue; } @@ -1725,9 +1717,9 @@ PortManager::fill_midi_port_info_locked () void PortManager::set_port_buffer_sizes (pframes_t n) { - boost::shared_ptr all = _ports.reader(); + boost::shared_ptr all = _ports.reader (); - for (Ports::iterator p = all->begin(); p != all->end(); ++p) { + for (Ports::iterator p = all->begin (); p != all->end (); ++p) { p->second->set_buffer_size (n); } _monitor_port.set_buffer_size (n); @@ -1736,26 +1728,26 @@ PortManager::set_port_buffer_sizes (pframes_t n) bool PortManager::check_for_ambiguous_latency (bool log) const { - bool rv = false; - boost::shared_ptr plist = _ports.reader(); - for (Ports::iterator pi = plist->begin(); pi != plist->end(); ++pi) { + bool rv = false; + boost::shared_ptr plist = _ports.reader (); + for (Ports::iterator pi = plist->begin (); pi != plist->end (); ++pi) { boost::shared_ptr const& p (pi->second); /* check one to many connections */ if (!p->sends_output () || (p->flags () & IsTerminal) || !p->connected ()) { continue; } - if (boost::dynamic_pointer_cast(p)) { + if (boost::dynamic_pointer_cast (p)) { continue; } assert (port_is_mine (p->name ())); LatencyRange range; - range.min = ~((pframes_t) 0); + range.min = ~((pframes_t)0); range.max = 0; p->collect_latency_from_backend (range, true); if (range.min != range.max) { if (log) { - warning << string_compose(_("Ambiguous latency for port '%1' (%2, %3)"), p->name(), range.min, range.max) << endmsg; + warning << string_compose (_("Ambiguous latency for port '%1' (%2, %3)"), p->name (), range.min, range.max) << endmsg; rv = true; } else { return true; @@ -1790,14 +1782,14 @@ PortManager::midi_input_ports () const * @rate engine sample-rate * @return coefficiant taking user preferences meter_falloff (dB/sec) into account */ -struct FallOffCache -{ +struct FallOffCache { FallOffCache () : _falloff (1.0) , _cfg_db_s (0) , _n_samples (0) , _rate (0) - {} + { + } float calc (pframes_t n_samples, samplecnt_t rate) { @@ -1819,11 +1811,11 @@ struct FallOffCache return _falloff; } - private: - float _falloff; - float _cfg_db_s; - pframes_t _n_samples; - samplecnt_t _rate; +private: + float _falloff; + float _cfg_db_s; + pframes_t _n_samples; + samplecnt_t _rate; }; static FallOffCache falloff_cache; @@ -1835,7 +1827,7 @@ PortManager::run_input_meters (pframes_t n_samples, samplecnt_t rate) return; } - const bool reset = g_atomic_int_compare_and_exchange (&_reset_meters, 1, 0); + const bool reset = g_atomic_int_compare_and_exchange (&_reset_meters, 1, 0); const float falloff = falloff_cache.calc (n_samples, rate); _monitor_port.monitor (port_engine (), n_samples); @@ -1843,7 +1835,7 @@ PortManager::run_input_meters (pframes_t n_samples, samplecnt_t rate) /* calculate peak of all physical inputs (readable ports) */ boost::shared_ptr aip = _audio_input_ports.reader (); - for (AudioInputPorts::iterator p = aip->begin(); p != aip->end(); ++p) { + for (AudioInputPorts::iterator p = aip->begin (); p != aip->end (); ++p) { assert (!port_is_mine (p->first)); AudioInputPort& ai (p->second); @@ -1856,7 +1848,7 @@ PortManager::run_input_meters (pframes_t n_samples, samplecnt_t rate) continue; } - Sample* buf = (Sample*) _backend->get_buffer (ph, n_samples); + Sample* buf = (Sample*)_backend->get_buffer (ph, n_samples); if (!buf) { /* can this happen? */ ai.meter->level = 0; @@ -1873,15 +1865,15 @@ PortManager::run_input_meters (pframes_t n_samples, samplecnt_t rate) ai.meter->level = 0; } - float level = ai.meter->level; - level = compute_peak (buf, n_samples, reset ? 0 : level); + float level = ai.meter->level; + level = compute_peak (buf, n_samples, reset ? 0 : level); ai.meter->level = std::min (level, 100.f); // cut off at +40dBFS for falloff. ai.meter->peak = std::max (ai.meter->peak, level); } /* MIDI */ boost::shared_ptr mip = _midi_input_ports.reader (); - for (MIDIInputPorts::iterator p = mip->begin(); p != mip->end(); ++p) { + for (MIDIInputPorts::iterator p = mip->begin (); p != mip->end (); ++p) { assert (!port_is_mine (p->first)); PortEngine::PortHandle ph = _backend->get_port_by_name (p->first); @@ -1900,12 +1892,12 @@ PortManager::run_input_meters (pframes_t n_samples, samplecnt_t rate) } } - void* buffer = _backend->get_buffer (ph, n_samples); + void* buffer = _backend->get_buffer (ph, n_samples); const pframes_t event_count = _backend->get_midi_event_count (buffer); for (pframes_t i = 0; i < event_count; ++i) { - pframes_t timestamp; - size_t size; + pframes_t timestamp; + size_t size; uint8_t const* buf; _backend->midi_event_get (timestamp, size, &buf, buffer, i); if (buf[0] == 0xfe) { @@ -1915,7 +1907,7 @@ PortManager::run_input_meters (pframes_t n_samples, samplecnt_t rate) if ((buf[0] & 0xf0) == 0xf0) { mi.meter->chn_active[16] = 1.0; } else { - int chn = (buf[0] & 0x0f); + int chn = (buf[0] & 0x0f); mi.meter->chn_active[chn] = 1.0; } mi.monitor->write (buf, size); @@ -1927,8 +1919,8 @@ PortManager::run_input_meters (pframes_t n_samples, samplecnt_t rate) void PortManager::list_all_ports () const { - boost::shared_ptr plist = _ports.reader(); - for (Ports::iterator p = plist->begin(); p != plist->end(); ++p) { + boost::shared_ptr plist = _ports.reader (); + for (Ports::iterator p = plist->begin (); p != plist->end (); ++p) { std::cout << p->first << "\n"; } } @@ -1936,7 +1928,7 @@ PortManager::list_all_ports () const void PortManager::list_cycle_ports () const { - for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) { + for (Ports::iterator p = _cycle_ports->begin (); p != _cycle_ports->end (); ++p) { std::cout << p->first << "\n"; } }