1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-28 22:30:30 +00:00

Declines to set up audio output if none is available.

This commit is contained in:
Thomas Harte 2020-07-02 22:58:15 -04:00
parent 402f2ddbd9
commit 2d5e9bf1bb

View File

@ -307,6 +307,7 @@ void MainWindow::launchMachine() {
const auto speaker = audio_producer->get_speaker(); const auto speaker = audio_producer->get_speaker();
if(speaker) { if(speaker) {
const QAudioDeviceInfo &defaultDeviceInfo = QAudioDeviceInfo::defaultOutputDevice(); const QAudioDeviceInfo &defaultDeviceInfo = QAudioDeviceInfo::defaultOutputDevice();
if(!defaultDeviceInfo.isNull()) {
QAudioFormat idealFormat = defaultDeviceInfo.preferredFormat(); QAudioFormat idealFormat = defaultDeviceInfo.preferredFormat();
// Use the ideal format's sample rate, provide stereo as long as at least two channels // Use the ideal format's sample rate, provide stereo as long as at least two channels
@ -332,6 +333,7 @@ void MainWindow::launchMachine() {
}); });
} }
} }
}
// Set user-friendly default options. // Set user-friendly default options.
const auto machineType = targets[0]->machine; const auto machineType = targets[0]->machine;