Verovio
Source code documentation
iomei.h
1 // Name: iomei.h
3 // Author: Laurent Pugin
4 // Created: 2011
5 // Copyright (c) Authors and others. All rights reserved.
7 
8 #ifndef __VRV_IOMEI_H__
9 #define __VRV_IOMEI_H__
10 
11 #include <sstream>
12 #include <stack>
13 
14 //----------------------------------------------------------------------------
15 
16 #include "doc.h"
17 #include "iobase.h"
18 
19 //----------------------------------------------------------------------------
20 
21 #include "pugixml.hpp"
22 
23 namespace vrv {
24 
25 class Abbr;
26 class Accid;
27 class Add;
28 class AltSymInterface;
29 class AnchoredText;
30 class Annot;
31 class AnnotScore;
32 class App;
33 class AreaPosInterface;
34 class Arpeg;
35 class Artic;
36 class BarLine;
37 class Beam;
38 class BeamSpan;
39 class BeatRpt;
40 class BracketSpan;
41 class Breath;
42 class BTrem;
43 class Caesura;
44 class Choice;
45 class Chord;
46 class Clef;
47 class ControlElement;
48 class Corr;
49 class Course;
50 class CpMark;
51 class Custos;
52 class Damage;
53 class Del;
54 class Dot;
55 class Dir;
56 class Div;
57 class DivLine;
58 class DurationInterface;
59 class Dynam;
60 class Ending;
61 class Episema;
62 class Expan;
63 class Expansion;
64 class F;
65 class Fb;
66 class Fig;
67 class Fing;
68 class Fermata;
69 class FloatingElement;
70 class FTrem;
71 class GenericLayerElement;
72 class Gliss;
73 class GraceGrp;
74 class Graphic;
75 class GrpSym;
76 class Hairpin;
77 class HalfmRpt;
78 class Harm;
79 class KeyAccid;
80 class KeySig;
81 class LinkingInterface;
82 class InstrDef;
83 class Label;
84 class LabelAbbr;
85 class Layer;
86 class LayerDef;
87 class LayerElement;
88 class Lb;
89 class Lem;
90 class Ligature;
91 class Liquescent;
92 class Lv;
93 class Mdiv;
94 class Measure;
95 class Mensur;
96 class MeterSig;
97 class MeterSigGrp;
98 class MNum;
99 class Mordent;
100 class MRest;
101 class MRpt;
102 class MRpt2;
103 class MSpace;
104 class MultiRest;
105 class MultiRpt;
106 class Nc;
107 class Neume;
108 class Note;
109 class Num;
110 class Octave;
111 class OffsetInterface;
112 class OffsetSpanningInterface;
113 class Orig;
114 class Oriscus;
115 class Ornam;
116 class Ossia;
117 class Page;
118 class PageElement;
119 class PageMilestoneEnd;
120 class Pages;
121 class Part;
122 class Parts;
123 class Pb;
124 class Pedal;
125 class PgFoot;
126 class PgHead;
127 class Phrase;
128 class PitchInflection;
129 class PitchInterface;
130 class Plica;
131 class PlistInterface;
132 class PositionInterface;
133 class Proport;
134 class Quilisma;
135 class Rdg;
136 class Ref;
137 class Reg;
138 class Reh;
139 class Rend;
140 class RepeatMark;
141 class Rest;
142 class Restore;
143 class Refrain;
144 class RunningElement;
145 class Score;
146 class ScoreOrPartElement;
147 class ScoreDef;
148 class ScoreDefElement;
149 class ScoreDefInterface;
150 class Sb;
151 class Section;
152 class Sic;
153 class Slur;
154 class Space;
155 class Staff;
156 class Stem;
157 class Strophicus;
158 class Subst;
159 class Supplied;
160 class Surface;
161 class Svg;
162 class Syl;
163 class Syllable;
164 class Symbol;
165 class SymbolDef;
166 class SymbolTable;
167 class System;
168 class SystemElement;
169 class SystemMilestoneEnd;
170 class TabDurSym;
171 class TabGrp;
172 class Tempo;
173 class Text;
174 class TextDirInterface;
175 class TextElement;
176 class TextLayoutElement;
177 class Tie;
178 class TimePointInterface;
179 class TimeSpanningInterface;
180 class Trill;
181 class Tuning;
182 class Turn;
183 class Tuplet;
184 class Unclear;
185 class Volta;
186 class Verse;
187 class LyricElement;
188 class Zone;
189 
190 // Helper enums
192 enum class MatchLocation { Before, Here, After };
193 enum class RangeMatchLocation { BeforeStart, AtStart, BetweenStartEnd, AtEnd, AfterEnd };
195 
196 //----------------------------------------------------------------------------
197 // MEIOutput
198 //----------------------------------------------------------------------------
199 
205 class MEIOutput : public Output {
206 public:
209  MEIOutput(Doc *doc);
210  virtual ~MEIOutput();
212 
216  std::string Export() override;
217 
221  bool Skip(Object *object) const override;
222 
227  bool WriteObject(Object *object) override;
228  bool WriteObjectEnd(Object *object) override;
230 
235  void SetScoreBasedMEI(bool scoreBasedMEI) { m_scoreBasedMEI = scoreBasedMEI; }
237 
242  void SetBasic(bool basic) { m_basic = basic; }
243  bool GetBasic() const { return m_basic; }
245 
250  bool HasFilter() const;
251  void SetFirstPage(int page);
252  void SetLastPage(int page);
253  void SetFirstMeasure(const std::string &id);
254  void SetLastMeasure(const std::string &id);
255  void SetMdiv(const std::string &id);
256  void ResetFilter();
258 
263  bool IsScoreBasedMEI() const { return m_scoreBasedMEI; }
264  bool IsPageBasedMEI() const { return !m_scoreBasedMEI; }
265  bool IsSerializing() const { return m_serializing; }
267 
271  void SetIndent(int indent) { m_indent = indent; }
272 
276  void SetIgnoreHeader(bool ignoreHeader) { m_ignoreHeader = ignoreHeader; }
277 
281  void SetSerializing(bool serializing) { m_serializing = serializing; }
282 
286  void SetRemoveIds(bool removeIds) { m_removeIds = removeIds; }
287 
288 private:
292  void Reset();
293 
299  bool IsTreeObject(Object *object) const;
300 
305  bool HasValidFilter() const;
306  bool IsMatchingFilter() const;
307  void UpdateFilter(Object *object);
308  void UpdatePageFilter(Object *object);
309  void UpdateMeasureFilter(Object *object);
310  void UpdateMdivFilter(Object *object);
311  bool ProcessScoreBasedFilter(Object *object);
312  bool ProcessScoreBasedFilterEnd(Object *object);
313  void PruneAttributes(pugi::xml_node node);
315 
320  bool WriteObjectInternal(Object *object, bool useCustomScoreDef);
321  bool WriteObjectInternalEnd(Object *object);
322  void WriteStackedObjects();
323  void WriteStackedObjectsEnd();
325 
330  void WriteCustomScoreDef(ScoreDef *scoreDef);
331  void AdjustStaffDef(StaffDef *staffDef, Measure *measure);
332  bool AdjustLabel(Label *label);
334 
338  bool WriteDoc(Doc *doc);
339 
343  void WriteRevisionDesc(pugi::xml_node meiHead);
344 
348  void WriteXmlId(pugi::xml_node currentNode, Object *object);
349 
354  void WriteMdiv(pugi::xml_node currentNode, Mdiv *mdiv);
355  void WritePages(pugi::xml_node currentNode, Pages *pages);
356  void WriteParts(pugi::xml_node currentNode, Parts *parts);
357  void WriteScoreOrPartElement(pugi::xml_node currentNode, ScoreOrPartElement *scoreOrPartElement);
358  void WritePart(pugi::xml_node currentNode, Part *part);
359  void WriteScore(pugi::xml_node currentNode, Score *score);
361 
366  void WriteSection(pugi::xml_node currentNode, Section *section);
367  void WriteEnding(pugi::xml_node currentNote, Ending *ending);
368  void WriteExpansion(pugi::xml_node currentNote, Expansion *expansion);
369  void WritePb(pugi::xml_node currentNode, Pb *pb);
370  void WriteSb(pugi::xml_node currentNode, Sb *sb);
372 
377  void WritePage(pugi::xml_node currentNode, Page *page);
378  void WritePageElement(pugi::xml_node element, PageElement *object);
379  void WritePageMilestoneEnd(pugi::xml_node currentNode, PageMilestoneEnd *milestoneEnd);
380  void WriteSystem(pugi::xml_node currentNode, System *system);
381  void WriteSystemMilestoneEnd(pugi::xml_node currentNode, SystemMilestoneEnd *milestoneEnd);
382  void WriteScoreDef(pugi::xml_node currentNode, ScoreDef *scoreDef);
383  void WriteGrpSym(pugi::xml_node currentNode, GrpSym *grmSym);
384  void WritePgFoot(pugi::xml_node currentNode, PgFoot *pgFoot);
385  void WritePgHead(pugi::xml_node currentNode, PgHead *pgHead);
386  void WriteDiv(pugi::xml_node currentNode, Div *div);
387  void WriteStaffGrp(pugi::xml_node currentNode, StaffGrp *staffGrp);
388  void WriteStaffDef(pugi::xml_node currentNode, StaffDef *staffDef);
389  void WriteInstrDef(pugi::xml_node currentNode, InstrDef *instrDef);
390  void WriteLabel(pugi::xml_node currentNode, Label *label);
391  void WriteLabelAbbr(pugi::xml_node currentNode, LabelAbbr *labelAbbr);
392  void WriteLayerDef(pugi::xml_node currentNode, LayerDef *layerDef);
393  void WriteTuning(pugi::xml_node currentNode, Tuning *tuning);
394  void WriteCourse(pugi::xml_node currentNode, Course *course);
395  void WriteSymbolTable(pugi::xml_node currentNode, SymbolTable *symbolTable);
396  void WriteMeasure(pugi::xml_node currentNode, Measure *measure);
397  void WriteMeterSigGrp(pugi::xml_node currentNode, MeterSigGrp *meterSigGrp);
398  void WriteFb(pugi::xml_node currentNode, Fb *fb);
399  void WriteStaff(pugi::xml_node currentNode, Staff *staff);
400  void WriteOStaff(pugi::xml_node currentNode, Staff *oStaff);
401  void WriteLayer(pugi::xml_node currentNode, Layer *layer);
402  void WriteOssia(pugi::xml_node currentNode, Ossia *ossia);
404 
410  void WriteAccid(pugi::xml_node currentNode, Accid *accid);
411  void WriteArtic(pugi::xml_node currentNode, Artic *artic);
412  void WriteBarLine(pugi::xml_node currentNode, BarLine *barLine);
413  void WriteBeam(pugi::xml_node currentNode, Beam *beam);
414  void WriteBeatRpt(pugi::xml_node currentNode, BeatRpt *beatRpt);
415  void WriteBTrem(pugi::xml_node currentNode, BTrem *bTrem);
416  void WriteChord(pugi::xml_node currentNode, Chord *chord);
417  void WriteClef(pugi::xml_node currentNode, Clef *clef);
418  void WriteCustos(pugi::xml_node currentNode, Custos *custos);
419  void WriteDivLine(pugi::xml_node currentNode, DivLine *divLine);
420  void WriteDot(pugi::xml_node currentNode, Dot *dot);
421  void WriteEpisema(pugi::xml_node currentNode, Episema *episema);
422  void WriteFTrem(pugi::xml_node currentNode, FTrem *fTrem);
423  void WriteGenericLayerElement(pugi::xml_node currentNode, GenericLayerElement *element);
424  void WriteGraceGrp(pugi::xml_node currentNode, GraceGrp *graceGrp);
425  void WriteHalfmRpt(pugi::xml_node currentNode, HalfmRpt *halfmRpt);
426  void WriteKeyAccid(pugi::xml_node currentNode, KeyAccid *keyAccid);
427  void WriteKeySig(pugi::xml_node currentNode, KeySig *keySig);
428  void WriteLigature(pugi::xml_node currentNode, Ligature *ligature);
429  void WriteLiquescent(pugi::xml_node currentNode, Liquescent *liquescent);
430  void WriteMensur(pugi::xml_node currentNode, Mensur *mensur);
431  void WriteMeterSig(pugi::xml_node currentNode, MeterSig *meterSig);
432  void WriteMRest(pugi::xml_node currentNode, MRest *mRest);
433  void WriteMRpt(pugi::xml_node currentNode, MRpt *mRpt);
434  void WriteMRpt2(pugi::xml_node currentNode, MRpt2 *mRpt2);
435  void WriteMSpace(pugi::xml_node currentNode, MSpace *mSpace);
436  void WriteMultiRest(pugi::xml_node currentNode, MultiRest *multiRest);
437  void WriteMultiRpt(pugi::xml_node currentNode, MultiRpt *multiRpt);
438  void WriteNc(pugi::xml_node currentNode, Nc *nc);
439  void WriteNeume(pugi::xml_node currentNode, Neume *neume);
440  void WriteNote(pugi::xml_node currentNode, Note *note);
441  void WriteOriscus(pugi::xml_node currentNode, Oriscus *oriscus);
442  void WritePlica(pugi::xml_node currentNode, Plica *plica);
443  void WriteProport(pugi::xml_node currentNode, Proport *proport);
444  void WriteQuilisma(pugi::xml_node currentNode, Quilisma *quilisma);
445  void WriteStrophicus(pugi::xml_node currentNode, Strophicus *strophicus);
446  void WriteRest(pugi::xml_node currentNode, Rest *rest);
447  void WriteSpace(pugi::xml_node currentNode, Space *space);
448  void WriteStem(pugi::xml_node currentNode, Stem *stem);
449  void WriteSyllable(pugi::xml_node currentNode, Syllable *syllable);
450  void WriteTabDurSym(pugi::xml_node currentNode, TabDurSym *tabDurSym);
451  void WriteTabGrp(pugi::xml_node currentNode, TabGrp *tabGrp);
452  void WriteTuplet(pugi::xml_node currentNode, Tuplet *tuplet);
454 
459  void WriteAnchoredText(pugi::xml_node currentNode, AnchoredText *anchoredText);
460  void WriteAnnotScore(pugi::xml_node currentNode, AnnotScore *annotScore);
461  void WriteArpeg(pugi::xml_node currentNode, Arpeg *arpeg);
462  void WriteBeamSpan(pugi::xml_node currentNode, BeamSpan *beamSpan);
463  void WriteBracketSpan(pugi::xml_node currentNode, BracketSpan *bracketSpan);
464  void WriteBreath(pugi::xml_node currentNode, Breath *breath);
465  void WriteCaesura(pugi::xml_node currentNode, Caesura *caesura);
466  void WriteCpMark(pugi::xml_node currentNode, CpMark *cpMark);
467  void WriteDir(pugi::xml_node currentNode, Dir *dir);
468  void WriteDynam(pugi::xml_node currentNode, Dynam *dynam);
469  void WriteFermata(pugi::xml_node currentNode, Fermata *fermata);
470  void WriteFing(pugi::xml_node currentNode, Fing *fing);
471  void WriteGliss(pugi::xml_node currentNode, Gliss *gliss);
472  void WriteHairpin(pugi::xml_node currentNode, Hairpin *hairpin);
473  void WriteHarm(pugi::xml_node currentNode, Harm *harm);
474  void WriteLv(pugi::xml_node currentNode, Lv *lv);
475  void WriteMNum(pugi::xml_node currentNode, MNum *mnum);
476  void WriteMordent(pugi::xml_node currentNode, Mordent *mordent);
477  void WriteOctave(pugi::xml_node currentNode, Octave *octave);
478  void WriteOrnam(pugi::xml_node currentNode, Ornam *ornam);
479  void WritePedal(pugi::xml_node currentNode, Pedal *pedal);
480  void WritePhrase(pugi::xml_node currentNode, Phrase *phrase);
481  void WritePitchInflection(pugi::xml_node currentNode, PitchInflection *pitchInflection);
482  void WriteReh(pugi::xml_node currentNode, Reh *reh);
483  void WriteRepeatMark(pugi::xml_node currentNode, RepeatMark *repeatMark);
484  void WriteSlur(pugi::xml_node currentNode, Slur *slur);
485  void WriteTempo(pugi::xml_node currentNode, Tempo *tempo);
486  void WriteTie(pugi::xml_node currentNode, Tie *tie);
487  void WriteTrill(pugi::xml_node currentNode, Trill *trill);
488  void WriteTurn(pugi::xml_node currentNode, Turn *turn);
490 
495  void WriteF(pugi::xml_node currentNode, F *f);
496  void WriteFig(pugi::xml_node currentNode, Fig *fig);
497  void WriteLb(pugi::xml_node currentNode, Lb *lb);
498  void WriteNum(pugi::xml_node currentNode, Num *num);
499  void WriteRend(pugi::xml_node currentNode, Rend *rend);
500  void WriteSvg(pugi::xml_node currentNode, Svg *svg);
501  void WriteSymbol(pugi::xml_node currentNode, Symbol *symbol);
502  void WriteSymbolDef(pugi::xml_node currentNode, SymbolDef *symbolDef);
503  void WriteText(pugi::xml_node currentNode, Text *text);
505 
510  void WriteAbbr(pugi::xml_node currentNode, Abbr *abbr);
511  void WriteAdd(pugi::xml_node currentNode, Add *add);
512  void WriteAnnot(pugi::xml_node currentNode, Annot *annot);
513  void WriteApp(pugi::xml_node currentNode, App *app);
514  void WriteChoice(pugi::xml_node currentNode, Choice *choice);
515  void WriteCorr(pugi::xml_node currentNode, Corr *corr);
516  void WriteDamage(pugi::xml_node currentNode, Damage *damage);
517  void WriteDel(pugi::xml_node currentNode, Del *del);
518  void WriteExpan(pugi::xml_node currentNode, Expan *expan);
519  void WriteLem(pugi::xml_node currentNode, Lem *lem);
520  void WriteOrig(pugi::xml_node currentNode, Orig *orig);
521  void WriteRdg(pugi::xml_node currentNode, Rdg *rdg);
522  void WriteRef(pugi::xml_node currentNode, Ref *Ref);
523  void WriteReg(pugi::xml_node currentNode, Reg *Reg);
524  void WriteRestore(pugi::xml_node currentNode, Restore *restore);
525  void WriteSic(pugi::xml_node currentNode, Sic *sic);
526  void WriteSubst(pugi::xml_node currentNode, Subst *subst);
527  void WriteSupplied(pugi::xml_node currentNode, Supplied *supplied);
528  void WriteUnclear(pugi::xml_node currentNode, Unclear *unclear);
530 
535  void WriteRefrain(pugi::xml_node currentNode, Refrain *refrain);
536  void WriteVolta(pugi::xml_node currentNode, Volta *volta);
537  void WriteVerse(pugi::xml_node currentNode, Verse *verse);
538  void WriteLyricElement(pugi::xml_node currentNode, LyricElement *lyricElement);
539  void WriteSyl(pugi::xml_node currentNode, Syl *syl);
540  void WriteZone(pugi::xml_node currentNode, Zone *zone);
541  void WriteSurface(pugi::xml_node currentNode, Surface *surface);
542  void WriteFacsimile(pugi::xml_node currentNode, Facsimile *facsimile);
543  void WriteGraphic(pugi::xml_node currentNode, Graphic *graphic);
545 
549  void WriteUnsupportedAttr(pugi::xml_node currentNode, Object *object);
550 
556  void WriteControlElement(pugi::xml_node element, ControlElement *object);
557  void WriteEditorialElement(pugi::xml_node element, EditorialElement *object);
558  void WriteLayerElement(pugi::xml_node element, LayerElement *object);
559  void WriteTextLayoutElement(pugi::xml_node element, TextLayoutElement *object);
560  void WriteRunningElement(pugi::xml_node element, RunningElement *object);
561  void WriteScoreDefElement(pugi::xml_node element, ScoreDefElement *object);
562  void WriteSystemElement(pugi::xml_node element, SystemElement *object);
563  void WriteTextElement(pugi::xml_node element, TextElement *object);
564  //
565  void WriteAltSymInterface(pugi::xml_node currentNode, AltSymInterface *interface);
566  void WriteAreaPosInterface(pugi::xml_node currentNode, AreaPosInterface *interface);
567  void WriteDurationInterface(pugi::xml_node currentNode, DurationInterface *interface);
568  void WriteLinkingInterface(pugi::xml_node currentNode, LinkingInterface *interface);
569  void WriteFacsimileInterface(pugi::xml_node element, FacsimileInterface *interface);
570  void WriteOffsetInterface(pugi::xml_node currentNode, OffsetInterface *interface);
571  void WriteOffsetSpanningInterface(pugi::xml_node currentNode, OffsetSpanningInterface *interface);
572  void WritePitchInterface(pugi::xml_node currentNode, PitchInterface *interface);
573  void WritePlistInterface(pugi::xml_node currentNode, PlistInterface *interface);
574  void WritePositionInterface(pugi::xml_node currentNode, PositionInterface *interface);
575  void WriteScoreDefInterface(pugi::xml_node currentNode, ScoreDefInterface *interface);
576  void WriteTextDirInterface(pugi::xml_node currentNode, TextDirInterface *interface);
577  void WriteTimePointInterface(pugi::xml_node currentNode, TimePointInterface *interface);
578  void WriteTimeSpanningInterface(pugi::xml_node currentNode, TimeSpanningInterface *interface);
580 
586  std::u32string EscapeSMuFL(std::u32string data);
587 
590  std::string IDToMeiStr(Object *element);
591  std::string DocTypeToStr(DocType type);
593 
594 public:
595  //
596 protected:
598  pugi::xml_node m_currentNode;
600  std::list<pugi::xml_node> m_nodeStack;
601 
602 private:
604  int m_indent;
606  bool m_scoreBasedMEI;
608  bool m_basic;
610  bool m_serializing;
611 
613  pugi::xml_node m_mei;
615  std::stack<Object *> m_boundaries;
617  std::deque<Object *> m_objectStack;
618 
621  bool m_hasFilter;
622  MatchLocation m_filterMatchLocation;
623  Object *m_firstFilterMatch;
624  int m_firstPage;
625  int m_currentPage;
626  int m_lastPage;
627  std::string m_firstMeasureID;
628  std::string m_lastMeasureID;
629  RangeMatchLocation m_measureFilterMatchLocation;
630  std::string m_mdivID;
631  MatchLocation m_mdivFilterMatchLocation;
633 
634  bool m_ignoreHeader;
635  bool m_removeIds;
636  SetOfConstObjects m_referredObjects;
637 };
638 
639 //----------------------------------------------------------------------------
640 // MEIOutputExtended
641 //----------------------------------------------------------------------------
642 
646 class MEIOutputExtended : public MEIOutput {
647 public:
650  MEIOutputExtended(Doc *doc);
652 
653  jsonxx::Object ExportScoreDef();
654  jsonxx::Object ExportStaffGrp(ScoreDef *scoreDef);
655  jsonxx::Object ExportStaffDef(ScoreDef *scoreDef, int staffN);
656  jsonxx::Object ExportMeterSig(ScoreDef *scoreDef);
657  jsonxx::Object ExportKeySig(ScoreDef *scoreDef);
658 
659 private:
660  jsonxx::Object ToJson(const pugi::xml_document &doc);
661 };
662 
663 //----------------------------------------------------------------------------
664 // MEIInput
665 //----------------------------------------------------------------------------
666 
672 class MEIInput : public Input {
673 public:
674  // constructors and destructors
675  MEIInput(Doc *doc);
676  virtual ~MEIInput();
677 
678  bool Import(const std::string &mei) override;
679 
683  void SetDeserializing(bool deserializing) { m_deserializing = deserializing; }
684 
685 protected:
690  bool ReadScoreDefExt(Object *parent, pugi::xml_node scoreDef) { return this->ReadScoreDef(parent, scoreDef); }
691  bool ReadStaffGrpExt(Object *parent, pugi::xml_node staffGrp) { return this->ReadStaffGrp(parent, staffGrp); }
692  bool ReadStaffDefExt(Object *parent, pugi::xml_node staffDef) { return this->ReadStaffDef(parent, staffDef); }
693  bool ReadMeterSigExt(Object *parent, pugi::xml_node meterSig) { return this->ReadMeterSig(parent, meterSig); }
694  bool ReadMeterSigGrpExt(Object *parent, pugi::xml_node meterSigGrp)
695  {
696  return this->ReadMeterSigGrp(parent, meterSigGrp);
697  }
698  bool ReadKeySigExt(Object *parent, pugi::xml_node keySig) { return this->ReadKeySig(parent, keySig); }
700 
701 private:
702  bool ReadDoc(pugi::xml_node root);
703  bool ReadIncipits(pugi::xml_node root);
704 
706  bool ReadMdiv(Object *parent, pugi::xml_node parentNode, bool isVisible);
707  bool ReadMdivChildren(Object *parent, pugi::xml_node parentNode, bool isVisible);
708  bool ReadParts(Object *parent, pugi::xml_node parentNode);
709  bool ReadPartsChildren(Object *parent, pugi::xml_node parentNode);
710  bool ReadPart(Object *parent, pugi::xml_node parentNode);
711  bool ReadScore(Object *parent, pugi::xml_node parentNode);
712  bool ReadScoreScoreDef(Object *parent, pugi::xml_node parentNode);
714 
719  bool ReadPages(Object *parent, pugi::xml_node parentNode);
720  bool ReadPage(Object *parent, pugi::xml_node parentNode);
721  bool ReadPageChildren(Object *parent, pugi::xml_node parentNode);
722  bool ReadPageMilestoneEnd(Object *parent, pugi::xml_node milestoneEnd);
723  bool ReadScoreOrPartChildren(Object *parent, pugi::xml_node parentNode);
724  bool ReadSystem(Object *parent, pugi::xml_node system);
725  bool ReadSystemChildren(Object *parent, pugi::xml_node parentNode);
726  bool ReadSystemMilestoneEnd(Object *parent, pugi::xml_node milestoneEnd);
728 
733  bool ReadSection(Object *parent, pugi::xml_node section);
734  bool ReadSectionChildren(Object *parent, pugi::xml_node parentNode);
735  bool ReadEnding(Object *parent, pugi::xml_node ending);
736  bool ReadExpansion(Object *parent, pugi::xml_node expansion);
737  bool ReadPb(Object *parent, pugi::xml_node pb);
738  bool ReadSb(Object *parent, pugi::xml_node sb);
740 
750  bool ReadScoreDef(Object *parent, pugi::xml_node scoreDef);
751  bool ReadScoreDefChildren(Object *parent, pugi::xml_node parentNode);
752  bool ReadGrpSym(Object *parent, pugi::xml_node grpSym);
753  bool ReadPgFoot(Object *parent, pugi::xml_node pgFoot);
754  bool ReadPgHead(Object *parent, pugi::xml_node pgHead);
755  bool ReadDiv(Object *parent, pugi::xml_node div);
756  bool ReadRunningChildren(Object *parent, pugi::xml_node parentNode, Object *filter = NULL);
757  bool ReadStaffGrp(Object *parent, pugi::xml_node staffGrp);
758  bool ReadStaffGrpChildren(Object *parent, pugi::xml_node parentNode);
759  bool ReadStaffDef(Object *parent, pugi::xml_node staffDef);
760  bool ReadStaffDefChildren(Object *parent, pugi::xml_node parentNode);
761  bool ReadInstrDef(Object *parent, pugi::xml_node instrDef);
762  bool ReadLabel(Object *parent, pugi::xml_node label);
763  bool ReadLabelAbbr(Object *parent, pugi::xml_node labelAbbr);
764  bool ReadTuning(Object *parent, pugi::xml_node tuning);
765  bool ReadOssia(Object *parent, pugi::xml_node ossia);
766  bool ReadTuningChildren(Object *parent, pugi::xml_node parentNode);
767  bool ReadCourse(Object *parent, pugi::xml_node course);
768  bool ReadSymbolTable(Object *parent, pugi::xml_node parentNode);
769  bool ReadMeasure(Object *parent, pugi::xml_node measure);
770  bool ReadMeasureChildren(Object *parent, pugi::xml_node parentNode);
771  bool ReadMeterSigGrp(Object *parent, pugi::xml_node meterSigGrp);
772  bool ReadMeterSigGrpChildren(Object *parent, pugi::xml_node parentNode);
773  bool ReadFb(Object *parent, pugi::xml_node fb);
774  bool ReadFbChildren(Object *parent, pugi::xml_node parentNode);
775  bool ReadNum(Object *parent, pugi::xml_node parentNode);
776  bool ReadStaff(Object *parent, pugi::xml_node staff);
777  bool ReadOStaff(Object *parent, pugi::xml_node oStaff);
778  bool ReadStaffChildren(Object *parent, pugi::xml_node parentNode);
779  bool ReadLayer(Object *parent, pugi::xml_node layer);
780  bool ReadLayerDef(Object *parent, pugi::xml_node layerDef);
781  bool ReadLayerDefChildren(Object *parent, pugi::xml_node parentNode);
782  bool ReadLayerChildren(Object *parent, pugi::xml_node parentNode, Object *filter = NULL);
783  bool ReadTextChildren(Object *parent, pugi::xml_node parentNode, Object *filter = NULL);
784  bool ReadSymbolDefChildren(Object *parent, pugi::xml_node parentNode, Object *filter = NULL);
786 
791  bool ReadAccid(Object *parent, pugi::xml_node accid);
792  bool ReadArtic(Object *parent, pugi::xml_node artic);
793  bool ReadBarLine(Object *parent, pugi::xml_node barLine);
794  bool ReadBeam(Object *parent, pugi::xml_node beam);
795  bool ReadBeatRpt(Object *parent, pugi::xml_node beatRpt);
796  bool ReadBTrem(Object *parent, pugi::xml_node bTrem);
797  bool ReadChord(Object *parent, pugi::xml_node chord);
798  bool ReadClef(Object *parent, pugi::xml_node clef);
799  bool ReadCustos(Object *parent, pugi::xml_node custos);
800  bool ReadDivLine(Object *parent, pugi::xml_node divLine);
801  bool ReadDot(Object *parent, pugi::xml_node dot);
802  bool ReadEpisema(Object *parent, pugi::xml_node episema);
803  bool ReadFTrem(Object *parent, pugi::xml_node fTrem);
804  bool ReadGenericLayerElement(Object *parent, pugi::xml_node element);
805  bool ReadGraceGrp(Object *parent, pugi::xml_node graceGrp);
806  bool ReadHalfmRpt(Object *parent, pugi::xml_node halfmRpt);
807  bool ReadKeyAccid(Object *parent, pugi::xml_node keyAccid);
808  bool ReadKeySig(Object *parent, pugi::xml_node keySig);
809  bool ReadLigature(Object *parent, pugi::xml_node ligature);
810  bool ReadLiquescent(Object *parent, pugi::xml_node liquescent);
811  bool ReadMensur(Object *parent, pugi::xml_node mensur);
812  bool ReadMeterSig(Object *parent, pugi::xml_node meterSig);
813  bool ReadMRest(Object *parent, pugi::xml_node mRest);
814  bool ReadMRpt(Object *parent, pugi::xml_node mRpt);
815  bool ReadMRpt2(Object *parent, pugi::xml_node mRpt2);
816  bool ReadMSpace(Object *parent, pugi::xml_node mSpace);
817  bool ReadMultiRest(Object *parent, pugi::xml_node multiRest);
818  bool ReadMultiRpt(Object *parent, pugi::xml_node multiRpt);
819  bool ReadNc(Object *parent, pugi::xml_node nc);
820  bool ReadNeume(Object *parent, pugi::xml_node note);
821  bool ReadNote(Object *parent, pugi::xml_node note);
822  bool ReadOriscus(Object *parent, pugi::xml_node oriscus);
823  bool ReadPlica(Object *parent, pugi::xml_node plica);
824  bool ReadProport(Object *parent, pugi::xml_node proport);
825  bool ReadQuilisma(Object *parent, pugi::xml_node quilisma);
826  bool ReadRefrain(Object *parent, pugi::xml_node refrain);
827  bool ReadRest(Object *parent, pugi::xml_node rest);
828  bool ReadSpace(Object *parent, pugi::xml_node space);
829  bool ReadStem(Object *parent, pugi::xml_node stem);
830  bool ReadStrophicus(Object *parent, pugi::xml_node strophicus);
831  bool ReadSyl(Object *parent, pugi::xml_node syl);
832  bool ReadSyllable(Object *parent, pugi::xml_node syllable);
833  bool ReadTabDurSym(Object *parent, pugi::xml_node tabDurSym);
834  bool ReadTabGrp(Object *parent, pugi::xml_node tabGrp);
835  bool ReadTuplet(Object *parent, pugi::xml_node tuplet);
836  bool ReadVolta(Object *parent, pugi::xml_node volta);
837  bool ReadVerse(Object *parent, pugi::xml_node verse);
838  void ReadLyricElement(pugi::xml_node element, LyricElement *lyricElement);
840 
845  bool ReadAnchoredText(Object *parent, pugi::xml_node anchoredText);
846  bool ReadArpeg(Object *parent, pugi::xml_node arpeg);
847  bool ReadBeamSpan(Object *parent, pugi::xml_node beamSpan);
848  bool ReadBracketSpan(Object *parent, pugi::xml_node bracketSpan);
849  bool ReadBreath(Object *parent, pugi::xml_node breath);
850  bool ReadCaesura(Object *parent, pugi::xml_node caesura);
851  bool ReadCpMark(Object *parent, pugi::xml_node cpMark);
852  bool ReadDir(Object *parent, pugi::xml_node dir, bool isStageDir = false);
853  bool ReadDynam(Object *parent, pugi::xml_node dynam);
854  bool ReadFermata(Object *parent, pugi::xml_node fermata);
855  bool ReadFing(Object *parent, pugi::xml_node fing);
856  bool ReadGliss(Object *parent, pugi::xml_node gliss);
857  bool ReadHairpin(Object *parent, pugi::xml_node hairpin);
858  bool ReadHarm(Object *parent, pugi::xml_node harm);
859  bool ReadLv(Object *parent, pugi::xml_node lv);
860  bool ReadMNum(Object *parent, pugi::xml_node mnum);
861  bool ReadMordent(Object *parent, pugi::xml_node mordent);
862  bool ReadOctave(Object *parent, pugi::xml_node octave);
863  bool ReadOrnam(Object *parent, pugi::xml_node ornam);
864  bool ReadPedal(Object *parent, pugi::xml_node pedal);
865  bool ReadPhrase(Object *parent, pugi::xml_node phrase);
866  bool ReadPitchInflection(Object *parent, pugi::xml_node pitchInflection);
867  bool ReadRepeatMark(Object *parent, pugi::xml_node repeatMark);
868  bool ReadReh(Object *parent, pugi::xml_node reh);
869  bool ReadSlur(Object *parent, pugi::xml_node slur);
870  bool ReadTempo(Object *parent, pugi::xml_node tempo);
871  bool ReadTie(Object *parent, pugi::xml_node tie);
872  bool ReadTrill(Object *parent, pugi::xml_node trill);
873  bool ReadTurn(Object *parent, pugi::xml_node turn);
875 
880  bool ReadF(Object *parent, pugi::xml_node f);
881  bool ReadFig(Object *parent, pugi::xml_node fig);
882  bool ReadLb(Object *parent, pugi::xml_node lb);
883  bool ReadRend(Object *parent, pugi::xml_node rend);
884  bool ReadSvg(Object *parent, pugi::xml_node svg);
885  bool ReadSymbol(Object *parent, pugi::xml_node symbol);
886  bool ReadSymbolDef(Object *parent, pugi::xml_node symbolDef);
887  bool ReadText(Object *parent, pugi::xml_node text, bool trimLeft, bool trimRight);
889 
895  bool ReadEditorialElement(Object *parent, pugi::xml_node app, EditorialLevel level, Object *filter = NULL);
896  bool ReadAbbr(Object *parent, pugi::xml_node abbr, EditorialLevel level, Object *filter = NULL);
897  bool ReadAdd(Object *parent, pugi::xml_node add, EditorialLevel level, Object *filter = NULL);
898  bool ReadAnnot(Object *parent, pugi::xml_node annot);
899  bool ReadAnnotScore(Object *parent, pugi::xml_node annot);
900  bool ReadApp(Object *parent, pugi::xml_node app, EditorialLevel level, Object *filter = NULL);
901  bool ReadAppChildren(Object *parent, pugi::xml_node parentNode, EditorialLevel level, Object *filter = NULL);
902  bool ReadChoice(Object *parent, pugi::xml_node choice, EditorialLevel level, Object *filter = NULL);
903  bool ReadChoiceChildren(Object *parent, pugi::xml_node parentNode, EditorialLevel level, Object *filter = NULL);
904  bool ReadCorr(Object *parent, pugi::xml_node corr, EditorialLevel level, Object *filter = NULL);
905  bool ReadDamage(Object *parent, pugi::xml_node damage, EditorialLevel level, Object *filter = NULL);
906  bool ReadDel(Object *parent, pugi::xml_node del, EditorialLevel level, Object *filter = NULL);
907  bool ReadExpan(Object *parent, pugi::xml_node expan, EditorialLevel level, Object *filter = NULL);
908  bool ReadLem(Object *parent, pugi::xml_node lem, EditorialLevel level, Object *filter = NULL);
909  bool ReadOrig(Object *parent, pugi::xml_node orig, EditorialLevel level, Object *filter = NULL);
910  bool ReadRdg(Object *parent, pugi::xml_node rdg, EditorialLevel level, Object *filter = NULL);
911  bool ReadRef(Object *parent, pugi::xml_node ref, EditorialLevel level, Object *filter = NULL);
912  bool ReadReg(Object *parent, pugi::xml_node reg, EditorialLevel level, Object *filter = NULL);
913  bool ReadRestore(Object *parent, pugi::xml_node restore, EditorialLevel level, Object *filter = NULL);
914  bool ReadSic(Object *parent, pugi::xml_node sic, EditorialLevel level, Object *filter = NULL);
915  bool ReadSubst(Object *parent, pugi::xml_node subst, EditorialLevel level, Object *filter = NULL);
916  bool ReadSubstChildren(Object *parent, pugi::xml_node parentNode, EditorialLevel level, Object *filter = NULL);
917  bool ReadSupplied(Object *parent, pugi::xml_node supplied, EditorialLevel level, Object *filter = NULL);
918  bool ReadUnclear(Object *parent, pugi::xml_node unclear, EditorialLevel level, Object *filter = NULL);
919  bool ReadEditorialChildren(Object *parent, pugi::xml_node supplied, EditorialLevel level, Object *filter = NULL);
921 
926  bool ReadControlElement(pugi::xml_node element, ControlElement *object);
927  bool ReadEditorialElement(pugi::xml_node element, EditorialElement *object);
928  bool ReadLayerElement(pugi::xml_node element, LayerElement *object);
929  bool ReadTextLayoutElement(pugi::xml_node element, TextLayoutElement *object);
930  bool ReadRunningElement(pugi::xml_node element, RunningElement *object);
931  bool ReadScoreDefElement(pugi::xml_node element, ScoreDefElement *object);
932  bool ReadScoreOrPartElement(pugi::xml_node element, ScoreOrPartElement *object);
933  bool ReadSystemElement(pugi::xml_node element, SystemElement *object);
934  bool ReadTextElement(pugi::xml_node element, TextElement *object);
935 
936  bool ReadAltSymInterface(pugi::xml_node element, AltSymInterface *interface);
937  bool ReadAreaPosInterface(pugi::xml_node element, AreaPosInterface *interface);
938  bool ReadDurationInterface(pugi::xml_node element, DurationInterface *interface);
939  bool ReadLinkingInterface(pugi::xml_node element, LinkingInterface *interface);
940  bool ReadFacsimileInterface(pugi::xml_node element, FacsimileInterface *interface);
941  bool ReadOffsetInterface(pugi::xml_node element, OffsetInterface *interface);
942  bool ReadOffsetSpanningInterface(pugi::xml_node element, OffsetSpanningInterface *interface);
943  bool ReadPitchInterface(pugi::xml_node element, PitchInterface *interface);
944  bool ReadPlistInterface(pugi::xml_node element, PlistInterface *interface);
945  bool ReadPositionInterface(pugi::xml_node element, PositionInterface *interface);
946  bool ReadScoreDefInterface(pugi::xml_node element, ScoreDefInterface *interface);
947  bool ReadTextDirInterface(pugi::xml_node element, TextDirInterface *interface);
948  bool ReadTimePointInterface(pugi::xml_node element, TimePointInterface *interface);
949  bool ReadTimeSpanningInterface(pugi::xml_node element, TimeSpanningInterface *interface);
951 
956  bool ReadFacsimile(Doc *doc, pugi::xml_node facsimile);
957  bool ReadGraphic(Object *parent, pugi::xml_node graphic);
958  bool ReadSurface(Facsimile *parent, pugi::xml_node surface);
959  bool ReadTupletSpanAsTuplet(Measure *measure, pugi::xml_node tupletSpan);
960  bool ReadZone(Surface *parent, pugi::xml_node zone);
962 
966  void ReadUnsupportedAttr(pugi::xml_node element, Object *object);
967 
971  bool IsAnnotScore(pugi::xml_node element);
972 
976  bool IsEditorialElementName(std::string elementName);
977 
981  void NormalizeAttributes(pugi::xml_node &xmlElement);
982 
988  bool ReadScoreBasedMei(pugi::xml_node element, ScoreOrPartElement *parent);
989 
994  void SetMeiID(pugi::xml_node element, Object *object);
995  DocType StrToDocType(std::string type);
996  std::u32string LeftTrim(std::u32string str);
997  std::u32string RightTrim(std::u32string str);
998  bool ReadXMLComment(Object *object, pugi::xml_node element);
1000 
1005  // to MEI 5.0.0
1006  void UpgradeKeySigTo_5_0(pugi::xml_node keySig);
1007  void UpgradePageTo_5_0(Page *page);
1008  void UpgradePgHeadFootTo_5_0(pugi::xml_node element);
1009  void UpgradeMeasureTo_5_0(pugi::xml_node measure);
1010  void UpgradeMeterSigTo_5_0(pugi::xml_node meterSig, MeterSig *vrvMeterSig);
1011  void UpgradeScoreDefElementTo_5_0(pugi::xml_node scoreDefElement);
1012  void UpgradeStaffTo_5_0(pugi::xml_node staff);
1013  void UpgradeLayerElementTo_5_0(pugi::xml_node element);
1014  void UpgradeRendTo_5_0(pugi::xml_node element);
1015  // to MEI 4.0.0
1016  void UpgradeBeatRptTo_4_0_0(pugi::xml_node beatRpt, BeatRpt *vrvBeatRpt);
1017  void UpgradeDurGesTo_4_0_0(pugi::xml_node element, DurationInterface *interface);
1018  void UpgradeFTremTo_4_0_0(pugi::xml_node fTrem, FTrem *vrvFTrem);
1019  void UpgradeMensurTo_5_0(pugi::xml_node mensur, Mensur *vrvMensur);
1020  void UpgradeMordentTo_4_0_0(pugi::xml_node mordent, Mordent *vrvMordent);
1021  void UpgradeScoreDefElementTo_4_0_0(pugi::xml_node scoreDefElement, ScoreDefElement *vrvScoreDefElement);
1022  void UpgradeStaffDefTo_4_0_0(pugi::xml_node staffDef, StaffDef *vrvStaffDef);
1023  void UpgradeStaffGrpTo_4_0_0(pugi::xml_node staffGrp, StaffGrp *vrvStaffGrp);
1024  void UpgradeTurnTo_4_0_0(pugi::xml_node turn, Turn *vrvTurn);
1025  // to MEI 3.0.0 (Page-Based MEI only)
1026  void UpgradeMeasureTo_3_0_0(Measure *measure, System *system);
1027  void UpgradePageTo_3_0_0(Page *page, Doc *doc);
1029 
1034  void ReadAccidAttr(pugi::xml_node node, Object *object);
1036 
1037 public:
1038  //
1039 protected:
1043  meiVersion_MEIVERSION m_meiversion;
1044 
1045 private:
1049  std::string m_filename;
1050 
1054  bool m_readingScoreBased;
1055 
1059  bool m_hasScoreDef;
1060 
1064  bool IsAllowed(std::string element, Object *filterParent);
1065 
1070  pugi::xml_node m_selectedMdiv;
1071 
1075  std::string m_comment;
1076 
1078  bool m_deserializing;
1079 
1080  //----------------//
1081  // Static members //
1082  //----------------//
1083 
1087  static const std::vector<std::string> s_editorialElementNames;
1088 };
1089 
1090 //----------------------------------------------------------------------------
1091 // MEIInputExtended
1092 //----------------------------------------------------------------------------
1093 
1097 class MEIInputExtended : public MEIInput {
1098 public:
1101  MEIInputExtended(Doc *doc);
1103 
1104  void ImportScoreDef(const jsonxx::Object &scoreDef);
1105 
1106  void ImportStaffGrp(const jsonxx::Object &staffGrp, ScoreDef *scoreDef);
1107 
1108  void ImportStaffDef(const jsonxx::Object &staffDef, ScoreDef *scoreDef, int staffN);
1109 
1110  void ImportMeterSigOrGrpIntoLayer(Layer *layer, const jsonxx::Object &meterSig);
1111 
1112  void ImportKeySigIntoLayer(Layer *layer, const jsonxx::Object &keySig);
1113 
1114 private:
1115  pugi::xml_document FromJson(const jsonxx::Object &json);
1116 };
1117 
1118 } // namespace vrv
1119 
1120 #endif
Definition: abbr.h:20
This class models the MEI <accid> element.
Definition: accid.h:41
Definition: add.h:20
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
Definition: app.h:19
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
Definition: artic.h:31
This class models the MEI <bTrem> element.
Definition: btrem.h:27
This class models the MEI <barLine> element.
Definition: barline.h:34
Definition: beam.h:284
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
Definition: choice.h:20
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
Definition: corr.h:20
This class models the MEI <course> element.
Definition: course.h:23
This class models the MEI <cpMark> element.
Definition: cpmark.h:26
Definition: custos.h:31
Definition: damage.h:20
Definition: del.h:20
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
Definition: dot.h:23
This class is an interface for elements with duration, such as notes and rests.
Definition: durationinterface.h:39
Definition: dynam.h:33
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
Definition: episema.h:29
Definition: expan.h:20
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 is a base class for input classes.
Definition: iobase.h:73
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:51
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:40
This class models the MEI <lb>
Definition: lb.h:23
Definition: lem.h:20
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
Shared implementation for note-attached verse and refrain lyrics.
Definition: lyricelement.h:33
Extended MEIInput for partial import.
Definition: iomei.h:1097
This class is a file input stream for reading MEI files.
Definition: iomei.h:672
void SetDeserializing(bool deserializing)
Setter for the page-based deserialization flag (default is false).
Definition: iomei.h:683
meiVersion_MEIVERSION m_meiversion
The version of the file being read.
Definition: iomei.h:1043
Extended MEIOutput for partial exports.
Definition: iomei.h:646
This class is a file output stream for writing MEI files.
Definition: iomei.h:205
void SetSerializing(bool serializing)
Setter for the page-based serialization flag (default is false)
Definition: iomei.h:281
void SetRemoveIds(bool removeIds)
Setter for remove ids flag for the MEI output (default is false)
Definition: iomei.h:286
std::list< pugi::xml_node > m_nodeStack
Xml node stack.
Definition: iomei.h:600
void SetIndent(int indent)
Setter for indent for the MEI output (default is 3, -1 for tabs)
Definition: iomei.h:271
void SetIgnoreHeader(bool ignoreHeader)
Setter for ignore header flag for the MEI output (default is false)
Definition: iomei.h:276
pugi::xml_node m_currentNode
Current xml element.
Definition: iomei.h:598
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:66
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
Definition: orig.h:20
Definition: oriscus.h:28
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 represent a <part> MEI.
Definition: part.h:22
This class represents a <parts> MEI.
Definition: parts.h:24
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 pgFoot.
Definition: pgfoot.h:22
This class represents an MEI pgHead.
Definition: pghead.h:22
Definition: phrase.h:19
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
Definition: plica.h:20
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
Definition: rdg.h:20
This class models the MEI <ref> element.
Definition: ref.h:23
Recurring note-attached lyrics, such as a chorus.
Definition: refrain.h:19
Definition: reg.h:20
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
Definition: restore.h:20
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:43
This class represents a MEI scoreDef.
Definition: scoredef.h:136
This class is an interface for elements implementing score attributes, such as <scoreDef>,...
Definition: scoredefinterface.h:43
This class represent a <score> MEI.
Definition: score.h:22
This class represents a <score> or a <part> in MEI.
Definition: scoreorpartelement.h:33
This class represents a MEI section.
Definition: section.h:28
Definition: sic.h:20
Definition: slur.h:59
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: strophicus.h:27
Definition: subst.h:22
Definition: supplied.h:20
Implements the surface element in MEI.
Definition: surface.h:30
Definition: svg.h:20
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
Definition: tuplet.h:33
This class models the MEI <turn> element.
Definition: turn.h:33
Definition: unclear.h:20
Definition: verse.h:21
Sung text for a specific iteration of a repeated section of music.
Definition: volta.h:26
Implements the zone element in MEI.
Definition: zone.h:30