From e873a70047c9acd84ac16c1b4709c455d8bc5ef1 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Wed, 24 Mar 2010 21:47:17 +0000 Subject: [PATCH] changed stereo reverberation behaviour: now the channel selection radio buttons are invisible in case of stereo since they are not used in that mode anyway --- src/llconclientdlg.cpp | 65 ++++++++++++++---------------------------- src/llconclientdlg.h | 6 ++-- 2 files changed, 24 insertions(+), 47 deletions(-) diff --git a/src/llconclientdlg.cpp b/src/llconclientdlg.cpp index 1e1d5d3a..c63df4a3 100755 --- a/src/llconclientdlg.cpp +++ b/src/llconclientdlg.cpp @@ -251,11 +251,7 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, SliderAudReverb->setValue ( iCurAudReverb ); SliderAudReverb->setTickInterval ( AUD_REVERB_MAX / 5 ); - - // set radio buttons --- - // reverb channel - RevSelectionButtonGroup.addButton ( RadioButtonRevSelL ); - RevSelectionButtonGroup.addButton ( RadioButtonRevSelR ); + // init reverb channel UpdateRevSelection(); @@ -335,9 +331,11 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, this, SLOT ( OnSliderAudReverb ( int ) ) ); // radio buttons - QObject::connect ( &RevSelectionButtonGroup, - SIGNAL ( buttonClicked ( QAbstractButton* ) ), this, - SLOT ( OnRevSelectionButtonGroupClicked ( QAbstractButton* ) ) ); + QObject::connect ( RadioButtonRevSelL, SIGNAL ( clicked() ), + this, SLOT ( OnRevSelL() ) ); + + QObject::connect ( RadioButtonRevSelR, SIGNAL ( clicked() ), + this, SLOT ( OnRevSelR() ) ); // line edits QObject::connect ( LineEditFaderTag, SIGNAL ( textChanged ( const QString& ) ), @@ -446,32 +444,26 @@ void CLlconClientDlg::UpdateRevSelection() { if ( pClient->GetUseStereo() ) { - // for stereo set both channels checked and disable all settings - RevSelectionButtonGroup.setExclusive ( false ); - - // to be able to set both checks, exclusive has to be disabled - RadioButtonRevSelL->setChecked ( true ); - RadioButtonRevSelR->setChecked ( true ); - - // enable exclusive again, since this is required for mono mode - RevSelectionButtonGroup.setExclusive ( true ); - - // the user shall not modify the radio buttons in stereo mode - RadioButtonRevSelL->setEnabled ( false ); - RadioButtonRevSelR->setEnabled ( false ); + // for stereo make channel selection invisible since + // reverberation effect is always applied to both channels + RadioButtonRevSelL->setVisible ( false ); + RadioButtonRevSelR->setVisible ( false ); } else { - // mono case, enable all radio buttons and set to current value - RadioButtonRevSelL->setEnabled ( true ); - RadioButtonRevSelR->setEnabled ( true ); + // make radio buttons visible + RadioButtonRevSelL->setVisible ( true ); + RadioButtonRevSelR->setVisible ( true ); - // first reset and then set correct selection - RadioButtonRevSelL->setChecked ( false ); - RadioButtonRevSelR->setChecked ( false ); - - RadioButtonRevSelL->setChecked ( pClient->IsReverbOnLeftChan() ); - RadioButtonRevSelR->setChecked ( !pClient->IsReverbOnLeftChan() ); + // update value + if ( pClient->IsReverbOnLeftChan() ) + { + RadioButtonRevSelL->setChecked ( true ); + } + else + { + RadioButtonRevSelR->setChecked ( true ); + } } } @@ -564,19 +556,6 @@ void CLlconClientDlg::OnNumClientsChanged ( int iNewNumClients ) SetMyWindowTitle ( iNewNumClients ); } -void CLlconClientDlg::OnRevSelectionButtonGroupClicked ( QAbstractButton* button ) -{ - if ( button == RadioButtonRevSelL ) - { - pClient->SetReverbOnLeftChan ( true ); - } - - if ( button == RadioButtonRevSelR ) - { - pClient->SetReverbOnLeftChan ( false ); - } -} - void CLlconClientDlg::SetMyWindowTitle ( const int iNumClients ) { // show number of connected clients in window title (and therefore also in diff --git a/src/llconclientdlg.h b/src/llconclientdlg.h index 236fc58f..a80e9ef1 100755 --- a/src/llconclientdlg.h +++ b/src/llconclientdlg.h @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include "global.h" @@ -96,8 +95,6 @@ protected: QMenu* pViewMenu; QMenuBar* pMenu; - QButtonGroup RevSelectionButtonGroup; - CClientSettingsDlg ClientSettingsDlg; CChatDlg ChatDlg; @@ -109,7 +106,8 @@ public slots: void OnOpenChatDialog() { ShowChatWindow(); } void OnSliderAudInFader ( int value ); void OnSliderAudReverb ( int value ) { pClient->SetReverbLevel ( value ); } - void OnRevSelectionButtonGroupClicked ( QAbstractButton* button ); + void OnRevSelL() { pClient->SetReverbOnLeftChan ( true ); } + void OnRevSelR() { pClient->SetReverbOnLeftChan ( false ); } void OnConClientListMesReceived ( CVector vecChanInfo ); void OnChangeChanGain ( int iId, double dGain ) { pClient->SetRemoteChanGain ( iId, dGain ); }