Commit 3cbc166a authored by Kateryna Kostiuk's avatar Kateryna Kostiuk

audio settings: allow default device selection

Change-Id: I1bd8808afbdb6274ac0969ffcb18202ff269b19b
parent 6ea9ac18
......@@ -57,14 +57,18 @@ QMetaObject::Connection audioDeviceEvent;
auto inputDevice = avModel->getInputDevice();
for (auto device : inputDevices) {
[inputDeviceList addItemWithTitle: @(device.c_str())];
if(device == inputDevice) {
[inputDeviceList selectItemWithTitle:@(inputDevice.c_str())];
}
}
[inputDeviceList selectItemWithTitle:@(inputDevice.c_str())];
auto outputDevices = avModel->getAudioOutputDevices();
auto outputDevice = avModel->getOutputDevice();
for (auto device : outputDevices) {
[outputDeviceList addItemWithTitle: @(device.c_str())];
if(device == outputDevice) {
[outputDeviceList selectItemWithTitle:@(outputDevice.c_str())];
}
}
[outputDeviceList selectItemWithTitle:@(outputDevice.c_str())];
}
-(void)connectdDeviceEvent {
......@@ -72,7 +76,11 @@ QMetaObject::Connection audioDeviceEvent;
audioDeviceEvent = QObject::connect(avModel,
&lrc::api::AVModel::deviceEvent,
[=]() {
[self addDevices];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW,
1 * NSEC_PER_SEC),
dispatch_get_main_queue(), ^{
[self addDevices];
});
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment