diff --git a/src/channel.h b/src/channel.h index 98160756..e92e9bad 100755 --- a/src/channel.h +++ b/src/channel.h @@ -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& vecChanInfo ) { Protocol.CreateConClientListMes ( vecChanInfo ); } diff --git a/src/client.cpp b/src/client.cpp index aa8338de..39f43e7b 100755 --- a/src/client.cpp +++ b/src/client.cpp @@ -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 diff --git a/src/client.h b/src/client.h index 62ea9ec7..6618f786 100755 --- a/src/client.h +++ b/src/client.h @@ -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; diff --git a/src/clientdlg.cpp b/src/clientdlg.cpp index b862b25c..adb9296d 100755 --- a/src/clientdlg.cpp +++ b/src/clientdlg.cpp @@ -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() ) ); diff --git a/src/clientdlg.h b/src/clientdlg.h index 1649653b..2539f59f 100755 --- a/src/clientdlg.h +++ b/src/clientdlg.h @@ -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; } diff --git a/src/clientsettingsdlg.cpp b/src/clientsettingsdlg.cpp index 91385ae5..98f8a1f3 100755 --- a/src/clientsettingsdlg.cpp +++ b/src/clientsettingsdlg.cpp @@ -189,6 +189,12 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent, chbGUIDesignFancy->setAccessibleName ( tr ( "Fancy skin check box" ) ); + // display channel levels + chbDisplayChannelLevels->setWhatsThis ( tr ( "Display Channel Levels: " + "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 ( "Audio Channels: " "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 diff --git a/src/clientsettingsdlg.h b/src/clientsettingsdlg.h index cf50826a..ce478cdf 100755 --- a/src/clientsettingsdlg.h +++ b/src/clientsettingsdlg.h @@ -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(); }; diff --git a/src/clientsettingsdlgbase.ui b/src/clientsettingsdlgbase.ui index 06d4fc41..d53654a7 100755 --- a/src/clientsettingsdlgbase.ui +++ b/src/clientsettingsdlgbase.ui @@ -530,11 +530,22 @@ - - - Fancy Skin - - + + + + + Fancy Skin + + + + + + + Display Channel Levels + + + + @@ -719,6 +730,7 @@ cbxAudioQuality edtNewClientLevel chbGUIDesignFancy + chbDisplayChannelFaders chbDefaultCentralServer edtCentralServerAddress diff --git a/src/settings.cpp b/src/settings.cpp index df592e16..9b9a4460 100755 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -250,6 +250,12 @@ void CSettings::Load() pClient->SetGUIDesign ( static_cast ( 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 ( pClient->GetGUIDesign() ) ); + // display channel levels preference + SetFlagIniSet ( IniXMLDocument, "client", "displaychannellevels", + pClient->GetDisplayChannelLevels() ); + // audio channels SetNumericIniSet ( IniXMLDocument, "client", "audiochannels", static_cast ( pClient->GetAudioChannels() ) );