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:
parent
402f2ddbd9
commit
2d5e9bf1bb
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user