From 4b43210eb81fc4a566e236fa4d7059a188bcd2e8 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sun, 15 Mar 2015 06:59:30 +0000 Subject: [PATCH] If the actual ASIO buffer delay is not one of the 128, 256 or 512 samples, you do not see the number in the GUI. Add a info text on what buffer size is actually used. --- src/clientsettingsdlg.cpp | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/src/clientsettingsdlg.cpp b/src/clientsettingsdlg.cpp index 8531af02..2ff5fbe7 100755 --- a/src/clientsettingsdlg.cpp +++ b/src/clientsettingsdlg.cpp @@ -447,6 +447,16 @@ void CClientSettingsDlg::UpdateSoundCardFrame() const int iCurActualBufSize = pClient->GetSndCrdActualMonoBlSize(); + // check which predefined size is used (it is possible that none is used) + const bool bPreferredChecked = + ( iCurActualBufSize == SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_PREFERRED ); + + const bool bDefaultChecked = + ( iCurActualBufSize == SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_DEFAULT ); + + const bool bSafeChecked = + ( iCurActualBufSize == SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_SAFE ); + // Set radio buttons according to current value (To make it possible // to have all radio buttons unchecked, we have to disable the // exclusive check for the radio button group. We require all radio @@ -454,16 +464,9 @@ void CClientSettingsDlg::UpdateSoundCardFrame() // support any of the buffer sizes and therefore all radio buttons // are disabeld and unchecked.). SndCrdBufferDelayButtonGroup.setExclusive ( false ); - - rbtBufferDelayPreferred->setChecked ( iCurActualBufSize == - SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_PREFERRED ); - - rbtBufferDelayDefault->setChecked ( iCurActualBufSize == - SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_DEFAULT ); - - rbtBufferDelaySafe->setChecked ( iCurActualBufSize == - SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_SAFE ); - + rbtBufferDelayPreferred->setChecked ( bPreferredChecked ); + rbtBufferDelayDefault->setChecked ( bDefaultChecked ); + rbtBufferDelaySafe->setChecked ( bSafeChecked ); SndCrdBufferDelayButtonGroup.setExclusive ( true ); // disable radio buttons which are not supported by audio interface @@ -475,6 +478,21 @@ void CClientSettingsDlg::UpdateSoundCardFrame() rbtBufferDelaySafe->setEnabled ( pClient->GetFraSiFactSafeSupported() ); + + // If any of our predefined sizes is chosen, use the regular group box + // title text. If not, show the actual buffer size. Otherwise the user + // would not know which buffer size is actually used. + if ( bPreferredChecked || bDefaultChecked || bSafeChecked ) + { + // default title text + grbSoundCrdBufDelay->setTitle ( "Buffer Delay" ); + } + else + { + // special title text with buffer size information added + grbSoundCrdBufDelay->setTitle ( "Buffer Delay: " + + GenSndCrdBufferDelayString ( iCurActualBufSize ) ); + } } void CClientSettingsDlg::UpdateSoundChannelSelectionFrame()