FreeDATA/gui_vue/src/store/audioStore.js

26 lines
856 B
JavaScript
Raw Normal View History

2023-09-05 09:22:00 +00:00
import { defineStore } from 'pinia'
import { ref, computed } from 'vue';
export const useAudioStore = defineStore('audioStore', () => {
var inputDevices = ref([{"id":0, "name": "no input devices"}])
var outputDevices = ref([{"id":0, "name": "no output devices"}])
function getInputDevices() {
var html = "";
for(var key in inputDevices.value) {
html +=`<option value=${inputDevices.value[key]["id"]}>${inputDevices.value[key]["name"]}</option>`;
}
return html
}
function getOutputDevices() {
var html = "";
for(var key in outputDevices.value) {
html +=`<option value="${outputDevices.value[key]["id"]}">${outputDevices.value[key]["name"]}</option>`;
}
return html
}
return { inputDevices, outputDevices, getInputDevices, getOutputDevices };
});