color device by host api

This commit is contained in:
wataru 2023-05-10 08:58:44 +09:00
parent 46a5bf7f77
commit 9ea33018cf
3 changed files with 6 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -59,7 +59,10 @@ export const AudioInputRow = (_props: AudioInputRowProps) => {
const hostAPIs = new Set(devices.map(x => { return x.hostAPI }))
const hostAPIOptions = Array.from(hostAPIs).map((x, index) => { return <option value={x} key={index} >{x}</option> })
const filteredDevice = devices.filter(x => { return x.hostAPI == hostApi || hostApi == "" }).map((x, index) => { return <option value={x.index} key={index}>{x.name}</option> })
const filteredDevice = devices.map((x, index) => {
const className = (x.hostAPI == hostApi || hostApi == "") ? "select-option-red" : ""
return <option className={className} value={x.index} key={index}>[{x.hostAPI}]{x.name}</option>
})
return (
@ -83,7 +86,6 @@ export const AudioInputRow = (_props: AudioInputRowProps) => {
}, [hostApi, appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings])
return (
<>
{audioInputRow}

View File

@ -111,7 +111,7 @@ export const AudioOutputRow = (_props: AudioOutputRowProps) => {
// const filteredDevice = devices.filter(x => { return x.hostAPI == hostApi || hostApi == "" }).map((x, index) => { return <option value={x.index} key={index}>{x.name}</option> })
const filteredDevice = devices.map((x, index) => {
const className = (x.hostAPI == hostApi || hostApi == "") ? "select-option-red" : ""
return <option className={className} value={x.index} key={index}>{x.name}</option>
return <option className={className} value={x.index} key={index}>[{x.hostAPI}]{x.name}</option>
})