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;
118 class PageMilestoneEnd;
125 class PitchInflection;
126 class PitchInterface;
128 class PlistInterface;
129 class PositionInterface;
140 class RunningElement;
143 class ScoreDefElement;
144 class ScoreDefInterface;
163 class SystemMilestoneEnd;
168 class TextDirInterface;
170 class TextLayoutElement;
172 class TimePointInterface;
173 class TimeSpanningInterface;
184 enum class MatchLocation { Before, Here, After };
185 enum class RangeMatchLocation { BeforeStart, AtStart, BetweenStartEnd, AtEnd, AfterEnd };
227 void SetScoreBasedMEI(
bool scoreBasedMEI) { m_scoreBasedMEI = scoreBasedMEI; }
234 void SetBasic(
bool basic) { m_basic = basic; }
235 bool GetBasic()
const {
return m_basic; }
243 void SetFirstPage(
int page);
244 void SetLastPage(
int page);
245 void SetFirstMeasure(
const std::string &
id);
246 void SetLastMeasure(
const std::string &
id);
247 void SetMdiv(
const std::string &
id);
255 bool IsScoreBasedMEI()
const {
return m_scoreBasedMEI; }
256 bool IsPageBasedMEI()
const {
return !m_scoreBasedMEI; }
257 bool IsSerializing()
const {
return m_serializing; }
291 bool IsTreeObject(
Object *
object)
const;
297 bool HasValidFilter()
const;
298 bool IsMatchingFilter()
const;
299 void UpdateFilter(
Object *
object);
300 void UpdatePageFilter(
Object *
object);
301 void UpdateMeasureFilter(
Object *
object);
302 void UpdateMdivFilter(
Object *
object);
303 bool ProcessScoreBasedFilter(
Object *
object);
304 bool ProcessScoreBasedFilterEnd(
Object *
object);
305 void PruneAttributes(pugi::xml_node node);
312 bool WriteObjectInternal(
Object *
object,
bool useCustomScoreDef);
313 bool WriteObjectInternalEnd(
Object *
object);
314 void WriteStackedObjects();
315 void WriteStackedObjectsEnd();
322 void WriteCustomScoreDef(
ScoreDef *scoreDef);
324 bool AdjustLabel(
Label *label);
330 bool WriteDoc(
Doc *doc);
335 void WriteRevisionDesc(pugi::xml_node meiHead);
340 void WriteXmlId(pugi::xml_node currentNode,
Object *
object);
346 void WriteMdiv(pugi::xml_node currentNode,
Mdiv *mdiv);
347 void WritePages(pugi::xml_node currentNode,
Pages *pages);
348 void WriteScore(pugi::xml_node currentNode,
Score *score);
355 void WriteSection(pugi::xml_node currentNode,
Section *section);
356 void WriteEnding(pugi::xml_node currentNote,
Ending *ending);
357 void WriteExpansion(pugi::xml_node currentNote,
Expansion *expansion);
358 void WritePb(pugi::xml_node currentNode,
Pb *pb);
359 void WriteSb(pugi::xml_node currentNode,
Sb *sb);
366 void WritePage(pugi::xml_node currentNode,
Page *page);
367 void WritePageElement(pugi::xml_node element,
PageElement *
object);
368 void WritePageMilestoneEnd(pugi::xml_node currentNode,
PageMilestoneEnd *milestoneEnd);
369 void WriteSystem(pugi::xml_node currentNode,
System *system);
370 void WriteSystemMilestoneEnd(pugi::xml_node currentNode,
SystemMilestoneEnd *milestoneEnd);
371 void WriteScoreDef(pugi::xml_node currentNode,
ScoreDef *scoreDef);
372 void WriteGrpSym(pugi::xml_node currentNode,
GrpSym *grmSym);
373 void WritePgFoot(pugi::xml_node currentNode,
PgFoot *pgFoot);
374 void WritePgHead(pugi::xml_node currentNode,
PgHead *pgHead);
375 void WriteDiv(pugi::xml_node currentNode,
Div *div);
376 void WriteStaffGrp(pugi::xml_node currentNode,
StaffGrp *staffGrp);
377 void WriteStaffDef(pugi::xml_node currentNode,
StaffDef *staffDef);
378 void WriteInstrDef(pugi::xml_node currentNode,
InstrDef *instrDef);
379 void WriteLabel(pugi::xml_node currentNode,
Label *label);
380 void WriteLabelAbbr(pugi::xml_node currentNode,
LabelAbbr *labelAbbr);
381 void WriteLayerDef(pugi::xml_node currentNode,
LayerDef *layerDef);
382 void WriteTuning(pugi::xml_node currentNode,
Tuning *tuning);
383 void WriteCourse(pugi::xml_node currentNode,
Course *course);
384 void WriteSymbolTable(pugi::xml_node currentNode,
SymbolTable *symbolTable);
385 void WriteMeasure(pugi::xml_node currentNode,
Measure *measure);
386 void WriteMeterSigGrp(pugi::xml_node currentNode,
MeterSigGrp *meterSigGrp);
387 void WriteFb(pugi::xml_node currentNode,
Fb *fb);
388 void WriteStaff(pugi::xml_node currentNode,
Staff *staff);
389 void WriteOStaff(pugi::xml_node currentNode,
Staff *oStaff);
390 void WriteLayer(pugi::xml_node currentNode,
Layer *layer);
391 void WriteOssia(pugi::xml_node currentNode,
Ossia *ossia);
399 void WriteAccid(pugi::xml_node currentNode,
Accid *accid);
400 void WriteArtic(pugi::xml_node currentNode,
Artic *artic);
401 void WriteBarLine(pugi::xml_node currentNode,
BarLine *barLine);
402 void WriteBeam(pugi::xml_node currentNode,
Beam *beam);
403 void WriteBeatRpt(pugi::xml_node currentNode,
BeatRpt *beatRpt);
404 void WriteBTrem(pugi::xml_node currentNode,
BTrem *bTrem);
405 void WriteChord(pugi::xml_node currentNode,
Chord *chord);
406 void WriteClef(pugi::xml_node currentNode,
Clef *clef);
407 void WriteCustos(pugi::xml_node currentNode,
Custos *custos);
408 void WriteDivLine(pugi::xml_node currentNode,
DivLine *divLine);
409 void WriteDot(pugi::xml_node currentNode,
Dot *dot);
410 void WriteFTrem(pugi::xml_node currentNode,
FTrem *fTrem);
412 void WriteGraceGrp(pugi::xml_node currentNode,
GraceGrp *graceGrp);
413 void WriteHalfmRpt(pugi::xml_node currentNode,
HalfmRpt *halfmRpt);
414 void WriteKeyAccid(pugi::xml_node currentNode,
KeyAccid *keyAccid);
415 void WriteKeySig(pugi::xml_node currentNode,
KeySig *keySig);
416 void WriteLigature(pugi::xml_node currentNode,
Ligature *ligature);
417 void WriteLiquescent(pugi::xml_node currentNode,
Liquescent *liquescent);
418 void WriteMensur(pugi::xml_node currentNode,
Mensur *mensur);
419 void WriteMeterSig(pugi::xml_node currentNode,
MeterSig *meterSig);
420 void WriteMRest(pugi::xml_node currentNode,
MRest *mRest);
421 void WriteMRpt(pugi::xml_node currentNode,
MRpt *mRpt);
422 void WriteMRpt2(pugi::xml_node currentNode,
MRpt2 *mRpt2);
423 void WriteMSpace(pugi::xml_node currentNode,
MSpace *mSpace);
424 void WriteMultiRest(pugi::xml_node currentNode,
MultiRest *multiRest);
425 void WriteMultiRpt(pugi::xml_node currentNode,
MultiRpt *multiRpt);
426 void WriteNc(pugi::xml_node currentNode,
Nc *nc);
427 void WriteNeume(pugi::xml_node currentNode,
Neume *neume);
428 void WriteNote(pugi::xml_node currentNode,
Note *note);
429 void WriteOriscus(pugi::xml_node currentNode,
Oriscus *oriscus);
430 void WritePlica(pugi::xml_node currentNode,
Plica *plica);
431 void WriteProport(pugi::xml_node currentNode,
Proport *proport);
432 void WriteQuilisma(pugi::xml_node currentNode,
Quilisma *quilisma);
433 void WriteRest(pugi::xml_node currentNode,
Rest *rest);
434 void WriteSpace(pugi::xml_node currentNode,
Space *space);
435 void WriteStem(pugi::xml_node currentNode,
Stem *stem);
436 void WriteSyllable(pugi::xml_node currentNode,
Syllable *syllable);
437 void WriteTabDurSym(pugi::xml_node currentNode,
TabDurSym *tabDurSym);
438 void WriteTabGrp(pugi::xml_node currentNode,
TabGrp *tabGrp);
439 void WriteTuplet(pugi::xml_node currentNode,
Tuplet *tuplet);
446 void WriteAnchoredText(pugi::xml_node currentNode,
AnchoredText *anchoredText);
447 void WriteAnnotScore(pugi::xml_node currentNode,
AnnotScore *annotScore);
448 void WriteArpeg(pugi::xml_node currentNode,
Arpeg *arpeg);
449 void WriteBeamSpan(pugi::xml_node currentNode,
BeamSpan *beamSpan);
450 void WriteBracketSpan(pugi::xml_node currentNode,
BracketSpan *bracketSpan);
451 void WriteBreath(pugi::xml_node currentNode,
Breath *breath);
452 void WriteCaesura(pugi::xml_node currentNode,
Caesura *caesura);
453 void WriteCpMark(pugi::xml_node currentNode,
CpMark *cpMark);
454 void WriteDir(pugi::xml_node currentNode,
Dir *dir);
455 void WriteDynam(pugi::xml_node currentNode,
Dynam *dynam);
456 void WriteFermata(pugi::xml_node currentNode,
Fermata *fermata);
457 void WriteFing(pugi::xml_node currentNode,
Fing *fing);
458 void WriteGliss(pugi::xml_node currentNode,
Gliss *gliss);
459 void WriteHairpin(pugi::xml_node currentNode,
Hairpin *hairpin);
460 void WriteHarm(pugi::xml_node currentNode,
Harm *harm);
461 void WriteLv(pugi::xml_node currentNode,
Lv *lv);
462 void WriteMNum(pugi::xml_node currentNode,
MNum *mnum);
463 void WriteMordent(pugi::xml_node currentNode,
Mordent *mordent);
464 void WriteOctave(pugi::xml_node currentNode,
Octave *octave);
465 void WriteOrnam(pugi::xml_node currentNode,
Ornam *ornam);
466 void WritePedal(pugi::xml_node currentNode,
Pedal *pedal);
467 void WritePhrase(pugi::xml_node currentNode,
Phrase *phrase);
468 void WritePitchInflection(pugi::xml_node currentNode,
PitchInflection *pitchInflection);
469 void WriteReh(pugi::xml_node currentNode,
Reh *reh);
470 void WriteRepeatMark(pugi::xml_node currentNode,
RepeatMark *repeatMark);
471 void WriteSlur(pugi::xml_node currentNode,
Slur *slur);
472 void WriteTempo(pugi::xml_node currentNode,
Tempo *tempo);
473 void WriteTie(pugi::xml_node currentNode,
Tie *tie);
474 void WriteTrill(pugi::xml_node currentNode,
Trill *trill);
475 void WriteTurn(pugi::xml_node currentNode,
Turn *turn);
482 void WriteF(pugi::xml_node currentNode,
F *f);
483 void WriteFig(pugi::xml_node currentNode,
Fig *fig);
484 void WriteLb(pugi::xml_node currentNode,
Lb *lb);
485 void WriteNum(pugi::xml_node currentNode,
Num *num);
486 void WriteRend(pugi::xml_node currentNode,
Rend *rend);
487 void WriteSvg(pugi::xml_node currentNode,
Svg *svg);
488 void WriteSymbol(pugi::xml_node currentNode,
Symbol *symbol);
489 void WriteSymbolDef(pugi::xml_node currentNode,
SymbolDef *symbolDef);
490 void WriteText(pugi::xml_node currentNode,
Text *text);
497 void WriteAbbr(pugi::xml_node currentNode,
Abbr *abbr);
498 void WriteAdd(pugi::xml_node currentNode,
Add *add);
499 void WriteAnnot(pugi::xml_node currentNode,
Annot *annot);
500 void WriteApp(pugi::xml_node currentNode,
App *app);
501 void WriteChoice(pugi::xml_node currentNode,
Choice *choice);
502 void WriteCorr(pugi::xml_node currentNode,
Corr *corr);
503 void WriteDamage(pugi::xml_node currentNode,
Damage *damage);
504 void WriteDel(pugi::xml_node currentNode,
Del *del);
505 void WriteExpan(pugi::xml_node currentNode,
Expan *expan);
506 void WriteLem(pugi::xml_node currentNode,
Lem *lem);
507 void WriteOrig(pugi::xml_node currentNode,
Orig *orig);
508 void WriteRdg(pugi::xml_node currentNode,
Rdg *rdg);
509 void WriteRef(pugi::xml_node currentNode,
Ref *
Ref);
510 void WriteReg(pugi::xml_node currentNode,
Reg *
Reg);
511 void WriteRestore(pugi::xml_node currentNode,
Restore *restore);
512 void WriteSic(pugi::xml_node currentNode,
Sic *sic);
513 void WriteSubst(pugi::xml_node currentNode,
Subst *subst);
514 void WriteSupplied(pugi::xml_node currentNode,
Supplied *supplied);
515 void WriteUnclear(pugi::xml_node currentNode,
Unclear *unclear);
522 void WriteVerse(pugi::xml_node currentNode,
Verse *verse);
523 void WriteSyl(pugi::xml_node currentNode,
Syl *syl);
524 void WriteZone(pugi::xml_node currentNode,
Zone *zone);
525 void WriteSurface(pugi::xml_node currentNode,
Surface *surface);
526 void WriteFacsimile(pugi::xml_node currentNode,
Facsimile *facsimile);
527 void WriteGraphic(pugi::xml_node currentNode,
Graphic *graphic);
533 void WriteUnsupportedAttr(pugi::xml_node currentNode,
Object *
object);
540 void WriteControlElement(pugi::xml_node element,
ControlElement *
object);
541 void WriteEditorialElement(pugi::xml_node element,
EditorialElement *
object);
542 void WriteLayerElement(pugi::xml_node element,
LayerElement *
object);
544 void WriteRunningElement(pugi::xml_node element,
RunningElement *
object);
545 void WriteScoreDefElement(pugi::xml_node element,
ScoreDefElement *
object);
546 void WriteSystemElement(pugi::xml_node element,
SystemElement *
object);
547 void WriteTextElement(pugi::xml_node element,
TextElement *
object);
549 void WriteAltSymInterface(pugi::xml_node currentNode,
AltSymInterface *interface);
550 void WriteAreaPosInterface(pugi::xml_node currentNode,
AreaPosInterface *interface);
551 void WriteDurationInterface(pugi::xml_node currentNode,
DurationInterface *interface);
552 void WriteLinkingInterface(pugi::xml_node currentNode,
LinkingInterface *interface);
554 void WriteOffsetInterface(pugi::xml_node currentNode,
OffsetInterface *interface);
556 void WritePitchInterface(pugi::xml_node currentNode,
PitchInterface *interface);
557 void WritePlistInterface(pugi::xml_node currentNode,
PlistInterface *interface);
558 void WritePositionInterface(pugi::xml_node currentNode,
PositionInterface *interface);
559 void WriteScoreDefInterface(pugi::xml_node currentNode,
ScoreDefInterface *interface);
560 void WriteTextDirInterface(pugi::xml_node currentNode,
TextDirInterface *interface);
561 void WriteTimePointInterface(pugi::xml_node currentNode,
TimePointInterface *interface);
570 std::u32string EscapeSMuFL(std::u32string data);
574 std::string IDToMeiStr(
Object *element);
575 std::string DocTypeToStr(DocType type);
584 bool m_scoreBasedMEI;
591 pugi::xml_node m_mei;
594 pugi::xml_node m_currentNode;
596 std::list<pugi::xml_node> m_nodeStack;
598 std::stack<Object *> m_boundaries;
600 std::deque<Object *> m_objectStack;
605 MatchLocation m_filterMatchLocation;
606 Object *m_firstFilterMatch;
610 std::string m_firstMeasureID;
611 std::string m_lastMeasureID;
612 RangeMatchLocation m_measureFilterMatchLocation;
613 std::string m_mdivID;
614 MatchLocation m_mdivFilterMatchLocation;
619 SetOfConstObjects m_referredObjects;
637 bool Import(
const std::string &mei)
override;
645 bool ReadDoc(pugi::xml_node root);
646 bool ReadIncipits(pugi::xml_node root);
649 bool ReadMdiv(
Object *parent, pugi::xml_node parentNode,
bool isVisible);
650 bool ReadMdivChildren(
Object *parent, pugi::xml_node parentNode,
bool isVisible);
651 bool ReadScore(
Object *parent, pugi::xml_node parentNode);
652 bool ReadScoreScoreDef(
Object *parent, pugi::xml_node parentNode);
659 bool ReadPages(
Object *parent, pugi::xml_node parentNode);
660 bool ReadPage(
Object *parent, pugi::xml_node parentNode);
661 bool ReadPageChildren(
Object *parent, pugi::xml_node parentNode);
662 bool ReadPageMilestoneEnd(
Object *parent, pugi::xml_node milestoneEnd);
663 bool ReadSystem(
Object *parent, pugi::xml_node system);
664 bool ReadSystemChildren(
Object *parent, pugi::xml_node parentNode);
665 bool ReadSystemMilestoneEnd(
Object *parent, pugi::xml_node milestoneEnd);
672 bool ReadSection(
Object *parent, pugi::xml_node section);
673 bool ReadSectionChildren(
Object *parent, pugi::xml_node parentNode);
674 bool ReadEnding(
Object *parent, pugi::xml_node ending);
675 bool ReadExpansion(
Object *parent, pugi::xml_node expansion);
676 bool ReadPb(
Object *parent, pugi::xml_node pb);
677 bool ReadSb(
Object *parent, pugi::xml_node sb);
689 bool ReadScoreDef(
Object *parent, pugi::xml_node scoreDef);
690 bool ReadScoreDefChildren(
Object *parent, pugi::xml_node parentNode);
691 bool ReadGrpSym(
Object *parent, pugi::xml_node grpSym);
692 bool ReadPgFoot(
Object *parent, pugi::xml_node pgFoot);
693 bool ReadPgHead(
Object *parent, pugi::xml_node pgHead);
694 bool ReadDiv(
Object *parent, pugi::xml_node div);
695 bool ReadRunningChildren(
Object *parent, pugi::xml_node parentNode,
Object *filter = NULL);
696 bool ReadStaffGrp(
Object *parent, pugi::xml_node staffGrp);
697 bool ReadStaffGrpChildren(
Object *parent, pugi::xml_node parentNode);
698 bool ReadStaffDef(
Object *parent, pugi::xml_node staffDef);
699 bool ReadStaffDefChildren(
Object *parent, pugi::xml_node parentNode);
700 bool ReadInstrDef(
Object *parent, pugi::xml_node instrDef);
701 bool ReadLabel(
Object *parent, pugi::xml_node label);
702 bool ReadLabelAbbr(
Object *parent, pugi::xml_node labelAbbr);
703 bool ReadTuning(
Object *parent, pugi::xml_node tuning);
704 bool ReadOssia(
Object *parent, pugi::xml_node ossia);
705 bool ReadTuningChildren(
Object *parent, pugi::xml_node parentNode);
706 bool ReadCourse(
Object *parent, pugi::xml_node course);
707 bool ReadSymbolTable(
Object *parent, pugi::xml_node parentNode);
708 bool ReadMeasure(
Object *parent, pugi::xml_node measure);
709 bool ReadMeasureChildren(
Object *parent, pugi::xml_node parentNode);
710 bool ReadMeterSigGrp(
Object *parent, pugi::xml_node meterSigGrp);
711 bool ReadMeterSigGrpChildren(
Object *parent, pugi::xml_node parentNode);
712 bool ReadFb(
Object *parent, pugi::xml_node fb);
713 bool ReadFbChildren(
Object *parent, pugi::xml_node parentNode);
714 bool ReadNum(
Object *parent, pugi::xml_node parentNode);
715 bool ReadStaff(
Object *parent, pugi::xml_node staff);
716 bool ReadOStaff(
Object *parent, pugi::xml_node oStaff);
717 bool ReadStaffChildren(
Object *parent, pugi::xml_node parentNode);
718 bool ReadLayer(
Object *parent, pugi::xml_node layer);
719 bool ReadLayerDef(
Object *parent, pugi::xml_node layerDef);
720 bool ReadLayerDefChildren(
Object *parent, pugi::xml_node parentNode);
721 bool ReadLayerChildren(
Object *parent, pugi::xml_node parentNode,
Object *filter = NULL);
722 bool ReadTextChildren(
Object *parent, pugi::xml_node parentNode,
Object *filter = NULL);
723 bool ReadSymbolDefChildren(
Object *parent, pugi::xml_node parentNode,
Object *filter = NULL);
730 bool ReadAccid(
Object *parent, pugi::xml_node accid);
731 bool ReadArtic(
Object *parent, pugi::xml_node artic);
732 bool ReadBarLine(
Object *parent, pugi::xml_node barLine);
733 bool ReadBeam(
Object *parent, pugi::xml_node beam);
734 bool ReadBeatRpt(
Object *parent, pugi::xml_node beatRpt);
735 bool ReadBTrem(
Object *parent, pugi::xml_node bTrem);
736 bool ReadChord(
Object *parent, pugi::xml_node chord);
737 bool ReadClef(
Object *parent, pugi::xml_node clef);
738 bool ReadCustos(
Object *parent, pugi::xml_node custos);
739 bool ReadDivLine(
Object *parent, pugi::xml_node divLine);
740 bool ReadDot(
Object *parent, pugi::xml_node dot);
741 bool ReadFTrem(
Object *parent, pugi::xml_node fTrem);
742 bool ReadGenericLayerElement(
Object *parent, pugi::xml_node element);
743 bool ReadGraceGrp(
Object *parent, pugi::xml_node graceGrp);
744 bool ReadHalfmRpt(
Object *parent, pugi::xml_node halfmRpt);
745 bool ReadKeyAccid(
Object *parent, pugi::xml_node keyAccid);
746 bool ReadKeySig(
Object *parent, pugi::xml_node keySig);
747 bool ReadLigature(
Object *parent, pugi::xml_node ligature);
748 bool ReadLiquescent(
Object *parent, pugi::xml_node liquescent);
749 bool ReadMensur(
Object *parent, pugi::xml_node mensur);
750 bool ReadMeterSig(
Object *parent, pugi::xml_node meterSig);
751 bool ReadMRest(
Object *parent, pugi::xml_node mRest);
752 bool ReadMRpt(
Object *parent, pugi::xml_node mRpt);
753 bool ReadMRpt2(
Object *parent, pugi::xml_node mRpt2);
754 bool ReadMSpace(
Object *parent, pugi::xml_node mSpace);
755 bool ReadMultiRest(
Object *parent, pugi::xml_node multiRest);
756 bool ReadMultiRpt(
Object *parent, pugi::xml_node multiRpt);
757 bool ReadNc(
Object *parent, pugi::xml_node nc);
758 bool ReadNeume(
Object *parent, pugi::xml_node note);
759 bool ReadNote(
Object *parent, pugi::xml_node note);
760 bool ReadOriscus(
Object *parent, pugi::xml_node oriscus);
761 bool ReadPlica(
Object *parent, pugi::xml_node plica);
762 bool ReadProport(
Object *parent, pugi::xml_node proport);
763 bool ReadQuilisma(
Object *parent, pugi::xml_node quilisma);
764 bool ReadRest(
Object *parent, pugi::xml_node rest);
765 bool ReadSpace(
Object *parent, pugi::xml_node space);
766 bool ReadStem(
Object *parent, pugi::xml_node stem);
767 bool ReadSyl(
Object *parent, pugi::xml_node syl);
768 bool ReadSyllable(
Object *parent, pugi::xml_node syllable);
769 bool ReadTabDurSym(
Object *parent, pugi::xml_node tabDurSym);
770 bool ReadTabGrp(
Object *parent, pugi::xml_node tabGrp);
771 bool ReadTuplet(
Object *parent, pugi::xml_node tuplet);
772 bool ReadVerse(
Object *parent, pugi::xml_node verse);
779 bool ReadAnchoredText(
Object *parent, pugi::xml_node anchoredText);
780 bool ReadArpeg(
Object *parent, pugi::xml_node arpeg);
781 bool ReadBeamSpan(
Object *parent, pugi::xml_node beamSpan);
782 bool ReadBracketSpan(
Object *parent, pugi::xml_node bracketSpan);
783 bool ReadBreath(
Object *parent, pugi::xml_node breath);
784 bool ReadCaesura(
Object *parent, pugi::xml_node caesura);
785 bool ReadCpMark(
Object *parent, pugi::xml_node cpMark);
786 bool ReadDir(
Object *parent, pugi::xml_node dir);
787 bool ReadDynam(
Object *parent, pugi::xml_node dynam);
788 bool ReadFermata(
Object *parent, pugi::xml_node fermata);
789 bool ReadFing(
Object *parent, pugi::xml_node fing);
790 bool ReadGliss(
Object *parent, pugi::xml_node gliss);
791 bool ReadHairpin(
Object *parent, pugi::xml_node hairpin);
792 bool ReadHarm(
Object *parent, pugi::xml_node harm);
793 bool ReadLv(
Object *parent, pugi::xml_node lv);
794 bool ReadMNum(
Object *parent, pugi::xml_node mnum);
795 bool ReadMordent(
Object *parent, pugi::xml_node mordent);
796 bool ReadOctave(
Object *parent, pugi::xml_node octave);
797 bool ReadOrnam(
Object *parent, pugi::xml_node ornam);
798 bool ReadPedal(
Object *parent, pugi::xml_node pedal);
799 bool ReadPhrase(
Object *parent, pugi::xml_node phrase);
800 bool ReadPitchInflection(
Object *parent, pugi::xml_node pitchInflection);
801 bool ReadRepeatMark(
Object *parent, pugi::xml_node repeatMark);
802 bool ReadReh(
Object *parent, pugi::xml_node reh);
803 bool ReadSlur(
Object *parent, pugi::xml_node slur);
804 bool ReadTempo(
Object *parent, pugi::xml_node tempo);
805 bool ReadTie(
Object *parent, pugi::xml_node tie);
806 bool ReadTrill(
Object *parent, pugi::xml_node trill);
807 bool ReadTurn(
Object *parent, pugi::xml_node turn);
814 bool ReadF(
Object *parent, pugi::xml_node f);
815 bool ReadFig(
Object *parent, pugi::xml_node fig);
816 bool ReadLb(
Object *parent, pugi::xml_node lb);
817 bool ReadRend(
Object *parent, pugi::xml_node rend);
818 bool ReadSvg(
Object *parent, pugi::xml_node svg);
819 bool ReadSymbol(
Object *parent, pugi::xml_node symbol);
820 bool ReadSymbolDef(
Object *parent, pugi::xml_node symbolDef);
821 bool ReadText(
Object *parent, pugi::xml_node text,
bool trimLeft,
bool trimRight);
829 bool ReadEditorialElement(
Object *parent, pugi::xml_node app, EditorialLevel level,
Object *filter = NULL);
830 bool ReadAbbr(
Object *parent, pugi::xml_node abbr, EditorialLevel level,
Object *filter = NULL);
831 bool ReadAdd(
Object *parent, pugi::xml_node add, EditorialLevel level,
Object *filter = NULL);
832 bool ReadAnnot(
Object *parent, pugi::xml_node annot);
833 bool ReadAnnotScore(
Object *parent, pugi::xml_node annot);
834 bool ReadApp(
Object *parent, pugi::xml_node app, EditorialLevel level,
Object *filter = NULL);
835 bool ReadAppChildren(
Object *parent, pugi::xml_node parentNode, EditorialLevel level,
Object *filter = NULL);
836 bool ReadChoice(
Object *parent, pugi::xml_node choice, EditorialLevel level,
Object *filter = NULL);
837 bool ReadChoiceChildren(
Object *parent, pugi::xml_node parentNode, EditorialLevel level,
Object *filter = NULL);
838 bool ReadCorr(
Object *parent, pugi::xml_node corr, EditorialLevel level,
Object *filter = NULL);
839 bool ReadDamage(
Object *parent, pugi::xml_node damage, EditorialLevel level,
Object *filter = NULL);
840 bool ReadDel(
Object *parent, pugi::xml_node del, EditorialLevel level,
Object *filter = NULL);
841 bool ReadExpan(
Object *parent, pugi::xml_node expan, EditorialLevel level,
Object *filter = NULL);
842 bool ReadLem(
Object *parent, pugi::xml_node lem, EditorialLevel level,
Object *filter = NULL);
843 bool ReadOrig(
Object *parent, pugi::xml_node orig, EditorialLevel level,
Object *filter = NULL);
844 bool ReadRdg(
Object *parent, pugi::xml_node rdg, EditorialLevel level,
Object *filter = NULL);
845 bool ReadRef(
Object *parent, pugi::xml_node ref, EditorialLevel level,
Object *filter = NULL);
846 bool ReadReg(
Object *parent, pugi::xml_node reg, EditorialLevel level,
Object *filter = NULL);
847 bool ReadRestore(
Object *parent, pugi::xml_node restore, EditorialLevel level,
Object *filter = NULL);
848 bool ReadSic(
Object *parent, pugi::xml_node sic, EditorialLevel level,
Object *filter = NULL);
849 bool ReadSubst(
Object *parent, pugi::xml_node subst, EditorialLevel level,
Object *filter = NULL);
850 bool ReadSubstChildren(
Object *parent, pugi::xml_node parentNode, EditorialLevel level,
Object *filter = NULL);
851 bool ReadSupplied(
Object *parent, pugi::xml_node supplied, EditorialLevel level,
Object *filter = NULL);
852 bool ReadUnclear(
Object *parent, pugi::xml_node unclear, EditorialLevel level,
Object *filter = NULL);
853 bool ReadEditorialChildren(
Object *parent, pugi::xml_node supplied, EditorialLevel level,
Object *filter = NULL);
860 bool ReadControlElement(pugi::xml_node element,
ControlElement *
object);
861 bool ReadEditorialElement(pugi::xml_node element,
EditorialElement *
object);
862 bool ReadLayerElement(pugi::xml_node element,
LayerElement *
object);
864 bool ReadRunningElement(pugi::xml_node element,
RunningElement *
object);
865 bool ReadScoreDefElement(pugi::xml_node element,
ScoreDefElement *
object);
866 bool ReadSystemElement(pugi::xml_node element,
SystemElement *
object);
867 bool ReadTextElement(pugi::xml_node element,
TextElement *
object);
869 bool ReadAltSymInterface(pugi::xml_node element,
AltSymInterface *interface);
870 bool ReadAreaPosInterface(pugi::xml_node element,
AreaPosInterface *interface);
871 bool ReadDurationInterface(pugi::xml_node element,
DurationInterface *interface);
872 bool ReadLinkingInterface(pugi::xml_node element,
LinkingInterface *interface);
874 bool ReadOffsetInterface(pugi::xml_node element,
OffsetInterface *interface);
876 bool ReadPitchInterface(pugi::xml_node element,
PitchInterface *interface);
877 bool ReadPlistInterface(pugi::xml_node element,
PlistInterface *interface);
878 bool ReadPositionInterface(pugi::xml_node element,
PositionInterface *interface);
879 bool ReadScoreDefInterface(pugi::xml_node element,
ScoreDefInterface *interface);
880 bool ReadTextDirInterface(pugi::xml_node element,
TextDirInterface *interface);
889 bool ReadFacsimile(
Doc *doc, pugi::xml_node facsimile);
890 bool ReadGraphic(
Object *parent, pugi::xml_node graphic);
891 bool ReadSurface(
Facsimile *parent, pugi::xml_node surface);
892 bool ReadTupletSpanAsTuplet(
Measure *measure, pugi::xml_node tupletSpan);
893 bool ReadZone(
Surface *parent, pugi::xml_node zone);
899 void ReadUnsupportedAttr(pugi::xml_node element,
Object *
object);
904 bool IsAnnotScore(pugi::xml_node element);
909 bool IsEditorialElementName(std::string elementName);
914 void NormalizeAttributes(pugi::xml_node &xmlElement);
921 bool ReadScoreBasedMei(pugi::xml_node element,
Score *parent);
927 void SetMeiID(pugi::xml_node element,
Object *
object);
928 DocType StrToDocType(std::string type);
929 std::u32string LeftTrim(std::u32string str);
930 std::u32string RightTrim(std::u32string str);
931 bool ReadXMLComment(
Object *
object, pugi::xml_node element);
939 void UpgradeKeySigTo_5_0(pugi::xml_node keySig);
940 void UpgradePageTo_5_0(
Page *page);
941 void UpgradePgHeadFootTo_5_0(pugi::xml_node element);
942 void UpgradeMeasureTo_5_0(pugi::xml_node measure);
943 void UpgradeMeterSigTo_5_0(pugi::xml_node meterSig,
MeterSig *vrvMeterSig);
944 void UpgradeScoreDefElementTo_5_0(pugi::xml_node scoreDefElement);
945 void UpgradeStaffTo_5_0(pugi::xml_node staff);
946 void UpgradeLayerElementTo_5_0(pugi::xml_node element);
947 void UpgradeRendTo_5_0(pugi::xml_node element);
949 void UpgradeBeatRptTo_4_0_0(pugi::xml_node beatRpt,
BeatRpt *vrvBeatRpt);
950 void UpgradeDurGesTo_4_0_0(pugi::xml_node element,
DurationInterface *interface);
951 void UpgradeFTremTo_4_0_0(pugi::xml_node fTrem,
FTrem *vrvFTrem);
952 void UpgradeMensurTo_5_0(pugi::xml_node mensur,
Mensur *vrvMensur);
953 void UpgradeMordentTo_4_0_0(pugi::xml_node mordent,
Mordent *vrvMordent);
954 void UpgradeScoreDefElementTo_4_0_0(pugi::xml_node scoreDefElement,
ScoreDefElement *vrvScoreDefElement);
955 void UpgradeStaffDefTo_4_0_0(pugi::xml_node staffDef,
StaffDef *vrvStaffDef);
956 void UpgradeStaffGrpTo_4_0_0(pugi::xml_node staffGrp,
StaffGrp *vrvStaffGrp);
957 void UpgradeTurnTo_4_0_0(pugi::xml_node turn,
Turn *vrvTurn);
959 void UpgradeMeasureTo_3_0_0(
Measure *measure,
System *system);
960 void UpgradePageTo_3_0_0(
Page *page,
Doc *doc);
967 void ReadAccidAttr(pugi::xml_node node,
Object *
object);
976 std::string m_filename;
981 meiVersion_MEIVERSION m_meiversion;
986 bool m_readingScoreBased;
996 bool IsAllowed(std::string element,
Object *filterParent);
1002 pugi::xml_node m_selectedMdiv;
1007 std::string m_comment;
1010 bool m_deserializing;
1019 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:32
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:197
void SetSerializing(bool serializing)
Setter for the page-based serialization flag (default is false)
Definition: iomei.h:273
void SetRemoveIds(bool removeIds)
Setter for remove ids flag for the MEI output (default is false)
Definition: iomei.h:278
void SetIndent(int indent)
Setter for indent for the MEI output (default is 3, -1 for tabs)
Definition: iomei.h:263
void SetIgnoreHeader(bool ignoreHeader)
Setter for ignore header flag for the MEI output (default is false)
Definition: iomei.h:268
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:33
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 represents an ossia.
Definition: ossia.h:28
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:110
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:32
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:33
Implements the zone element in MEI.
Definition: zone.h:30