support MIDI control faders in headless build (#483)
This commit is contained in:
parent
fefb5ade36
commit
e5174ef461
6 changed files with 42 additions and 24 deletions
|
@ -13,10 +13,11 @@
|
|||
|
||||
- improve server audio mix processing for better clipping behavior
|
||||
|
||||
- support MIDI control faders in headless build (#483)
|
||||
|
||||
- bug fix: --showallservers ping column sort is alphabetic (#201)
|
||||
|
||||
|
||||
TODO If network configuration of client changes (e.g. Wifi to LAN) we may get audio issues for a period of time #426
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -470,7 +470,7 @@ void CChannelFader::SendFaderLevelToServer ( const double dLevel,
|
|||
( !bOtherChannelIsSolo || IsSolo() ) );
|
||||
|
||||
// emit signal for new fader gain value
|
||||
emit gainValueChanged ( CalcFaderGain ( dLevel ),
|
||||
emit gainValueChanged ( MathUtils::CalcFaderGain ( dLevel ),
|
||||
bIsMyOwnFader,
|
||||
bIsGroupUpdate,
|
||||
bSuppressServerUpdate,
|
||||
|
@ -569,7 +569,7 @@ void CChannelFader::SetMute ( const bool bState )
|
|||
if ( !bOtherChannelIsSolo || IsSolo() )
|
||||
{
|
||||
// mute was unchecked, get current fader value and apply
|
||||
emit gainValueChanged ( CalcFaderGain ( GetFaderLevel() ), bIsMyOwnFader, false, false, -1 ); // set level ratio to in invalid value
|
||||
emit gainValueChanged ( MathUtils::CalcFaderGain ( GetFaderLevel() ), bIsMyOwnFader, false, false, -1 ); // set level ratio to in invalid value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -771,23 +771,6 @@ void CChannelFader::SetChannelInfos ( const CChannelInfo& cChanInfo )
|
|||
plblLabel->setToolTip ( strToolTip );
|
||||
}
|
||||
|
||||
double CChannelFader::CalcFaderGain ( const double dValue )
|
||||
{
|
||||
// convert actual slider range in gain values
|
||||
// and normalize so that maximum gain is 1
|
||||
const double dInValueRange0_1 = dValue / AUD_MIX_FADER_MAX;
|
||||
|
||||
// map range from 0..1 to range -35..0 dB and calculate linear gain
|
||||
if ( dValue == 0 )
|
||||
{
|
||||
return 0; // -infinity
|
||||
}
|
||||
else
|
||||
{
|
||||
return pow ( 10, ( dInValueRange0_1 * 35 - 35 ) / 20 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************\
|
||||
* CAudioMixerBoard *
|
||||
|
|
|
@ -84,7 +84,6 @@ public:
|
|||
|
||||
protected:
|
||||
void UpdateGroupIDDependencies();
|
||||
double CalcFaderGain ( const double dValue );
|
||||
void SetMute ( const bool bState );
|
||||
void SetupFaderTag ( const ESkillLevel eSkillLevel );
|
||||
void SendPanValueToServer ( const int iPan );
|
||||
|
|
|
@ -182,7 +182,7 @@ CClient::CClient ( const quint16 iPortNumber,
|
|||
this, &CClient::OnSndCrdReinitRequest );
|
||||
|
||||
QObject::connect ( &Sound, &CSound::ControllerInFaderLevel,
|
||||
this, &CClient::ControllerInFaderLevel );
|
||||
this, &CClient::OnControllerInFaderLevel );
|
||||
|
||||
QObject::connect ( &Socket, &CHighPrioSocket::InvalidPacketReceived,
|
||||
this, &CClient::OnInvalidPacketReceived );
|
||||
|
@ -684,6 +684,22 @@ void CClient::OnHandledSignal ( int sigNum )
|
|||
#endif
|
||||
}
|
||||
|
||||
void CClient::OnControllerInFaderLevel ( int iChannelIdx,
|
||||
int iValue )
|
||||
{
|
||||
// in case of a headless client the faders cannot be moved so we need
|
||||
// to send the controller information directly to the server
|
||||
#ifdef HEADLESS
|
||||
// only apply new fader level if channel index is valid
|
||||
if ( ( iChannelIdx >= 0 ) && ( iChannelIdx < MAX_NUM_CHANNELS ) )
|
||||
{
|
||||
SetRemoteChanGain ( iChannelIdx, MathUtils::CalcFaderGain ( iValue ), false );
|
||||
}
|
||||
#endif
|
||||
|
||||
emit ControllerInFaderLevel ( iChannelIdx, iValue );
|
||||
}
|
||||
|
||||
void CClient::Start()
|
||||
{
|
||||
// init object
|
||||
|
|
|
@ -372,7 +372,7 @@ protected:
|
|||
|
||||
CSignalHandler* pSignalHandler;
|
||||
|
||||
public slots:
|
||||
protected slots:
|
||||
void OnHandledSignal ( int sigNum );
|
||||
void OnSendProtMessage ( CVector<uint8_t> vecMessage );
|
||||
void OnInvalidPacketReceived ( CHostAddress RecHostAddr );
|
||||
|
@ -397,6 +397,7 @@ public slots:
|
|||
int iNumClients );
|
||||
|
||||
void OnSndCrdReinitRequest ( int iSndCrdResetType );
|
||||
void OnControllerInFaderLevel ( int iChannelIdx, int iValue );
|
||||
|
||||
signals:
|
||||
void ConClientListMesReceived ( CVector<CChannelInfo> vecChanInfo );
|
||||
|
|
18
src/util.h
18
src/util.h
|
@ -1278,6 +1278,24 @@ public:
|
|||
{
|
||||
return bXFade ? dPan : std::min ( 0.5, dPan ) * 2;
|
||||
}
|
||||
|
||||
// calculate linear gain from fader values which are in dB
|
||||
static double CalcFaderGain ( const double dValue )
|
||||
{
|
||||
// convert actual slider range in gain values
|
||||
// and normalize so that maximum gain is 1
|
||||
const double dInValueRange0_1 = dValue / AUD_MIX_FADER_MAX;
|
||||
|
||||
// map range from 0..1 to range -35..0 dB and calculate linear gain
|
||||
if ( dValue == 0 )
|
||||
{
|
||||
return 0; // -infinity
|
||||
}
|
||||
else
|
||||
{
|
||||
return pow ( 10, ( dInValueRange0_1 * 35 - 35 ) / 20 );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue