wip:support m1 mac 1
This commit is contained in:
parent
568e06ed2f
commit
d77739707a
@ -20,7 +20,6 @@
|
||||
"F0DetectorEnable": false
|
||||
},
|
||||
"speakerSetting": {
|
||||
"showSpeakerF0": false,
|
||||
"srcIdEnable": true,
|
||||
"editSpeakerIdMappingEnable": true,
|
||||
"f0FactorEnable": false,
|
||||
|
@ -20,7 +20,6 @@
|
||||
"F0DetectorEnable": true
|
||||
},
|
||||
"speakerSetting": {
|
||||
"showSpeakerF0": true,
|
||||
"srcIdEnable": true,
|
||||
"editSpeakerIdMappingEnable": false,
|
||||
"f0FactorEnable": true,
|
||||
|
@ -20,7 +20,6 @@
|
||||
"F0DetectorEnable": true
|
||||
},
|
||||
"speakerSetting": {
|
||||
"showSpeakerF0": false,
|
||||
"srcIdEnable": false,
|
||||
"editSpeakerIdMappingEnable": false,
|
||||
"f0FactorEnable": false,
|
||||
|
@ -20,7 +20,6 @@
|
||||
"F0DetectorEnable": true
|
||||
},
|
||||
"speakerSetting": {
|
||||
"showSpeakerF0": false,
|
||||
"srcIdEnable": false,
|
||||
"editSpeakerIdMappingEnable": false,
|
||||
"f0FactorEnable": false,
|
||||
|
@ -26,7 +26,6 @@ export type AppGuiDemoSetting = {
|
||||
"F0DetectorEnable": boolean
|
||||
},
|
||||
"speakerSetting": {
|
||||
"showSpeakerF0": boolean
|
||||
"srcIdEnable": boolean
|
||||
"editSpeakerIdMappingEnable": boolean
|
||||
"f0FactorEnable": boolean
|
||||
@ -81,7 +80,6 @@ const InitialAppGuiDemoSetting: AppGuiDemoSetting = {
|
||||
"F0DetectorEnable": false
|
||||
},
|
||||
"speakerSetting": {
|
||||
"showSpeakerF0": false,
|
||||
"srcIdEnable": false,
|
||||
"editSpeakerIdMappingEnable": false,
|
||||
"f0FactorEnable": false,
|
||||
|
@ -6,12 +6,13 @@ export const SrcIdRow = () => {
|
||||
const appState = useAppState()
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
const speakerSetting = appGuiSettingState.appGuiSetting.front.speakerSetting
|
||||
const clientId = appGuiSettingState.appGuiSetting.id
|
||||
|
||||
const srcIdRow = useMemo(() => {
|
||||
if (!speakerSetting.srcIdEnable) {
|
||||
return <></>
|
||||
}
|
||||
if (speakerSetting.showSpeakerF0) {
|
||||
if (clientId != "MMVCv13") {
|
||||
return <></>
|
||||
}
|
||||
return (
|
||||
@ -40,7 +41,7 @@ export const SrcIdRow = () => {
|
||||
if (!speakerSetting.srcIdEnable) {
|
||||
return <></>
|
||||
}
|
||||
if (!speakerSetting.showSpeakerF0) {
|
||||
if (clientId != "MMVCv15") {
|
||||
return <></>
|
||||
}
|
||||
const selected = appState.clientSetting.clientSetting.correspondences?.find(x => {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import React, { useMemo } from "react"
|
||||
import React, { useMemo, useEffect } from "react"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
|
||||
@ -36,5 +36,23 @@ export const F0FactorRow = () => {
|
||||
)
|
||||
}, [appState.serverSetting.serverSetting.f0Factor, appState.serverSetting.serverSetting.srcId, appState.serverSetting.serverSetting.dstId, appState.clientSetting.clientSetting.correspondences, appState.serverSetting.updateServerSettings])
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (!speakerSetting.f0FactorEnable) {
|
||||
return
|
||||
}
|
||||
|
||||
const src = appState.clientSetting.clientSetting.correspondences?.find(x => {
|
||||
return x.sid == appState.serverSetting.serverSetting.srcId
|
||||
})
|
||||
const dst = appState.clientSetting.clientSetting.correspondences?.find(x => {
|
||||
return x.sid == appState.serverSetting.serverSetting.dstId
|
||||
})
|
||||
const recommendedF0Factor = dst && src ? dst.correspondence / src.correspondence : 0
|
||||
|
||||
appState.serverSetting.updateServerSettings({ ...appState.serverSetting.serverSetting, f0Factor: recommendedF0Factor })
|
||||
}, [appState.serverSetting.serverSetting.srcId, appState.serverSetting.serverSetting.dstId])
|
||||
|
||||
return f0FactorRow
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user