From c2b802c6e2e7f3c1af4e7784504c74375c75db50 Mon Sep 17 00:00:00 2001 From: Hans Baier Date: Fri, 4 Apr 2008 16:36:30 +0000 Subject: [PATCH] * bugfix: Connecting/disconnecting MIDI ports did not work: http://tracker.ardour.org/view.php?id=2141 git-svn-id: svn://localhost/ardour2/branches/3.0@3216 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/audioengine.cc | 5 +++++ libs/ardour/jack_port.cc | 4 ++-- libs/ardour/midi_port.cc | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index 0f13b05a09..886bb4a61f 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -591,6 +591,7 @@ AudioEngine::get_port (const std::string& full_name) boost::shared_ptr p = ports.reader(); for (Ports::iterator i = p->begin(); i != p->end(); ++i) { + //cerr << "comparing port name '" << (*i)->name() << "' with '" << full_name << "'" << endl; if ((*i)->name() == full_name) { return *i; } @@ -671,6 +672,8 @@ AudioEngine::connect (const string& source, const string& destination) string s = make_port_name_non_relative (source); string d = make_port_name_non_relative (destination); + //cerr << "Trying to connect source: " << s << " with destination " << d << endl; + Port* src = get_port (s); Port* dst = get_port (d); @@ -741,6 +744,8 @@ AudioEngine::disconnect (const string& source, const string& destination) string s = make_port_name_non_relative (source); string d = make_port_name_non_relative (destination); + //cerr << "trying to disconnect port '" << s << "' from port '" << d << endl; + Port* src = get_port (s); Port* dst = get_port (d); diff --git a/libs/ardour/jack_port.cc b/libs/ardour/jack_port.cc index c4705816e9..5fac52af68 100644 --- a/libs/ardour/jack_port.cc +++ b/libs/ardour/jack_port.cc @@ -140,9 +140,9 @@ JackPort::disconnect (const std::string& other) int ret; if (_flags & IsInput) { - ret = jack_disconnect (engine->jack(), _name.c_str(), other.c_str()); - } else { ret = jack_disconnect (engine->jack(), other.c_str(), _name.c_str()); + } else { + ret = jack_disconnect (engine->jack(), _name.c_str(), other.c_str()); } set::iterator i = _named_connections.find (other); diff --git a/libs/ardour/midi_port.cc b/libs/ardour/midi_port.cc index 7a045dc829..fc48218efa 100644 --- a/libs/ardour/midi_port.cc +++ b/libs/ardour/midi_port.cc @@ -37,12 +37,13 @@ MidiPort::MidiPort (const std::string& name, Flags flags, bool external, nframes /* external ports use the same buffer for the jack port (_ext_port) * and internal ports (this) */ _ext_port = new JackMidiPort (name, flags, _buffer); + Port::set_name (_ext_port->name()); } else { /* internal ports just have a single buffer, no jack port */ _ext_port = 0; + set_name (name); } - set_name (name); reset (); }