Browse Source

评测修改

TIANYONG 2 months ago
parent
commit
127605f4c8
1 changed files with 7 additions and 3 deletions
  1. 7 3
      src/page-instrument/evaluat-model/index.tsx

+ 7 - 3
src/page-instrument/evaluat-model/index.tsx

@@ -187,7 +187,7 @@ export default defineComponent({
         const startIndex = state.times.findIndex((n: any) => n.noteId == state.section[0].noteId);
         let endIndex = state.times.findIndex((n: any) => n.noteId == state.section[1].noteId);
         endIndex = endIndex < state.section[1].i ? state.section[1].i : endIndex;
-        if (startIndex >= 1) {
+        if (startIndex > 1) {
           // firstNoteTime应该取预备小节的第一个音符的开始播放的时间
           const idx = startIndex - 1 - state.times[startIndex - 1].si;
           preTime = state.times[idx] ? state.times[idx].time * 1000 : 0;
@@ -205,14 +205,18 @@ export default defineComponent({
       // 阶段评测beatLength需要加上预备小节的持续时长
       actualBeatLength = preTimes.length ? actualBeatLength + preTimes[preTimes.length - 1].relaMeasureLength * 1000 : actualBeatLength;
       // 如果是弱起,并且预备小节是第一节
-      if (state.section.length && state.sectionFirst && state.sectionFirst.measureListIndex == 0) {
+      if (state.section.length && state.sectionFirst && state.sectionFirst.measureListIndex == 0 && !state.isEvxml) {
         actualBeatLength = actualBeatLength < Math.round((state.times[0].fixtime * 1000) / 1) ? Math.round((state.times[0].fixtime * 1000) / 1) : actualBeatLength;
       }
       
-      let firstNoteTime = unitTestIdx >= 1 ? preTime : 0;
+      let firstNoteTime = unitTestIdx > 1 ? preTime : 0;
       let measureIndex = -1;
       let recordMeasure = -1;
 
+      // 如果有mp3节拍器,并且预备小节是第一节,并且从0开始播放,actualBeatLength需要加上mp3节拍器时间
+      if (state.section.length === 2 && firstNoteTime === 0 && state.section[0]?.MeasureNumberXML === state.firstMeasureNumber + 1 && state.times[0].fixtime) {
+        actualBeatLength  = actualBeatLength + Math.round((state.times[0].fixtime * 1000) / 1)
+      }
       for (let index = 0; index < selectTimes.length; index++) {
         const item = selectTimes[index];
         const note = getNoteByMeasuresSlursStart(item);