Renamed device_id to deviceId

This commit is contained in:
WolverinDEV 2021-03-25 12:35:44 +01:00
parent b8a3d9d01f
commit fe947ea83b
2 changed files with 9 additions and 5 deletions

View File

@ -1,5 +1,5 @@
export interface OutputDevice {
device_id: string;
deviceId: string;
driver: string;
name: string;
}

View File

@ -54,7 +54,7 @@ export class NativeAudioPlayer implements AudioBackend {
});
return devices.map(entry => ({
device_id: entry.device_id,
deviceId: entry.device_id,
driver: entry.driver,
name: entry.name
}));
@ -62,7 +62,11 @@ export class NativeAudioPlayer implements AudioBackend {
getCurrentDevice(): OutputDevice {
if(this.currentDevice) {
return this.currentDevice;
return {
name: this.currentDevice.name,
driver: this.currentDevice.driver,
deviceId: this.currentDevice.device_id
};
}
const defaultDevice = native.audio.available_devices().find(entry => entry.output_default);
@ -70,13 +74,13 @@ export class NativeAudioPlayer implements AudioBackend {
return {
name: defaultDevice.name,
driver: defaultDevice.driver,
device_id: defaultDevice.device_id
deviceId: defaultDevice.device_id
};
}
return {
name: "Default device",
device_id: "default",
deviceId: "default",
driver: "default driver"
};
}