Forráskód Böngészése

fix: 速度bug修复

TIANYONG 8 hónapja
szülő
commit
4b72501e4f

+ 2 - 1
src/page-instrument/header-top/index.tsx

@@ -9,7 +9,7 @@ import { Badge, Circle, Popover, Popup, showConfirmDialog, showToast, NoticeBar
 import Speed from "./speed";
 import { evaluatingData, handleStartEvaluat } from "/src/view/evaluating";
 import Settting from "./settting";
-import state, { IPlatform, handleChangeSection, handleResetPlay, handleRessetState, togglePlay, IPlayState, refreshMusicSvg, EnumMusicRenderType, resetSettings, handleGuide } from "/src/state";
+import state, { IPlatform, handleChangeSection, handleResetPlay, handleRessetState, togglePlay, IPlayState, refreshMusicSvg, EnumMusicRenderType, resetSettings, handleGuide, resetCursorPosition } from "/src/state";
 import { getAudioCurrentTime } from "/src/view/audio-list";
 import { followData, toggleFollow } from "/src/view/follow-practice";
 import { api_back } from "/src/helpers/communication";
@@ -83,6 +83,7 @@ export const headTopData = reactive({
       smoothAnimationState.isShow.value = false; // 隐藏旋律线
       state.playIngSpeed = state.originSpeed;
       handleStartEvaluat();
+      resetCursorPosition()
       // 开发模式,把此处打开
       // state.modeType = "evaluating";
       // evaluatingData.rendered = true;

+ 13 - 1
src/page-instrument/header-top/speed/index.tsx

@@ -38,7 +38,19 @@ export default defineComponent({
 				state.speed = Math.floor(speed.value);
 				// handleSetSpeed(speed.value);
 				if (state.playState === 'paused') {
-					const currentItem: any = (state.sectionStatus && state.section.length === 2) ? state.section[0] : state.times[state.activeNoteIndex];
+					let currentItem: any;
+					if (state.section.length === 2 && state.sectionStatus && state.times[state.activeNoteIndex].MeasureNumberXML === state.sectionFirst.MeasureNumberXML) {
+						currentItem = state.section[0]
+					}
+					if (state.section.length === 2 && state.sectionStatus && state.times[state.activeNoteIndex].MeasureNumberXML !== state.sectionFirst.MeasureNumberXML) {
+						currentItem = state.times[state.activeNoteIndex]
+					}
+					// if (state.section.length === 2 && state.sectionStatus && state.times[state.activeNoteIndex].MeasureNumberXML !== state.sectionFirst.MeasureNumberXML) {
+					// 	currentItem = state.times[state.activeNoteIndex]
+					// } else {
+					// 	currentItem = (state.sectionStatus && state.section.length === 2) ? state.section[0] : state.times[state.activeNoteIndex];
+					// }
+					
 					state.basePlayRate = currentItem?.measureSpeed ? state.speed / currentItem.measureSpeed : state.speed / state.originSpeed;
 				}
 			}