From 7324a29031b0b8331427a7e213744948ea3aea90 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Fri, 22 May 2020 20:26:04 +0200 Subject: [PATCH] in mono mode we should not show the Pan controls --- ChangeLog | 2 -- src/audiomixerboard.cpp | 29 ++++++++++++++++++++--------- src/audiomixerboard.h | 3 +++ src/clientdlg.cpp | 3 +++ src/settings.cpp | 2 +- 5 files changed, 27 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index ee6d57ef..73a9bf9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,8 +19,6 @@ - save client settings on Linux cmdline termination signal, coded by pljones (#70) -TODO in mono mode we should not show the Pan controls - diff --git a/src/audiomixerboard.cpp b/src/audiomixerboard.cpp index bb51b71f..24e253a2 100644 --- a/src/audiomixerboard.cpp +++ b/src/audiomixerboard.cpp @@ -71,14 +71,14 @@ CChannelFader::CChannelFader ( QWidget* pNW, pFader->setMinimumHeight ( 75 ); // setup panning control - pPan->setRange ( 0, AUD_MIX_PAN_MAX ); - pPan->setValue ( AUD_MIX_PAN_MAX / 2 ); - pPan->setFixedSize ( 55, 55 ); + pPan->setRange ( 0, AUD_MIX_PAN_MAX ); + pPan->setValue ( AUD_MIX_PAN_MAX / 2 ); + pPan->setFixedSize ( 50, 50 ); pPan->setNotchesVisible ( true ); - pPanInfoGrid->addWidget ( pPanLabel, 0, Qt::AlignLeft ); + pPanInfoGrid->addWidget ( pPanLabel, 0, Qt::AlignLeft ); pPanInfoGrid->addWidget ( pInfoLabel ); - pPanGrid->addLayout ( pPanInfoGrid ); - pPanGrid->addWidget ( pPan, 0, Qt::AlignHCenter ); + pPanGrid->addLayout ( pPanInfoGrid ); + pPanGrid->addWidget ( pPan, 0, Qt::AlignHCenter ); // setup fader tag label (black bold text which is centered) plblLabel->setTextFormat ( Qt::PlainText ); @@ -610,6 +610,8 @@ CAudioMixerBoard::CAudioMixerBoard ( QWidget* parent, Qt::WindowFlags ) : vecStoredFaderIsSolo ( MAX_NUM_STORED_FADER_SETTINGS, false ), vecStoredFaderIsMute ( MAX_NUM_STORED_FADER_SETTINGS, false ), iNewClientFaderLevel ( 100 ), + bDisplayPans ( false ), + bIsPanSupported ( false ), bNoFaderVisible ( true ), strServerName ( "" ) { @@ -721,14 +723,22 @@ void CAudioMixerBoard::SetDisplayChannelLevels ( const bool eNDCL ) } } -void CAudioMixerBoard::SetPanIsSupported() +void CAudioMixerBoard::SetDisplayPans ( const bool eNDP ) { + bDisplayPans = eNDP; + for ( int i = 0; i < MAX_NUM_CHANNELS; i++ ) { - vecpChanFader[i]->SetDisplayPans ( true ); + vecpChanFader[i]->SetDisplayPans ( eNDP && bIsPanSupported ); } } +void CAudioMixerBoard::SetPanIsSupported() +{ + bIsPanSupported = true; + SetDisplayPans ( bDisplayPans ); +} + void CAudioMixerBoard::HideAll() { // make all controls invisible @@ -743,7 +753,8 @@ void CAudioMixerBoard::HideAll() vecpChanFader[i]->Hide(); } - // set flag + // set flags + bIsPanSupported = false; bNoFaderVisible = true; // emit status of connected clients diff --git a/src/audiomixerboard.h b/src/audiomixerboard.h index 12a2c7be..c072239f 100644 --- a/src/audiomixerboard.h +++ b/src/audiomixerboard.h @@ -144,6 +144,7 @@ public: void SetServerName ( const QString& strNewServerName ); void SetGUIDesign ( const EGUIDesign eNewDesign ); void SetDisplayChannelLevels ( const bool eNDCL ); + void SetDisplayPans ( const bool eNDP ); void SetPanIsSupported(); void SetRemoteFaderIsMute ( const int iChannelIdx, const bool bIsMute ); @@ -192,6 +193,8 @@ protected: CMixerBoardScrollArea* pScrollArea; QHBoxLayout* pMainLayout; bool bDisplayChannelLevels; + bool bDisplayPans; + bool bIsPanSupported; bool bNoFaderVisible; QString strServerName; diff --git a/src/clientdlg.cpp b/src/clientdlg.cpp index 82b3ed71..1f8771ea 100755 --- a/src/clientdlg.cpp +++ b/src/clientdlg.cpp @@ -661,6 +661,9 @@ void CClientDlg::UpdateRevSelection() rbtReverbSelR->setChecked ( true ); } } + + // update visibility of the pan controls in the audio mixer board (pan is not supported for mono) + MainMixerBoard->SetDisplayPans ( pClient->GetAudioChannels() != CC_MONO ); } void CClientDlg::OnAudioPanValueChanged ( int value ) diff --git a/src/settings.cpp b/src/settings.cpp index 223b1321..7c5156fd 100755 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -82,7 +82,7 @@ void CSettings::Load() { if ( GetNumericIniSet ( IniXMLDocument, "client", QString ( "storedpanvalue%1" ).arg ( iIdx ), - 0, AUD_MIX_PAN_MAX/2, iValue ) ) + 0, AUD_MIX_PAN_MAX, iValue ) ) { pClient->vecStoredPanValues[iIdx] = iValue; }