|
@@ -619,9 +619,11 @@ export const xmlAddPartName = (xml: string) => {
|
|
|
if (!xml) return "";
|
|
|
const xmlParse = new DOMParser().parseFromString(xml, "text/xml");
|
|
|
const scoreParts = Array.from(xmlParse.getElementsByTagName("score-part"));
|
|
|
+ // 曲子:1795013313499971585,有两条声轨,声轨1有name,声轨2没有name,需要判断是否都没有name,才把evxmlAddPartName赋值为true
|
|
|
+ state.evxmlAddPartName = scoreParts.every(item => item.getElementsByTagName("part-name").length === 0);
|
|
|
for (const scorePart of scoreParts) {
|
|
|
if (scorePart.getElementsByTagName("part-name").length === 0) {
|
|
|
- state.evxmlAddPartName = true;
|
|
|
+ // state.evxmlAddPartName = true;
|
|
|
const name = scorePart.getAttribute("id") || "";
|
|
|
const newPartName = `<part-name>${name}</part-name>`
|
|
|
// scorePart.prepend(newPartName);
|
|
@@ -1223,8 +1225,10 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
|
|
|
const staffEntries = note.sourceMeasure.verticalMeasureList?.[0]?.staffEntries || [];
|
|
|
//计算第一个小节里面的音符时值是否等于整个小节的时值
|
|
|
staffEntries.forEach((_a: any) => {
|
|
|
- if (_a?.sourceStaffEntry?.voiceEntries?.[0]?.notes?.[0]?.length?.realValue) {
|
|
|
- _firstMeasureRealValue += _a.sourceStaffEntry.voiceEntries[0].notes[0].length.realValue;
|
|
|
+ // 需要过滤掉倚音音符
|
|
|
+ const matchNote = _a?.sourceStaffEntry?.voiceEntries?.length > 1 ? _a?.sourceStaffEntry?.voiceEntries.find((item: any) => !item.isGrace) : _a?.sourceStaffEntry?.voiceEntries?.[0]
|
|
|
+ if (matchNote?.notes?.[0]?.length?.realValue) {
|
|
|
+ _firstMeasureRealValue += matchNote.notes[0].length.realValue;
|
|
|
}
|
|
|
});
|
|
|
if (_firstMeasureRealValue < vRealValue) {
|