|
@@ -63,6 +63,15 @@ export const headTopData = reactive({
|
|
|
metronomeData.cursorMode = 1;
|
|
|
}
|
|
|
if (value === "practise") {
|
|
|
+ // 切回当前的时值
|
|
|
+ const isModeChange = modeChangeHandleTimes("play", "music")
|
|
|
+ // 没有切换的时候 不处理下面的
|
|
|
+ if (isModeChange) {
|
|
|
+ try {
|
|
|
+ metronomeData.metro.calculation(state.times);
|
|
|
+ } catch (error) {}
|
|
|
+ console.log("重新之后的times", state.times, state.fixtime);
|
|
|
+ }
|
|
|
// state.playIngSpeed = state.speed
|
|
|
}
|
|
|
if (value === "evaluating") {
|
|
@@ -87,6 +96,17 @@ export const headTopData = reactive({
|
|
|
// state.isSingleLine = true;
|
|
|
// refreshMusicSvg();
|
|
|
// }
|
|
|
+ /* 当前是唱名的模式 */
|
|
|
+ if(state.playSource === "mingSong") {
|
|
|
+ const isModeChange = modeChangeHandleTimes("play","mingSong","play","music")
|
|
|
+ // 没有切换的时候 不处理下面的
|
|
|
+ if (isModeChange) {
|
|
|
+ try {
|
|
|
+ metronomeData.metro.calculation(state.times);
|
|
|
+ } catch (error) {}
|
|
|
+ console.log("重新之后的times", state.times, state.fixtime);
|
|
|
+ }
|
|
|
+ }
|
|
|
// 关闭节奏律动
|
|
|
headTopData.rhythmMode = false
|
|
|
smoothAnimationState.isShow.value = false; // 隐藏旋律线
|
|
@@ -162,11 +182,19 @@ export async function handlerModeChange(oldPlayType: "play" | "sing", oldPlaySou
|
|
|
}
|
|
|
}
|
|
|
// 模式切换之后重新给times赋值
|
|
|
-function modeChangeHandleTimes(oldPlayType: "play" | "sing", oldPlaySource: IPlayState) {
|
|
|
- const playType = state.playType;
|
|
|
- const playSource = state.playSource;
|
|
|
+function modeChangeHandleTimes(oldPlayType: "play" | "sing", oldPlaySource: IPlayState, nowPlayType?:"play" | "sing", nowPlaySource?: IPlayState) {
|
|
|
+ const playType = nowPlayType || state.playType;
|
|
|
+ const playSource = nowPlaySource || state.playSource;
|
|
|
const { notBeatFixtime, xmlMp3BeatFixTime, difftime } = state.times[0];
|
|
|
const { isOpenMetronome, isSingOpenMetronome } = state;
|
|
|
+ // 跟练模式不切换时值 因为演奏加了唱名,所以往跟练模式切换的时候,刷新谱面的时候需要更新时值,这时候调用handleRessetState 会回到练习模式
|
|
|
+ if(state.modeType === "follow") {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ // 当相同时候也不处理
|
|
|
+ if(oldPlayType === playType && oldPlaySource === playSource) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
// 原声向伴奏和伴奏向原声不处理 范唱向伴唱和伴唱向范唱切不处理
|
|
|
if((oldPlaySource==="music"&&playSource==="background")||(oldPlaySource==="background"&&playSource==="music")){
|
|
|
return false
|
|
@@ -387,7 +415,6 @@ export default defineComponent({
|
|
|
let index = 0;
|
|
|
state.music && index++;
|
|
|
state.accompany && index++;
|
|
|
- state.mingSong && index++;
|
|
|
let songIndex = 0;
|
|
|
state.fanSong && songIndex++;
|
|
|
state.banSong && songIndex++;
|