Commit ebd73955 authored by Michael Kohnen's avatar Michael Kohnen

Updatet Patchbay channel connections to avoid doubled connections

parent d3158a9c
......@@ -190,8 +190,18 @@ void ITAStreamPatchbay::ConnectChannels( const int iInput,
ITA_EXCEPT1( INVALID_PARAMETER, "Output index out of range" );
if( iOutputChannel >= m_vpOutputs[ iOutput ]->iChannels )
ITA_EXCEPT1( INVALID_PARAMETER, "Output channel index out of range" );
m_vpOutputs[ iOutput ]->conns[ iOutputChannel ].insert( Connection( iInput, iInputChannel, ( float ) dGain ) );
// Check if connections already exists
std::set<Connection, CompareConnection>& conns = m_vpOutputs[iOutput]->conns[iOutputChannel];
std::set<Connection, CompareConnection>::iterator it = conns.find(Connection(iInput, iInputChannel));
if (it == conns.end())
{
m_vpOutputs[iOutput]->conns[iOutputChannel].insert(Connection(iInput, iInputChannel, (float)dGain));
}
else
{
Connection& conn = *const_cast<Connection*>(&(*it));
conn.fNewGain = (float)dGain;
}
}
void ITAStreamPatchbay::Disconnect( const int iInput, const int iOutput )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment