mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 17:17:58 +02:00
Display list of audio input devices before list of audio output devices
This commit is contained in:
parent
9e3d8b0b6d
commit
8a995cc1d2
1 changed files with 25 additions and 25 deletions
|
@ -52,31 +52,6 @@ var selectedInputMenu = "";
|
||||||
var selectedOutputMenu = "";
|
var selectedOutputMenu = "";
|
||||||
|
|
||||||
function setupAudioMenus() {
|
function setupAudioMenus() {
|
||||||
Menu.addSeparator("Audio", "Output Audio Device");
|
|
||||||
|
|
||||||
var outputDeviceSetting = Settings.getValue(OUTPUT_DEVICE_SETTING);
|
|
||||||
var outputDevices = AudioDevice.getOutputDevices();
|
|
||||||
var selectedOutputDevice = AudioDevice.getOutputDevice();
|
|
||||||
if (outputDevices.indexOf(outputDeviceSetting) != -1 && selectedOutputDevice != outputDeviceSetting) {
|
|
||||||
if (AudioDevice.setOutputDevice(outputDeviceSetting)) {
|
|
||||||
selectedOutputDevice = outputDeviceSetting;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print("audio output devices: " + outputDevices);
|
|
||||||
for(var i = 0; i < outputDevices.length; i++) {
|
|
||||||
var thisDeviceSelected = (outputDevices[i] == selectedOutputDevice);
|
|
||||||
var menuItem = "Use " + outputDevices[i] + " for Output";
|
|
||||||
Menu.addMenuItem({
|
|
||||||
menuName: "Audio",
|
|
||||||
menuItemName: menuItem,
|
|
||||||
isCheckable: true,
|
|
||||||
isChecked: thisDeviceSelected
|
|
||||||
});
|
|
||||||
if (thisDeviceSelected) {
|
|
||||||
selectedOutputMenu = menuItem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Menu.addSeparator("Audio", "Input Audio Device");
|
Menu.addSeparator("Audio", "Input Audio Device");
|
||||||
|
|
||||||
var inputDeviceSetting = Settings.getValue(INPUT_DEVICE_SETTING);
|
var inputDeviceSetting = Settings.getValue(INPUT_DEVICE_SETTING);
|
||||||
|
@ -101,6 +76,31 @@ function setupAudioMenus() {
|
||||||
selectedInputMenu = menuItem;
|
selectedInputMenu = menuItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Menu.addSeparator("Audio", "Output Audio Device");
|
||||||
|
|
||||||
|
var outputDeviceSetting = Settings.getValue(OUTPUT_DEVICE_SETTING);
|
||||||
|
var outputDevices = AudioDevice.getOutputDevices();
|
||||||
|
var selectedOutputDevice = AudioDevice.getOutputDevice();
|
||||||
|
if (outputDevices.indexOf(outputDeviceSetting) != -1 && selectedOutputDevice != outputDeviceSetting) {
|
||||||
|
if (AudioDevice.setOutputDevice(outputDeviceSetting)) {
|
||||||
|
selectedOutputDevice = outputDeviceSetting;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print("audio output devices: " + outputDevices);
|
||||||
|
for (var i = 0; i < outputDevices.length; i++) {
|
||||||
|
var thisDeviceSelected = (outputDevices[i] == selectedOutputDevice);
|
||||||
|
var menuItem = "Use " + outputDevices[i] + " for Output";
|
||||||
|
Menu.addMenuItem({
|
||||||
|
menuName: "Audio",
|
||||||
|
menuItemName: menuItem,
|
||||||
|
isCheckable: true,
|
||||||
|
isChecked: thisDeviceSelected
|
||||||
|
});
|
||||||
|
if (thisDeviceSelected) {
|
||||||
|
selectedOutputMenu = menuItem;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onDevicechanged() {
|
function onDevicechanged() {
|
||||||
|
|
Loading…
Reference in a new issue