Bläddra i källkod

Merge branch 'feature-tianyong' into klx-online

TIANYONG 4 månader sedan
förälder
incheckning
b807c459c9

+ 2 - 2
src/helpers/formateMusic.ts

@@ -1412,8 +1412,8 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 				trackIndex: note.trackIndex, // 当前的音符属于第几条分轨
 				isStaccato: note.voiceEntry.isStaccato(),
 				isRestFlag: note.isRestFlag,
-				noteId: note.NoteToGraphicalNoteObjectId,
-				// noteId: note.NoteToGraphicalNoteObjectId || `restNote${note.sourceMeasure.MeasureNumberXML}`,
+				// noteId: note.NoteToGraphicalNoteObjectId,
+				noteId: note.NoteToGraphicalNoteObjectId === undefined ? `restNote${note.sourceMeasure.MeasureNumberXML}` : note.NoteToGraphicalNoteObjectId,
 				measureListIndex: note.sourceMeasure.measureListIndex,
 				MeasureNumberXML: note.sourceMeasure.MeasureNumberXML, // 当前的小节数,(从1开始)
 				_noteLength: _noteLength,

+ 3 - 1
src/helpers/midiPlay.tsx

@@ -97,11 +97,13 @@ export const cloudToggleState = async (type: "play" | "paused") => {
     if (state.isSelectMeasureMode) {
       audioData.progress = state.midiSectionStart
     }
+    console.log('midi速度',state.originSpeed,state.speed)
     await api_cloudPlay({
       songID: state.examSongId,
       startTime: audioData.progress * 1000,
       originalSpeed: state.originSpeed, // midi初始速度
-      speed: state.modeType === "evaluating" ? state.originSpeed : state.speed,
+      // speed: state.modeType === "evaluating" ? state.originSpeed : state.speed,
+      speed: state.speed,
       hertz: 440, //SettingState.sett.hertz,
     })
     // startCapture()

+ 2 - 0
src/page-instrument/custom-plugins/guide-driver/index.tsx

@@ -1337,6 +1337,8 @@ export const EvaluatingReportDriver = defineComponent({
             doneBtnText: "完成",
             showButtons: ["next", "previous"],
             onPopoverRender: (popover: PopoverDOM, options: { config: Config; state: State }) => {
+              options.config.stageRadius = 8;
+              options.config.stagePadding = 5;
               try {
                 const rect = options.state.activeElement?.getBoundingClientRect();
                 popover.wrapper.style.marginLeft = ((rect?.width || 0) / 2) * -1 + 4 + "px";

+ 4 - 2
src/page-instrument/evaluat-model/index.tsx

@@ -224,7 +224,8 @@ export default defineComponent({
       if (preTimes.length) {
         for (let index = preTimes.length-1; index >= 0; index--) {
           const item = preTimes[index]
-          const note = getNoteByMeasuresSlursStart(item)
+          // const note = getNoteByMeasuresSlursStart(item)
+          const note = item
           if (note.formatLyricsEntries.contains('Play') || note.formatLyricsEntries.contains('Play...')) {
             preLyricsContent = 'Play'
             break
@@ -238,7 +239,8 @@ export default defineComponent({
       }
       for (let index = 0; index < selectTimes.length; index++) {
         const item = selectTimes[index];
-        const note = getNoteByMeasuresSlursStart(item);
+        // const note = getNoteByMeasuresSlursStart(item);
+        const note = item
         // #8701 bug: 评测模式,是以曲谱本身的速度进行评测,所以rate取1,不需要转换
         // const rate = state.speed / state.originSpeed;
         const rate = state.basePlayRate * state.originAudioPlayRate; // 播放倍率

+ 5 - 6
src/page-instrument/view-evaluat-report/index.tsx

@@ -365,13 +365,12 @@ export default defineComponent({
       console.log("🚀 ~ state.times:", allNote.value);
       // @ts-ignore
       const startMeasureNum = detailData.musicalNotesPlayStats?.[0]?.measureRenderIndex, endMeasureNum = detailData.musicalNotesPlayStats?.last()?.measureRenderIndex;
-      allNote.value = allNote.value.filter((item: any) => (item.MeasureNumberXML >= startMeasureNum+1 && item.MeasureNumberXML <= endMeasureNum+1))
       // 从0开始的曲子,MeasureNumberXML也是从0开始,需要兼容处理
-      // if (state.firstMeasureNumber === 0) {
-      //   allNote.value = allNote.value.filter((item: any) => (item.MeasureNumberXML >= startMeasureNum && item.MeasureNumberXML <= endMeasureNum))
-      // } else {
-      //   allNote.value = allNote.value.filter((item: any) => (item.MeasureNumberXML >= startMeasureNum+1 && item.MeasureNumberXML <= endMeasureNum+1))
-      // }
+      if (state.firstMeasureNumber === 0) {
+        allNote.value = allNote.value.filter((item: any) => (item.MeasureNumberXML >= startMeasureNum && item.MeasureNumberXML <= endMeasureNum))
+      } else {
+        allNote.value = allNote.value.filter((item: any) => (item.MeasureNumberXML >= startMeasureNum+1 && item.MeasureNumberXML <= endMeasureNum+1))
+      }
       // @ts-ignore
       const beams = Array.from(new Set(document.getElementsByClassName("vf-beam")));
       beams.forEach((item: any) => {

+ 2 - 1
src/state.ts

@@ -696,7 +696,8 @@ export const togglePlay = async (playState: "play" | "paused", isForceCLoseToast
     }
     skipNotePlay(state.activeNoteIndex, false);
     await api_cloudChangeSpeed({
-      speed: state.modeType === "evaluating" ? state.originSpeed : state.speed,
+      // speed: state.modeType === "evaluating" ? state.originSpeed : state.speed,
+      speed: state.speed,
       originalSpeed: state.originSpeed,
       songID: state.examSongId,
     });

+ 2 - 2
src/view/evaluating/index.tsx

@@ -462,7 +462,7 @@ export const handleStartBegin = async (preTimes?: number) => {
 	// 如果是midi音频评测,需要调用cloudPlay
 	if (state.isAppPlay) {
 		await api_cloudChangeSpeed({
-			speed: state.originSpeed,
+			speed: state.speed,
 			originalSpeed: state.originSpeed,
 			songID: state.examSongId,
 		});
@@ -620,7 +620,7 @@ export const handleCancelEvaluat = (cancelType?: string) => {
   if (state.setting.camera) {
     console.log("结束录制视频2");
     api_endCapture();
-    api_closeCamera();
+    // api_closeCamera();
   }
 };
 

+ 3 - 3
src/view/selection/index.module.less

@@ -83,9 +83,9 @@
 
 .scoreItem {
     position: absolute;
-    left: 80%;
-    top: -120%;
-    transform: translateX(-50%);
+    right: 10px;
+    top: -45px;
+    // transform: translateX(-50%);   
     font-size: 16px;
     font-family: "Roboto", sans-serif;
     font-weight: bold;