Prechádzať zdrojové kódy

Merge branch 'feature-tianyong-newVersion' into feature-wxl-newVersion

lex 11 mesiacov pred
rodič
commit
065d0ef77f

+ 8 - 2
src/helpers/formateMusic.ts

@@ -970,17 +970,23 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 			// 	activeVerticalMeasureList = [note.sourceMeasure?.verticalMeasureList?.[0]] || [];
 			// }
 			
+			// 合并展示某些分轨,需要把展示的分轨筛选出来
+			if (state.isCombineRender && note.sourceMeasure.verticalMeasureList.length) {
+				note.sourceMeasure.verticalMeasureList = note.sourceMeasure?.verticalMeasureList.filter((item: any) => state.canSelectTracks.includes(item?.parentStaff?.parentInstrument.Name))
+			}
+
 			activeVerticalMeasureList = [note.sourceMeasure?.verticalMeasureList?.[0]] || [];
-			const currenrtVfVoices = activeVerticalMeasureList[0]?.vfVoices['1'] ? activeVerticalMeasureList[0]?.vfVoices['1'] : activeVerticalMeasureList[0]?.vfVoices['2'] ? activeVerticalMeasureList[0]?.vfVoices['2'] : null;
+			let currenrtVfVoices = activeVerticalMeasureList[0]?.vfVoices['1'] ? activeVerticalMeasureList[0]?.vfVoices['1'] : activeVerticalMeasureList[0]?.vfVoices['2'] ? activeVerticalMeasureList[0]?.vfVoices['2'] : null;
 			/**
 			 * TODO:多分轨合并的小节,音符可能没有id,此时就去其它分轨找
 			 */
 			const vmLength = note.sourceMeasure?.verticalMeasureList?.length
 			let currentVmIndex = 0;
 			let hasSvgElement = currenrtVfVoices?.tickables[staveNoteIndex];
-			while (!hasSvgElement && vmLength > 1 && currentVmIndex <= vmLength - 1) {
+			while (!hasSvgElement && vmLength > 1 && currentVmIndex <= vmLength - 1 && currenrtVfVoices !== null) {
 				currentVmIndex += 1;
 				activeVerticalMeasureList = [note.sourceMeasure?.verticalMeasureList?.[currentVmIndex]] || [];
+				currenrtVfVoices = activeVerticalMeasureList[0]?.vfVoices['1'] ? activeVerticalMeasureList[0]?.vfVoices['1'] : activeVerticalMeasureList[0]?.vfVoices['2'] ? activeVerticalMeasureList[0]?.vfVoices['2'] : null;
 				hasSvgElement = currenrtVfVoices?.tickables[staveNoteIndex];
 			}
 

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

@@ -416,6 +416,7 @@ export default defineComponent({
     });
     /** 模式切换按钮 */
     const toggleBtn = computed(() => {
+      if(state.isCombineRender) return { display: false, disabled: false };
       // 没有音源不显示
       if (state.noMusicSource) return { display: false, disabled: false };
       // 不是演奏模式 影藏
@@ -544,7 +545,7 @@ export default defineComponent({
     const changePlay = (res: any) => {
       // console.log('监听上课页面message',res)
       if (res?.data?.api === "setPlayState") {
-        togglePlay("paused", "courseware");
+        togglePlay("paused", true);
       }
       // 上课页面,按钮方向
       if (res?.data?.api === "imagePos") {

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

@@ -166,8 +166,8 @@ export default defineComponent({
         return;
       }
       detailData.isLoading = false;
-      // 如果后台设置了不显示指法,关闭指法开关
-      if (!state.isShowFingering) {
+      // 如果后台设置了不显示指法,关闭指法开关   如果默认进来是演奏模式 不显示指法开关
+      if (!state.isShowFingering || state.playType === "sing") {
         state.setting.displayFingering = false;
       }
       // api_setEventTracking();

BIN
src/page-instrument/view-evaluat-report/component/share-top/image/videobg.png


+ 1 - 1
src/page-instrument/view-evaluat-report/component/share-top/index.module.less

@@ -221,7 +221,7 @@
 }
 
 .playerBox {
-    width: 537px;
+    width: 536px;
     height: 314px;
     background: #FFF8F8;
     box-shadow: inset 4px -3px 6px 0px #B2E8FF;

+ 6 - 3
src/page-instrument/view-evaluat-report/component/share-top/index.tsx

@@ -200,6 +200,9 @@ export default defineComponent({
 			}
 			const pauseVisualDraw = () => {
 				isPause = true
+        requestAnimationFrame(()=>{
+          canvasCtx.clearRect(0, 0, width, height);
+        })
 				//audioCtx?.suspend()  // 暂停   加了暂停和恢复音频音质发生了变化  所以这里取消了
 				// source?.disconnect()
 				// analyser?.disconnect()
@@ -435,9 +438,9 @@ export default defineComponent({
               {mediaType.value === "audio" ? (
                 <div class={styles.audioBox}>
                   <canvas class={styles.audioVisualizer} id="audioVisualizer"></canvas>
-                  <Vue3Lottie class={styles.audioBga} animationData={audioBga} autoPlay={false} loop={true}></Vue3Lottie>
-                  <Vue3Lottie class={styles.audioBga1} animationData={audioBga1} autoPlay={false} loop={true}></Vue3Lottie>
-                  <Vue3Lottie class={styles.audioBga2} animationData={audioBga2} autoPlay={false} loop={true}></Vue3Lottie>
+                  <Vue3Lottie class={styles.audioBga} animationData={audioBga} autoPlay={true} loop={true}></Vue3Lottie>
+                  <Vue3Lottie class={styles.audioBga1} animationData={audioBga1} autoPlay={true} loop={true}></Vue3Lottie>
+                  <Vue3Lottie class={styles.audioBga2} animationData={audioBga2} autoPlay={true} loop={true}></Vue3Lottie>
                   <audio crossorigin="anonymous" id="audioSrc" src={scoreData.value.videoFilePath} controls="false" preload="metadata" playsinline />
                 </div>
               ) : (

+ 9 - 7
src/state.ts

@@ -779,10 +779,10 @@ export const skipNotePlay = async (itemIndex: number, isStart = false) => {
  * 切换曲谱播放状态
  * @param playState 需要切换的状态 play:播放, paused: 暂停
  */
-export const togglePlay = async (playState: "play" | "paused", sourceType?: string) => {
+export const togglePlay = async (playState: "play" | "paused", isForceCLoseToast?:boolean) => {
   // 如果mp3资源还在加载中,给出提示
   if (!state.isAppPlay && !state.audioDone) {
-    if (sourceType !== 'courseware') showToast('音频资源加载中,请稍后')
+    if (!isForceCLoseToast) showToast('音频资源加载中,请稍后')
     return
   }
   // 播放之前  当为评测模式和不为MIDI时候按  是否禁用节拍器  切换音源
@@ -1293,7 +1293,7 @@ export const handleRessetState = () => {
   if (state.modeType === "evaluating") {
     handleStartEvaluat();
   } else if (state.modeType === "practise") {
-    togglePlay("paused");
+    togglePlay("paused", true);
   } else if (state.modeType === "follow") {
     toggleFollow(false);
   }
@@ -1390,14 +1390,16 @@ function initMusicSource(data: any, tracks: string[], partIndex: number) {
         // 总谱渲染
         state.isCombineRender = true
         state.partListNames = tracks
-        banSongObj = musicSheetAccompanimentList.find((item: any) => {
+        // 总谱演唱模式是 范唱
+        fanSongObj = musicSheetAccompanimentList.find((item: any) => {
           return item.audioPlayType === "SING"
         })
         // 先取scoreAudioFileUrl的值
-        if(banSongObj?.scoreAudioFileUrl){
-          banSongObj.audioFileUrl = banSongObj.scoreAudioFileUrl
-          banSongObj.audioBeatMixUrl = banSongObj.scoreAudioBeatMixUrl
+        if(fanSongObj?.scoreAudioFileUrl){
+          fanSongObj.audioFileUrl = fanSongObj.scoreAudioFileUrl
+          fanSongObj.audioBeatMixUrl = fanSongObj.scoreAudioBeatMixUrl
         }
+        // 总谱演奏模式是 伴奏
         accompanyObj = musicSheetAccompanimentList.find((item: any) => {
           return item.audioPlayType === "PLAY"
         })