Update channel send model names properly

This commit is contained in:
Vesa
2014-06-28 10:06:52 +03:00
parent 31b82fe50b
commit 0058b1064f
2 changed files with 23 additions and 0 deletions

View File

@@ -101,6 +101,8 @@ class FxRoute : public QObject
{
return m_to;
}
void updateName();
private:
FxChannel * m_from;

View File

@@ -52,6 +52,15 @@ FxRoute::~FxRoute()
}
void FxRoute::updateName()
{
if( m_amount)
{
m_amount->setDisplayName(
tr( "Amount to send from channel %1 to channel %2" ).arg( m_from->m_channelIndex ).arg( m_to->m_channelIndex ) );
}
}
FxChannel::FxChannel( int idx, Model * _parent ) :
m_fxChain( NULL ),
@@ -661,4 +670,16 @@ void FxMixer::validateChannelName( int index, int oldIndex )
{
fxc->m_name = tr( "FX %1" ).arg( index );
}
// set correct channel index
fxc->m_channelIndex = index;
// now check all routes and update names of the send models
foreach( FxRoute * r, fxc->m_sends )
{
r->updateName();
}
foreach( FxRoute * r, fxc->m_receives )
{
r->updateName();
}
}