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;
110 class OffsetInterface;
111 class OffsetSpanningInterface;
117 class PageMilestoneEnd;
124 class PitchInflection;
125 class PitchInterface;
127 class PlistInterface;
128 class PositionInterface;
139 class RunningElement;
142 class ScoreDefElement;
143 class ScoreDefInterface;
162 class SystemMilestoneEnd;
167 class TextDirInterface;
169 class TextLayoutElement;
171 class TimePointInterface;
172 class TimeSpanningInterface;
183 enum class MatchLocation { Before, Here, After };
184 enum class RangeMatchLocation { BeforeStart, AtStart, BetweenStartEnd, AtEnd, AfterEnd };
226 void SetScoreBasedMEI(
bool scoreBasedMEI) { m_scoreBasedMEI = scoreBasedMEI; }
233 void SetBasic(
bool basic) { m_basic = basic; }
234 bool GetBasic()
const {
return m_basic; }
242 void SetFirstPage(
int page);
243 void SetLastPage(
int page);
244 void SetFirstMeasure(
const std::string &
id);
245 void SetLastMeasure(
const std::string &
id);
246 void SetMdiv(
const std::string &
id);
254 bool IsScoreBasedMEI()
const {
return m_scoreBasedMEI; }
255 bool IsPageBasedMEI()
const {
return !m_scoreBasedMEI; }
256 bool IsSerializing()
const {
return m_serializing; }
290 bool IsTreeObject(
Object *
object)
const;
296 bool HasValidFilter()
const;
297 bool IsMatchingFilter()
const;
298 void UpdateFilter(
Object *
object);
299 void UpdatePageFilter(
Object *
object);
300 void UpdateMeasureFilter(
Object *
object);
301 void UpdateMdivFilter(
Object *
object);
302 bool ProcessScoreBasedFilter(
Object *
object);
303 bool ProcessScoreBasedFilterEnd(
Object *
object);
304 void PruneAttributes(pugi::xml_node node);
311 bool WriteObjectInternal(
Object *
object,
bool useCustomScoreDef);
312 bool WriteObjectInternalEnd(
Object *
object);
313 void WriteStackedObjects();
314 void WriteStackedObjectsEnd();
321 void WriteCustomScoreDef(
ScoreDef *scoreDef);
323 bool AdjustLabel(
Label *label);
329 bool WriteDoc(
Doc *doc);
334 void WriteRevisionDesc(pugi::xml_node meiHead);
339 void WriteXmlId(pugi::xml_node currentNode,
Object *
object);
345 void WriteMdiv(pugi::xml_node currentNode,
Mdiv *mdiv);
346 void WritePages(pugi::xml_node currentNode,
Pages *pages);
347 void WriteScore(pugi::xml_node currentNode,
Score *score);
354 void WriteSection(pugi::xml_node currentNode,
Section *section);
355 void WriteEnding(pugi::xml_node currentNote,
Ending *ending);
356 void WriteExpansion(pugi::xml_node currentNote,
Expansion *expansion);
357 void WritePb(pugi::xml_node currentNode,
Pb *pb);
358 void WriteSb(pugi::xml_node currentNode,
Sb *sb);
365 void WritePage(pugi::xml_node currentNode,
Page *page);
366 void WritePageElement(pugi::xml_node element,
PageElement *
object);
367 void WritePageMilestoneEnd(pugi::xml_node currentNode,
PageMilestoneEnd *milestoneEnd);
368 void WriteSystem(pugi::xml_node currentNode,
System *system);
369 void WriteSystemMilestoneEnd(pugi::xml_node currentNode,
SystemMilestoneEnd *milestoneEnd);
370 void WriteScoreDef(pugi::xml_node currentNode,
ScoreDef *scoreDef);
371 void WriteGrpSym(pugi::xml_node currentNode,
GrpSym *grmSym);
372 void WritePgFoot(pugi::xml_node currentNode,
PgFoot *pgFoot);
373 void WritePgHead(pugi::xml_node currentNode,
PgHead *pgHead);
374 void WriteDiv(pugi::xml_node currentNode,
Div *div);
375 void WriteStaffGrp(pugi::xml_node currentNode,
StaffGrp *staffGrp);
376 void WriteStaffDef(pugi::xml_node currentNode,
StaffDef *staffDef);
377 void WriteInstrDef(pugi::xml_node currentNode,
InstrDef *instrDef);
378 void WriteLabel(pugi::xml_node currentNode,
Label *label);
379 void WriteLabelAbbr(pugi::xml_node currentNode,
LabelAbbr *labelAbbr);
380 void WriteLayerDef(pugi::xml_node currentNode,
LayerDef *layerDef);
381 void WriteTuning(pugi::xml_node currentNode,
Tuning *tuning);
382 void WriteCourse(pugi::xml_node currentNode,
Course *course);
383 void WriteSymbolTable(pugi::xml_node currentNode,
SymbolTable *symbolTable);
384 void WriteMeasure(pugi::xml_node currentNode,
Measure *measure);
385 void WriteMeterSigGrp(pugi::xml_node currentNode,
MeterSigGrp *meterSigGrp);
386 void WriteFb(pugi::xml_node currentNode,
Fb *fb);
387 void WriteStaff(pugi::xml_node currentNode,
Staff *staff);
388 void WriteLayer(pugi::xml_node currentNode,
Layer *layer);
396 void WriteAccid(pugi::xml_node currentNode,
Accid *accid);
397 void WriteArtic(pugi::xml_node currentNode,
Artic *artic);
398 void WriteBarLine(pugi::xml_node currentNode,
BarLine *barLine);
399 void WriteBeam(pugi::xml_node currentNode,
Beam *beam);
400 void WriteBeatRpt(pugi::xml_node currentNode,
BeatRpt *beatRpt);
401 void WriteBTrem(pugi::xml_node currentNode,
BTrem *bTrem);
402 void WriteChord(pugi::xml_node currentNode,
Chord *chord);
403 void WriteClef(pugi::xml_node currentNode,
Clef *clef);
404 void WriteCustos(pugi::xml_node currentNode,
Custos *custos);
405 void WriteDivLine(pugi::xml_node currentNode,
DivLine *divLine);
406 void WriteDot(pugi::xml_node currentNode,
Dot *dot);
407 void WriteFTrem(pugi::xml_node currentNode,
FTrem *fTrem);
409 void WriteGraceGrp(pugi::xml_node currentNode,
GraceGrp *graceGrp);
410 void WriteHalfmRpt(pugi::xml_node currentNode,
HalfmRpt *halfmRpt);
411 void WriteKeyAccid(pugi::xml_node currentNode,
KeyAccid *keyAccid);
412 void WriteKeySig(pugi::xml_node currentNode,
KeySig *keySig);
413 void WriteLigature(pugi::xml_node currentNode,
Ligature *ligature);
414 void WriteLiquescent(pugi::xml_node currentNode,
Liquescent *liquescent);
415 void WriteMensur(pugi::xml_node currentNode,
Mensur *mensur);
416 void WriteMeterSig(pugi::xml_node currentNode,
MeterSig *meterSig);
417 void WriteMRest(pugi::xml_node currentNode,
MRest *mRest);
418 void WriteMRpt(pugi::xml_node currentNode,
MRpt *mRpt);
419 void WriteMRpt2(pugi::xml_node currentNode,
MRpt2 *mRpt2);
420 void WriteMSpace(pugi::xml_node currentNode,
MSpace *mSpace);
421 void WriteMultiRest(pugi::xml_node currentNode,
MultiRest *multiRest);
422 void WriteMultiRpt(pugi::xml_node currentNode,
MultiRpt *multiRpt);
423 void WriteNc(pugi::xml_node currentNode,
Nc *nc);
424 void WriteNeume(pugi::xml_node currentNode,
Neume *neume);
425 void WriteNote(pugi::xml_node currentNode,
Note *note);
426 void WriteOriscus(pugi::xml_node currentNode,
Oriscus *oriscus);
427 void WritePlica(pugi::xml_node currentNode,
Plica *plica);
428 void WriteProport(pugi::xml_node currentNode,
Proport *proport);
429 void WriteQuilisma(pugi::xml_node currentNode,
Quilisma *quilisma);
430 void WriteRest(pugi::xml_node currentNode,
Rest *rest);
431 void WriteSpace(pugi::xml_node currentNode,
Space *space);
432 void WriteStem(pugi::xml_node currentNode,
Stem *stem);
433 void WriteSyllable(pugi::xml_node currentNode,
Syllable *syllable);
434 void WriteTabDurSym(pugi::xml_node currentNode,
TabDurSym *tabDurSym);
435 void WriteTabGrp(pugi::xml_node currentNode,
TabGrp *tabGrp);
436 void WriteTuplet(pugi::xml_node currentNode,
Tuplet *tuplet);
443 void WriteAnchoredText(pugi::xml_node currentNode,
AnchoredText *anchoredText);
444 void WriteAnnotScore(pugi::xml_node currentNode,
AnnotScore *annotScore);
445 void WriteArpeg(pugi::xml_node currentNode,
Arpeg *arpeg);
446 void WriteBeamSpan(pugi::xml_node currentNode,
BeamSpan *beamSpan);
447 void WriteBracketSpan(pugi::xml_node currentNode,
BracketSpan *bracketSpan);
448 void WriteBreath(pugi::xml_node currentNode,
Breath *breath);
449 void WriteCaesura(pugi::xml_node currentNode,
Caesura *caesura);
450 void WriteCpMark(pugi::xml_node currentNode,
CpMark *cpMark);
451 void WriteDir(pugi::xml_node currentNode,
Dir *dir);
452 void WriteDynam(pugi::xml_node currentNode,
Dynam *dynam);
453 void WriteFermata(pugi::xml_node currentNode,
Fermata *fermata);
454 void WriteFing(pugi::xml_node currentNode,
Fing *fing);
455 void WriteGliss(pugi::xml_node currentNode,
Gliss *gliss);
456 void WriteHairpin(pugi::xml_node currentNode,
Hairpin *hairpin);
457 void WriteHarm(pugi::xml_node currentNode,
Harm *harm);
458 void WriteLv(pugi::xml_node currentNode,
Lv *lv);
459 void WriteMNum(pugi::xml_node currentNode,
MNum *mnum);
460 void WriteMordent(pugi::xml_node currentNode,
Mordent *mordent);
461 void WriteOctave(pugi::xml_node currentNode,
Octave *octave);
462 void WriteOrnam(pugi::xml_node currentNode,
Ornam *ornam);
463 void WritePedal(pugi::xml_node currentNode,
Pedal *pedal);
464 void WritePhrase(pugi::xml_node currentNode,
Phrase *phrase);
465 void WritePitchInflection(pugi::xml_node currentNode,
PitchInflection *pitchInflection);
466 void WriteReh(pugi::xml_node currentNode,
Reh *reh);
467 void WriteRepeatMark(pugi::xml_node currentNode,
RepeatMark *repeatMark);
468 void WriteSlur(pugi::xml_node currentNode,
Slur *slur);
469 void WriteTempo(pugi::xml_node currentNode,
Tempo *tempo);
470 void WriteTie(pugi::xml_node currentNode,
Tie *tie);
471 void WriteTrill(pugi::xml_node currentNode,
Trill *trill);
472 void WriteTurn(pugi::xml_node currentNode,
Turn *turn);
479 void WriteF(pugi::xml_node currentNode,
F *f);
480 void WriteFig(pugi::xml_node currentNode,
Fig *fig);
481 void WriteLb(pugi::xml_node currentNode,
Lb *lb);
482 void WriteNum(pugi::xml_node currentNode,
Num *num);
483 void WriteRend(pugi::xml_node currentNode,
Rend *rend);
484 void WriteSvg(pugi::xml_node currentNode,
Svg *svg);
485 void WriteSymbol(pugi::xml_node currentNode,
Symbol *symbol);
486 void WriteSymbolDef(pugi::xml_node currentNode,
SymbolDef *symbolDef);
487 void WriteText(pugi::xml_node currentNode,
Text *text);
494 void WriteAbbr(pugi::xml_node currentNode,
Abbr *abbr);
495 void WriteAdd(pugi::xml_node currentNode,
Add *add);
496 void WriteAnnot(pugi::xml_node currentNode,
Annot *annot);
497 void WriteApp(pugi::xml_node currentNode,
App *app);
498 void WriteChoice(pugi::xml_node currentNode,
Choice *choice);
499 void WriteCorr(pugi::xml_node currentNode,
Corr *corr);
500 void WriteDamage(pugi::xml_node currentNode,
Damage *damage);
501 void WriteDel(pugi::xml_node currentNode,
Del *del);
502 void WriteExpan(pugi::xml_node currentNode,
Expan *expan);
503 void WriteLem(pugi::xml_node currentNode,
Lem *lem);
504 void WriteOrig(pugi::xml_node currentNode,
Orig *orig);
505 void WriteRdg(pugi::xml_node currentNode,
Rdg *rdg);
506 void WriteRef(pugi::xml_node currentNode,
Ref *
Ref);
507 void WriteReg(pugi::xml_node currentNode,
Reg *
Reg);
508 void WriteRestore(pugi::xml_node currentNode,
Restore *restore);
509 void WriteSic(pugi::xml_node currentNode,
Sic *sic);
510 void WriteSubst(pugi::xml_node currentNode,
Subst *subst);
511 void WriteSupplied(pugi::xml_node currentNode,
Supplied *supplied);
512 void WriteUnclear(pugi::xml_node currentNode,
Unclear *unclear);
519 void WriteVerse(pugi::xml_node currentNode,
Verse *verse);
520 void WriteSyl(pugi::xml_node currentNode,
Syl *syl);
521 void WriteZone(pugi::xml_node currentNode,
Zone *zone);
522 void WriteSurface(pugi::xml_node currentNode,
Surface *surface);
523 void WriteFacsimile(pugi::xml_node currentNode,
Facsimile *facsimile);
524 void WriteGraphic(pugi::xml_node currentNode,
Graphic *graphic);
530 void WriteUnsupportedAttr(pugi::xml_node currentNode,
Object *
object);
537 void WriteControlElement(pugi::xml_node element,
ControlElement *
object);
538 void WriteEditorialElement(pugi::xml_node element,
EditorialElement *
object);
539 void WriteLayerElement(pugi::xml_node element,
LayerElement *
object);
541 void WriteRunningElement(pugi::xml_node element,
RunningElement *
object);
542 void WriteScoreDefElement(pugi::xml_node element,
ScoreDefElement *
object);
543 void WriteSystemElement(pugi::xml_node element,
SystemElement *
object);
544 void WriteTextElement(pugi::xml_node element,
TextElement *
object);
546 void WriteAltSymInterface(pugi::xml_node currentNode,
AltSymInterface *interface);
547 void WriteAreaPosInterface(pugi::xml_node currentNode,
AreaPosInterface *interface);
548 void WriteDurationInterface(pugi::xml_node currentNode,
DurationInterface *interface);
549 void WriteLinkingInterface(pugi::xml_node currentNode,
LinkingInterface *interface);
551 void WriteOffsetInterface(pugi::xml_node currentNode,
OffsetInterface *interface);
553 void WritePitchInterface(pugi::xml_node currentNode,
PitchInterface *interface);
554 void WritePlistInterface(pugi::xml_node currentNode,
PlistInterface *interface);
555 void WritePositionInterface(pugi::xml_node currentNode,
PositionInterface *interface);
556 void WriteScoreDefInterface(pugi::xml_node currentNode,
ScoreDefInterface *interface);
557 void WriteTextDirInterface(pugi::xml_node currentNode,
TextDirInterface *interface);
558 void WriteTimePointInterface(pugi::xml_node currentNode,
TimePointInterface *interface);
567 std::u32string EscapeSMuFL(std::u32string data);
571 std::string IDToMeiStr(
Object *element);
572 std::string DocTypeToStr(DocType type);
581 bool m_scoreBasedMEI;
588 pugi::xml_node m_mei;
591 pugi::xml_node m_currentNode;
593 std::list<pugi::xml_node> m_nodeStack;
595 std::stack<Object *> m_boundaries;
597 std::deque<Object *> m_objectStack;
602 MatchLocation m_filterMatchLocation;
603 Object *m_firstFilterMatch;
607 std::string m_firstMeasureID;
608 std::string m_lastMeasureID;
609 RangeMatchLocation m_measureFilterMatchLocation;
610 std::string m_mdivID;
611 MatchLocation m_mdivFilterMatchLocation;
616 SetOfConstObjects m_referredObjects;
634 bool Import(
const std::string &mei)
override;
642 bool ReadDoc(pugi::xml_node root);
643 bool ReadIncipits(pugi::xml_node root);
646 bool ReadMdiv(
Object *parent, pugi::xml_node parentNode,
bool isVisible);
647 bool ReadMdivChildren(
Object *parent, pugi::xml_node parentNode,
bool isVisible);
648 bool ReadScore(
Object *parent, pugi::xml_node parentNode);
649 bool ReadScoreScoreDef(
Object *parent, pugi::xml_node parentNode);
656 bool ReadPages(
Object *parent, pugi::xml_node parentNode);
657 bool ReadPage(
Object *parent, pugi::xml_node parentNode);
658 bool ReadPageChildren(
Object *parent, pugi::xml_node parentNode);
659 bool ReadPageMilestoneEnd(
Object *parent, pugi::xml_node milestoneEnd);
660 bool ReadSystem(
Object *parent, pugi::xml_node system);
661 bool ReadSystemChildren(
Object *parent, pugi::xml_node parentNode);
662 bool ReadSystemMilestoneEnd(
Object *parent, pugi::xml_node milestoneEnd);
669 bool ReadSection(
Object *parent, pugi::xml_node section);
670 bool ReadSectionChildren(
Object *parent, pugi::xml_node parentNode);
671 bool ReadEnding(
Object *parent, pugi::xml_node ending);
672 bool ReadExpansion(
Object *parent, pugi::xml_node expansion);
673 bool ReadPb(
Object *parent, pugi::xml_node pb);
674 bool ReadSb(
Object *parent, pugi::xml_node sb);
686 bool ReadScoreDef(
Object *parent, pugi::xml_node scoreDef);
687 bool ReadScoreDefChildren(
Object *parent, pugi::xml_node parentNode);
688 bool ReadGrpSym(
Object *parent, pugi::xml_node grpSym);
689 bool ReadPgFoot(
Object *parent, pugi::xml_node pgFoot);
690 bool ReadPgHead(
Object *parent, pugi::xml_node pgHead);
691 bool ReadDiv(
Object *parent, pugi::xml_node div);
692 bool ReadRunningChildren(
Object *parent, pugi::xml_node parentNode,
Object *filter = NULL);
693 bool ReadStaffGrp(
Object *parent, pugi::xml_node staffGrp);
694 bool ReadStaffGrpChildren(
Object *parent, pugi::xml_node parentNode);
695 bool ReadStaffDef(
Object *parent, pugi::xml_node staffDef);
696 bool ReadStaffDefChildren(
Object *parent, pugi::xml_node parentNode);
697 bool ReadInstrDef(
Object *parent, pugi::xml_node instrDef);
698 bool ReadLabel(
Object *parent, pugi::xml_node label);
699 bool ReadLabelAbbr(
Object *parent, pugi::xml_node labelAbbr);
700 bool ReadTuning(
Object *parent, pugi::xml_node tuning);
701 bool ReadTuningChildren(
Object *parent, pugi::xml_node parentNode);
702 bool ReadCourse(
Object *parent, pugi::xml_node course);
703 bool ReadSymbolTable(
Object *parent, pugi::xml_node parentNode);
704 bool ReadMeasure(
Object *parent, pugi::xml_node measure);
705 bool ReadMeasureChildren(
Object *parent, pugi::xml_node parentNode);
706 bool ReadMeterSigGrp(
Object *parent, pugi::xml_node meterSigGrp);
707 bool ReadMeterSigGrpChildren(
Object *parent, pugi::xml_node parentNode);
708 bool ReadFb(
Object *parent, pugi::xml_node fb);
709 bool ReadFbChildren(
Object *parent, pugi::xml_node parentNode);
710 bool ReadNum(
Object *parent, pugi::xml_node parentNode);
711 bool ReadStaff(
Object *parent, pugi::xml_node staff);
712 bool ReadStaffChildren(
Object *parent, pugi::xml_node parentNode);
713 bool ReadLayer(
Object *parent, pugi::xml_node layer);
714 bool ReadLayerDef(
Object *parent, pugi::xml_node layerDef);
715 bool ReadLayerDefChildren(
Object *parent, pugi::xml_node parentNode);
716 bool ReadLayerChildren(
Object *parent, pugi::xml_node parentNode,
Object *filter = NULL);
717 bool ReadTextChildren(
Object *parent, pugi::xml_node parentNode,
Object *filter = NULL);
718 bool ReadSymbolDefChildren(
Object *parent, pugi::xml_node parentNode,
Object *filter = NULL);
725 bool ReadAccid(
Object *parent, pugi::xml_node accid);
726 bool ReadArtic(
Object *parent, pugi::xml_node artic);
727 bool ReadBarLine(
Object *parent, pugi::xml_node barLine);
728 bool ReadBeam(
Object *parent, pugi::xml_node beam);
729 bool ReadBeatRpt(
Object *parent, pugi::xml_node beatRpt);
730 bool ReadBTrem(
Object *parent, pugi::xml_node bTrem);
731 bool ReadChord(
Object *parent, pugi::xml_node chord);
732 bool ReadClef(
Object *parent, pugi::xml_node clef);
733 bool ReadCustos(
Object *parent, pugi::xml_node custos);
734 bool ReadDivLine(
Object *parent, pugi::xml_node divLine);
735 bool ReadDot(
Object *parent, pugi::xml_node dot);
736 bool ReadFTrem(
Object *parent, pugi::xml_node fTrem);
737 bool ReadGenericLayerElement(
Object *parent, pugi::xml_node element);
738 bool ReadGraceGrp(
Object *parent, pugi::xml_node graceGrp);
739 bool ReadHalfmRpt(
Object *parent, pugi::xml_node halfmRpt);
740 bool ReadKeyAccid(
Object *parent, pugi::xml_node keyAccid);
741 bool ReadKeySig(
Object *parent, pugi::xml_node keySig);
742 bool ReadLigature(
Object *parent, pugi::xml_node ligature);
743 bool ReadLiquescent(
Object *parent, pugi::xml_node liquescent);
744 bool ReadMensur(
Object *parent, pugi::xml_node mensur);
745 bool ReadMeterSig(
Object *parent, pugi::xml_node meterSig);
746 bool ReadMRest(
Object *parent, pugi::xml_node mRest);
747 bool ReadMRpt(
Object *parent, pugi::xml_node mRpt);
748 bool ReadMRpt2(
Object *parent, pugi::xml_node mRpt2);
749 bool ReadMSpace(
Object *parent, pugi::xml_node mSpace);
750 bool ReadMultiRest(
Object *parent, pugi::xml_node multiRest);
751 bool ReadMultiRpt(
Object *parent, pugi::xml_node multiRpt);
752 bool ReadNc(
Object *parent, pugi::xml_node nc);
753 bool ReadNeume(
Object *parent, pugi::xml_node note);
754 bool ReadNote(
Object *parent, pugi::xml_node note);
755 bool ReadOriscus(
Object *parent, pugi::xml_node oriscus);
756 bool ReadPlica(
Object *parent, pugi::xml_node plica);
757 bool ReadProport(
Object *parent, pugi::xml_node proport);
758 bool ReadQuilisma(
Object *parent, pugi::xml_node quilisma);
759 bool ReadRest(
Object *parent, pugi::xml_node rest);
760 bool ReadSpace(
Object *parent, pugi::xml_node space);
761 bool ReadStem(
Object *parent, pugi::xml_node stem);
762 bool ReadSyl(
Object *parent, pugi::xml_node syl);
763 bool ReadSyllable(
Object *parent, pugi::xml_node syllable);
764 bool ReadTabDurSym(
Object *parent, pugi::xml_node tabDurSym);
765 bool ReadTabGrp(
Object *parent, pugi::xml_node tabGrp);
766 bool ReadTuplet(
Object *parent, pugi::xml_node tuplet);
767 bool ReadVerse(
Object *parent, pugi::xml_node verse);
774 bool ReadAnchoredText(
Object *parent, pugi::xml_node anchoredText);
775 bool ReadArpeg(
Object *parent, pugi::xml_node arpeg);
776 bool ReadBeamSpan(
Object *parent, pugi::xml_node beamSpan);
777 bool ReadBracketSpan(
Object *parent, pugi::xml_node bracketSpan);
778 bool ReadBreath(
Object *parent, pugi::xml_node breath);
779 bool ReadCaesura(
Object *parent, pugi::xml_node caesura);
780 bool ReadCpMark(
Object *parent, pugi::xml_node cpMark);
781 bool ReadDir(
Object *parent, pugi::xml_node dir);
782 bool ReadDynam(
Object *parent, pugi::xml_node dynam);
783 bool ReadFermata(
Object *parent, pugi::xml_node fermata);
784 bool ReadFing(
Object *parent, pugi::xml_node fing);
785 bool ReadGliss(
Object *parent, pugi::xml_node gliss);
786 bool ReadHairpin(
Object *parent, pugi::xml_node hairpin);
787 bool ReadHarm(
Object *parent, pugi::xml_node harm);
788 bool ReadLv(
Object *parent, pugi::xml_node lv);
789 bool ReadMNum(
Object *parent, pugi::xml_node mnum);
790 bool ReadMordent(
Object *parent, pugi::xml_node mordent);
791 bool ReadOctave(
Object *parent, pugi::xml_node octave);
792 bool ReadOrnam(
Object *parent, pugi::xml_node ornam);
793 bool ReadPedal(
Object *parent, pugi::xml_node pedal);
794 bool ReadPhrase(
Object *parent, pugi::xml_node phrase);
795 bool ReadPitchInflection(
Object *parent, pugi::xml_node pitchInflection);
796 bool ReadRepeatMark(
Object *parent, pugi::xml_node repeatMark);
797 bool ReadReh(
Object *parent, pugi::xml_node reh);
798 bool ReadSlur(
Object *parent, pugi::xml_node slur);
799 bool ReadTempo(
Object *parent, pugi::xml_node tempo);
800 bool ReadTie(
Object *parent, pugi::xml_node tie);
801 bool ReadTrill(
Object *parent, pugi::xml_node trill);
802 bool ReadTurn(
Object *parent, pugi::xml_node turn);
809 bool ReadF(
Object *parent, pugi::xml_node f);
810 bool ReadFig(
Object *parent, pugi::xml_node fig);
811 bool ReadLb(
Object *parent, pugi::xml_node lb);
812 bool ReadRend(
Object *parent, pugi::xml_node rend);
813 bool ReadSvg(
Object *parent, pugi::xml_node svg);
814 bool ReadSymbol(
Object *parent, pugi::xml_node symbol);
815 bool ReadSymbolDef(
Object *parent, pugi::xml_node symbolDef);
816 bool ReadText(
Object *parent, pugi::xml_node text,
bool trimLeft,
bool trimRight);
824 bool ReadEditorialElement(
Object *parent, pugi::xml_node app, EditorialLevel level,
Object *filter = NULL);
825 bool ReadAbbr(
Object *parent, pugi::xml_node abbr, EditorialLevel level,
Object *filter = NULL);
826 bool ReadAdd(
Object *parent, pugi::xml_node add, EditorialLevel level,
Object *filter = NULL);
827 bool ReadAnnot(
Object *parent, pugi::xml_node annot);
828 bool ReadAnnotScore(
Object *parent, pugi::xml_node annot);
829 bool ReadApp(
Object *parent, pugi::xml_node app, EditorialLevel level,
Object *filter = NULL);
830 bool ReadAppChildren(
Object *parent, pugi::xml_node parentNode, EditorialLevel level,
Object *filter = NULL);
831 bool ReadChoice(
Object *parent, pugi::xml_node choice, EditorialLevel level,
Object *filter = NULL);
832 bool ReadChoiceChildren(
Object *parent, pugi::xml_node parentNode, EditorialLevel level,
Object *filter = NULL);
833 bool ReadCorr(
Object *parent, pugi::xml_node corr, EditorialLevel level,
Object *filter = NULL);
834 bool ReadDamage(
Object *parent, pugi::xml_node damage, EditorialLevel level,
Object *filter = NULL);
835 bool ReadDel(
Object *parent, pugi::xml_node del, EditorialLevel level,
Object *filter = NULL);
836 bool ReadExpan(
Object *parent, pugi::xml_node expan, EditorialLevel level,
Object *filter = NULL);
837 bool ReadLem(
Object *parent, pugi::xml_node lem, EditorialLevel level,
Object *filter = NULL);
838 bool ReadOrig(
Object *parent, pugi::xml_node orig, EditorialLevel level,
Object *filter = NULL);
839 bool ReadRdg(
Object *parent, pugi::xml_node rdg, EditorialLevel level,
Object *filter = NULL);
840 bool ReadRef(
Object *parent, pugi::xml_node ref, EditorialLevel level,
Object *filter = NULL);
841 bool ReadReg(
Object *parent, pugi::xml_node reg, EditorialLevel level,
Object *filter = NULL);
842 bool ReadRestore(
Object *parent, pugi::xml_node restore, EditorialLevel level,
Object *filter = NULL);
843 bool ReadSic(
Object *parent, pugi::xml_node sic, EditorialLevel level,
Object *filter = NULL);
844 bool ReadSubst(
Object *parent, pugi::xml_node subst, EditorialLevel level,
Object *filter = NULL);
845 bool ReadSubstChildren(
Object *parent, pugi::xml_node parentNode, EditorialLevel level,
Object *filter = NULL);
846 bool ReadSupplied(
Object *parent, pugi::xml_node supplied, EditorialLevel level,
Object *filter = NULL);
847 bool ReadUnclear(
Object *parent, pugi::xml_node unclear, EditorialLevel level,
Object *filter = NULL);
848 bool ReadEditorialChildren(
Object *parent, pugi::xml_node supplied, EditorialLevel level,
Object *filter = NULL);
855 bool ReadControlElement(pugi::xml_node element,
ControlElement *
object);
856 bool ReadEditorialElement(pugi::xml_node element,
EditorialElement *
object);
857 bool ReadLayerElement(pugi::xml_node element,
LayerElement *
object);
859 bool ReadRunningElement(pugi::xml_node element,
RunningElement *
object);
860 bool ReadScoreDefElement(pugi::xml_node element,
ScoreDefElement *
object);
861 bool ReadSystemElement(pugi::xml_node element,
SystemElement *
object);
862 bool ReadTextElement(pugi::xml_node element,
TextElement *
object);
864 bool ReadAltSymInterface(pugi::xml_node element,
AltSymInterface *interface);
865 bool ReadAreaPosInterface(pugi::xml_node element,
AreaPosInterface *interface);
866 bool ReadDurationInterface(pugi::xml_node element,
DurationInterface *interface);
867 bool ReadLinkingInterface(pugi::xml_node element,
LinkingInterface *interface);
869 bool ReadOffsetInterface(pugi::xml_node element,
OffsetInterface *interface);
871 bool ReadPitchInterface(pugi::xml_node element,
PitchInterface *interface);
872 bool ReadPlistInterface(pugi::xml_node element,
PlistInterface *interface);
873 bool ReadPositionInterface(pugi::xml_node element,
PositionInterface *interface);
874 bool ReadScoreDefInterface(pugi::xml_node element,
ScoreDefInterface *interface);
875 bool ReadTextDirInterface(pugi::xml_node element,
TextDirInterface *interface);
884 bool ReadFacsimile(
Doc *doc, pugi::xml_node facsimile);
885 bool ReadGraphic(
Object *parent, pugi::xml_node graphic);
886 bool ReadSurface(
Facsimile *parent, pugi::xml_node surface);
887 bool ReadTupletSpanAsTuplet(
Measure *measure, pugi::xml_node tupletSpan);
888 bool ReadZone(
Surface *parent, pugi::xml_node zone);
894 void ReadUnsupportedAttr(pugi::xml_node element,
Object *
object);
899 bool IsAnnotScore(pugi::xml_node element);
904 bool IsEditorialElementName(std::string elementName);
909 void NormalizeAttributes(pugi::xml_node &xmlElement);
916 bool ReadScoreBasedMei(pugi::xml_node element,
Score *parent);
922 void SetMeiID(pugi::xml_node element,
Object *
object);
923 DocType StrToDocType(std::string type);
924 std::u32string LeftTrim(std::u32string str);
925 std::u32string RightTrim(std::u32string str);
926 bool ReadXMLComment(
Object *
object, pugi::xml_node element);
934 void UpgradeKeySigTo_5_0(pugi::xml_node keySig);
935 void UpgradePageTo_5_0(
Page *page);
936 void UpgradePgHeadFootTo_5_0(pugi::xml_node element);
937 void UpgradeMeasureTo_5_0(pugi::xml_node measure);
938 void UpgradeMeterSigTo_5_0(pugi::xml_node meterSig,
MeterSig *vrvMeterSig);
939 void UpgradeScoreDefElementTo_5_0(pugi::xml_node scoreDefElement);
940 void UpgradeStaffTo_5_0(pugi::xml_node staff);
941 void UpgradeLayerElementTo_5_0(pugi::xml_node element);
942 void UpgradeRendTo_5_0(pugi::xml_node element);
944 void UpgradeBeatRptTo_4_0_0(pugi::xml_node beatRpt,
BeatRpt *vrvBeatRpt);
945 void UpgradeDurGesTo_4_0_0(pugi::xml_node element,
DurationInterface *interface);
946 void UpgradeFTremTo_4_0_0(pugi::xml_node fTrem,
FTrem *vrvFTrem);
947 void UpgradeMensurTo_5_0(pugi::xml_node mensur,
Mensur *vrvMensur);
948 void UpgradeMordentTo_4_0_0(pugi::xml_node mordent,
Mordent *vrvMordent);
949 void UpgradeScoreDefElementTo_4_0_0(pugi::xml_node scoreDefElement,
ScoreDefElement *vrvScoreDefElement);
950 void UpgradeStaffDefTo_4_0_0(pugi::xml_node staffDef,
StaffDef *vrvStaffDef);
951 void UpgradeStaffGrpTo_4_0_0(pugi::xml_node staffGrp,
StaffGrp *vrvStaffGrp);
952 void UpgradeTurnTo_4_0_0(pugi::xml_node turn,
Turn *vrvTurn);
954 void UpgradeMeasureTo_3_0_0(
Measure *measure,
System *system);
955 void UpgradePageTo_3_0_0(
Page *page,
Doc *doc);
962 void ReadAccidAttr(pugi::xml_node node,
Object *
object);
971 std::string m_filename;
976 meiVersion_MEIVERSION m_meiversion;
981 bool m_readingScoreBased;
991 bool IsAllowed(std::string element,
Object *filterParent);
997 pugi::xml_node m_selectedMdiv;
1002 std::string m_comment;
1005 bool m_deserializing;
1014 static const std::vector<std::string> s_editorialElementNames;
This class models the MEI <accid> element.
Definition: accid.h:41
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:41
This class represents elements appearing within a measure.
Definition: controlelement.h:35
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:33
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:27
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:28
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:196
void SetSerializing(bool serializing)
Setter for the page-based serialization flag (default is false)
Definition: iomei.h:272
void SetRemoveIds(bool removeIds)
Setter for remove ids flag for the MEI output (default is false)
Definition: iomei.h:277
void SetIndent(int indent)
Setter for indent for the MEI output (default is 3, -1 for tabs)
Definition: iomei.h:262
void SetIgnoreHeader(bool ignoreHeader)
Setter for ignore header flag for the MEI output (default is false)
Definition: iomei.h:267
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:36
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:32
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:43
This class models the MEI <neume> element.
Definition: neume.h:60
This class models the MEI <note> element.
Definition: note.h:69
This class models the MEI <num> element.
Definition: num.h:24
This class represents a basic object.
Definition: object.h:64
This class models the MEI <octave> element.
Definition: octave.h:31
This class is an interface for elements having a single visual offset, such as arpeg,...
Definition: offsetinterface.h:28
This class is an interface for elements having spanning visual offsets, such as slur,...
Definition: offsetinterface.h:72
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:28
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:49
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:38
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:24
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:35
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