|
@@ -1469,10 +1469,20 @@ const getMusicInfo = async (res: any) => {
|
|
|
state.isScoreRender = res.data?.isScoreRender
|
|
|
// 是否默认显示总谱
|
|
|
state.defaultScoreRender = res.data?.defaultScoreRender
|
|
|
+ /* 获取声轨列表 */
|
|
|
+ let xmlString = await fetch(res.data.xmlFileUrl).then((response) => response.text());
|
|
|
+ xmlString = xmlAddPartName(xmlString);
|
|
|
+ downloadXmlStr.value = xmlString //给musice-score 赋值xmlString 以免加载2次
|
|
|
+ const tracks = xmlToTracks(xmlString) //获取声轨列表
|
|
|
// 是否显示节拍器 (管乐迷 默认显示节拍器)
|
|
|
//state.isMixBeat = res.data?.isMixBeat
|
|
|
/* 设置partIndex */
|
|
|
let partIndexs = query["part-index"] ? query["part-index"].split(",") : ["-1"] // -1为partIndex没有值的时候
|
|
|
+ // 如果传入的是part-name,需要将part-name转换成part-index
|
|
|
+ if (query["part-name"]) {
|
|
|
+ let nameIdx = tracks.findIndex((item: any) => item == query["part-name"])
|
|
|
+ partIndexs = [nameIdx]
|
|
|
+ }
|
|
|
partIndexs = partIndexs.map((indexStr:string) => {
|
|
|
return parseInt(indexStr)
|
|
|
}).sort((a, b) => a - b);
|
|
@@ -1491,11 +1501,7 @@ const getMusicInfo = async (res: any) => {
|
|
|
// multiTracksSelection 返回为空,默认代表全部分轨
|
|
|
state.canSelectTracks = res.data.multiTracksSelection === "null" || res.data.multiTracksSelection === "" || res.data.multiTracksSelection === null ? [] : res.data.multiTracksSelection?.split(',');
|
|
|
state.canSelectTracks = state.canSelectTracks.map((item: any)=>item.trim())
|
|
|
- /* 获取声轨列表 */
|
|
|
- let xmlString = await fetch(res.data.xmlFileUrl).then((response) => response.text());
|
|
|
- xmlString = xmlAddPartName(xmlString);
|
|
|
- downloadXmlStr.value = xmlString //给musice-score 赋值xmlString 以免加载2次
|
|
|
- const tracks = xmlToTracks(xmlString) //获取声轨列表
|
|
|
+
|
|
|
// 如果是多个分轨合并显示的,需要记录下所选分轨的第一个分轨的名字,渲染计算音符位置的时候需要根据第一个分轨找到对应音符的位置
|
|
|
if (state.combinePartIndexs.length) {
|
|
|
(window as any).DYFirstTrackName = tracks[state.combinePartIndexs[0]] || '';
|