mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-08-01 16:37:31 -04:00
Avoid enumerating audio devices until absolutely necessary
Enumerating audio devices with QAudioDeviceInfo::availableDevices() takes a long time on Linux with pulseaudio. This change only enumerates up to the selected device when configuring and only enumerates the whole list when the Settings->Audio tab is current. This change also warns with a message box when Tx is started with no audio output device configured.
This commit is contained in:
+5
-1
@@ -77,7 +77,11 @@ void SoundOutput::setFormat (QAudioDeviceInfo const& device, unsigned channels,
|
||||
|
||||
void SoundOutput::restart (QIODevice * source)
|
||||
{
|
||||
Q_ASSERT (m_stream);
|
||||
if (!m_stream)
|
||||
{
|
||||
Q_EMIT error (tr ("No audio output device configured."));
|
||||
return;
|
||||
}
|
||||
|
||||
// we have to set this before every start on the stream because the
|
||||
// Windows implementation seems to forget the buffer size after a
|
||||
|
||||
Reference in New Issue
Block a user