Browse Source

Merge branch 'feature-tianyong-newVersion' into ktyq-online-new

TIANYONG 6 months ago
parent
commit
0aeee2c384
3 changed files with 6 additions and 3 deletions
  1. 3 0
      src/helpers/formateMusic.ts
  2. 2 0
      src/state.ts
  3. 1 3
      src/view/plugins/move-music-score/index.tsx

+ 3 - 0
src/helpers/formateMusic.ts

@@ -1653,6 +1653,9 @@ const analyzeEvxml = (xmlParse: any, xmlUrl?: string) => {
 		const hasTimeGap = state.xmlHasTimeGap = xmlParse.getElementsByTagName("timegap").length > 0;
 		const hasTimes = xmlParse.getElementsByTagName("times").length > 0;
 		if (timeGaps && timeGaps.length && !firstNoteBeginTime) {
+			// 有timegap的曲子,需要找到是从哪一小节开始循环的,默认是从第一节开始循环
+			// const startRepeat = Array.from(xmlParse.getElementsByTagName("repeat") || []).filter((item: any) => item?.getAttribute('direction') === 'forward')
+			// state.timegapRepeatMeasureIndex = startRepeat ? 2 : 1;
 			for (const timeGap of timeGaps) {
 				const num: any = timeGap?.getAttribute('num'), den: any = timeGap?.getAttribute('den');
 				const startTime = num ? 60 / state.originSpeed * num * 4/den : 0;

+ 2 - 0
src/state.ts

@@ -445,6 +445,8 @@ const state = reactive({
   xmlHasTimes: false,  
   /** evxml的曲子是否有timeGap */
   xmlHasTimeGap: false,
+  /** 有timeGap的曲子,是从哪个小节开始循环的,默认从第一小节开始循环 */
+  timegapRepeatMeasureIndex: 1,
   /** 指法信息 */
   fingeringInfo: {} as IFingering,
   /** 滚动容器的ID */

+ 1 - 3
src/view/plugins/move-music-score/index.tsx

@@ -541,10 +541,8 @@ export const renderForMoveData = () => {
 							}
 						}
 					}
-					// index = targetIndex + 1
-					// item.id = `text${index}`
 					index = targetIndex
-					item.id = `text${targetIndex}`
+					item.id = moveData.modelList[targetIndex].id
 				}
 				// console.log(66666666,index)
 				if (index > -1) {