Browse Source

Merge branch 'feature-tianyong'

TIANYONG 1 year ago
parent
commit
45d214ec07

+ 1 - 0
src/helpers/formateMusic.ts

@@ -904,6 +904,7 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 			usetime += noteLength;
 			relaMeasureLength += noteLength;
 			let relaEndtime = noteLength + relativeTime;
+			// console.log('relaEndtime',noteLength, relativeTime)
 			const fixedKey = note.fixedKey || 0;
 			const svgElement = activeVerticalMeasureList[0]?.vfVoices["1"]?.tickables[si];
 			// console.log(note.sourceMeasure.MeasureNumberXML,note,svgElement, NoteRealValue, measureLength)

+ 1 - 1
src/page-instrument/evaluat-model/evaluat-result/index.module.less

@@ -61,7 +61,7 @@
     position: relative;
     border-radius: 18px;
     width: 361px;
-    height: 238px;
+    height: 256px;
     display: flex;
     flex-direction: column;
     justify-content: space-between;

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

@@ -99,7 +99,9 @@ export default defineComponent({
       for (let index = 0; index < state.times.length; index++) {
         const item = state.times[index];
         const note = getNoteByMeasuresSlursStart(item);
-        const rate = state.speed / state.originSpeed;
+        // #8701 bug: 评测模式,是以曲谱本身的速度进行评测,所以rate取1,不需要转换
+        // const rate = state.speed / state.originSpeed;
+        const rate = 1;
         const difftime = item.difftime;
         const start = difftime + (item.sourceRelativeTime || item.relativeTime);
         const end = difftime + (item.sourceRelaEndtime || item.relaEndtime);
@@ -127,6 +129,7 @@ export default defineComponent({
         }
         // console.log(note.measureOpenIndex, item.measureOpenIndex, note);
         // console.log("skip", skip)
+        // console.log(end,start,rate,noteRate, '评测')
         const data = {
           timeStamp: (start * 1000) / rate,
           duration: ((end * 1000) / rate - (start * 1000) / rate) * noteRate,

+ 1 - 1
src/page-instrument/header-top/index.module.less

@@ -25,7 +25,7 @@
         left: -30px;
         height: 100%;
         width: 50px;
-        background: #fff;
+        background: var(--container-background);
         z-index: 0;
     }
 }

+ 6 - 6
src/page-instrument/view-detail/index.tsx

@@ -31,7 +31,7 @@ import ToggleMusicSheet from "/src/view/plugins/toggleMusicSheet"
 /**
  * 特殊教材分类id
  */
-export const classids = [1, 2, 6, 7, 8, 9, 3, 10, 11, 12, 13, 4, 14, 15, 16, 17, 30, 31, 35, 36, 108];  // 大雅金唐, 竖笛教程, 声部训练展开的分类ID
+export const classids = [1, 2, 6, 7, 8, 9, 3, 10, 11, 12, 13, 4, 14, 15, 16, 17, 30, 31, 35, 36, 46, 108];  // 大雅金唐, 竖笛教程, 声部训练展开的分类ID
 
 const calcCeilFrequency = (frequency: number) => {
   if (frequency) return frequency * 1000 * 2 / 1000;
@@ -162,11 +162,11 @@ export default defineComponent({
 
       // console.log("🚀 ~ state.subjectId:", state.subjectId, state.track as any , state.subjectId)
       // 是否打击乐
-      // state.isPercussion =
-      // 	state.subjectId == 23 ||
-      // 	state.subjectId == 113 ||
-      // 	state.subjectId == 121 ||
-      // 	isRhythmicExercises();
+      state.isPercussion =
+      	state.subjectId == 23 ||
+      	state.subjectId == 113 ||
+      	state.subjectId == 121 ||
+      	isRhythmicExercises();
 
       // 设置是否特殊曲谱, 是特殊曲谱取反(不理解之前的思考逻辑), 使用后台设置的速度
       state.isSpecialBookCategory = !classids.includes(data.musicSheetCategoriesId) 

+ 8 - 4
src/view/evaluating/index.tsx

@@ -194,12 +194,16 @@ export const handlePerformDetection = async () => {
 
 /** 记录小节分数 */
 export const addMeasureScore = (measureScore: any, show = true) => {
+	// #8720 bug修复
+	for(let idx in evaluatingData.evaluatings) {
+		evaluatingData.evaluatings[idx].show = false
+	}
 	evaluatingData.evaluatings[measureScore.measureRenderIndex] = {
 		...measureScore,
 		leve: getLeveByScoreMeasure(measureScore.score),
 		show,
 	};
-	// console.log("🚀 ~ measureScore:", evaluatingData.evaluatings[measureScore.measureRenderIndex])
+	// console.log("🚀 ~ measureScore:", evaluatingData.evaluatings)
 };
 
 const handleScoreResult = (res?: IPostMessage) => {
@@ -281,7 +285,7 @@ export const handleStartBegin = async () => {
 	await api_startRecording();
 
 	// 如果开启了摄像头, 开启录制视频
-	if (state.setting.camera && state.setting.saveToAlbum) {
+	if (state.setting.camera) {
 		console.log("开始录制视频");
 		api_startCapture();
 	}
@@ -300,7 +304,7 @@ const playMusic = async () => {
 	check_currentTime();
 
 	// 如果开启了摄像头, 开启录制视频
-	if (state.setting.camera && state.setting.saveToAlbum) {
+	if (state.setting.camera) {
 		console.log("开始录制视频");
 		api_startCapture();
 	}
@@ -357,7 +361,7 @@ export const handleEndEvaluat = (isComplete = false) => {
 	});
 	evaluatingData.isComplete = isComplete;
 	// 如果开启了摄像头, 结束录制视频
-	if (state.setting.camera && state.setting.saveToAlbum) {
+	if (state.setting.camera) {
 		console.log("结束录制视频");
 		api_endCapture();
 	}

+ 6 - 0
src/view/selection/index.tsx

@@ -209,6 +209,12 @@ export default defineComponent({
 			>
 				{selectData.staves.map((item: any) => {
 					const scoreItem = item.id && evaluatingData.evaluatings[item.measureListIndex];
+					// for(let idx in evaluatingData.evaluatings) {
+					// 	const { show, measureIndex } = evaluatingData.evaluatings[idx]
+					// 	if (show && measureIndex !== item.measureListIndex) {
+					// 		evaluatingData.evaluatings[idx].show = false
+					// 	}
+					// }
 					// 高级模式下,显示节拍线
 					// 不是报告模式
 					// 不是多小节休止符