Parcourir la source

feat: 切换声轨修改

TIANYONG il y a 2 mois
Parent
commit
d7a09842f4
1 fichiers modifiés avec 20 ajouts et 13 suppressions
  1. 20 13
      src/view/music-score/index.tsx

+ 20 - 13
src/view/music-score/index.tsx

@@ -77,19 +77,26 @@ export default defineComponent({
 				downloadXmlStr.value = await fetch(state.xmlUrl).then((response) => response.text())
 			}
 			console.time('增删改查xml')
-			if (state.xmlFromStore) {
-				musicData.score = state.isCombineRender ? downloadXmlStr.value : onlyVisible(downloadXmlStr.value, state.partIndex);
-				if (state.gradualTimes) {
-					state.gradual = getGradualLengthByXml(downloadXmlStr.value);
-				}
-			} else {
-				const xmlStr = downloadXmlStr.value;
-				const parseXmlInfo = getCustomInfo(xmlStr, cbType);
-				const xml = formatXML(parseXmlInfo.parsedXML, '', cbType);
-				musicData.score = state.isCombineRender ? xml : onlyVisible(xml, state.partIndex);
-				if (state.gradualTimes) {
-					state.gradual = getGradualLengthByXml(xml);
-				}
+			// if (state.xmlFromStore) {
+			// 	musicData.score = state.isCombineRender ? downloadXmlStr.value : onlyVisible(downloadXmlStr.value, state.partIndex);
+			// 	if (state.gradualTimes) {
+			// 		state.gradual = getGradualLengthByXml(downloadXmlStr.value);
+			// 	}
+			// } else {
+			// 	const xmlStr = downloadXmlStr.value;
+			// 	const parseXmlInfo = getCustomInfo(xmlStr, cbType);
+			// 	const xml = formatXML(parseXmlInfo.parsedXML, '', cbType);
+			// 	musicData.score = state.isCombineRender ? xml : onlyVisible(xml, state.partIndex);
+			// 	if (state.gradualTimes) {
+			// 		state.gradual = getGradualLengthByXml(xml);
+			// 	}
+			// }
+			const xmlStr = downloadXmlStr.value;
+			const parseXmlInfo = getCustomInfo(xmlStr, cbType);
+			const xml = formatXML(parseXmlInfo.parsedXML, '', cbType);
+			musicData.score = state.isCombineRender ? xml : onlyVisible(xml, state.partIndex);
+			if (state.gradualTimes) {
+				state.gradual = getGradualLengthByXml(xml);
 			}
 			console.timeEnd('增删改查xml')
 		};