X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fio.cc;h=b72c29aae15d15e4d852d41a535aafb6722dccd2;hb=8367b7cab344e75908744a95fda860c7fadff420;hp=ebd295411e9cdfaf3d5198e0c36f0a737cd86d92;hpb=2a6a16f980ff9181b138f7a30aedfbde4426a591;p=ardour.git diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index ebd295411e..b72c29aae1 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -39,6 +39,7 @@ #include "ardour/debug.h" #include "ardour/io.h" #include "ardour/port.h" +#include "ardour/profile.h" #include "ardour/route.h" #include "ardour/session.h" #include "ardour/user_bundle.h" @@ -527,7 +528,7 @@ IO::state (bool /*full_state*/) string str; vector::iterator ci; int n; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); Glib::Threads::Mutex::Lock lm (io_lock); node->add_property("name", _name); @@ -588,7 +589,7 @@ IO::set_state (const XMLNode& node, int version) const XMLProperty* prop; XMLNodeConstIterator iter; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); /* force use of non-localized representation of decimal point, since we use it a lot in XML files and so forth. @@ -644,7 +645,7 @@ IO::set_state_2X (const XMLNode& node, int version, bool in) { const XMLProperty* prop; XMLNodeConstIterator iter; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); /* force use of non-localized representation of decimal point, since we use it a lot in XML files and so forth. @@ -692,13 +693,16 @@ IO::set_state_2X (const XMLNode& node, int version, bool in) int IO::connecting_became_legal () { - int ret; + int ret = 0; assert (pending_state_node); connection_legal_c.disconnect (); - ret = make_connections (*pending_state_node, pending_state_node_version, pending_state_node_in); + // it's not required for TracksLive, as long as TracksLive's session does all the cennections when it's being loaded + if (!Profile->get_trx() ) { + ret = make_connections (*pending_state_node, pending_state_node_version, pending_state_node_in); + } delete pending_state_node; pending_state_node = 0; @@ -854,6 +858,7 @@ IO::get_port_counts (const XMLNode& node, int version, ChanCount& n, boost::shar for (iter = node.children().begin(); iter != node.children().end(); ++iter) { if ((*iter)->name() == X_("Bundle")) { + prop = (*iter)->property ("name"); if ((c = find_possible_bundle (prop->value())) != 0) { n = ChanCount::max (n, c->nchannels()); return 0; @@ -1039,7 +1044,8 @@ IO::make_connections_2X (const XMLNode& node, int /*version*/, bool in) if (p != string::npos) { ports[x].replace (p, 4, "/audio_out"); } - nth(i)->connect (ports[x]); + if (NULL != nth(i).get()) + nth(i)->connect (ports[x]); } } @@ -1081,7 +1087,8 @@ IO::make_connections_2X (const XMLNode& node, int /*version*/, bool in) if (p != string::npos) { ports[x].replace (p, 3, "/audio_in"); } - nth(i)->connect (ports[x]); + if (NULL != nth(i).get()) + nth(i)->connect (ports[x]); } } @@ -1097,7 +1104,6 @@ int IO::set_ports (const string& str) { vector ports; - int i; int n; uint32_t nports; @@ -1114,14 +1120,10 @@ IO::set_ports (const string& str) } } - string::size_type start, end, ostart; - - ostart = 0; - start = 0; - end = 0; - i = 0; - - while ((start = str.find_first_of ('{', ostart)) != string::npos) { + string::size_type start = 0; + string::size_type end = 0; + string::size_type ostart = 0; + for (int i = 0; (start = str.find_first_of ('{', ostart)) != string::npos; ++i) { start += 1; if ((end = str.find_first_of ('}', start)) == string::npos) { @@ -1142,7 +1144,6 @@ IO::set_ports (const string& str) } ostart = end+1; - i++; } return 0; @@ -1179,7 +1180,6 @@ IO::parse_gain_string (const string& str, vector& ports) { string::size_type pos, opos; - pos = 0; opos = 0; ports.clear (); @@ -1414,7 +1414,7 @@ IO::find_port_hole (const char* base) std::vector buf (AudioEngine::instance()->port_name_size()); PortSet::iterator i = _ports.begin(); - snprintf (&buf[0], jack_port_name_size(), _("%s %u"), base, n); + snprintf (&buf[0], buf.size()+1, _("%s %u"), base, n); for ( ; i != _ports.end(); ++i) { if (string(i->name()) == string(&buf[0])) { @@ -1611,8 +1611,10 @@ IO::connected_to (boost::shared_ptr other) const for (i = 0; i < no; ++i) { for (j = 0; j < ni; ++j) { - if (nth(i)->connected_to (other->nth(j)->name())) { - return true; + if ((NULL != nth(i).get()) && (NULL != other->nth(j).get())) { + if (nth(i)->connected_to (other->nth(j)->name())) { + return true; + } } } }