diff --git a/src/braille/internal/braille.cpp b/src/braille/internal/braille.cpp index 624a037e4110d..1b1fd87fb7f49 100644 --- a/src/braille/internal/braille.cpp +++ b/src/braille/internal/braille.cpp @@ -1448,8 +1448,8 @@ void Braille::brailleMeasureLyrics(BrailleEngravingItemList* beiz, Measure* meas ChordRest* cr = seg->cr(staffCount * VOICES + voice); if (cr && !cr->lyrics().empty()) { for (Lyrics* l : cr->lyrics()) { - int no = l->no(); - lyrics[no].addLyricsItem(l); + int verse = l->verse(); + lyrics[verse].addLyricsItem(l); } } } diff --git a/src/engraving/dom/chordrest.cpp b/src/engraving/dom/chordrest.cpp index fd9b33c85e18e..19dcf82d07dc1 100644 --- a/src/engraving/dom/chordrest.cpp +++ b/src/engraving/dom/chordrest.cpp @@ -1136,20 +1136,20 @@ void ChordRest::setMelismaEnd(bool v) // lyrics //--------------------------------------------------------- -Lyrics* ChordRest::lyrics(int no) const +Lyrics* ChordRest::lyrics(int verse) const { for (Lyrics* l : m_lyrics) { - if (l->no() == no) { + if (l->verse() == verse) { return l; } } return 0; } -Lyrics* ChordRest::lyrics(int no, PlacementV p) const +Lyrics* ChordRest::lyrics(int verse, PlacementV p) const { for (Lyrics* l : m_lyrics) { - if (l->placement() == p && l->no() == no) { + if (l->placement() == p && l->verse() == verse) { return l; } } @@ -1167,8 +1167,8 @@ int ChordRest::lastVerse(PlacementV p) const int lastVerse = -1; for (Lyrics* l : m_lyrics) { - if (l->placement() == p && l->no() > lastVerse) { - lastVerse = l->no(); + if (l->placement() == p && l->verse() > lastVerse) { + lastVerse = l->verse(); } } diff --git a/src/engraving/dom/lyrics.cpp b/src/engraving/dom/lyrics.cpp index ce8529863209f..6e600c21894f1 100644 --- a/src/engraving/dom/lyrics.cpp +++ b/src/engraving/dom/lyrics.cpp @@ -59,7 +59,7 @@ Lyrics::Lyrics(ChordRest* parent) { m_separator = 0; initElementStyle(&lyricsElementStyle); - m_no = 0; + m_verse = 0; m_ticks = Fraction(0, 1); m_syllabic = LyricsSyllabic::SINGLE; } @@ -67,7 +67,7 @@ Lyrics::Lyrics(ChordRest* parent) Lyrics::Lyrics(const Lyrics& l) : TextBase(l) { - m_no = l.m_no; + m_verse = l.m_verse; m_ticks = l.m_ticks; m_syllabic = l.m_syllabic; m_separator = 0; @@ -82,7 +82,7 @@ Lyrics::~Lyrics() TranslatableString Lyrics::subtypeUserName() const { - return TranslatableString("engraving", "Verse %1").arg(m_no + 1); + return TranslatableString("engraving", "Verse %1").arg(m_verse + 1); } //--------------------------------------------------------- @@ -141,11 +141,11 @@ bool Lyrics::isMelisma() const const ChordRest* trackNextCR = s ? s->nextChordRest(track) : nullptr; if (trackNextCR) { if (lyrTrack != track && lyrVoiceNextCR - && !lyrVoiceNextCR->lyrics(m_no, placement()) && lyrVoiceNextCR->tick() < trackNextCR->tick()) { + && !lyrVoiceNextCR->lyrics(m_verse, placement()) && lyrVoiceNextCR->tick() < trackNextCR->tick()) { // There is an intermediary note in a different voice, this is a melisma return true; } - if (trackNextCR->lyrics(m_no, placement())) { + if (trackNextCR->lyrics(m_verse, placement())) { // Next note has lyrics, not a melisma just a dash return false; } @@ -378,7 +378,7 @@ void Lyrics::removeFromScore() continue; } PartialLyricsLine* partialLine = toPartialLyricsLine(sp.value); - if (partialLine->isEndMelisma() || partialLine->no() != no() || partialLine->placement() != placement()) { + if (partialLine->isEndMelisma() || partialLine->verse() != verse() || partialLine->placement() != placement()) { continue; } score()->undoRemoveElement(partialLine); @@ -409,7 +409,7 @@ PropertyValue Lyrics::getProperty(Pid propertyId) const case Pid::LYRIC_TICKS: return m_ticks; case Pid::VERSE: - return m_no; + return m_verse; case Pid::AVOID_BARLINES: return m_avoidBarlines; default: @@ -470,7 +470,7 @@ bool Lyrics::setProperty(Pid propertyId, const PropertyValue& v) l->setNeedRemoveInvalidSegments(); } bool followTextStyle = getProperty(Pid::TEXT_STYLE) == propertyDefault(Pid::TEXT_STYLE); - m_no = v.toInt(); + m_verse = v.toInt(); if (followTextStyle) { setProperty(Pid::TEXT_STYLE, propertyDefault(Pid::TEXT_STYLE)); } @@ -564,11 +564,11 @@ void Score::forAllLyrics(std::function f) void Lyrics::undoChangeProperty(Pid id, const PropertyValue& v, PropertyFlags ps) { - if (id == Pid::VERSE && no() != v.toInt()) { + if (id == Pid::VERSE && verse() != v.toInt()) { for (Lyrics* l : chordRest()->lyrics()) { - if (l->no() == v.toInt()) { + if (l->verse() == v.toInt()) { // verse already exists, swap - l->TextBase::undoChangeProperty(id, no(), ps); + l->TextBase::undoChangeProperty(id, verse(), ps); PlacementV p = l->placement(); l->TextBase::undoChangeProperty(Pid::PLACEMENT, int(placement()), ps); TextBase::undoChangeProperty(Pid::PLACEMENT, int(p), ps); diff --git a/src/engraving/dom/lyrics.h b/src/engraving/dom/lyrics.h index cade832ab33b6..8c232bc179d9a 100644 --- a/src/engraving/dom/lyrics.h +++ b/src/engraving/dom/lyrics.h @@ -60,11 +60,11 @@ class Lyrics final : public TextBase void scanElements(void* data, void (* func)(void*, EngravingItem*), bool all=true) override; - int subtype() const override { return m_no; } + int subtype() const override { return m_verse; } TranslatableString subtypeUserName() const override; - void setNo(int n) { m_no = n; } - int no() const { return m_no; } - bool isEven() const { return m_no % 2; } + void setVerse(int n) { m_verse = n; } + int verse() const { return m_verse; } + bool isEven() const { return m_verse % 2; } void setSyllabic(LyricsSyllabic s) { m_syllabic = s; } LyricsSyllabic syllabic() const { return m_syllabic; } void add(EngravingItem*) override; @@ -105,7 +105,6 @@ class Lyrics final : public TextBase void setAvoidBarlines(bool v) { m_avoidBarlines = v; } protected: - int m_no = 0; // row index private: @@ -115,6 +114,7 @@ class Lyrics final : public TextBase void undoChangeProperty(Pid id, const PropertyValue&, PropertyFlags ps) override; + int m_verse = 0; // row index Fraction m_ticks; // if > 0 then draw an underline to tick() + _ticks (melisma) LyricsSyllabic m_syllabic = LyricsSyllabic::SINGLE; LyricsLine* m_separator = nullptr; @@ -177,7 +177,7 @@ class LyricsLineSegment : public LineSegment virtual double baseLineShift() const; - virtual int no() const { return lyrics()->no(); } + virtual int verse() const { return lyrics()->verse(); } virtual bool lyricsPlaceAbove() const { return lyrics()->placeAbove(); } virtual bool lyricsAddToSkyline() const { return lyrics()->addToSkyline(); } virtual double lineSpacing() const { return lyrics()->lineSpacing(); } @@ -206,7 +206,6 @@ class PartialLyricsLine final : public LyricsLine OBJECT_ALLOCATOR(engraving, PartialLyricsLine) DECLARE_CLASSOF(ElementType::PARTIAL_LYRICSLINE) - M_PROPERTY2(int, no, setNo, 0) public: PartialLyricsLine(EngravingItem* parent); PartialLyricsLine(const PartialLyricsLine&); @@ -218,6 +217,9 @@ class PartialLyricsLine final : public LyricsLine void setIsEndMelisma(bool val) { m_isEndMelisma = val; } bool isEndMelisma() const override { return m_isEndMelisma; } + void setVerse(int val) { m_verse = val; } + int verse() const { return m_verse; } + PropertyValue getProperty(Pid propertyId) const override; bool setProperty(Pid propertyId, const PropertyValue&) override; PropertyValue propertyDefault(Pid propertyId) const override; @@ -231,6 +233,7 @@ class PartialLyricsLine final : public LyricsLine private: bool m_isEndMelisma = false; + int m_verse = 0; }; class PartialLyricsLineSegment final : public LyricsLineSegment @@ -246,7 +249,7 @@ class PartialLyricsLineSegment final : public LyricsLineSegment PartialLyricsLine* lyricsLine() const { return toPartialLyricsLine(spanner()); } Lyrics* lyrics() const override { return nullptr; } - int no() const override { return lyricsLine()->no(); } + int verse() const override { return lyricsLine()->verse(); } double lineSpacing() const override; bool lyricsPlaceAbove() const override { return lyricsLine()->placeAbove(); }// Delegate? bool lyricsAddToSkyline() const override { return lyricsLine()->addToSkyline(); } diff --git a/src/engraving/dom/lyricsline.cpp b/src/engraving/dom/lyricsline.cpp index 1abd659150450..aec8b7dc3fbda 100644 --- a/src/engraving/dom/lyricsline.cpp +++ b/src/engraving/dom/lyricsline.cpp @@ -195,7 +195,7 @@ PropertyValue PartialLyricsLine::getProperty(Pid propertyId) const { switch (propertyId) { case Pid::VERSE: - return _no; + return m_verse; default: return LyricsLine::getProperty(propertyId); } @@ -205,7 +205,7 @@ bool PartialLyricsLine::setProperty(Pid propertyId, const PropertyValue& val) { switch (propertyId) { case Pid::VERSE: - setNo(val.toInt()); + setVerse(val.toInt()); break; default: return LyricsLine::setProperty(propertyId, val); @@ -302,7 +302,7 @@ Lyrics* PartialLyricsLine::findLyricsInPreviousRepeatSeg() const const std::vector measures = findPreviousRepeatMeasures(findStartMeasure()); for (const Measure* measure : measures) { - Lyrics* prev = lastLyricsInMeasure(measure->last(SegmentType::ChordRest), staffIdx(), no(), placement()); + Lyrics* prev = lastLyricsInMeasure(measure->last(SegmentType::ChordRest), staffIdx(), verse(), placement()); if (!prev) { continue; diff --git a/src/engraving/dom/navigate.cpp b/src/engraving/dom/navigate.cpp index bd18eebc2cac1..52b21d77e9887 100644 --- a/src/engraving/dom/navigate.cpp +++ b/src/engraving/dom/navigate.cpp @@ -1232,7 +1232,7 @@ Lyrics* prevLyrics(const Lyrics* lyrics) const track_idx_t etrack = strack + VOICES; for (track_idx_t track = strack; track < etrack; ++track) { EngravingItem* el = seg->element(track); - Lyrics* prevLyrics = el && el->isChord() ? toChordRest(el)->lyrics(lyrics->no(), lyrics->placement()) : nullptr; + Lyrics* prevLyrics = el && el->isChord() ? toChordRest(el)->lyrics(lyrics->verse(), lyrics->placement()) : nullptr; if (prevLyrics) { return prevLyrics; } @@ -1253,7 +1253,7 @@ Lyrics* nextLyrics(const Lyrics* lyrics) const track_idx_t etrack = strack + VOICES; for (track_idx_t track = strack; track < etrack; ++track) { EngravingItem* el = nextSegment->element(track); - Lyrics* nextLyrics = el && el->isChord() ? toChordRest(el)->lyrics(lyrics->no(), lyrics->placement()) : nullptr; + Lyrics* nextLyrics = el && el->isChord() ? toChordRest(el)->lyrics(lyrics->verse(), lyrics->placement()) : nullptr; if (nextLyrics) { return nextLyrics; } diff --git a/src/engraving/dom/score.cpp b/src/engraving/dom/score.cpp index 264b877c15a89..c66aeb3694a36 100644 --- a/src/engraving/dom/score.cpp +++ b/src/engraving/dom/score.cpp @@ -5529,7 +5529,7 @@ void Score::changeSelectedElementsVoice(voice_idx_t voice) // Move lyrics for (Lyrics* lyric : chord->lyrics()) { - if (!lyric || dstChord->lyrics(lyric->no(), lyric->placement())) { + if (!lyric || dstChord->lyrics(lyric->verse(), lyric->placement())) { continue; } diff --git a/src/engraving/editing/cmd.cpp b/src/engraving/editing/cmd.cpp index 0bc49d67716c4..9a7119ea4fef2 100644 --- a/src/engraving/editing/cmd.cpp +++ b/src/engraving/editing/cmd.cpp @@ -3419,7 +3419,7 @@ void Score::cmdMoveRest(Rest* rest, DirectionV dir) void Score::cmdMoveLyrics(Lyrics* lyrics, DirectionV dir) { - int verse = lyrics->no() + (dir == DirectionV::UP ? -1 : 1); + int verse = lyrics->verse() + (dir == DirectionV::UP ? -1 : 1); if (verse < 0) { return; } diff --git a/src/engraving/editing/edit.cpp b/src/engraving/editing/edit.cpp index fed7622eb2842..6fb7db43aa46a 100644 --- a/src/engraving/editing/edit.cpp +++ b/src/engraving/editing/edit.cpp @@ -935,7 +935,7 @@ TextBase* Score::addText(TextStyleType type, EngravingItem* destinationElement) } const PartialLyricsLine* line = toPartialLyricsLine(spanner.value); - no = std::max(no, line->no() + 1); + no = std::max(no, line->verse() + 1); } // Also check how many partial lines there are diff --git a/src/engraving/rendering/score/horizontalspacing.cpp b/src/engraving/rendering/score/horizontalspacing.cpp index 1f09fb38dd56f..69fb7b3a1354f 100644 --- a/src/engraving/rendering/score/horizontalspacing.cpp +++ b/src/engraving/rendering/score/horizontalspacing.cpp @@ -1773,7 +1773,7 @@ KerningType HorizontalSpacing::computeLyricsKerningType(const Lyrics* lyrics1, c { if (item2->isLyrics()) { const Lyrics* lyrics2 = toLyrics(item2); - if (lyrics1->no() == lyrics2->no()) { + if (lyrics1->verse() == lyrics2->verse()) { return KerningType::NON_KERNING; } } diff --git a/src/engraving/rendering/score/lyricslayout.cpp b/src/engraving/rendering/score/lyricslayout.cpp index 7e76d8866fd98..d770350ac12eb 100644 --- a/src/engraving/rendering/score/lyricslayout.cpp +++ b/src/engraving/rendering/score/lyricslayout.cpp @@ -206,7 +206,7 @@ void LyricsLayout::layout(LyricsLine* item, LayoutContext& ctx) } else { // dash(es) item->setNextLyrics(searchNextLyrics(item->lyrics()->segment(), item->staffIdx(), - item->lyrics()->no(), + item->lyrics()->verse(), item->lyrics()->placement() )); item->setTrack2(item->nextLyrics() ? item->nextLyrics()->track() : item->track()); @@ -306,7 +306,7 @@ void LyricsLayout::layoutDashes(LyricsLineSegment* item) Lyrics* endLyrics = nullptr; if (endCR) { for (Lyrics* lyr : endCR->lyrics()) { - if (lyr->no() == item->no()) { + if (lyr->verse() == item->verse()) { endLyrics = lyr; break; } @@ -409,7 +409,7 @@ Lyrics* LyricsLayout::findNextLyrics(const ChordRest* endChordRest, int verseNum } ChordRest* nextCR = toChordRest(segment->elementAt(endChordRest->track())); for (Lyrics* lyr : nextCR->lyrics()) { - if (lyr->no() == verseNumber) { + if (lyr->verse() == verseNumber) { return lyr; } } @@ -588,7 +588,7 @@ void LyricsLayout::collectLyricsVerses(staff_idx_t staffIdx, System* system, Lyr continue; } for (Lyrics* lyrics : toChordRest(element)->lyrics()) { - int verse = lyrics->no(); + int verse = lyrics->verse(); if (lyrics->placeAbove()) { lyricsVersesAbove[verse].addLyrics(lyrics); } else { @@ -605,7 +605,7 @@ void LyricsLayout::collectLyricsVerses(staff_idx_t staffIdx, System* system, Lyr continue; } LyricsLineSegment* lyricsLineSegment = toLyricsLineSegment(spannerSegment); - int verse = lyricsLineSegment->no(); + int verse = lyricsLineSegment->verse(); if (lyricsLineSegment->lyricsPlaceAbove()) { lyricsVersesAbove[verse].addLine(lyricsLineSegment); } else { @@ -876,7 +876,7 @@ void LyricsLayout::adjustLyricsLineYOffset(LyricsLineSegment* item, const Lyrics // Partial melisma or dashes if (lyricsLine->isPartialLyricsLine()) { - Lyrics* nextLyrics = findNextLyrics(endChordRest, item->no()); + Lyrics* nextLyrics = findNextLyrics(endChordRest, item->verse()); item->ryoffset() = nextLyrics ? nextLyrics->offset().y() : item->offset().y(); return; } @@ -887,7 +887,7 @@ void LyricsLayout::adjustLyricsLineYOffset(LyricsLineSegment* item, const Lyrics } if (melisma || !endLyrics) { - Lyrics* nextLyrics = findNextLyrics(endChordRest, item->no()); + Lyrics* nextLyrics = findNextLyrics(endChordRest, item->verse()); item->ryoffset() = nextLyrics ? nextLyrics->offset().y() : startLyrics->offset().y(); return; } diff --git a/src/engraving/rw/read114/read114.cpp b/src/engraving/rw/read114/read114.cpp index 1e403fc92ae31..cd0822a730509 100644 --- a/src/engraving/rw/read114/read114.cpp +++ b/src/engraving/rw/read114/read114.cpp @@ -1856,7 +1856,7 @@ static void readMeasure(Measure* m, int staffIdx, XmlReader& e, ReadContext& ctx while (e.readNextStartElement()) { const AsciiStringView t(e.name()); if (t == "no") { - l->setNo(e.readInt()); + l->setVerse(e.readInt()); if (l->isEven()) { l->initTextStyleType(TextStyleType::LYRICS_EVEN); } diff --git a/src/engraving/rw/read400/tread.cpp b/src/engraving/rw/read400/tread.cpp index cd85778c04946..a5d1da51ed223 100644 --- a/src/engraving/rw/read400/tread.cpp +++ b/src/engraving/rw/read400/tread.cpp @@ -2948,7 +2948,7 @@ bool TRead::readProperties(Lyrics* l, XmlReader& e, ReadContext& ctx) const AsciiStringView tag(e.name()); if (tag == "no") { - l->setNo(e.readInt()); + l->setVerse(e.readInt()); if (l->isEven()) { l->initTextStyleType(TextStyleType::LYRICS_EVEN); } diff --git a/src/engraving/rw/read410/tread.cpp b/src/engraving/rw/read410/tread.cpp index 2b66057474f73..8efa2a1b67422 100644 --- a/src/engraving/rw/read410/tread.cpp +++ b/src/engraving/rw/read410/tread.cpp @@ -3183,7 +3183,7 @@ bool TRead::readProperties(Lyrics* l, XmlReader& e, ReadContext& ctx) const AsciiStringView tag(e.name()); if (tag == "no") { - l->setNo(e.readInt()); + l->setVerse(e.readInt()); if (l->isEven()) { l->initTextStyleType(TextStyleType::LYRICS_EVEN); } diff --git a/src/engraving/rw/read460/tread.cpp b/src/engraving/rw/read460/tread.cpp index 2d7fef028aae0..44aba0408aa8b 100644 --- a/src/engraving/rw/read460/tread.cpp +++ b/src/engraving/rw/read460/tread.cpp @@ -3162,7 +3162,7 @@ bool TRead::readProperties(Lyrics* l, XmlReader& e, ReadContext& ctx) const AsciiStringView tag(e.name()); if (tag == "no") { - l->setNo(e.readInt()); + l->setVerse(e.readInt()); if (l->isEven()) { l->initTextStyleType(TextStyleType::LYRICS_EVEN); } diff --git a/src/importexport/capella/internal/capella.cpp b/src/importexport/capella/internal/capella.cpp index e3c65b642aa97..343574a308ef6 100644 --- a/src/importexport/capella/internal/capella.cpp +++ b/src/importexport/capella/internal/capella.cpp @@ -813,7 +813,7 @@ static Fraction readCapVoice(Score* score, CapVoice* cvoice, int staffIdx, const if (v.hyphen) { l->setSyllabic(LyricsSyllabic::BEGIN); } - l->setNo(v.num); + l->setVerse(v.num); l->initTextStyleType(l->isEven() ? TextStyleType::LYRICS_EVEN : TextStyleType::LYRICS_ODD, /*preserveDifferent*/ true); chord->add(l); } diff --git a/src/importexport/mei/internal/meiexporter.cpp b/src/importexport/mei/internal/meiexporter.cpp index ca78bf0b8f0cf..929ffa03c8bae 100644 --- a/src/importexport/mei/internal/meiexporter.cpp +++ b/src/importexport/mei/internal/meiexporter.cpp @@ -1552,7 +1552,7 @@ bool MeiExporter::writeVerse(const Lyrics* lyrics) } libmei::Verse meiVerse; - meiVerse.SetN(String::number(lyrics->no() + 1).toStdString()); + meiVerse.SetN(String::number(lyrics->verse() + 1).toStdString()); if (lyrics->propertyFlags(engraving::Pid::PLACEMENT) == engraving::PropertyFlags::UNSTYLED) { meiVerse.SetPlace(Convert::placeToMEI(lyrics->placement())); } diff --git a/src/importexport/mei/internal/meiimporter.cpp b/src/importexport/mei/internal/meiimporter.cpp index f1af0b7d0abad..99a8d46ae5f36 100644 --- a/src/importexport/mei/internal/meiimporter.cpp +++ b/src/importexport/mei/internal/meiimporter.cpp @@ -2236,7 +2236,7 @@ bool MeiImporter::readVerse(pugi::xml_node verseNode, Chord* chord) Convert::textFromMEI(syllable, textBlocks); lyrics->setXmlText(syllable); - lyrics->setNo(no); + lyrics->setVerse(no); lyrics->initTextStyleType(lyrics->isEven() ? TextStyleType::LYRICS_EVEN : TextStyleType::LYRICS_ODD, /*preserveDifferent*/ true); lyrics->setTrack(chord->track()); chord->add(lyrics); diff --git a/src/importexport/musedata/internal/musedata.cpp b/src/importexport/musedata/internal/musedata.cpp index 9b4fabbc1c5f3..12288ccbcf04d 100644 --- a/src/importexport/musedata/internal/musedata.cpp +++ b/src/importexport/musedata/internal/musedata.cpp @@ -438,7 +438,7 @@ void MuseData::readNote(Part* part, QStringView s) for (const QStringView w : sl) { Lyrics* l = Factory::createLyrics(chord); l->setPlainText(diacritical(w)); - l->setNo(no++); + l->setVerse(no++); l->setTrack(gstaff * VOICES); chord->add(l); } diff --git a/src/importexport/musicxml/internal/musicxml/export/exportmusicxml.cpp b/src/importexport/musicxml/internal/musicxml/export/exportmusicxml.cpp index d4ee6bd546d64..2187bb1af329a 100644 --- a/src/importexport/musicxml/internal/musicxml/export/exportmusicxml.cpp +++ b/src/importexport/musicxml/internal/musicxml/export/exportmusicxml.cpp @@ -6000,7 +6000,7 @@ void ExportMusicXml::lyrics(const std::vector& ll, const track_idx_t tr for (const Lyrics* l : ll) { if (l && !l->xmlText().isEmpty()) { if ((l)->track() == trk) { - String lyricXml = String(u"lyric number=\"%1\"").arg((l)->no() + 1); + String lyricXml = String(u"lyric number=\"%1\"").arg((l)->verse() + 1); lyricXml += color2xml(l); lyricXml += positioningAttributes(l); if (!l->visible()) { diff --git a/src/importexport/musicxml/internal/musicxml/import/importmusicxmlpass2.cpp b/src/importexport/musicxml/internal/musicxml/import/importmusicxmlpass2.cpp index a9549b005258f..d80b4b5c22a42 100644 --- a/src/importexport/musicxml/internal/musicxml/import/importmusicxmlpass2.cpp +++ b/src/importexport/musicxml/internal/musicxml/import/importmusicxmlpass2.cpp @@ -208,7 +208,8 @@ static Fraction lastChordTicks(const Segment* s, const Fraction& tick, const tra // called when lyric (with or without "extend") or note with "extend type=stop" is found // // note that no == -1 means all lyrics in this *track* -void MusicXmlLyricsExtend::setExtend(const int no, const track_idx_t track, const Fraction& tick, const Lyrics* prevAddedLyrics = nullptr) +void MusicXmlLyricsExtend::setExtend(const int verse, const track_idx_t track, const Fraction& tick, + const Lyrics* prevAddedLyrics = nullptr) { std::vector list; for (Lyrics* l : m_lyrics) { @@ -217,8 +218,8 @@ void MusicXmlLyricsExtend::setExtend(const int no, const track_idx_t track, cons const ChordRest* par = static_cast(el); // no = -1: stop all extends on this track // otherwise, stop all extends in the stave with the same no and placement - if ((no == -1 && par->track() == track) - || (l->no() == no && track2staff(par->track()) == track2staff(track) && prevAddedLyrics + if ((verse == -1 && par->track() == track) + || (l->verse() == verse && track2staff(par->track()) == track2staff(track) && prevAddedLyrics && prevAddedLyrics->placement() == l->placement())) { Fraction lct = lastChordTicks(l->segment(), tick, track); if (lct > Fraction(0, 1)) { @@ -919,7 +920,7 @@ static void addLyric(MusicXmlLogger* logger, const XmlStreamReader* const xmlrea .arg(MAX_LYRICS), xmlreader); delete l; } else { - l->setNo(lyricNo); + l->setVerse(lyricNo); l->initTextStyleType(l->isEven() ? TextStyleType::LYRICS_EVEN : TextStyleType::LYRICS_ODD, /*preserveDifferent*/ true); cr->add(l); extendedLyrics.setExtend(lyricNo, cr->track(), cr->tick(), l); diff --git a/src/importexport/musicxml/internal/musicxml/import/importmusicxmlpass2.h b/src/importexport/musicxml/internal/musicxml/import/importmusicxmlpass2.h index da7138c10af96..66d2e6df3e895 100644 --- a/src/importexport/musicxml/internal/musicxml/import/importmusicxmlpass2.h +++ b/src/importexport/musicxml/internal/musicxml/import/importmusicxmlpass2.h @@ -192,7 +192,7 @@ class MusicXmlLyricsExtend MusicXmlLyricsExtend() {} void init(); void addLyric(engraving::Lyrics* const lyric); - void setExtend(const int no, const engraving::track_idx_t track, const engraving::Fraction& tick, + void setExtend(const int verse, const engraving::track_idx_t track, const engraving::Fraction& tick, const engraving::Lyrics* prevAddedLyrics); private: diff --git a/src/importexport/ove/internal/importove.cpp b/src/importexport/ove/internal/importove.cpp index 9a5325be4db09..7c134854f32a8 100644 --- a/src/importexport/ove/internal/importove.cpp +++ b/src/importexport/ove/internal/importove.cpp @@ -2074,7 +2074,7 @@ void OveToMScore::convertLyrics(Measure* measure, int part, int staff, int track int tick = m_mtt->getTick(measure->no(), oveLyric->getTick()); Lyrics* lyric = Factory::createLyrics(m_score->dummy()->chord()); - lyric->setNo(oveLyric->getVerse()); + lyric->setVerse(oveLyric->getVerse()); lyric->setPlainText(oveLyric->getLyric()); lyric->setTrack(track); Segment* segment = measure->getSegment(SegmentType::ChordRest, Fraction::fromTicks(tick)); diff --git a/src/notation/internal/notationinteraction.cpp b/src/notation/internal/notationinteraction.cpp index 72d81c1f98248..2671fb0ea3642 100644 --- a/src/notation/internal/notationinteraction.cpp +++ b/src/notation/internal/notationinteraction.cpp @@ -6481,7 +6481,7 @@ void NotationInteraction::navigateToLyrics(bool back, bool moveOnly, bool end) mu::engraving::Lyrics* lyrics = toLyrics(m_editData.element); track_idx_t track = lyrics->track(); mu::engraving::Segment* segment = lyrics->segment(); - int verse = lyrics->no(); + int verse = lyrics->verse(); mu::engraving::PlacementV placement = lyrics->placement(); mu::engraving::PropertyFlags pFlags = lyrics->propertyFlags(mu::engraving::Pid::PLACEMENT); mu::engraving::FontStyle fStyle = lyrics->fontStyle(); @@ -6557,7 +6557,7 @@ void NotationInteraction::navigateToLyrics(bool back, bool moveOnly, bool end) nextLyrics->setTrack(track); cr = toChordRest(nextSegment->element(track)); nextLyrics->setParent(cr); - nextLyrics->setNo(verse); + nextLyrics->setVerse(verse); nextLyrics->setTextStyleType(styleType); nextLyrics->setPlacement(placement); nextLyrics->setPropertyFlags(mu::engraving::Pid::PLACEMENT, pFlags); @@ -6640,7 +6640,7 @@ void NotationInteraction::navigateToNextSyllable() track_idx_t track = lyrics->track(); track_idx_t toLyricTrack = track; Segment* segment = lyrics->segment(); - int verse = lyrics->no(); + int verse = lyrics->verse(); PlacementV placement = lyrics->placement(); PropertyFlags pFlags = lyrics->propertyFlags(Pid::PLACEMENT); FontStyle fStyle = lyrics->fontStyle(); @@ -6721,7 +6721,7 @@ void NotationInteraction::navigateToNextSyllable() // No from lyrics - create incoming partial dash PartialLyricsLine* dash = Factory::createPartialLyricsLine(score()->dummy()); dash->setIsEndMelisma(false); - dash->setNo(verse); + dash->setVerse(verse); dash->setPlacement(placement); dash->setTick(initialCR->tick()); dash->setTicks(Fraction(0, 1)); @@ -6735,7 +6735,7 @@ void NotationInteraction::navigateToNextSyllable() Lyrics* toLyrics = Factory::createLyrics(initialCR); toLyrics->setTrack(track); toLyrics->setParent(initialCR); - toLyrics->setNo(verse); + toLyrics->setVerse(verse); toLyrics->setTextStyleType(styleType); toLyrics->setPlacement(placement); toLyrics->setPropertyFlags(Pid::PLACEMENT, pFlags); @@ -6810,7 +6810,7 @@ void NotationInteraction::navigateToNextSyllable() continue; } PartialLyricsLine* partialLine = toPartialLyricsLine(sp.value); - if (partialLine->isEndMelisma() || partialLine->no() != lyrics->no() || partialLine->placement() != lyrics->placement()) { + if (partialLine->isEndMelisma() || partialLine->verse() != lyrics->verse() || partialLine->placement() != lyrics->placement()) { continue; } prevPartialLyricsLine = partialLine; @@ -6826,7 +6826,7 @@ void NotationInteraction::navigateToNextSyllable() toLyrics->setTrack(track); toLyrics->setParent(toLyricsChord); - toLyrics->setNo(verse); + toLyrics->setVerse(verse); toLyrics->setTextStyleType(styleType); toLyrics->setPlacement(placement); @@ -6863,7 +6863,7 @@ void NotationInteraction::navigateToNextSyllable() // No from lyrics - create incoming partial dash PartialLyricsLine* dash = Factory::createPartialLyricsLine(score()->dummy()); dash->setIsEndMelisma(false); - dash->setNo(verse); + dash->setVerse(verse); dash->setPlacement(lyrics->placement()); dash->setTick(initialCR->tick()); dash->setTicks(hasPrecedingRepeat ? Fraction(0, 1) : initialCR->ticks()); @@ -6901,7 +6901,7 @@ void NotationInteraction::navigateToLyricsVerse(MoveDirection direction) mu::engraving::Lyrics* lyrics = toLyrics(m_editData.element); engraving::track_idx_t track = lyrics->track(); ChordRest* cr = lyrics->chordRest(); - int verse = lyrics->no(); + int verse = lyrics->verse(); mu::engraving::PlacementV placement = lyrics->placement(); mu::engraving::PropertyFlags pFlags = lyrics->propertyFlags(mu::engraving::Pid::PLACEMENT); mu::engraving::FontStyle fStyle = lyrics->fontStyle(); @@ -6927,7 +6927,7 @@ void NotationInteraction::navigateToLyricsVerse(MoveDirection direction) lyrics = Factory::createLyrics(cr); lyrics->setTrack(track); lyrics->setParent(cr); - lyrics->setNo(verse); + lyrics->setVerse(verse); lyrics->setTextStyleType(styleType); lyrics->setPlacement(placement); lyrics->setPropertyFlags(mu::engraving::Pid::PLACEMENT, pFlags); @@ -7510,7 +7510,7 @@ void NotationInteraction::addMelisma() const bool hasPrecedingRepeat = initialCR->hasPrecedingJumpItem(); track_idx_t track = lyrics->track(); Segment* segment = lyrics->segment(); - int verse = lyrics->no(); + int verse = lyrics->verse(); PlacementV placement = lyrics->placement(); PropertyFlags pFlags = lyrics->propertyFlags(Pid::PLACEMENT); FontStyle fStyle = lyrics->fontStyle(); @@ -7550,7 +7550,7 @@ void NotationInteraction::addMelisma() continue; } PartialLyricsLine* lyricsLine = toPartialLyricsLine(spanner.value); - if (lyricsLine->no() != verse || lyricsLine->placement() != placement || !lyricsLine->isEndMelisma()) { + if (lyricsLine->verse() != verse || lyricsLine->placement() != placement || !lyricsLine->isEndMelisma()) { continue; } @@ -7602,7 +7602,7 @@ void NotationInteraction::addMelisma() // No from lyrics - create incoming partial melisma PartialLyricsLine* melisma = Factory::createPartialLyricsLine(score()->dummy()); melisma->setIsEndMelisma(true); - melisma->setNo(verse); + melisma->setVerse(verse); melisma->setPlacement(lyrics->placement()); melisma->setTick(initialCR->tick()); melisma->setTicks(initialCR->ticks()); @@ -7649,7 +7649,7 @@ void NotationInteraction::addMelisma() toLyrics->setTrack(track); toLyrics->setParent(nextCR); - toLyrics->setNo(verse); + toLyrics->setVerse(verse); const TextStyleType styleType(toLyrics->isEven() ? TextStyleType::LYRICS_EVEN : TextStyleType::LYRICS_ODD); toLyrics->setTextStyleType(styleType); @@ -7685,7 +7685,7 @@ void NotationInteraction::addMelisma() // No from lyrics - create incoming partial melisma PartialLyricsLine* melisma = Factory::createPartialLyricsLine(score()->dummy()); melisma->setIsEndMelisma(true); - melisma->setNo(verse); + melisma->setVerse(verse); melisma->setPlacement(lyrics->placement()); melisma->setTick(initialCR->tick()); melisma->setTicks(initialCR->ticks()); @@ -7727,7 +7727,7 @@ void NotationInteraction::addLyricsVerse() endEditText(); score()->startCmd(TranslatableString("undoableAction", "Add lyrics verse")); - int newVerse = oldLyrics->no() + 1; + int newVerse = oldLyrics->verse() + 1; mu::engraving::Lyrics* lyrics = Factory::createLyrics(oldLyrics->chordRest()); lyrics->setTrack(oldLyrics->track()); @@ -7735,7 +7735,7 @@ void NotationInteraction::addLyricsVerse() lyrics->setPlacement(oldLyrics->placement()); lyrics->setPropertyFlags(mu::engraving::Pid::PLACEMENT, oldLyrics->propertyFlags(mu::engraving::Pid::PLACEMENT)); - lyrics->setNo(newVerse); + lyrics->setVerse(newVerse); const mu::engraving::TextStyleType styleType(lyrics->isEven() ? TextStyleType::LYRICS_EVEN : TextStyleType::LYRICS_ODD); lyrics->setTextStyleType(styleType);