Skip to content

Commit

Permalink
Remove the NoteLine element
Browse files Browse the repository at this point in the history
Backport of musescore#24993
Also fix most clazy warnings
  • Loading branch information
miiizen authored and Jojo-Schmitz committed Oct 11, 2024
1 parent 009a9bd commit ba6d337
Show file tree
Hide file tree
Showing 12 changed files with 107 additions and 219 deletions.
4 changes: 2 additions & 2 deletions libmscore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ add_library (
harmony.h hook.h icon.h image.h imageStore.h iname.h input.h instrchange.h instrtemplate.h instrument.h interval.h
jump.h key.h keylist.h keysig.h lasso.h layout.h layoutbreak.h ledgerline.h letring.h line.h location.h
lyrics.h marker.h mcursor.h measure.h measurebase.h mscore.h mscoreview.h musescoreCore.h navigate.h note.h notedot.h
noteevent.h noteline.h ossia.h ottava.h page.h palmmute.h part.h pedal.h pitch.h pitchspelling.h pitchvalue.h
noteevent.h ossia.h ottava.h page.h palmmute.h part.h pedal.h pitch.h pitchspelling.h pitchvalue.h
pos.h property.h range.h read206.h realizedharmony.h rehearsalmark.h repeat.h repeatlist.h rest.h revisions.h score.h scoreOrder.h scoreElement.h segment.h
segmentlist.h select.h sequencer.h shadownote.h shape.h sig.h slur.h slurtie.h spacer.h spanner.h spannermap.h spatium.h
staff.h stafflines.h staffstate.h stafftext.h stafftextbase.h stafftype.h stafftypechange.h stafftypelist.h stem.h
Expand Down Expand Up @@ -89,7 +89,7 @@ add_library (
paste.cpp
bsymbol.cpp marker.cpp jump.cpp stemslash.cpp ledgerline.cpp
synthesizerstate.cpp mcursor.cpp groups.cpp mscoreview.cpp
noteline.cpp spannermap.cpp
spannermap.cpp
bagpembell.cpp ambitus.cpp keylist.cpp scoreElement.cpp scoreOrder.cpp
shape.cpp systemdivider.cpp midimapping.cpp stafflines.cpp
sticking.cpp
Expand Down
4 changes: 1 addition & 3 deletions libmscore/element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
#include "mscore.h"
#include "notedot.h"
#include "note.h"
#include "noteline.h"
#include "ossia.h"
#include "ottava.h"
#include "page.h"
Expand Down Expand Up @@ -748,7 +747,7 @@ bool Element::readProperties(XmlReader& e)
}
#ifndef NDEBUG
else {
for (ScoreElement* eee : *_links) {
for (ScoreElement* eee : qAsConst(*_links)) {
Element* ee = static_cast<Element*>(eee);
if (ee->type() != type()) {
qFatal("link %s(%d) type mismatch %s linked to %s",
Expand Down Expand Up @@ -1061,7 +1060,6 @@ Element* Element::create(ElementType type, Score* score)
case ElementType::VOLTA: return new Volta(score);
case ElementType::OTTAVA: return new Ottava(score);
case ElementType::TEXTLINE: return new TextLine(score);
case ElementType::NOTELINE: return new NoteLine(score);
case ElementType::TRILL: return new Trill(score);
case ElementType::LET_RING: return new LetRing(score);
case ElementType::VIBRATO: return new Vibrato(score);
Expand Down
42 changes: 0 additions & 42 deletions libmscore/noteline.cpp

This file was deleted.

48 changes: 0 additions & 48 deletions libmscore/noteline.h

This file was deleted.

11 changes: 4 additions & 7 deletions libmscore/scoreElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@
// the file LICENCE.GPL
//=============================================================================

#include "scoreElement.h"
#include "score.h"
#include "undo.h"
#include "xml.h"
#include "bracket.h"
#include "bracketItem.h"
#include "measure.h"
#include "spanner.h"
#include "musescoreCore.h"
#include "score.h"
#include "scoreElement.h"
#include "undo.h"
#include "xml.h"

namespace Ms {

Expand Down Expand Up @@ -114,7 +112,6 @@ static const ElementName elementNames[] = {
{ ElementType::PALM_MUTE, "PalmMute", QT_TRANSLATE_NOOP("elementName", "Palm Mute") },
{ ElementType::TEXTLINE, "TextLine", QT_TRANSLATE_NOOP("elementName", "Text Line") },
{ ElementType::TEXTLINE_BASE, "TextLineBase", QT_TRANSLATE_NOOP("elementName", "Text Line Base") }, // remove
{ ElementType::NOTELINE, "NoteLine", QT_TRANSLATE_NOOP("elementName", "Note Line") },
{ ElementType::LYRICSLINE, "LyricsLine", QT_TRANSLATE_NOOP("elementName", "Melisma Line") },
{ ElementType::GLISSANDO, "Glissando", QT_TRANSLATE_NOOP("elementName", "Glissando") },
{ ElementType::BRACKET, "Bracket", QT_TRANSLATE_NOOP("elementName", "Bracket") },
Expand Down
4 changes: 0 additions & 4 deletions libmscore/scoreElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ class PedalSegment;
class LedgerLine;
class Icon;
class VoltaSegment;
class NoteLine;
class Trill;
class TrillSegment;
class Symbol;
Expand Down Expand Up @@ -323,7 +322,6 @@ class ScoreElement {
CONVERT(LedgerLine, LEDGER_LINE)
CONVERT(Icon, ICON)
CONVERT(VoltaSegment, VOLTA_SEGMENT)
CONVERT(NoteLine, NOTELINE)
CONVERT(Trill, TRILL)
CONVERT(TrillSegment, TRILL_SEGMENT)
CONVERT(LetRing, LET_RING)
Expand Down Expand Up @@ -391,7 +389,6 @@ class ScoreElement {
bool isTextLineBase() const {
return isHairpin()
|| isLetRing()
|| isNoteLine()
|| isOttava()
|| isPalmMute()
|| isPedal()
Expand Down Expand Up @@ -578,7 +575,6 @@ static inline const a* to##a(const ScoreElement* e) { Q_ASSERT(e == 0 || e->is##
CONVERT(LedgerLine)
CONVERT(Icon)
CONVERT(VoltaSegment)
CONVERT(NoteLine)
CONVERT(Trill)
CONVERT(TrillSegment)
CONVERT(LetRing)
Expand Down
36 changes: 16 additions & 20 deletions libmscore/select.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@

#include "global/log.h"

#include "mscore.h"
#include "accidental.h"
#include "arpeggio.h"
#include "articulation.h"
#include "barline.h"
#include "beam.h"
#include "chord.h"
Expand All @@ -31,33 +32,29 @@
#include "fret.h"
#include "hook.h"
#include "input.h"
#include "limits.h"
#include "lyrics.h"
#include "measure.h"
#include "mscore.h"
#include "note.h"
#include "notedot.h"
#include "page.h"
#include "part.h"
#include "rest.h"
#include "score.h"
#include "segment.h"
#include "select.h"
#include "sig.h"
#include "slur.h"
#include "staff.h"
#include "stafftext.h"
#include "stem.h"
#include "stemslash.h"
#include "tie.h"
#include "sticking.h"
#include "system.h"
#include "text.h"
#include "tie.h"
#include "tremolo.h"
#include "tuplet.h"
#include "utils.h"
#include "xml.h"
#include "staff.h"
#include "part.h"
#include "accidental.h"
#include "articulation.h"
#include "stafftext.h"
#include "sticking.h"

namespace Ms {

Expand Down Expand Up @@ -417,7 +414,7 @@ bool SelectionFilter::canSelect(const Element* e) const
return isFiltered(SelectionFilterType::BREATH);
if (e->isTextBase()) // only TEXT, INSTRCHANGE and STAFFTEXT are caught here, rest are system thus not in selection
return isFiltered(SelectionFilterType::OTHER_TEXT);
if (e->isSLine()) // NoteLine, Volta
if (e->isSLine()) // Volta
return isFiltered(SelectionFilterType::OTHER_LINE);
if (e->isTremolo())
return isFiltered(SelectionFilterType::TREMOLO);
Expand Down Expand Up @@ -487,7 +484,7 @@ void Selection::appendChord(Chord* chord)
if (note->accidental()) _el.append(note->accidental());
for (Element* el : note->el())
appendFiltered(el);
for (NoteDot* dot : note->dots())
for (NoteDot* dot : qAsConst(note->dots()))
_el.append(dot);

if (note->tieFor() && (note->tieFor()->endElement() != 0)) {
Expand Down Expand Up @@ -605,10 +602,10 @@ void Selection::updateSelectedElements()
}
if (e->isChord()) {
Chord* chord = toChord(e);
for (Chord* graceNote : chord->graceNotes())
for (Chord* graceNote : qAsConst(chord->graceNotes()))
if (canSelect(graceNote)) appendChord(graceNote);
appendChord(chord);
for (Articulation* art : chord->articulations())
for (Articulation* art : qAsConst(chord->articulations()))
appendFiltered(art);
}
else {
Expand Down Expand Up @@ -710,7 +707,7 @@ void Selection::dump()
case SelState::RANGE: qDebug("RANGE"); break;
case SelState::LIST: qDebug("LIST"); break;
}
for (const Element* e : _el)
for (const Element* e : qAsConst(_el))
qDebug(" %p %s", e, e->name());
}

Expand Down Expand Up @@ -842,10 +839,10 @@ QByteArray Selection::staffMimeData() const
Fraction ticks = tickEnd() - tickStart();
int staves = staffEnd() - staffStart();
if (!MScore::testMode) {
xml.stag(QString("StaffList version=\"" MSC_VERSION "\" tick=\"%1\" len=\"%2\" staff=\"%3\" staves=\"%4\"").arg(tickStart().toString()).arg(ticks.toString()).arg(staffStart()).arg(staves));
xml.stag(QString("StaffList version=\"" MSC_VERSION "\" tick=\"%1\" len=\"%2\" staff=\"%3\" staves=\"%4\"").arg(tickStart().toString(), ticks.toString()).arg(staffStart()).arg(staves));
}
else {
xml.stag(QString("StaffList version=\"2.00\" tick=\"%1\" len=\"%2\" staff=\"%3\" staves=\"%4\"").arg(tickStart().toString()).arg(ticks.toString()).arg(staffStart()).arg(staves));
xml.stag(QString("StaffList version=\"2.00\" tick=\"%1\" len=\"%2\" staff=\"%3\" staves=\"%4\"").arg(tickStart().toString(), ticks.toString()).arg(staffStart()).arg(staves));
}
Segment* seg1 = _startSegment;
Segment* seg2 = _endSegment;
Expand Down Expand Up @@ -977,7 +974,6 @@ Enabling copying of more element types requires enabling pasting in Score::paste
case ElementType::PEDAL:
case ElementType::TRILL:
case ElementType::TEXTLINE:
case ElementType::NOTELINE:
case ElementType::SEGMENT:
case ElementType::SYSTEM:
case ElementType::COMPOUND:
Expand Down Expand Up @@ -1148,7 +1144,7 @@ std::vector<Note*> Selection::noteList(int selTrack) const
continue;
Chord* c = toChord(e);
nl.insert(nl.end(), c->notes().begin(), c->notes().end());
for (Chord* g : c->graceNotes()) {
for (Chord* g : qAsConst(c->graceNotes())) {
nl.insert(nl.end(), g->notes().begin(), g->notes().end());
}
}
Expand Down
1 change: 0 additions & 1 deletion libmscore/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ enum class ElementType {
PALM_MUTE,
TEXTLINE,
TEXTLINE_BASE,
NOTELINE,
LYRICSLINE,
GLISSANDO,
BRACKET,
Expand Down
Loading

0 comments on commit ba6d337

Please sign in to comment.