Mixer: Fix JACK port disconnection when Auto Input/Output mode is changed.
This commit is contained in:
parent
00c02c7d74
commit
286dec338c
|
@ -1042,9 +1042,14 @@ Mixer_Strip::maybe_auto_connect_output ( Module::Port *p )
|
||||||
|
|
||||||
if ( _auto_input && matches_pattern( _auto_input, p ) )
|
if ( _auto_input && matches_pattern( _auto_input, p ) )
|
||||||
{
|
{
|
||||||
|
/* FIXME: would be faster if we avoided breaking and remaking
|
||||||
|
* the same connections, while still breaking connections that
|
||||||
|
* will not be remade */
|
||||||
|
|
||||||
/* break any prior auto-connection */
|
/* break any prior auto-connection */
|
||||||
p->disconnect();
|
p->disconnect();
|
||||||
|
|
||||||
|
|
||||||
// FIXME: Find a better way to get the port index.
|
// FIXME: Find a better way to get the port index.
|
||||||
const char* jack_name = p->jack_port()->jack_name();
|
const char* jack_name = p->jack_port()->jack_name();
|
||||||
|
|
||||||
|
|
|
@ -285,15 +285,14 @@ Module::paste_before ( void )
|
||||||
void
|
void
|
||||||
Module::Port::disconnect_from_strip ( Mixer_Strip *o )
|
Module::Port::disconnect_from_strip ( Mixer_Strip *o )
|
||||||
{
|
{
|
||||||
for ( std::list<Port*>::iterator i = _connected.begin(); i != _connected.end(); i++ )
|
for ( std::list<Port*>::iterator i = _connected.begin(); i != _connected.end(); )
|
||||||
{
|
{
|
||||||
Port *p = *i;
|
Port *p = *i;
|
||||||
|
|
||||||
|
i++; /* iterator trick */
|
||||||
|
|
||||||
if ( p->module()->chain()->strip() == o )
|
if ( p->module()->chain()->strip() == o )
|
||||||
{
|
{
|
||||||
/* iterator about to be invalidated... */
|
|
||||||
i = _connected.erase(i);
|
|
||||||
|
|
||||||
disconnect(p);
|
disconnect(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue