some small cleanups
This commit is contained in:
parent
f55c669e5e
commit
fccbb4144c
3 changed files with 13 additions and 26 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -17,6 +17,7 @@ moc_predefs.h
|
||||||
src/res/qrc_resources.cpp
|
src/res/qrc_resources.cpp
|
||||||
windows/ASIOSDK2
|
windows/ASIOSDK2
|
||||||
debug/
|
debug/
|
||||||
|
jamulus.sln
|
||||||
jamulus.vcxproj
|
jamulus.vcxproj
|
||||||
jamulus.vcxproj.filters
|
jamulus.vcxproj.filters
|
||||||
release/
|
release/
|
||||||
|
|
|
@ -650,27 +650,16 @@ void CClient::Stop()
|
||||||
void CClient::Init()
|
void CClient::Init()
|
||||||
{
|
{
|
||||||
// check if possible frame size factors are supported
|
// check if possible frame size factors are supported
|
||||||
const int iFraSizePreffered =
|
const int iFraSizePreffered = FRAME_SIZE_FACTOR_PREFERRED * SYSTEM_FRAME_SIZE_SAMPLES;
|
||||||
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 =
|
bFraSiFactPrefSupported = ( Sound.Init ( iFraSizePreffered ) == iFraSizePreffered );
|
||||||
( Sound.Init ( iFraSizePreffered ) == iFraSizePreffered );
|
bFraSiFactDefSupported = ( Sound.Init ( iFraSizeDefault ) == iFraSizeDefault );
|
||||||
|
bFraSiFactSafeSupported = ( Sound.Init ( iFraSizeSafe ) == iFraSizeSafe );
|
||||||
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 );
|
|
||||||
|
|
||||||
// translate block size index in actual block size
|
// translate block size index in actual block size
|
||||||
const int iPrefMonoFrameSize =
|
const int iPrefMonoFrameSize = iSndCrdPrefFrameSizeFactor * SYSTEM_FRAME_SIZE_SAMPLES;
|
||||||
iSndCrdPrefFrameSizeFactor * SYSTEM_FRAME_SIZE_SAMPLES;
|
|
||||||
|
|
||||||
// get actual sound card buffer size using preferred size
|
// get actual sound card buffer size using preferred size
|
||||||
iMonoBlockSizeSam = Sound.Init ( iPrefMonoFrameSize );
|
iMonoBlockSizeSam = Sound.Init ( iPrefMonoFrameSize );
|
||||||
|
@ -686,7 +675,7 @@ void CClient::Init()
|
||||||
iSndCrdFrameSizeFactor = iMonoBlockSizeSam / SYSTEM_FRAME_SIZE_SAMPLES;
|
iSndCrdFrameSizeFactor = iMonoBlockSizeSam / SYSTEM_FRAME_SIZE_SAMPLES;
|
||||||
|
|
||||||
// no sound card conversion buffer required
|
// no sound card conversion buffer required
|
||||||
bSndCrdConversionBufferRequired = false;
|
bSndCrdConversionBufferRequired = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -700,8 +689,7 @@ void CClient::Init()
|
||||||
|
|
||||||
// overwrite block size by smallest supported buffer size
|
// overwrite block size by smallest supported buffer size
|
||||||
iSndCrdFrameSizeFactor = FRAME_SIZE_FACTOR_PREFERRED;
|
iSndCrdFrameSizeFactor = FRAME_SIZE_FACTOR_PREFERRED;
|
||||||
iMonoBlockSizeSam =
|
iMonoBlockSizeSam = SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_PREFERRED;
|
||||||
SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_PREFERRED;
|
|
||||||
|
|
||||||
iStereoBlockSizeSam = 2 * iMonoBlockSizeSam;
|
iStereoBlockSizeSam = 2 * iMonoBlockSizeSam;
|
||||||
|
|
||||||
|
|
|
@ -197,8 +197,7 @@ QString CSoundBase::SetDev ( const int iNewDev )
|
||||||
|
|
||||||
for ( int i = 0; i < lNumDevs; i++ )
|
for ( int i = 0; i < lNumDevs; i++ )
|
||||||
{
|
{
|
||||||
sErrorMessage += "<li><b>" + GetDeviceName ( i ) + "</b>: " +
|
sErrorMessage += "<li><b>" + GetDeviceName ( i ) + "</b>: " + vsErrorList[i] + "</li>";
|
||||||
vsErrorList[i] + "</li>";
|
|
||||||
}
|
}
|
||||||
sErrorMessage += "</ul>";
|
sErrorMessage += "</ul>";
|
||||||
|
|
||||||
|
@ -216,14 +215,13 @@ QVector<QString> CSoundBase::LoadAndInitializeFirstValidDriver()
|
||||||
|
|
||||||
// load and initialize first valid ASIO driver
|
// load and initialize first valid ASIO driver
|
||||||
bool bValidDriverDetected = false;
|
bool bValidDriverDetected = false;
|
||||||
int iCurDriverIdx = 0;
|
int iCurDriverIdx = 0;
|
||||||
|
|
||||||
// try all available drivers in the system ("lNumDevs" devices)
|
// try all available drivers in the system ("lNumDevs" devices)
|
||||||
while ( !bValidDriverDetected && ( iCurDriverIdx < lNumDevs ) )
|
while ( !bValidDriverDetected && ( iCurDriverIdx < lNumDevs ) )
|
||||||
{
|
{
|
||||||
// try to load and initialize current driver, store error message
|
// try to load and initialize current driver, store error message
|
||||||
const QString strCurError =
|
const QString strCurError = LoadAndInitializeDriver ( iCurDriverIdx );
|
||||||
LoadAndInitializeDriver ( iCurDriverIdx );
|
|
||||||
|
|
||||||
vsErrorList.append ( strCurError );
|
vsErrorList.append ( strCurError );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue