summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/io_selector.cc11
-rw-r--r--libs/ardour/audioengine.cc2
-rw-r--r--libs/ardour/bundle.cc8
-rw-r--r--libs/ardour/io.cc4
4 files changed, 17 insertions, 8 deletions
diff --git a/gtk2_ardour/io_selector.cc b/gtk2_ardour/io_selector.cc
index f438c21d3f..8c4c0a86a8 100644
--- a/gtk2_ardour/io_selector.cc
+++ b/gtk2_ardour/io_selector.cc
@@ -69,7 +69,7 @@ IOSelector::setup ()
char buf[32];
snprintf (buf, sizeof(buf), _("out %d"), j + 1);
_our_bundle->add_channel (buf);
- _our_bundle->add_port_to_channel (j, i->name());
+ _our_bundle->add_port_to_channel (j, _session.engine().make_port_name_non_relative (i->name()));
++j;
}
@@ -82,7 +82,7 @@ IOSelector::setup ()
char buf[32];
snprintf (buf, sizeof(buf), _("in %d"), j + 1);
_our_bundle->add_channel (buf);
- _our_bundle->add_port_to_channel (j, i->name());
+ _our_bundle->add_port_to_channel (j, _session.engine().make_port_name_non_relative (i->name()));
++j;
}
@@ -152,10 +152,11 @@ IOSelector::get_state (
for (ARDOUR::Bundle::PortList::const_iterator j = other_ports.begin(); j != other_ports.end(); ++j) {
Port* f = _session.engine().get_port_by_name (*i);
- if (!f) {
- return false;
- }
+ /* since we are talking about an IO, our ports should all have an associated Port *,
+ so the above call should never fail */
+ assert (f);
+
if (!f->connected_to (*j)) {
/* if any one thing is not connected, all bets are off */
return false;
diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc
index 095fb205c1..14a4e48d72 100644
--- a/libs/ardour/audioengine.cc
+++ b/libs/ardour/audioengine.cc
@@ -837,6 +837,8 @@ AudioEngine::frames_per_cycle ()
Port *
AudioEngine::get_port_by_name (const string& portname)
{
+ assert (portname.find_first_of (':') != string::npos);
+
Glib::Mutex::Lock lm (_process_lock);
return get_port_by_name_locked (portname);
}
diff --git a/libs/ardour/bundle.cc b/libs/ardour/bundle.cc
index 379a3d4c2b..70800b06eb 100644
--- a/libs/ardour/bundle.cc
+++ b/libs/ardour/bundle.cc
@@ -47,12 +47,13 @@ Bundle::channel_ports (uint32_t c) const
/** Add an association between one of our channels and a port.
* @param ch Channel index.
- * @param portname port name to associate with.
+ * @param portname full port name to associate with (including prefix).
*/
void
Bundle::add_port_to_channel (uint32_t ch, string portname)
{
assert (ch < nchannels());
+ assert (portname.find_first_of (':') != string::npos);
{
Glib::Mutex::Lock lm (_channel_mutex);
@@ -99,10 +100,15 @@ Bundle::operator== (const Bundle& other) const
}
+/** Set a single port to be associated with a channel, removing any others.
+ * @param ch Channel.
+ * @param portname Full port name, including prefix.
+ */
void
Bundle::set_port (uint32_t ch, string portname)
{
assert (ch < nchannels());
+ assert (portname.find_first_of (':') != string::npos);
{
Glib::Mutex::Lock lm (_channel_mutex);
diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc
index 671ade36ea..ec9618d47e 100644
--- a/libs/ardour/io.cc
+++ b/libs/ardour/io.cc
@@ -2601,7 +2601,7 @@ IO::setup_bundles_for_inputs_and_outputs ()
for (uint32_t i = 0; i < ni; ++i) {
snprintf (buf, sizeof(buf), _("in %d"), (i + 1));
_bundle_for_inputs->add_channel (buf);
- _bundle_for_inputs->set_port (i, inputs().port(i)->name());
+ _bundle_for_inputs->set_port (i, _session.engine().make_port_name_non_relative (inputs().port(i)->name()));
}
snprintf(buf, sizeof (buf), _("%s out"), _name.c_str());
@@ -2610,7 +2610,7 @@ IO::setup_bundles_for_inputs_and_outputs ()
for (uint32_t i = 0; i < no; ++i) {
snprintf (buf, sizeof(buf), _("out %d"), (i + 1));
_bundle_for_outputs->add_channel (buf);
- _bundle_for_outputs->set_port (i, outputs().port(i)->name());
+ _bundle_for_outputs->set_port (i, _session.engine().make_port_name_non_relative (outputs().port(i)->name()));
}
}