mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
26 lines
856 B
JavaScript
26 lines
856 B
JavaScript
|
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 };
|
||
|
});
|