If paInDevice was not a saved setting, use Pa_GetDefaultInputDevice().

If paOutDevice was not a saved setting, use Pa_GetDefaultOutputDevice().

This allows wsjtx to startup with default audio on a new install.

However, it does not set the menu index numbers, so the Config SoundIn/Out
menus do not look correct, until they have been set and saved once.

It would be better if only the device names were saved in settings,
because the index numbers can change, especially if USB soundcards
are added or removed.


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3339 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
John T Nogatch 2013-06-05 21:28:31 +00:00
parent 39ec4c7c1e
commit f3259f9380

View File

@ -446,9 +446,21 @@ void MainWindow::readSettings()
m_pttPort=settings.value("PTTport",0).toInt();
m_saveDir=settings.value("SaveDir",m_appDir + "/save").toString();
m_nDevIn = settings.value("SoundInIndex", 0).toInt();
m_paInDevice = settings.value("paInDevice",0).toInt();
m_paInDevice = settings.value("paInDevice", paNoDevice).toInt();
if (m_paInDevice == paNoDevice) { // no saved input device?
m_paInDevice = Pa_GetDefaultInputDevice();
if (m_paInDevice == paNoDevice) { // no default input device?
m_paInDevice = 0;
}
}
m_nDevOut = settings.value("SoundOutIndex", 0).toInt();
m_paOutDevice = settings.value("paOutDevice",0).toInt();
m_paOutDevice = settings.value("paOutDevice", paNoDevice).toInt();
if (m_paOutDevice == paNoDevice) { // no saved output device?
m_paOutDevice = Pa_GetDefaultOutputDevice();
if (m_paOutDevice == paNoDevice) { // no default output device?
m_paOutDevice = 0;
}
}
ui->actionCuteSDR->setChecked(settings.value(
"PaletteCuteSDR",true).toBool());
ui->actionLinrad->setChecked(settings.value(