Add a preference for the Channel Levels

This commit is contained in:
Peter L Jones 2020-03-30 21:36:25 +01:00
parent 8db54e8616
commit 36e54f4da7
9 changed files with 73 additions and 5 deletions

View File

@ -159,6 +159,7 @@ public:
void CreateReqConnClientsList() { Protocol.CreateReqConnClientsList(); }
void CreateChatTextMes ( const QString& strChatText ) { Protocol.CreateChatTextMes ( strChatText ); }
void CreateLicReqMes ( const ELicenceType eLicenceType ) { Protocol.CreateLicenceRequiredMes ( eLicenceType ); }
void CreateReqChannelLevelListMes ( bool bOptIn ) { Protocol.CreateReqChannelLevelListMes ( bOptIn ); }
void CreateConClientListMes ( const CVector<CChannelInfo>& vecChanInfo )
{ Protocol.CreateConClientListMes ( vecChanInfo ); }

View File

@ -65,6 +65,7 @@ CClient::CClient ( const quint16 iPortNumber,
bFraSiFactDefSupported ( false ),
bFraSiFactSafeSupported ( false ),
eGUIDesign ( GD_ORIGINAL ),
bDisplayChannelLevels ( true ),
bJitterBufferOK ( true ),
strCentralServerAddress ( "" ),
bUseDefaultCentralServerAddress ( true ),
@ -279,6 +280,9 @@ void CClient::OnNewConnection()
// Same problem is with the jitter buffer message.
Channel.CreateReqConnClientsList();
CreateServerJitterBufferMessage();
// send opt-in / out for Channel Level updates
Channel.CreateReqChannelLevelListMes ( bDisplayChannelLevels );
}
void CClient::CreateServerJitterBufferMessage()
@ -387,6 +391,14 @@ bool CClient::GetAndResetbJitterBufferOKFlag()
return bSocketJitBufOKFlag;
}
void CClient::SetDisplayChannelLevels ( const bool bNDCL )
{
bDisplayChannelLevels = bNDCL;
// tell any connected server about the change
Channel.CreateReqChannelLevelListMes ( bDisplayChannelLevels );
}
void CClient::SetSndCrdPrefFrameSizeFactor ( const int iNewFactor )
{
// first check new input parameter

View File

@ -128,6 +128,9 @@ public:
EGUIDesign GetGUIDesign() const { return eGUIDesign; }
void SetGUIDesign ( const EGUIDesign eNGD ) { eGUIDesign = eNGD; }
bool GetDisplayChannelLevels() const { return bDisplayChannelLevels; }
void SetDisplayChannelLevels ( const bool bNDCL );
EAudioQuality GetAudioQuality() const { return eAudioQuality; }
void SetAudioQuality ( const EAudioQuality eNAudioQuality );
@ -359,6 +362,7 @@ protected:
int iStereoBlockSizeSam;
EGUIDesign eGUIDesign;
bool bDisplayChannelLevels;
bool bJitterBufferOK;

View File

@ -185,6 +185,9 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
// reset mixer board
MainMixerBoard->HideAll();
// restore channel level display preference
MainMixerBoard->SetDisplayChannelLevels ( pClient->GetDisplayChannelLevels() );
// restore fader settings
MainMixerBoard->vecStoredFaderTags = pClient->vecStoredFaderTags;
MainMixerBoard->vecStoredFaderLevels = pClient->vecStoredFaderLevels;
@ -495,6 +498,9 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
QObject::connect ( &ClientSettingsDlg, SIGNAL ( GUIDesignChanged() ),
this, SLOT ( OnGUIDesignChanged() ) );
QObject::connect ( &ClientSettingsDlg, SIGNAL ( DisplayChannelLevelsChanged() ),
this, SLOT ( OnDisplayChannelLevelsChanged() ) );
QObject::connect ( &ClientSettingsDlg, SIGNAL ( AudioChannelsChanged() ),
this, SLOT ( OnAudioChannelsChanged() ) );

View File

@ -198,6 +198,9 @@ public slots:
void OnGUIDesignChanged()
{ SetGUIDesign ( pClient->GetGUIDesign() ); }
void OnDisplayChannelLevelsChanged()
{ MainMixerBoard->SetDisplayChannelLevels ( pClient->GetDisplayChannelLevels() ); }
void OnAudioChannelsChanged() { UpdateRevSelection(); }
void OnNumClientsChanged ( int iNewNumClients );
void OnNewClientLevelChanged() { MainMixerBoard->iNewClientFaderLevel = pClient->iNewClientFaderLevel; }

View File

@ -189,6 +189,12 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
chbGUIDesignFancy->setAccessibleName ( tr ( "Fancy skin check box" ) );
// display channel levels
chbDisplayChannelLevels->setWhatsThis ( tr ( "<b>Display Channel Levels:</b> "
"If enabled, each client channel will display a pre-fader level bar." ) );
chbDisplayChannelLevels->setAccessibleName ( tr ( "Display channel levels check box" ) );
// audio channels
QString strAudioChannels = tr ( "<b>Audio Channels:</b> "
"Select the number of audio channels to be used. There are three "
@ -323,6 +329,9 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
chbGUIDesignFancy->setCheckState ( Qt::Checked );
}
// Display Channel Levels check box
chbDisplayChannelLevels->setCheckState ( pClient->GetDisplayChannelLevels() ? Qt::Checked : Qt::Unchecked );
// "Audio Channels" combo box
cbxAudioChannels->clear();
cbxAudioChannels->addItem ( "Mono" ); // CC_MONO
@ -386,6 +395,9 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
QObject::connect ( chbGUIDesignFancy, SIGNAL ( stateChanged ( int ) ),
this, SLOT ( OnGUIDesignFancyStateChanged ( int ) ) );
QObject::connect ( chbDisplayChannelLevels, SIGNAL ( stateChanged ( int ) ),
this, SLOT ( OnDisplayChannelLevelsStateChanged ( int ) ) );
QObject::connect ( chbAutoJitBuf, SIGNAL ( stateChanged ( int ) ),
this, SLOT ( OnAutoJitBufStateChanged ( int ) ) );
@ -704,6 +716,12 @@ void CClientSettingsDlg::OnGUIDesignFancyStateChanged ( int value )
UpdateDisplay();
}
void CClientSettingsDlg::OnDisplayChannelLevelsStateChanged ( int value )
{
pClient->SetDisplayChannelLevels ( value != Qt::Unchecked );
emit DisplayChannelLevelsChanged();
}
void CClientSettingsDlg::OnDefaultCentralServerStateChanged ( int value )
{
// apply new setting to the client

View File

@ -90,6 +90,7 @@ protected:
void OnSliderSndCrdBufferDelay ( int value );
void OnAutoJitBufStateChanged ( int value );
void OnGUIDesignFancyStateChanged ( int value );
void OnDisplayChannelLevelsStateChanged ( int value );
void OnDefaultCentralServerStateChanged ( int value );
void OnCentralServerAddressEditingFinished();
void OnNewClientLevelEditingFinished();
@ -105,6 +106,7 @@ protected:
signals:
void GUIDesignChanged();
void DisplayChannelLevelsChanged();
void AudioChannelsChanged();
void NewClientLevelChanged();
};

View File

@ -530,11 +530,22 @@
</layout>
</item>
<item>
<widget class="QCheckBox" name="chbGUIDesignFancy">
<property name="text">
<string>Fancy Skin</string>
</property>
</widget>
<layout class="QHBoxLayout">
<item>
<widget class="QCheckBox" name="chbGUIDesignFancy">
<property name="text">
<string>Fancy Skin</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chbDisplayChannelLevels">
<property name="text">
<string>Display Channel Levels</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
@ -719,6 +730,7 @@
<tabstop>cbxAudioQuality</tabstop>
<tabstop>edtNewClientLevel</tabstop>
<tabstop>chbGUIDesignFancy</tabstop>
<tabstop>chbDisplayChannelFaders</tabstop>
<tabstop>chbDefaultCentralServer</tabstop>
<tabstop>edtCentralServerAddress</tabstop>
</tabstops>

View File

@ -250,6 +250,12 @@ void CSettings::Load()
pClient->SetGUIDesign ( static_cast<EGUIDesign> ( iValue ) );
}
// display channel levels preference
if ( GetFlagIniSet ( IniXMLDocument, "client", "displaychannellevels", bValue ) )
{
pClient->SetDisplayChannelLevels ( bValue );
}
// audio channels
if ( GetNumericIniSet ( IniXMLDocument, "client", "audiochannels",
0, 2 /* CC_STEREO */, iValue ) )
@ -490,6 +496,10 @@ void CSettings::Save()
SetNumericIniSet ( IniXMLDocument, "client", "guidesign",
static_cast<int> ( pClient->GetGUIDesign() ) );
// display channel levels preference
SetFlagIniSet ( IniXMLDocument, "client", "displaychannellevels",
pClient->GetDisplayChannelLevels() );
// audio channels
SetNumericIniSet ( IniXMLDocument, "client", "audiochannels",
static_cast<int> ( pClient->GetAudioChannels() ) );