Browse Source

feat: 多遍歌词反复播放问题1.0

TIANYONG 1 năm trước cách đây
mục cha
commit
c279ce2c72
1 tập tin đã thay đổi với 15 bổ sung0 xóa
  1. 15 0
      src/helpers/formateMusic.ts

+ 15 - 0
src/helpers/formateMusic.ts

@@ -1351,6 +1351,21 @@ const customizationXml = (xmlParse: any) => {
 			parent.removeChild(measure);
 			parent.removeChild(measure);
 		}
 		}
 	}
 	}
+
+	/**
+	 * bug: #10289,曲目:1782672015612725196、1788040971888537602
+	 * 妙极客xml,多遍歌词循环的曲目,如果没有repeat标签,需要加上repeat标签
+	 * */
+	if (maxLyricNum > 1) {
+		const hasRepeat = xmlParse.querySelectorAll('repeat').length > 0
+		if (!hasRepeat) {
+			measures.last().innerHTML = measures.last().innerHTML + `
+			<barline location="right">
+				<bar-style>light-heavy</bar-style>
+				<repeat direction="backward" />
+			</barline>`
+		}
+	}
 }
 }
 
 
 // 计算evxml的起始播放时间
 // 计算evxml的起始播放时间