Переглянути джерело

评测使用开始时间累加

skyblued 2 роки тому
батько
коміт
f230b26d2c
1 змінених файлів з 3 додано та 1 видалено
  1. 3 1
      src/subpages/colexiu/buttons/evaluating.tsx

+ 3 - 1
src/subpages/colexiu/buttons/evaluating.tsx

@@ -72,6 +72,7 @@ const formatTimes = () => {
   }
   let measureIndex = -1
   let recordMeasure = -1
+  let timeStamp = 0
   for (let index = 0; index < times.length; index++) {
     const item = times[index]
     const note = getNoteByMeasuresSlursStart(item)
@@ -106,7 +107,7 @@ const formatTimes = () => {
     }
     // console.log(note.measureOpenIndex , measureIndex, note.noteElement.sourceMeasure.measureListIndex)
     const data = {
-      timeStamp: (start * 1000) / rate,
+      timeStamp: timeStamp, // (start * 1000) / rate
       duration: ((end * 1000) / rate - (start * 1000) / rate) * noteRate,
       frequency: formatPitch(item.noteElement?.pitch?.frequency),
       nextFrequency: formatPitch(item.noteElement?.pitch?.nextFrequency),
@@ -119,6 +120,7 @@ const formatTimes = () => {
       denominator: note.noteElement?.Length.denominator,
       isOrnament: !!note?.voiceEntry?.ornamentContainer,
     }
+    timeStamp += data.duration
     datas.push(data)
   }
   return datas