* bugfix: Connecting/disconnecting MIDI ports did not work: http://tracker.ardour...
authorHans Baier <hansfbaier@googlemail.com>
Fri, 4 Apr 2008 16:36:30 +0000 (16:36 +0000)
committerHans Baier <hansfbaier@googlemail.com>
Fri, 4 Apr 2008 16:36:30 +0000 (16:36 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@3216 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/audioengine.cc
libs/ardour/jack_port.cc
libs/ardour/midi_port.cc

index 0f13b05a09eba8d43d965502d01b3846af32a8d1..886bb4a61fb38cf468f90041ba38e6b0fc7935da 100644 (file)
@@ -591,6 +591,7 @@ AudioEngine::get_port (const std::string& full_name)
        boost::shared_ptr<Ports> 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);
 
index c4705816e9a08d0e3865ce5020ec5982686775f4..5fac52af68992428ff5a498c364c4784039bcb91 100644 (file)
@@ -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<string>::iterator i = _named_connections.find (other);
index 7a045dc8290d23949e103a598697005b93c7d2bc..fc48218efad747c4ad073f0202373c7d923201c5 100644 (file)
@@ -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 ();
 }