@@ -397,7 +397,6 @@ class ExportMusicXml {
397
397
Fraction tick () const { return _tick; }
398
398
void writeInstrumentChange (const InstrumentChange* instrChange);
399
399
void writeInstrumentDetails (const Instrument* instrument, const bool concertPitch);
400
- static bool canWrite (const Element* e);
401
400
};
402
401
403
402
// ---------------------------------------------------------
@@ -768,7 +767,7 @@ void SlurHandler::doSlurs(const ChordRest* chordRest, Notations& notations, XmlW
768
767
// search for slur(s) starting or stopping at this chord
769
768
for (const auto & it : chordRest->score ()->spanner ()) {
770
769
auto sp = it.second ;
771
- if (sp->generated () || sp->type () != ElementType::SLUR || ! ExportMusicXml::canWrite (sp) )
770
+ if (sp->generated () || sp->type () != ElementType::SLUR)
772
771
continue ;
773
772
if (chordRest == sp->startElement () || chordRest == sp->endElement ()) {
774
773
const Slur* s = static_cast <const Slur*>(sp);
@@ -1035,7 +1034,7 @@ static void findTrills(const Measure* const measure, int strack, int etrack, Tri
1035
1034
for (auto it = measure->score ()->spanner ().lower_bound (stick.ticks ()); it != measure->score ()->spanner ().upper_bound (etick.ticks ()); ++it) {
1036
1035
Element* e = it->second ;
1037
1036
// qDebug("1 trill %p type %d track %d tick %s", e, e->type(), e->track(), qPrintable(e->tick().print()));
1038
- if (e->isTrill () && ExportMusicXml::canWrite (e) && strack <= e->track () && e->track () < etrack
1037
+ if (e->isTrill () && strack <= e->track () && e->track () < etrack
1039
1038
&& e->tick () >= measure->tick () && e->tick () < (measure->tick () + measure->ticks ()))
1040
1039
{
1041
1040
// qDebug("2 trill %p", e);
@@ -2776,7 +2775,7 @@ void ExportMusicXml::wavyLineStartStop(const ChordRest* const cr, Notations& not
2776
2775
static void tremoloSingleStartStop (Chord* chord, Notations& notations, Ornaments& ornaments, XmlWriter& xml)
2777
2776
{
2778
2777
Tremolo* tr = chord->tremolo ();
2779
- if (tr && ExportMusicXml::canWrite (tr) ) {
2778
+ if (tr) {
2780
2779
int count = 0 ;
2781
2780
TremoloType st = tr->tremoloType ();
2782
2781
QString type;
@@ -2839,7 +2838,7 @@ static void tremoloSingleStartStop(Chord* chord, Notations& notations, Ornaments
2839
2838
static void fermatas (const QVector<Element*>& cra, XmlWriter& xml, Notations& notations)
2840
2839
{
2841
2840
for (const Element* e : cra) {
2842
- if (!e->isFermata () || ! ExportMusicXml::canWrite (e) )
2841
+ if (!e->isFermata ())
2843
2842
continue ;
2844
2843
notations.tag (xml);
2845
2844
fermata (toFermata (e), xml);
@@ -3093,8 +3092,8 @@ static void writeChordLines(const Chord* const chord, XmlWriter& xml, Notations&
3093
3092
default :
3094
3093
qDebug (" unknown ChordLine subtype %d" , int (cl->chordLineType ()));
3095
3094
}
3096
- subtype += color2xml (cl);
3097
3095
if (!subtype.isEmpty ()) {
3096
+ subtype += color2xml (cl);
3098
3097
notations.tag (xml);
3099
3098
articulations.tag (xml);
3100
3099
xml.tagE (subtype);
@@ -3109,7 +3108,7 @@ static void writeChordLines(const Chord* const chord, XmlWriter& xml, Notations&
3109
3108
3110
3109
static void writeBreathMark (const Breath* const breath, XmlWriter& xml, Notations& notations, Articulations& articulations)
3111
3110
{
3112
- if (breath && ExportMusicXml::canWrite (breath) ) {
3111
+ if (breath) {
3113
3112
QString tagName;
3114
3113
QString type;
3115
3114
@@ -3192,9 +3191,6 @@ void ExportMusicXml::chordAttributes(Chord* chord, Notations& notations, Technic
3192
3191
// first the attributes whose elements are children of <articulations>
3193
3192
Articulations articulations;
3194
3193
for (const Articulation* a : na) {
3195
- if (!ExportMusicXml::canWrite (a))
3196
- continue ;
3197
-
3198
3194
SymId sid = a->symId ();
3199
3195
std::vector<QString> mxmlArtics = symIdToArtics (sid);
3200
3196
@@ -3229,8 +3225,6 @@ void ExportMusicXml::chordAttributes(Chord* chord, Notations& notations, Technic
3229
3225
// then the attributes whose elements are children of <ornaments>
3230
3226
Ornaments ornaments;
3231
3227
for (const Articulation* a : na) {
3232
- if (!ExportMusicXml::canWrite (a))
3233
- continue ;
3234
3228
if (!a->isOrnament ())
3235
3229
continue ;
3236
3230
@@ -3257,9 +3251,6 @@ void ExportMusicXml::chordAttributes(Chord* chord, Notations& notations, Technic
3257
3251
3258
3252
// and finally the attributes whose elements are children of <technical>
3259
3253
for (const Articulation* a : na) {
3260
- if (!ExportMusicXml::canWrite (a))
3261
- continue ;
3262
-
3263
3254
SymId sid = a->symId ();
3264
3255
QString placement;
3265
3256
QString direction;
@@ -3347,9 +3338,6 @@ void ExportMusicXml::chordAttributes(Chord* chord, Notations& notations, Technic
3347
3338
3348
3339
// check if all articulations were handled
3349
3340
for (const Articulation* a : na) {
3350
- if (!ExportMusicXml::canWrite (a))
3351
- continue ;
3352
-
3353
3341
SymId sid = a->symId ();
3354
3342
if (symIdToArtics (sid).empty ()
3355
3343
&& symIdToTechn (sid).isEmpty ()
@@ -3389,9 +3377,6 @@ static Arpeggio* findArpeggio(Note* note)
3389
3377
3390
3378
static void arpeggiate (Arpeggio* arp, bool front, bool back, XmlWriter& xml, Notations& notations)
3391
3379
{
3392
- if (!ExportMusicXml::canWrite (arp))
3393
- return ;
3394
-
3395
3380
QString tagName;
3396
3381
switch (arp->arpeggioType ()) {
3397
3382
case ArpeggioType::NORMAL:
@@ -3644,9 +3629,6 @@ static void writeNotehead(XmlWriter& xml, const Note* const note)
3644
3629
static void writeFingering (XmlWriter& xml, Notations& notations, Technical& technical, const Note* const note)
3645
3630
{
3646
3631
for (const Element* e : note->el ()) {
3647
- if (!ExportMusicXml::canWrite (e))
3648
- continue ;
3649
-
3650
3632
if (e->type () == ElementType::FINGERING) {
3651
3633
const TextBase* f = toTextBase (e);
3652
3634
notations.tag (xml);
@@ -3999,17 +3981,17 @@ void ExportMusicXml::chord(Chord* chord, int staff, const std::vector<Lyrics*>*
3999
3981
Technical technical;
4000
3982
4001
3983
const Tie* tieBack = note->tieBack ();
4002
- if (tieBack && ExportMusicXml::canWrite (tieBack) ) {
3984
+ if (tieBack) {
4003
3985
notations.tag (_xml);
4004
3986
_xml.tagE (" tied type=\" stop\" " );
4005
3987
}
4006
3988
const Tie* tieFor = note->tieFor ();
4007
- if (tieFor && ExportMusicXml::canWrite (tieFor) ) {
3989
+ if (tieFor) {
4008
3990
notations.tag (_xml);
4009
3991
QString rest = slurTieLineStyle (tieFor);
4010
3992
_xml.tagE (QString (" tied type=\" start\" %1" ).arg (rest));
4011
3993
}
4012
- if (hasLaissezVibrer (chord)/* && ExportMusicXml::canWrite(laissezVibrer) */ ) {
3994
+ if (hasLaissezVibrer (chord)) {
4013
3995
notations.tag (_xml);
4014
3996
_xml.tagE (" tied type=\" let-ring\" " );
4015
3997
}
@@ -4039,11 +4021,11 @@ void ExportMusicXml::chord(Chord* chord, int staff, const std::vector<Lyrics*>*
4039
4021
arpeggiate (arp, note == nl.front (), note == nl.back (), _xml, notations);
4040
4022
}
4041
4023
for (Spanner* spanner : note->spannerFor ())
4042
- if (spanner->type () == ElementType::GLISSANDO && ExportMusicXml::canWrite (spanner) ) {
4024
+ if (spanner->type () == ElementType::GLISSANDO) {
4043
4025
gh.doGlissandoStart (static_cast <Glissando*>(spanner), notations, _xml);
4044
4026
}
4045
4027
for (Spanner* spanner : note->spannerBack ())
4046
- if (spanner->type () == ElementType::GLISSANDO && ExportMusicXml::canWrite (spanner) ) {
4028
+ if (spanner->type () == ElementType::GLISSANDO) {
4047
4029
gh.doGlissandoStop (static_cast <Glissando*>(spanner), notations, _xml);
4048
4030
}
4049
4031
// write glissando (only for last note)
@@ -8207,17 +8189,4 @@ void ExportMusicXml::harmony(Harmony const* const h, FretDiagram const* const fd
8207
8189
}
8208
8190
_xml.etag (); // harmony
8209
8191
}
8210
- // ---------------------------------------------------------
8211
- // canWrite
8212
- // ---------------------------------------------------------
8213
-
8214
- /* *
8215
- Whether a tag corresponding to the given element \p e
8216
- should be included to the exported MusicXML file.
8217
- */
8218
-
8219
- bool ExportMusicXml::canWrite (const Element* e)
8220
- {
8221
- return e->visible () || preferences.getBool (PREF_EXPORT_MUSICXML_EXPORTINVISIBLEELEMENTS);
8222
- }
8223
8192
}
0 commit comments