|
@@ -362,7 +362,7 @@ export const isRepeatWord = (text: string): boolean => {
|
|
|
return false;
|
|
|
};
|
|
|
|
|
|
-export const onlyVisible = (xml: string, partIndex: number): string => {
|
|
|
+export const onlyVisible = (xml: string, partIndex: number, resourceType?: string): string => {
|
|
|
if (!xml) return "";
|
|
|
// console.log('原始xml')
|
|
|
const detailId = state.examSongId + "";
|
|
@@ -500,6 +500,17 @@ export const onlyVisible = (xml: string, partIndex: number): string => {
|
|
|
|
|
|
// 最后一个小节的结束线元素不在最后 调整
|
|
|
if (part && part.getAttribute("id") === id) {
|
|
|
+ if (!resourceType) {
|
|
|
+ const backups = Array.from(part.getElementsByTagName('backup')) || []
|
|
|
+ for (let backup of backups) {
|
|
|
+ // @ts-ignore
|
|
|
+ if (backup && backup?.getElementsByTagName('duration')?.length) {
|
|
|
+ state.isSingleMutliTrack = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ state.isSingleMutliTrack = part.getElementsByTagName('backup').length > 0 ? true : false;
|
|
|
+ }
|
|
|
const barlines = part.getElementsByTagName("barline");
|
|
|
const lastParent = barlines[barlines.length - 1]?.parentElement;
|
|
|
if (lastParent?.lastElementChild?.tagName !== "barline") {
|
|
@@ -1514,8 +1525,9 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
|
|
|
// console.log(note.sourceMeasure.MeasureNumberXML, note.sourceMeasure.verticalSourceStaffEntryContainers.length)
|
|
|
// console.log('👀看看endtime', nodeDetail.duration, relaEndtime, fixtime, i)
|
|
|
// console.log('音符时间',nodeDetail.i,nodeDetail.time,nodeDetail.endtime)
|
|
|
+
|
|
|
tickables = tickables.filter((tickable: any) => tickable.attrs?.type !== "GhostNote")
|
|
|
- let maxNum = (state.isCombineRender && note.maxNoteNum) ? note.maxNoteNum : tickables.length;
|
|
|
+ let maxNum = (state.isCombineRender && note.maxNoteNum) || state.isSingleMutliTrack ? note.maxNoteNum : tickables.length;
|
|
|
// 妙极客的曲子,一个休止小节内可能有多个休止符,此时maxNum是0,需要针对这种情况作处理
|
|
|
if (note.isRestFlag && maxNum === 0) {
|
|
|
maxNum = note.maxNoteNum;
|