移除升降调预设
parent
3c02e3dddc
commit
c8f6153831
|
@ -1,6 +1,6 @@
|
|||
### 新增
|
||||
|
||||
- 新增音效设置(实验性功能),支持10段均衡器设置、内置的一些环境混响音效、音调升降调节、3D立体环绕音效
|
||||
- 新增音效设置(实验性功能),支持10段均衡器设置、内置的一些环境混响音效、音调升降调节、3D立体环绕音效(据测试升降调可能会导致意外的CPU占用,调整过升降调后若想完全关闭需将其重置为1.00x并重启软件)
|
||||
- 播放速率设置面板新增是否音调补偿设置,在调整播放速率后,可以选择是否启用音调补偿,默认启用
|
||||
|
||||
### 修复
|
||||
|
|
|
@ -94,8 +94,8 @@ const modules = {
|
|||
save_sound_effect_eq_preset: 'save_sound_effect_eq_preset',
|
||||
get_sound_effect_convolution_preset: 'get_sound_effect_convolution_preset',
|
||||
save_sound_effect_convolution_preset: 'save_sound_effect_convolution_preset',
|
||||
get_sound_effect_pitch_shifter_preset: 'get_sound_effect_pitch_shifter_preset',
|
||||
save_sound_effect_pitch_shifter_preset: 'save_sound_effect_pitch_shifter_preset',
|
||||
// get_sound_effect_pitch_shifter_preset: 'get_sound_effect_pitch_shifter_preset',
|
||||
// save_sound_effect_pitch_shifter_preset: 'save_sound_effect_pitch_shifter_preset',
|
||||
get_hot_key: 'get_hot_key',
|
||||
|
||||
import_user_api: 'import_user_api',
|
||||
|
|
|
@ -21,10 +21,10 @@ declare namespace LX {
|
|||
mainGain: number
|
||||
sendGain: number
|
||||
}
|
||||
interface PitchShifterPreset {
|
||||
id: string
|
||||
name: string
|
||||
playbackRate: number
|
||||
}
|
||||
// interface PitchShifterPreset {
|
||||
// id: string
|
||||
// name: string
|
||||
// playbackRate: number
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,10 +18,10 @@ export default () => {
|
|||
getStore(STORE_NAMES.SOUND_EFFECT).set('convolutionPreset', params)
|
||||
})
|
||||
|
||||
mainHandle<LX.SoundEffect.PitchShifterPreset[]>(WIN_MAIN_RENDERER_EVENT_NAME.get_sound_effect_pitch_shifter_preset, async() => {
|
||||
return getStore(STORE_NAMES.SOUND_EFFECT).get('pitchShifterPreset') as LX.SoundEffect.PitchShifterPreset[] | null ?? []
|
||||
})
|
||||
mainOn<LX.SoundEffect.PitchShifterPreset[]>(WIN_MAIN_RENDERER_EVENT_NAME.save_sound_effect_pitch_shifter_preset, ({ params }) => {
|
||||
getStore(STORE_NAMES.SOUND_EFFECT).set('pitchShifterPreset', params)
|
||||
})
|
||||
// mainHandle<LX.SoundEffect.PitchShifterPreset[]>(WIN_MAIN_RENDERER_EVENT_NAME.get_sound_effect_pitch_shifter_preset, async() => {
|
||||
// return getStore(STORE_NAMES.SOUND_EFFECT).get('pitchShifterPreset') as LX.SoundEffect.PitchShifterPreset[] | null ?? []
|
||||
// })
|
||||
// mainOn<LX.SoundEffect.PitchShifterPreset[]>(WIN_MAIN_RENDERER_EVENT_NAME.save_sound_effect_pitch_shifter_preset, ({ params }) => {
|
||||
// getStore(STORE_NAMES.SOUND_EFFECT).set('pitchShifterPreset', params)
|
||||
// })
|
||||
}
|
||||
|
|
|
@ -10,20 +10,20 @@
|
|||
<base-slider-bar :class="$style.slider" :value="playbackRate * 100" :min="50" :max="150" @change="handleUpdatePlaybackRate" />
|
||||
</div>
|
||||
</div>
|
||||
<div :class="$style.saveList">
|
||||
<!-- <div :class="$style.saveList">
|
||||
<base-btn v-for="num in semitones" :key="num" min @click="handleSetSemitones(num)">{{ $t(`player__sound_effect_pitch_shifter_preset_semitones`, { num: num > 0 ? `+${num}` : num }) }}</base-btn>
|
||||
<base-btn v-for="item in userPresetList" :key="item.id" min @click="handleSetPreset(item.playbackRate)" @contextmenu="handleRemovePreset(item.id)">{{ item.name }}</base-btn>
|
||||
<AddPitchShifterPresetBtn v-if="userPresetList.length < 31" />
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted } from '@common/utils/vueTools'
|
||||
import { computed } from '@common/utils/vueTools'
|
||||
import { appSetting, updateSetting } from '@renderer/store/setting'
|
||||
import AddPitchShifterPresetBtn from './AddPitchShifterPresetBtn.vue'
|
||||
import { getUserPitchShifterPresetList, removeUserPitchShifterPreset } from '@renderer/store/soundEffect'
|
||||
import { semitones } from '@renderer/plugins/player'
|
||||
// import AddPitchShifterPresetBtn from './AddPitchShifterPresetBtn.vue'
|
||||
// import { getUserPitchShifterPresetList, removeUserPitchShifterPreset } from '@renderer/store/soundEffect'
|
||||
// import { semitones } from '@renderer/plugins/player'
|
||||
|
||||
// const setting = reactive({
|
||||
// enabled: false,
|
||||
|
@ -38,10 +38,10 @@ const handleSetPreset = (value) => {
|
|||
updateSetting({ 'player.soundEffect.pitchShifter.playbackRate': value })
|
||||
}
|
||||
|
||||
const handleSetSemitones = (value) => {
|
||||
// https://zpl.fi/pitch-shifting-in-web-audio-api/
|
||||
handleSetPreset(2 ** (value / 12))
|
||||
}
|
||||
// const handleSetSemitones = (value) => {
|
||||
// // https://zpl.fi/pitch-shifting-in-web-audio-api/
|
||||
// handleSetPreset(2 ** (value / 12))
|
||||
// }
|
||||
|
||||
const handleUpdatePlaybackRate = (value) => {
|
||||
value = parseFloat((Math.round(value) / 100).toFixed(2))
|
||||
|
@ -49,17 +49,17 @@ const handleUpdatePlaybackRate = (value) => {
|
|||
}
|
||||
|
||||
|
||||
const userPresetList = ref([])
|
||||
// const userPresetList = ref([])
|
||||
|
||||
const handleRemovePreset = id => {
|
||||
removeUserPitchShifterPreset(id)
|
||||
}
|
||||
// const handleRemovePreset = id => {
|
||||
// removeUserPitchShifterPreset(id)
|
||||
// }
|
||||
|
||||
onMounted(() => {
|
||||
getUserPitchShifterPresetList().then(list => {
|
||||
userPresetList.value = list
|
||||
})
|
||||
})
|
||||
// onMounted(() => {
|
||||
// getUserPitchShifterPresetList().then(list => {
|
||||
// userPresetList.value = list
|
||||
// })
|
||||
// })
|
||||
|
||||
|
||||
</script>
|
||||
|
|
|
@ -11,10 +11,10 @@
|
|||
<div :class="['scroll', $style.row]">
|
||||
<AudioConvolution />
|
||||
<PitchShifter />
|
||||
<AudioPanner />
|
||||
</div>
|
||||
<div :class="['scroll', $style.row]">
|
||||
<BiquadFilter />
|
||||
<AudioPanner />
|
||||
</div>
|
||||
</div>
|
||||
<!-- </main> -->
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
import { reactive, toRaw } from '@common/utils/vueTools'
|
||||
import { getUserSoundEffectConvolutionPresetList, getUserSoundEffectEQPresetList, getUserSoundEffectPitchShifterPresetList, saveUserSoundEffectConvolutionPresetList, saveUserSoundEffectEQPresetList, saveUserSoundEffectPitchShifterPresetList } from '@renderer/utils/ipc'
|
||||
import {
|
||||
getUserSoundEffectConvolutionPresetList,
|
||||
getUserSoundEffectEQPresetList,
|
||||
// getUserSoundEffectPitchShifterPresetList,
|
||||
saveUserSoundEffectConvolutionPresetList,
|
||||
saveUserSoundEffectEQPresetList,
|
||||
// saveUserSoundEffectPitchShifterPresetList,
|
||||
} from '@renderer/utils/ipc'
|
||||
|
||||
let userEqPresetList: LX.SoundEffect.EQPreset[] | null = null
|
||||
|
||||
|
@ -56,28 +63,28 @@ export const removeUserConvolutionPreset = async(id: string) => {
|
|||
}
|
||||
|
||||
|
||||
let userPitchShifterPresetList: LX.SoundEffect.PitchShifterPreset[] | null = null
|
||||
export const getUserPitchShifterPresetList = async() => {
|
||||
if (userEqPresetList == null) {
|
||||
userPitchShifterPresetList = reactive(await getUserSoundEffectPitchShifterPresetList())
|
||||
}
|
||||
return userPitchShifterPresetList
|
||||
}
|
||||
export const saveUserPitchShifterPreset = async(preset: LX.SoundEffect.PitchShifterPreset) => {
|
||||
if (userPitchShifterPresetList == null) {
|
||||
userPitchShifterPresetList = reactive(await getUserSoundEffectPitchShifterPresetList())
|
||||
}
|
||||
const target = userPitchShifterPresetList.find(p => p.id == preset.id)
|
||||
if (target) Object.assign(target, preset)
|
||||
else userPitchShifterPresetList.push(preset)
|
||||
saveUserSoundEffectPitchShifterPresetList(toRaw(userPitchShifterPresetList))
|
||||
}
|
||||
export const removeUserPitchShifterPreset = async(id: string) => {
|
||||
if (userPitchShifterPresetList == null) {
|
||||
userPitchShifterPresetList = reactive(await getUserSoundEffectPitchShifterPresetList())
|
||||
}
|
||||
const index = userPitchShifterPresetList.findIndex(p => p.id == id)
|
||||
if (index < 0) return
|
||||
userPitchShifterPresetList.splice(index, 1)
|
||||
saveUserSoundEffectPitchShifterPresetList(toRaw(userPitchShifterPresetList))
|
||||
}
|
||||
// let userPitchShifterPresetList: LX.SoundEffect.PitchShifterPreset[] | null = null
|
||||
// export const getUserPitchShifterPresetList = async() => {
|
||||
// if (userEqPresetList == null) {
|
||||
// userPitchShifterPresetList = reactive(await getUserSoundEffectPitchShifterPresetList())
|
||||
// }
|
||||
// return userPitchShifterPresetList
|
||||
// }
|
||||
// export const saveUserPitchShifterPreset = async(preset: LX.SoundEffect.PitchShifterPreset) => {
|
||||
// if (userPitchShifterPresetList == null) {
|
||||
// userPitchShifterPresetList = reactive(await getUserSoundEffectPitchShifterPresetList())
|
||||
// }
|
||||
// const target = userPitchShifterPresetList.find(p => p.id == preset.id)
|
||||
// if (target) Object.assign(target, preset)
|
||||
// else userPitchShifterPresetList.push(preset)
|
||||
// saveUserSoundEffectPitchShifterPresetList(toRaw(userPitchShifterPresetList))
|
||||
// }
|
||||
// export const removeUserPitchShifterPreset = async(id: string) => {
|
||||
// if (userPitchShifterPresetList == null) {
|
||||
// userPitchShifterPresetList = reactive(await getUserSoundEffectPitchShifterPresetList())
|
||||
// }
|
||||
// const index = userPitchShifterPresetList.findIndex(p => p.id == id)
|
||||
// if (index < 0) return
|
||||
// userPitchShifterPresetList.splice(index, 1)
|
||||
// saveUserSoundEffectPitchShifterPresetList(toRaw(userPitchShifterPresetList))
|
||||
// }
|
||||
|
|
|
@ -307,13 +307,13 @@ export const saveUserSoundEffectConvolutionPresetList = (list: LX.SoundEffect.Co
|
|||
rendererSend<LX.SoundEffect.ConvolutionPreset[]>(WIN_MAIN_RENDERER_EVENT_NAME.save_sound_effect_convolution_preset, list)
|
||||
}
|
||||
|
||||
export const getUserSoundEffectPitchShifterPresetList = async() => {
|
||||
return await rendererInvoke<LX.SoundEffect.PitchShifterPreset[]>(WIN_MAIN_RENDERER_EVENT_NAME.get_sound_effect_pitch_shifter_preset)
|
||||
}
|
||||
// export const getUserSoundEffectPitchShifterPresetList = async() => {
|
||||
// return await rendererInvoke<LX.SoundEffect.PitchShifterPreset[]>(WIN_MAIN_RENDERER_EVENT_NAME.get_sound_effect_pitch_shifter_preset)
|
||||
// }
|
||||
|
||||
export const saveUserSoundEffectPitchShifterPresetList = (list: LX.SoundEffect.PitchShifterPreset[]) => {
|
||||
rendererSend<LX.SoundEffect.PitchShifterPreset[]>(WIN_MAIN_RENDERER_EVENT_NAME.save_sound_effect_pitch_shifter_preset, list)
|
||||
}
|
||||
// export const saveUserSoundEffectPitchShifterPresetList = (list: LX.SoundEffect.PitchShifterPreset[]) => {
|
||||
// rendererSend<LX.SoundEffect.PitchShifterPreset[]>(WIN_MAIN_RENDERER_EVENT_NAME.save_sound_effect_pitch_shifter_preset, list)
|
||||
// }
|
||||
|
||||
export const allHotKeys = markRaw({
|
||||
local: [
|
||||
|
|
Loading…
Reference in New Issue