From fccbb4144cd7dd2a32d89d7e272b958e116e1c27 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sat, 21 Mar 2020 10:27:31 +0100 Subject: [PATCH] some small cleanups --- .gitignore | 1 + src/client.cpp | 30 +++++++++--------------------- src/soundbase.cpp | 8 +++----- 3 files changed, 13 insertions(+), 26 deletions(-) diff --git a/.gitignore b/.gitignore index 80ec35c9..71b19050 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ moc_predefs.h src/res/qrc_resources.cpp windows/ASIOSDK2 debug/ +jamulus.sln jamulus.vcxproj jamulus.vcxproj.filters release/ diff --git a/src/client.cpp b/src/client.cpp index d76c9960..062a3279 100755 --- a/src/client.cpp +++ b/src/client.cpp @@ -650,27 +650,16 @@ void CClient::Stop() void CClient::Init() { // check if possible frame size factors are supported - const int iFraSizePreffered = - FRAME_SIZE_FACTOR_PREFERRED * SYSTEM_FRAME_SIZE_SAMPLES; + const int iFraSizePreffered = FRAME_SIZE_FACTOR_PREFERRED * SYSTEM_FRAME_SIZE_SAMPLES; + const int iFraSizeDefault = FRAME_SIZE_FACTOR_DEFAULT * SYSTEM_FRAME_SIZE_SAMPLES; + const int iFraSizeSafe = FRAME_SIZE_FACTOR_SAFE * SYSTEM_FRAME_SIZE_SAMPLES; - bFraSiFactPrefSupported = - ( Sound.Init ( iFraSizePreffered ) == iFraSizePreffered ); - - const int iFraSizeDefault = - FRAME_SIZE_FACTOR_DEFAULT * SYSTEM_FRAME_SIZE_SAMPLES; - - bFraSiFactDefSupported = - ( Sound.Init ( iFraSizeDefault ) == iFraSizeDefault ); - - const int iFraSizeSafe = - FRAME_SIZE_FACTOR_SAFE * SYSTEM_FRAME_SIZE_SAMPLES; - - bFraSiFactSafeSupported = - ( Sound.Init ( iFraSizeSafe ) == iFraSizeSafe ); + bFraSiFactPrefSupported = ( Sound.Init ( iFraSizePreffered ) == iFraSizePreffered ); + bFraSiFactDefSupported = ( Sound.Init ( iFraSizeDefault ) == iFraSizeDefault ); + bFraSiFactSafeSupported = ( Sound.Init ( iFraSizeSafe ) == iFraSizeSafe ); // translate block size index in actual block size - const int iPrefMonoFrameSize = - iSndCrdPrefFrameSizeFactor * SYSTEM_FRAME_SIZE_SAMPLES; + const int iPrefMonoFrameSize = iSndCrdPrefFrameSizeFactor * SYSTEM_FRAME_SIZE_SAMPLES; // get actual sound card buffer size using preferred size iMonoBlockSizeSam = Sound.Init ( iPrefMonoFrameSize ); @@ -686,7 +675,7 @@ void CClient::Init() iSndCrdFrameSizeFactor = iMonoBlockSizeSam / SYSTEM_FRAME_SIZE_SAMPLES; // no sound card conversion buffer required - bSndCrdConversionBufferRequired = false; + bSndCrdConversionBufferRequired = false; } else { @@ -700,8 +689,7 @@ void CClient::Init() // overwrite block size by smallest supported buffer size iSndCrdFrameSizeFactor = FRAME_SIZE_FACTOR_PREFERRED; - iMonoBlockSizeSam = - SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_PREFERRED; + iMonoBlockSizeSam = SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_PREFERRED; iStereoBlockSizeSam = 2 * iMonoBlockSizeSam; diff --git a/src/soundbase.cpp b/src/soundbase.cpp index 485d961f..611836d2 100755 --- a/src/soundbase.cpp +++ b/src/soundbase.cpp @@ -197,8 +197,7 @@ QString CSoundBase::SetDev ( const int iNewDev ) for ( int i = 0; i < lNumDevs; i++ ) { - sErrorMessage += "
  • " + GetDeviceName ( i ) + ": " + - vsErrorList[i] + "
  • "; + sErrorMessage += "
  • " + GetDeviceName ( i ) + ": " + vsErrorList[i] + "
  • "; } sErrorMessage += ""; @@ -216,14 +215,13 @@ QVector CSoundBase::LoadAndInitializeFirstValidDriver() // load and initialize first valid ASIO driver bool bValidDriverDetected = false; - int iCurDriverIdx = 0; + int iCurDriverIdx = 0; // try all available drivers in the system ("lNumDevs" devices) while ( !bValidDriverDetected && ( iCurDriverIdx < lNumDevs ) ) { // try to load and initialize current driver, store error message - const QString strCurError = - LoadAndInitializeDriver ( iCurDriverIdx ); + const QString strCurError = LoadAndInitializeDriver ( iCurDriverIdx ); vsErrorList.append ( strCurError );