8 #ifndef __VRV_IOMEI_H__
9 #define __VRV_IOMEI_H__
21 #include "pugixml.hpp"
28 class AltSymInterface;
33 class AreaPosInterface;
58 class DurationInterface;
68 class FloatingElement;
70 class GenericLayerElement;
80 class LinkingInterface;
115 class PageMilestoneEnd;
122 class PitchInflection;
123 class PitchInterface;
125 class PlistInterface;
126 class PositionInterface;
137 class RunningElement;
140 class ScoreDefElement;
141 class ScoreDefInterface;
160 class SystemMilestoneEnd;
165 class TextDirInterface;
167 class TextLayoutElement;
169 class TimePointInterface;
170 class TimeSpanningInterface;
181 enum class MatchLocation { Before, Here, After };
182 enum class RangeMatchLocation { BeforeStart, AtStart, BetweenStartEnd, AtEnd, AfterEnd };
224 void SetScoreBasedMEI(
bool scoreBasedMEI) { m_scoreBasedMEI = scoreBasedMEI; }
231 void SetBasic(
bool basic) { m_basic = basic; }
232 bool GetBasic()
const {
return m_basic; }
240 void SetFirstPage(
int page);
241 void SetLastPage(
int page);
242 void SetFirstMeasure(
const std::string &
id);
243 void SetLastMeasure(
const std::string &
id);
244 void SetMdiv(
const std::string &
id);
252 bool IsScoreBasedMEI()
const {
return m_scoreBasedMEI; }
253 bool IsPageBasedMEI()
const {
return !m_scoreBasedMEI; }
254 bool IsSerializing()
const {
return m_serializing; }
288 bool IsTreeObject(
Object *
object)
const;
294 bool HasValidFilter()
const;
295 bool IsMatchingFilter()
const;
296 void UpdateFilter(
Object *
object);
297 void UpdatePageFilter(
Object *
object);
298 void UpdateMeasureFilter(
Object *
object);
299 void UpdateMdivFilter(
Object *
object);
300 bool ProcessScoreBasedFilter(
Object *
object);
301 bool ProcessScoreBasedFilterEnd(
Object *
object);
302 void PruneAttributes(pugi::xml_node node);
309 bool WriteObjectInternal(
Object *
object,
bool useCustomScoreDef);
310 bool WriteObjectInternalEnd(
Object *
object);
311 void WriteStackedObjects();
312 void WriteStackedObjectsEnd();
319 void WriteCustomScoreDef(
ScoreDef *scoreDef);
321 bool AdjustLabel(
Label *label);
327 bool WriteDoc(
Doc *doc);
332 void WriteRevisionDesc(pugi::xml_node meiHead);
337 void WriteXmlId(pugi::xml_node currentNode,
Object *
object);
343 void WriteMdiv(pugi::xml_node currentNode,
Mdiv *mdiv);
344 void WritePages(pugi::xml_node currentNode,
Pages *pages);
345 void WriteScore(pugi::xml_node currentNode,
Score *score);
352 void WriteSection(pugi::xml_node currentNode,
Section *section);
353 void WriteEnding(pugi::xml_node currentNote,
Ending *ending);
354 void WriteExpansion(pugi::xml_node currentNote,
Expansion *expansion);
355 void WritePb(pugi::xml_node currentNode,
Pb *pb);
356 void WriteSb(pugi::xml_node currentNode,
Sb *sb);
363 void WritePage(pugi::xml_node currentNode,
Page *page);
364 void WritePageElement(pugi::xml_node element,
PageElement *
object);
365 void WritePageMilestoneEnd(pugi::xml_node currentNode,
PageMilestoneEnd *milestoneEnd);
366 void WriteSystem(pugi::xml_node currentNode,
System *system);
367 void WriteSystemMilestoneEnd(pugi::xml_node currentNode,
SystemMilestoneEnd *milestoneEnd);
368 void WriteScoreDef(pugi::xml_node currentNode,
ScoreDef *scoreDef);
369 void WriteGrpSym(pugi::xml_node currentNode,
GrpSym *grmSym);
370 void WritePgFoot(pugi::xml_node currentNode,
PgFoot *pgFoot);
371 void WritePgHead(pugi::xml_node currentNode,
PgHead *pgHead);
372 void WriteDiv(pugi::xml_node currentNode,
Div *div);
373 void WriteStaffGrp(pugi::xml_node currentNode,
StaffGrp *staffGrp);
374 void WriteStaffDef(pugi::xml_node currentNode,
StaffDef *staffDef);
375 void WriteInstrDef(pugi::xml_node currentNode,
InstrDef *instrDef);
376 void WriteLabel(pugi::xml_node currentNode,
Label *label);
377 void WriteLabelAbbr(pugi::xml_node currentNode,
LabelAbbr *labelAbbr);
378 void WriteLayerDef(pugi::xml_node currentNode,
LayerDef *layerDef);
379 void WriteTuning(pugi::xml_node currentNode,
Tuning *tuning);
380 void WriteCourse(pugi::xml_node currentNode,
Course *course);
381 void WriteSymbolTable(pugi::xml_node currentNode,
SymbolTable *symbolTable);
382 void WriteMeasure(pugi::xml_node currentNode,
Measure *measure);
383 void WriteMeterSigGrp(pugi::xml_node currentNode,
MeterSigGrp *meterSigGrp);
384 void WriteFb(pugi::xml_node currentNode,
Fb *fb);
385 void WriteStaff(pugi::xml_node currentNode,
Staff *staff);
386 void WriteLayer(pugi::xml_node currentNode,
Layer *layer);
394 void WriteAccid(pugi::xml_node currentNode,
Accid *accid);
395 void WriteArtic(pugi::xml_node currentNode,
Artic *artic);
396 void WriteBarLine(pugi::xml_node currentNode,
BarLine *barLine);
397 void WriteBeam(pugi::xml_node currentNode,
Beam *beam);
398 void WriteBeatRpt(pugi::xml_node currentNode,
BeatRpt *beatRpt);
399 void WriteBTrem(pugi::xml_node currentNode,
BTrem *bTrem);
400 void WriteChord(pugi::xml_node currentNode,
Chord *chord);
401 void WriteClef(pugi::xml_node currentNode,
Clef *clef);
402 void WriteCustos(pugi::xml_node currentNode,
Custos *custos);
403 void WriteDivLine(pugi::xml_node currentNode,
DivLine *divLine);
404 void WriteDot(pugi::xml_node currentNode,
Dot *dot);
405 void WriteFTrem(pugi::xml_node currentNode,
FTrem *fTrem);
407 void WriteGraceGrp(pugi::xml_node currentNode,
GraceGrp *graceGrp);
408 void WriteHalfmRpt(pugi::xml_node currentNode,
HalfmRpt *halfmRpt);
409 void WriteKeyAccid(pugi::xml_node currentNode,
KeyAccid *keyAccid);
410 void WriteKeySig(pugi::xml_node currentNode,
KeySig *keySig);
411 void WriteLigature(pugi::xml_node currentNode,
Ligature *ligature);
412 void WriteLiquescent(pugi::xml_node currentNode,
Liquescent *liquescent);
413 void WriteMensur(pugi::xml_node currentNode,
Mensur *mensur);
414 void WriteMeterSig(pugi::xml_node currentNode,
MeterSig *meterSig);
415 void WriteMRest(pugi::xml_node currentNode,
MRest *mRest);
416 void WriteMRpt(pugi::xml_node currentNode,
MRpt *mRpt);
417 void WriteMRpt2(pugi::xml_node currentNode,
MRpt2 *mRpt2);
418 void WriteMSpace(pugi::xml_node currentNode,
MSpace *mSpace);
419 void WriteMultiRest(pugi::xml_node currentNode,
MultiRest *multiRest);
420 void WriteMultiRpt(pugi::xml_node currentNode,
MultiRpt *multiRpt);
421 void WriteNc(pugi::xml_node currentNode,
Nc *nc);
422 void WriteNeume(pugi::xml_node currentNode,
Neume *neume);
423 void WriteNote(pugi::xml_node currentNode,
Note *note);
424 void WriteOriscus(pugi::xml_node currentNode,
Oriscus *oriscus);
425 void WritePlica(pugi::xml_node currentNode,
Plica *plica);
426 void WriteProport(pugi::xml_node currentNode,
Proport *proport);
427 void WriteQuilisma(pugi::xml_node currentNode,
Quilisma *quilisma);
428 void WriteRest(pugi::xml_node currentNode,
Rest *rest);
429 void WriteSpace(pugi::xml_node currentNode,
Space *space);
430 void WriteStem(pugi::xml_node currentNode,
Stem *stem);
431 void WriteSyllable(pugi::xml_node currentNode,
Syllable *syllable);
432 void WriteTabDurSym(pugi::xml_node currentNode,
TabDurSym *tabDurSym);
433 void WriteTabGrp(pugi::xml_node currentNode,
TabGrp *tabGrp);
434 void WriteTuplet(pugi::xml_node currentNode,
Tuplet *tuplet);
441 void WriteAnchoredText(pugi::xml_node currentNode,
AnchoredText *anchoredText);
442 void WriteAnnotScore(pugi::xml_node currentNode,
AnnotScore *annotScore);
443 void WriteArpeg(pugi::xml_node currentNode,
Arpeg *arpeg);
444 void WriteBeamSpan(pugi::xml_node currentNode,
BeamSpan *beamSpan);
445 void WriteBracketSpan(pugi::xml_node currentNode,
BracketSpan *bracketSpan);
446 void WriteBreath(pugi::xml_node currentNode,
Breath *breath);
447 void WriteCaesura(pugi::xml_node currentNode,
Caesura *caesura);
448 void WriteCpMark(pugi::xml_node currentNode,
CpMark *cpMark);
449 void WriteDir(pugi::xml_node currentNode,
Dir *dir);
450 void WriteDynam(pugi::xml_node currentNode,
Dynam *dynam);
451 void WriteFermata(pugi::xml_node currentNode,
Fermata *fermata);
452 void WriteFing(pugi::xml_node currentNode,
Fing *fing);
453 void WriteGliss(pugi::xml_node currentNode,
Gliss *gliss);
454 void WriteHairpin(pugi::xml_node currentNode,
Hairpin *hairpin);
455 void WriteHarm(pugi::xml_node currentNode,
Harm *harm);
456 void WriteLv(pugi::xml_node currentNode,
Lv *lv);
457 void WriteMNum(pugi::xml_node currentNode,
MNum *mnum);
458 void WriteMordent(pugi::xml_node currentNode,
Mordent *mordent);
459 void WriteOctave(pugi::xml_node currentNode,
Octave *octave);
460 void WriteOrnam(pugi::xml_node currentNode,
Ornam *ornam);
461 void WritePedal(pugi::xml_node currentNode,
Pedal *pedal);
462 void WritePhrase(pugi::xml_node currentNode,
Phrase *phrase);
463 void WritePitchInflection(pugi::xml_node currentNode,
PitchInflection *pitchInflection);
464 void WriteReh(pugi::xml_node currentNode,
Reh *reh);
465 void WriteRepeatMark(pugi::xml_node currentNode,
RepeatMark *repeatMark);
466 void WriteSlur(pugi::xml_node currentNode,
Slur *slur);
467 void WriteTempo(pugi::xml_node currentNode,
Tempo *tempo);
468 void WriteTie(pugi::xml_node currentNode,
Tie *tie);
469 void WriteTrill(pugi::xml_node currentNode,
Trill *trill);
470 void WriteTurn(pugi::xml_node currentNode,
Turn *turn);
477 void WriteF(pugi::xml_node currentNode,
F *f);
478 void WriteFig(pugi::xml_node currentNode,
Fig *fig);
479 void WriteLb(pugi::xml_node currentNode,
Lb *lb);
480 void WriteNum(pugi::xml_node currentNode,
Num *num);
481 void WriteRend(pugi::xml_node currentNode,
Rend *rend);
482 void WriteSvg(pugi::xml_node currentNode,
Svg *svg);
483 void WriteSymbol(pugi::xml_node currentNode,
Symbol *symbol);
484 void WriteSymbolDef(pugi::xml_node currentNode,
SymbolDef *symbolDef);
485 void WriteText(pugi::xml_node currentNode,
Text *text);
492 void WriteAbbr(pugi::xml_node currentNode,
Abbr *abbr);
493 void WriteAdd(pugi::xml_node currentNode,
Add *add);
494 void WriteAnnot(pugi::xml_node currentNode,
Annot *annot);
495 void WriteApp(pugi::xml_node currentNode,
App *app);
496 void WriteChoice(pugi::xml_node currentNode,
Choice *choice);
497 void WriteCorr(pugi::xml_node currentNode,
Corr *corr);
498 void WriteDamage(pugi::xml_node currentNode,
Damage *damage);
499 void WriteDel(pugi::xml_node currentNode,
Del *del);
500 void WriteExpan(pugi::xml_node currentNode,
Expan *expan);
501 void WriteLem(pugi::xml_node currentNode,
Lem *lem);
502 void WriteOrig(pugi::xml_node currentNode,
Orig *orig);
503 void WriteRdg(pugi::xml_node currentNode,
Rdg *rdg);
504 void WriteRef(pugi::xml_node currentNode,
Ref *
Ref);
505 void WriteReg(pugi::xml_node currentNode,
Reg *
Reg);
506 void WriteRestore(pugi::xml_node currentNode,
Restore *restore);
507 void WriteSic(pugi::xml_node currentNode,
Sic *sic);
508 void WriteSubst(pugi::xml_node currentNode,
Subst *subst);
509 void WriteSupplied(pugi::xml_node currentNode,
Supplied *supplied);
510 void WriteUnclear(pugi::xml_node currentNode,
Unclear *unclear);
517 void WriteVerse(pugi::xml_node currentNode,
Verse *verse);
518 void WriteSyl(pugi::xml_node currentNode,
Syl *syl);
519 void WriteZone(pugi::xml_node currentNode,
Zone *zone);
520 void WriteSurface(pugi::xml_node currentNode,
Surface *surface);
521 void WriteFacsimile(pugi::xml_node currentNode,
Facsimile *facsimile);
522 void WriteGraphic(pugi::xml_node currentNode,
Graphic *graphic);
528 void WriteUnsupportedAttr(pugi::xml_node currentNode,
Object *
object);
535 void WriteControlElement(pugi::xml_node element,
ControlElement *
object);
536 void WriteEditorialElement(pugi::xml_node element,
EditorialElement *
object);
537 void WriteLayerElement(pugi::xml_node element,
LayerElement *
object);
539 void WriteRunningElement(pugi::xml_node element,
RunningElement *
object);
540 void WriteScoreDefElement(pugi::xml_node element,
ScoreDefElement *
object);
541 void WriteSystemElement(pugi::xml_node element,
SystemElement *
object);
542 void WriteTextElement(pugi::xml_node element,
TextElement *
object);
544 void WriteAltSymInterface(pugi::xml_node currentNode,
AltSymInterface *interface);
545 void WriteAreaPosInterface(pugi::xml_node currentNode,
AreaPosInterface *interface);
546 void WriteDurationInterface(pugi::xml_node currentNode,
DurationInterface *interface);
547 void WriteLinkingInterface(pugi::xml_node currentNode,
LinkingInterface *interface);
549 void WritePitchInterface(pugi::xml_node currentNode,
PitchInterface *interface);
550 void WritePlistInterface(pugi::xml_node currentNode,
PlistInterface *interface);
551 void WritePositionInterface(pugi::xml_node currentNode,
PositionInterface *interface);
552 void WriteScoreDefInterface(pugi::xml_node currentNode,
ScoreDefInterface *interface);
553 void WriteTextDirInterface(pugi::xml_node currentNode,
TextDirInterface *interface);
554 void WriteTimePointInterface(pugi::xml_node currentNode,
TimePointInterface *interface);
563 std::u32string EscapeSMuFL(std::u32string data);
567 std::string IDToMeiStr(
Object *element);
568 std::string DocTypeToStr(DocType type);
577 bool m_scoreBasedMEI;
584 pugi::xml_node m_mei;
587 pugi::xml_node m_currentNode;
589 std::list<pugi::xml_node> m_nodeStack;
591 std::stack<Object *> m_boundaries;
593 std::deque<Object *> m_objectStack;
598 MatchLocation m_filterMatchLocation;
599 Object *m_firstFilterMatch;
603 std::string m_firstMeasureID;
604 std::string m_lastMeasureID;
605 RangeMatchLocation m_measureFilterMatchLocation;
606 std::string m_mdivID;
607 MatchLocation m_mdivFilterMatchLocation;
612 SetOfConstObjects m_referredObjects;
630 bool Import(
const std::string &mei)
override;
638 bool ReadDoc(pugi::xml_node root);
639 bool ReadIncipits(pugi::xml_node root);
642 bool ReadMdiv(
Object *parent, pugi::xml_node parentNode,
bool isVisible);
643 bool ReadMdivChildren(
Object *parent, pugi::xml_node parentNode,
bool isVisible);
644 bool ReadScore(
Object *parent, pugi::xml_node parentNode);
645 bool ReadScoreScoreDef(
Object *parent, pugi::xml_node parentNode);
652 bool ReadPages(
Object *parent, pugi::xml_node parentNode);
653 bool ReadPage(
Object *parent, pugi::xml_node parentNode);
654 bool ReadPageChildren(
Object *parent, pugi::xml_node parentNode);
655 bool ReadPageMilestoneEnd(
Object *parent, pugi::xml_node milestoneEnd);
656 bool ReadSystem(
Object *parent, pugi::xml_node system);
657 bool ReadSystemChildren(
Object *parent, pugi::xml_node parentNode);
658 bool ReadSystemMilestoneEnd(
Object *parent, pugi::xml_node milestoneEnd);
665 bool ReadSection(
Object *parent, pugi::xml_node section);
666 bool ReadSectionChildren(
Object *parent, pugi::xml_node parentNode);
667 bool ReadEnding(
Object *parent, pugi::xml_node ending);
668 bool ReadExpansion(
Object *parent, pugi::xml_node expansion);
669 bool ReadPb(
Object *parent, pugi::xml_node pb);
670 bool ReadSb(
Object *parent, pugi::xml_node sb);
682 bool ReadScoreDef(
Object *parent, pugi::xml_node scoreDef);
683 bool ReadScoreDefChildren(
Object *parent, pugi::xml_node parentNode);
684 bool ReadGrpSym(
Object *parent, pugi::xml_node grpSym);
685 bool ReadPgFoot(
Object *parent, pugi::xml_node pgFoot);
686 bool ReadPgHead(
Object *parent, pugi::xml_node pgHead);
687 bool ReadDiv(
Object *parent, pugi::xml_node div);
688 bool ReadRunningChildren(
Object *parent, pugi::xml_node parentNode,
Object *filter = NULL);
689 bool ReadStaffGrp(
Object *parent, pugi::xml_node staffGrp);
690 bool ReadStaffGrpChildren(
Object *parent, pugi::xml_node parentNode);
691 bool ReadStaffDef(
Object *parent, pugi::xml_node staffDef);
692 bool ReadStaffDefChildren(
Object *parent, pugi::xml_node parentNode);
693 bool ReadInstrDef(
Object *parent, pugi::xml_node instrDef);
694 bool ReadLabel(
Object *parent, pugi::xml_node label);
695 bool ReadLabelAbbr(
Object *parent, pugi::xml_node labelAbbr);
696 bool ReadTuning(
Object *parent, pugi::xml_node tuning);
697 bool ReadTuningChildren(
Object *parent, pugi::xml_node parentNode);
698 bool ReadCourse(
Object *parent, pugi::xml_node course);
699 bool ReadSymbolTable(
Object *parent, pugi::xml_node parentNode);
700 bool ReadMeasure(
Object *parent, pugi::xml_node measure);
701 bool ReadMeasureChildren(
Object *parent, pugi::xml_node parentNode);
702 bool ReadMeterSigGrp(
Object *parent, pugi::xml_node meterSigGrp);
703 bool ReadMeterSigGrpChildren(
Object *parent, pugi::xml_node parentNode);
704 bool ReadFb(
Object *parent, pugi::xml_node fb);
705 bool ReadFbChildren(
Object *parent, pugi::xml_node parentNode);
706 bool ReadNum(
Object *parent, pugi::xml_node parentNode);
707 bool ReadStaff(
Object *parent, pugi::xml_node staff);
708 bool ReadStaffChildren(
Object *parent, pugi::xml_node parentNode);
709 bool ReadLayer(
Object *parent, pugi::xml_node layer);
710 bool ReadLayerDef(
Object *parent, pugi::xml_node layerDef);
711 bool ReadLayerDefChildren(
Object *parent, pugi::xml_node parentNode);
712 bool ReadLayerChildren(
Object *parent, pugi::xml_node parentNode,
Object *filter = NULL);
713 bool ReadTextChildren(
Object *parent, pugi::xml_node parentNode,
Object *filter = NULL);
714 bool ReadSymbolDefChildren(
Object *parent, pugi::xml_node parentNode,
Object *filter = NULL);
721 bool ReadAccid(
Object *parent, pugi::xml_node accid);
722 bool ReadArtic(
Object *parent, pugi::xml_node artic);
723 bool ReadBarLine(
Object *parent, pugi::xml_node barLine);
724 bool ReadBeam(
Object *parent, pugi::xml_node beam);
725 bool ReadBeatRpt(
Object *parent, pugi::xml_node beatRpt);
726 bool ReadBTrem(
Object *parent, pugi::xml_node bTrem);
727 bool ReadChord(
Object *parent, pugi::xml_node chord);
728 bool ReadClef(
Object *parent, pugi::xml_node clef);
729 bool ReadCustos(
Object *parent, pugi::xml_node custos);
730 bool ReadDivLine(
Object *parent, pugi::xml_node divLine);
731 bool ReadDot(
Object *parent, pugi::xml_node dot);
732 bool ReadFTrem(
Object *parent, pugi::xml_node fTrem);
733 bool ReadGenericLayerElement(
Object *parent, pugi::xml_node element);
734 bool ReadGraceGrp(
Object *parent, pugi::xml_node graceGrp);
735 bool ReadHalfmRpt(
Object *parent, pugi::xml_node halfmRpt);
736 bool ReadKeyAccid(
Object *parent, pugi::xml_node keyAccid);
737 bool ReadKeySig(
Object *parent, pugi::xml_node keySig);
738 bool ReadLigature(
Object *parent, pugi::xml_node ligature);
739 bool ReadLiquescent(
Object *parent, pugi::xml_node liquescent);
740 bool ReadMensur(
Object *parent, pugi::xml_node mensur);
741 bool ReadMeterSig(
Object *parent, pugi::xml_node meterSig);
742 bool ReadMRest(
Object *parent, pugi::xml_node mRest);
743 bool ReadMRpt(
Object *parent, pugi::xml_node mRpt);
744 bool ReadMRpt2(
Object *parent, pugi::xml_node mRpt2);
745 bool ReadMSpace(
Object *parent, pugi::xml_node mSpace);
746 bool ReadMultiRest(
Object *parent, pugi::xml_node multiRest);
747 bool ReadMultiRpt(
Object *parent, pugi::xml_node multiRpt);
748 bool ReadNc(
Object *parent, pugi::xml_node nc);
749 bool ReadNeume(
Object *parent, pugi::xml_node note);
750 bool ReadNote(
Object *parent, pugi::xml_node note);
751 bool ReadOriscus(
Object *parent, pugi::xml_node oriscus);
752 bool ReadPlica(
Object *parent, pugi::xml_node plica);
753 bool ReadProport(
Object *parent, pugi::xml_node proport);
754 bool ReadQuilisma(
Object *parent, pugi::xml_node quilisma);
755 bool ReadRest(
Object *parent, pugi::xml_node rest);
756 bool ReadSpace(
Object *parent, pugi::xml_node space);
757 bool ReadStem(
Object *parent, pugi::xml_node stem);
758 bool ReadSyl(
Object *parent, pugi::xml_node syl);
759 bool ReadSyllable(
Object *parent, pugi::xml_node syllable);
760 bool ReadTabDurSym(
Object *parent, pugi::xml_node tabDurSym);
761 bool ReadTabGrp(
Object *parent, pugi::xml_node tabGrp);
762 bool ReadTuplet(
Object *parent, pugi::xml_node tuplet);
763 bool ReadVerse(
Object *parent, pugi::xml_node verse);
770 bool ReadAnchoredText(
Object *parent, pugi::xml_node anchoredText);
771 bool ReadArpeg(
Object *parent, pugi::xml_node arpeg);
772 bool ReadBeamSpan(
Object *parent, pugi::xml_node beamSpan);
773 bool ReadBracketSpan(
Object *parent, pugi::xml_node bracketSpan);
774 bool ReadBreath(
Object *parent, pugi::xml_node breath);
775 bool ReadCaesura(
Object *parent, pugi::xml_node caesura);
776 bool ReadCpMark(
Object *parent, pugi::xml_node cpMark);
777 bool ReadDir(
Object *parent, pugi::xml_node dir);
778 bool ReadDynam(
Object *parent, pugi::xml_node dynam);
779 bool ReadFermata(
Object *parent, pugi::xml_node fermata);
780 bool ReadFing(
Object *parent, pugi::xml_node fing);
781 bool ReadGliss(
Object *parent, pugi::xml_node gliss);
782 bool ReadHairpin(
Object *parent, pugi::xml_node hairpin);
783 bool ReadHarm(
Object *parent, pugi::xml_node harm);
784 bool ReadLv(
Object *parent, pugi::xml_node lv);
785 bool ReadMNum(
Object *parent, pugi::xml_node mnum);
786 bool ReadMordent(
Object *parent, pugi::xml_node mordent);
787 bool ReadOctave(
Object *parent, pugi::xml_node octave);
788 bool ReadOrnam(
Object *parent, pugi::xml_node ornam);
789 bool ReadPedal(
Object *parent, pugi::xml_node pedal);
790 bool ReadPhrase(
Object *parent, pugi::xml_node phrase);
791 bool ReadPitchInflection(
Object *parent, pugi::xml_node pitchInflection);
792 bool ReadRepeatMark(
Object *parent, pugi::xml_node repeatMark);
793 bool ReadReh(
Object *parent, pugi::xml_node reh);
794 bool ReadSlur(
Object *parent, pugi::xml_node slur);
795 bool ReadTempo(
Object *parent, pugi::xml_node tempo);
796 bool ReadTie(
Object *parent, pugi::xml_node tie);
797 bool ReadTrill(
Object *parent, pugi::xml_node trill);
798 bool ReadTurn(
Object *parent, pugi::xml_node turn);
805 bool ReadF(
Object *parent, pugi::xml_node f);
806 bool ReadFig(
Object *parent, pugi::xml_node fig);
807 bool ReadLb(
Object *parent, pugi::xml_node lb);
808 bool ReadRend(
Object *parent, pugi::xml_node rend);
809 bool ReadSvg(
Object *parent, pugi::xml_node svg);
810 bool ReadSymbol(
Object *parent, pugi::xml_node symbol);
811 bool ReadSymbolDef(
Object *parent, pugi::xml_node symbolDef);
812 bool ReadText(
Object *parent, pugi::xml_node text,
bool trimLeft,
bool trimRight);
820 bool ReadEditorialElement(
Object *parent, pugi::xml_node app, EditorialLevel level,
Object *filter = NULL);
821 bool ReadAbbr(
Object *parent, pugi::xml_node abbr, EditorialLevel level,
Object *filter = NULL);
822 bool ReadAdd(
Object *parent, pugi::xml_node add, EditorialLevel level,
Object *filter = NULL);
823 bool ReadAnnot(
Object *parent, pugi::xml_node annot);
824 bool ReadAnnotScore(
Object *parent, pugi::xml_node annot);
825 bool ReadApp(
Object *parent, pugi::xml_node app, EditorialLevel level,
Object *filter = NULL);
826 bool ReadAppChildren(
Object *parent, pugi::xml_node parentNode, EditorialLevel level,
Object *filter = NULL);
827 bool ReadChoice(
Object *parent, pugi::xml_node choice, EditorialLevel level,
Object *filter = NULL);
828 bool ReadChoiceChildren(
Object *parent, pugi::xml_node parentNode, EditorialLevel level,
Object *filter = NULL);
829 bool ReadCorr(
Object *parent, pugi::xml_node corr, EditorialLevel level,
Object *filter = NULL);
830 bool ReadDamage(
Object *parent, pugi::xml_node damage, EditorialLevel level,
Object *filter = NULL);
831 bool ReadDel(
Object *parent, pugi::xml_node del, EditorialLevel level,
Object *filter = NULL);
832 bool ReadExpan(
Object *parent, pugi::xml_node expan, EditorialLevel level,
Object *filter = NULL);
833 bool ReadLem(
Object *parent, pugi::xml_node lem, EditorialLevel level,
Object *filter = NULL);
834 bool ReadOrig(
Object *parent, pugi::xml_node orig, EditorialLevel level,
Object *filter = NULL);
835 bool ReadRdg(
Object *parent, pugi::xml_node rdg, EditorialLevel level,
Object *filter = NULL);
836 bool ReadRef(
Object *parent, pugi::xml_node ref, EditorialLevel level,
Object *filter = NULL);
837 bool ReadReg(
Object *parent, pugi::xml_node reg, EditorialLevel level,
Object *filter = NULL);
838 bool ReadRestore(
Object *parent, pugi::xml_node restore, EditorialLevel level,
Object *filter = NULL);
839 bool ReadSic(
Object *parent, pugi::xml_node sic, EditorialLevel level,
Object *filter = NULL);
840 bool ReadSubst(
Object *parent, pugi::xml_node subst, EditorialLevel level,
Object *filter = NULL);
841 bool ReadSubstChildren(
Object *parent, pugi::xml_node parentNode, EditorialLevel level,
Object *filter = NULL);
842 bool ReadSupplied(
Object *parent, pugi::xml_node supplied, EditorialLevel level,
Object *filter = NULL);
843 bool ReadUnclear(
Object *parent, pugi::xml_node unclear, EditorialLevel level,
Object *filter = NULL);
844 bool ReadEditorialChildren(
Object *parent, pugi::xml_node supplied, EditorialLevel level,
Object *filter = NULL);
851 bool ReadControlElement(pugi::xml_node element,
ControlElement *
object);
852 bool ReadEditorialElement(pugi::xml_node element,
EditorialElement *
object);
853 bool ReadLayerElement(pugi::xml_node element,
LayerElement *
object);
855 bool ReadRunningElement(pugi::xml_node element,
RunningElement *
object);
856 bool ReadScoreDefElement(pugi::xml_node element,
ScoreDefElement *
object);
857 bool ReadSystemElement(pugi::xml_node element,
SystemElement *
object);
858 bool ReadTextElement(pugi::xml_node element,
TextElement *
object);
860 bool ReadAltSymInterface(pugi::xml_node element,
AltSymInterface *interface);
861 bool ReadAreaPosInterface(pugi::xml_node element,
AreaPosInterface *interface);
862 bool ReadDurationInterface(pugi::xml_node element,
DurationInterface *interface);
863 bool ReadLinkingInterface(pugi::xml_node element,
LinkingInterface *interface);
865 bool ReadPitchInterface(pugi::xml_node element,
PitchInterface *interface);
866 bool ReadPlistInterface(pugi::xml_node element,
PlistInterface *interface);
867 bool ReadPositionInterface(pugi::xml_node element,
PositionInterface *interface);
868 bool ReadScoreDefInterface(pugi::xml_node element,
ScoreDefInterface *interface);
869 bool ReadTextDirInterface(pugi::xml_node element,
TextDirInterface *interface);
878 bool ReadFacsimile(
Doc *doc, pugi::xml_node facsimile);
879 bool ReadGraphic(
Object *parent, pugi::xml_node graphic);
880 bool ReadSurface(
Facsimile *parent, pugi::xml_node surface);
881 bool ReadTupletSpanAsTuplet(
Measure *measure, pugi::xml_node tupletSpan);
882 bool ReadZone(
Surface *parent, pugi::xml_node zone);
888 void ReadUnsupportedAttr(pugi::xml_node element,
Object *
object);
893 bool IsAnnotScore(pugi::xml_node element);
898 bool IsEditorialElementName(std::string elementName);
903 void NormalizeAttributes(pugi::xml_node &xmlElement);
910 bool ReadScoreBasedMei(pugi::xml_node element,
Score *parent);
916 void SetMeiID(pugi::xml_node element,
Object *
object);
917 DocType StrToDocType(std::string type);
918 std::u32string LeftTrim(std::u32string str);
919 std::u32string RightTrim(std::u32string str);
920 bool ReadXMLComment(
Object *
object, pugi::xml_node element);
928 void UpgradeKeySigTo_5_0(pugi::xml_node keySig);
929 void UpgradePageTo_5_0(
Page *page);
930 void UpgradePgHeadFootTo_5_0(pugi::xml_node element);
931 void UpgradeMeasureTo_5_0(pugi::xml_node measure);
932 void UpgradeMeterSigTo_5_0(pugi::xml_node meterSig,
MeterSig *vrvMeterSig);
933 void UpgradeScoreDefElementTo_5_0(pugi::xml_node scoreDefElement);
934 void UpgradeStaffTo_5_0(pugi::xml_node staff);
935 void UpgradeLayerElementTo_5_0(pugi::xml_node element);
936 void UpgradeRendTo_5_0(pugi::xml_node element);
938 void UpgradeBeatRptTo_4_0_0(pugi::xml_node beatRpt,
BeatRpt *vrvBeatRpt);
939 void UpgradeDurGesTo_4_0_0(pugi::xml_node element,
DurationInterface *interface);
940 void UpgradeFTremTo_4_0_0(pugi::xml_node fTrem,
FTrem *vrvFTrem);
941 void UpgradeMensurTo_5_0(pugi::xml_node mensur,
Mensur *vrvMensur);
942 void UpgradeMordentTo_4_0_0(pugi::xml_node mordent,
Mordent *vrvMordent);
943 void UpgradeScoreDefElementTo_4_0_0(pugi::xml_node scoreDefElement,
ScoreDefElement *vrvScoreDefElement);
944 void UpgradeStaffDefTo_4_0_0(pugi::xml_node staffDef,
StaffDef *vrvStaffDef);
945 void UpgradeStaffGrpTo_4_0_0(pugi::xml_node staffGrp,
StaffGrp *vrvStaffGrp);
946 void UpgradeTurnTo_4_0_0(pugi::xml_node turn,
Turn *vrvTurn);
948 void UpgradeMeasureTo_3_0_0(
Measure *measure,
System *system);
949 void UpgradePageTo_3_0_0(
Page *page,
Doc *doc);
956 void ReadAccidAttr(pugi::xml_node node,
Object *
object);
965 std::string m_filename;
970 meiVersion_MEIVERSION m_meiversion;
975 bool m_readingScoreBased;
985 bool IsAllowed(std::string element,
Object *filterParent);
991 pugi::xml_node m_selectedMdiv;
996 std::string m_comment;
999 bool m_deserializing;
1008 static const std::vector<std::string> s_editorialElementNames;
This class models the MEI <accid> element.
Definition: accid.h:37
This class is an interface for elements having a @altsym It is not an abstract class but should not b...
Definition: altsyminterface.h:30
This class is an interface for <anchoredText> elements at the measure level.
Definition: anchoredtext.h:25
This class models the MEI <annot> element.
Definition: annot.h:23
This class models the MEI <annot> element where @type is score.
Definition: annotscore.h:24
This class is an interface for elements implementing vertically and horizontally positionned elements...
Definition: areaposinterface.h:26
This class models the MEI <arpeg> element.
Definition: arpeg.h:31
This class models the MEI <bTrem> element.
Definition: btrem.h:27
This class models the MEI <barLine> element.
Definition: barline.h:34
This class models the MEI <beamSpan> element.
Definition: beamspan.h:36
This class models the MEI <beatRpt> element.
Definition: beatrpt.h:25
This class models the MEI <bracketSpan> element.
Definition: bracketspan.h:28
This class models the MEI <breath> element.
Definition: breath.h:24
This class models the MEI <caesura> element.
Definition: caesura.h:29
This class represents a collection of notes in the same layer with the same onset time.
Definition: chord.h:44
This class models the MEI <clef> element.
Definition: clef.h:39
This class represents elements appearing within a measure.
Definition: controlelement.h:33
This class models the MEI <course> element.
Definition: course.h:23
This class models the MEI <cpMark> element.
Definition: cpmark.h:26
This class models the MEI <dir> element.
Definition: dir.h:33
This class represents an MEI Div.
Definition: div.h:24
This class models the MEI <divLine> element.
Definition: divline.h:31
This class is a hold the data and corresponds to the model of a MVC design pattern.
Definition: doc.h:41
This class is an interface for elements with duration, such as notes and rests.
Definition: durationinterface.h:39
This class is a base class for the editorial element containing musical content, for example <rgd> or...
Definition: editorial.h:43
This class represents a MEI ending.
Definition: ending.h:33
This class represents a MEI expansion.
Definition: expansion.h:26
This class models the MEI <f> element.
Definition: f.h:24
This class models the MEI <fTrem> element.
Definition: ftrem.h:25
Implements the facsimile element in MEI.
Definition: facsimile.h:31
Definition: facsimileinterface.h:27
This class models the MEI <fb> element.
Definition: fb.h:23
This class models the MEI <fermata> element.
Definition: fermata.h:32
This class models the MEI <fig> element.
Definition: fig.h:23
This class models the MEI <fing> element.
Definition: fing.h:25
This class holds generic elements existing within MEI <layer> but not supported by Verovio.
Definition: genericlayerelement.h:22
This class models the MEI <gliss> element.
Definition: gliss.h:28
Definition: gracegrp.h:20
Implements the graphic element in MEI.
Definition: graphic.h:30
This class represents a MEI grpSym.
Definition: grpsym.h:30
This class models the MEI <hairpin> element.
Definition: hairpin.h:31
This class models the MEI <halfmRpt> element.
Definition: halfmrpt.h:26
This class models the MEI <harm> element.
Definition: harm.h:32
This class models the MEI <instrDef> element.
Definition: instrdef.h:28
This class models the MEI <keyAccid> element.
Definition: keyaccid.h:33
This class models the MEI <keySig> element.
Definition: keysig.h:52
This class models the MEI <labelAbbr> element.
Definition: labelabbr.h:22
This class models the MEI <label> element.
Definition: label.h:22
Definition: layerdef.h:18
This class is a base class for the Layer (<layer>) content.
Definition: layerelement.h:51
This class represents a layer in a laid-out score (Doc).
Definition: layer.h:39
This class models the MEI <lb>
Definition: lb.h:23
This class represents a collection of notes in the same layer with successive onset times,...
Definition: ligature.h:28
This class is an interface for elements having a link It is not an abstract class but should not be i...
Definition: linkinginterface.h:31
Definition: liquescent.h:23
This class models the MEI <lv> element.
Definition: lv.h:22
This class is a file output stream for writing MEI files.
Definition: iomei.h:194
void SetSerializing(bool serializing)
Setter for the page-based serialization flag (default is false)
Definition: iomei.h:270
void SetRemoveIds(bool removeIds)
Setter for remove ids flag for the MEI output (default is false)
Definition: iomei.h:275
void SetIndent(int indent)
Setter for indent for the MEI output (default is 3, -1 for tabs)
Definition: iomei.h:260
void SetIgnoreHeader(bool ignoreHeader)
Setter for ignore header flag for the MEI output (default is false)
Definition: iomei.h:265
bool Skip(Object *object) const override
Method for skipping under certain circumstances.
std::string Export() override
The main method for exporting the file to MEI.
bool HasFilter() const
Score based filtering by measure, page or mdiv.
bool WriteObject(Object *object) override
The main method for writing objects.
bool WriteObjectEnd(Object *object) override
Dummy object method that must be overridden in child class.
This class models the MEI <mNum> element.
Definition: mnum.h:31
This class models the MEI <mRest> element.
Definition: mrest.h:32
This class models the MEI <mRpt2> element.
Definition: mrpt2.h:26
This class models the MEI <mRpt> element.
Definition: mrpt.h:26
This class models the MEI <space> element.
Definition: mspace.h:22
This class represent a <mdiv> in page-based MEI.
Definition: mdiv.h:29
This class represents a measure in a page-based score (Doc).
Definition: measure.h:46
This class models the MEI <mensur> element.
Definition: mensur.h:34
This class represents a MEI meterSigGrp.
Definition: metersiggrp.h:28
This class models the MEI <meterSig> element.
Definition: metersig.h:34
This class models the MEI <mordent> element.
Definition: mordent.h:32
This class models the MEI <multiRest> element.
Definition: multirest.h:32
This class models the MEI <multiRpt> element.
Definition: multirpt.h:25
This class models the MEI <nc> element.
Definition: nc.h:41
This class models the MEI <neume> element.
Definition: neume.h:60
This class models the MEI <note> element.
Definition: note.h:67
This class models the MEI <num> element.
Definition: num.h:24
This class represents a basic object.
Definition: object.h:61
This class models the MEI <octave> element.
Definition: octave.h:31
This class models the MEI <ornam> element.
Definition: ornam.h:31
This class is a base class for output classes.
Definition: iobase.h:31
This class represents elements appearing within a page.
Definition: pageelement.h:25
This class represents a page in a laid-out score (Doc).
Definition: page.h:31
This class models an end milestone element and has no MEI equivalent.
Definition: pagemilestone.h:26
This class represent a <pages> in page-based MEI.
Definition: pages.h:27
This class represents a MEI pb in score-based MEI.
Definition: pb.h:25
This class models the MEI <pedal> element.
Definition: pedal.h:34
This class represents an MEI pgHead.
Definition: pghead.h:22
This class models the MEI <dir> element.
Definition: pitchinflection.h:23
This class is an interface for elements with pitch, such as notes and neumes.
Definition: pitchinterface.h:28
This class is an interface for elements having a single time point, such as tempo,...
Definition: plistinterface.h:29
This class is an interface for elements with a position on the staff, such as rests.
Definition: positioninterface.h:30
This class models the MEI <proport> element.
Definition: proport.h:23
Definition: quilisma.h:23
This class models the MEI <ref> element.
Definition: ref.h:23
This class models the MEI <reh> element.
Definition: reh.h:30
This class models the MEI <rend> element.
Definition: rend.h:33
This class models the MEI <ornam> element.
Definition: repeatmark.h:32
This class models the MEI <rest> element.
Definition: rest.h:45
This class represents running elements (headers and footers).
Definition: runningelement.h:28
This class represents a MEI sb in score-based MEI.
Definition: sb.h:25
This class is a base class for MEI scoreDef or staffDef elements.
Definition: scoredef.h:42
This class represents a MEI scoreDef.
Definition: scoredef.h:135
This class is an interface for elements implementing score attributes, such as <scoreDef>,...
Definition: scoredefinterface.h:42
This class represent a <score> in MEI.
Definition: score.h:30
This class represents a MEI section.
Definition: section.h:28
This class models the MEI <space> element.
Definition: space.h:23
This class represents a MEI staffDef.
Definition: staffdef.h:37
This class represents a MEI staffGrp.
Definition: staffgrp.h:39
This class represents a staff in a laid-out score (Doc).
Definition: staff.h:107
This class models a stem as a layer element part and as MEI <stem> element.
Definition: stem.h:27
Definition: supplied.h:20
Implements the surface element in MEI.
Definition: surface.h:30
Syl is a TimeSpanningInterface for managing syllable connectors.
Definition: syl.h:36
This class models the MEI <mensur> element.
Definition: syllable.h:25
Definition: symboldef.h:20
This class models the MEI <symbol> element.
Definition: symbol.h:25
Definition: symboltable.h:20
This class represents elements appearing within a measure.
Definition: systemelement.h:26
This class represents a system in a laid-out score (Doc).
Definition: system.h:36
This class models an end milestone element at the system level.
Definition: systemmilestone.h:28
This class models the MEI <tabDurSym> element.
Definition: tabdursym.h:29
This class models the MEI <tabGrp> element.
Definition: tabgrp.h:23
This class is an interface for <tempo> elements at the measure level.
Definition: tempo.h:33
This class is an interface for elements implementing a text directive, such as <dir>,...
Definition: textdirinterface.h:26
Definition: textelement.h:22
This class models CDATA (text)
Definition: text.h:23
This class represents a text element featuring horizontal and vertical layout.
Definition: textlayoutelement.h:24
This class models the MEI <tie> element.
Definition: tie.h:27
This class is an interface for elements having a single time point, such as tempo,...
Definition: timeinterface.h:39
This class is an interface for spanning elements, such as slur, hairpin, etc.
Definition: timeinterface.h:145
This class models the MEI <trill> element.
Definition: trill.h:34
This class models the MEI <tuning> element.
Definition: tuning.h:23
This class models the MEI <turn> element.
Definition: turn.h:32
Implements the zone element in MEI.
Definition: zone.h:30