LibMusicXML 3.18
msrOah.h
1/*
2 MusicXML Library
3 Copyright (C) Grame 2006-2013
4
5 This Source Code Form is subject to the terms of the Mozilla Public
6 License, v. 2.0. If a copy of the MPL was not distributed with this
7 file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9 Grame Research Laboratory, 11, cours de Verdun Gensoul 69002 Lyon - France
10 research@grame.fr
11*/
12
13#ifndef ___msrOah___
14#define ___msrOah___
15
16#include "msrBasicTypes.h"
17
18#include "oahBasicTypes.h"
19
20
21namespace MusicXML2
22{
23
24//______________________________________________________________________________
26{
27 public:
28
29 // creation
30 // ------------------------------------------------------
31
32 static SMARTP<msrRenamePartAtom> create (
33 string shortName,
34 string longName,
35 string description,
36 string valueSpecification,
37 string variableName,
38 map<string, string>& stringStringMapVariable);
39
40 protected:
41
42 // constructors/destructor
43 // ------------------------------------------------------
44
46 string shortName,
47 string longName,
48 string description,
49 string valueSpecification,
50 string variableName,
51 map<string, string>& stringStringMapVariable);
52
53 virtual ~msrRenamePartAtom ();
54
55 public:
56
57 // set and get
58 // ------------------------------------------------------
59
60 const map<string, string>&
61 getStringStringMapVariable ()
62 { return fStringStringMapVariable; }
63
64 public:
65
66 // services
67 // ------------------------------------------------------
68
69 S_oahValuedAtom handleOptionUnderName (
70 string optionName,
71 ostream& os);
72
73 void handleValue (
74 string theString,
75 ostream& os);
76
77 public:
78
79 // visitors
80 // ------------------------------------------------------
81
82 virtual void acceptIn (basevisitor* v);
83 virtual void acceptOut (basevisitor* v);
84
85 virtual void browseData (basevisitor* v);
86
87 public:
88
89 // print
90 // ------------------------------------------------------
91
92 string asShortNamedOptionString () const;
93 string asActualLongNamedOptionString () const;
94
95 void print (ostream& os) const;
96
97 void printAtomOptionsValues (
98 ostream& os,
99 int valueFieldWidth) const;
100
101 private:
102
103 // fields
104 // ------------------------------------------------------
105
106 map<string, string>& fStringStringMapVariable;
107};
109EXP ostream& operator<< (ostream& os, const S_msrRenamePartAtom& elt);
110
111//______________________________________________________________________________
113{
114 public:
115
116 // creation
117 // ------------------------------------------------------
118
119 static SMARTP<msrTransposePartAtom> create (
120 string shortName,
121 string longName,
122 string description,
123 string valueSpecification,
124 string variableName,
125 map<string, S_msrSemiTonesPitchAndOctave>&
126 stringMsrSemiTonesPitchAndOctaveVariable);
127
128 protected:
129
130 // constructors/destructor
131 // ------------------------------------------------------
132
134 string shortName,
135 string longName,
136 string description,
137 string valueSpecification,
138 string variableName,
139 map<string, S_msrSemiTonesPitchAndOctave>&
140 stringMsrSemiTonesPitchAndOctaveVariable);
141
142 virtual ~msrTransposePartAtom ();
143
144 public:
145
146 // set and get
147 // ------------------------------------------------------
148
149 void setStringMsrSemiTonesPitchAndOctaveVariable (
150 string partName,
152 semiTonesPitchAndOctave)
153 {
154 fStringMsrSemiTonesPitchAndOctaveVariable [
155 partName
156 ] =
157 semiTonesPitchAndOctave;
158 }
159
160 const map<string, S_msrSemiTonesPitchAndOctave>&
161 getStringMsrSemiTonesPitchAndOctaveVariable ()
162 {
163 return
164 fStringMsrSemiTonesPitchAndOctaveVariable;
165 }
166
167 public:
168
169 // services
170 // ------------------------------------------------------
171
172 S_oahValuedAtom handleOptionUnderName (
173 string optionName,
174 ostream& os);
175
176 void handleValue (
177 string theString,
178 ostream& os);
179
180 public:
181
182 // visitors
183 // ------------------------------------------------------
184
185 virtual void acceptIn (basevisitor* v);
186 virtual void acceptOut (basevisitor* v);
187
188 virtual void browseData (basevisitor* v);
189
190 public:
191
192 // print
193 // ------------------------------------------------------
194
195 string asShortNamedOptionString () const;
196 string asActualLongNamedOptionString () const;
197
198 void print (ostream& os) const;
199
200 void printAtomOptionsValues (
201 ostream& os,
202 int valueFieldWidth) const;
203
204 private:
205
206 // fields
207 // ------------------------------------------------------
208
209 map<string, S_msrSemiTonesPitchAndOctave>&
210 fStringMsrSemiTonesPitchAndOctaveVariable;
211};
213EXP ostream& operator<< (ostream& os, const S_msrTransposePartAtom& elt);
214
215//______________________________________________________________________________
217{
218 public:
219
220 // creation
221 // ------------------------------------------------------
222
223 static SMARTP<msrOmitPartAtom> create (
224 string shortName,
225 string longName,
226 string description,
227 string valueSpecification,
228 string variableName,
229 set<string>& stringSetVariable);
230
231 protected:
232
233 // constructors/destructor
234 // ------------------------------------------------------
235
237 string shortName,
238 string longName,
239 string description,
240 string valueSpecification,
241 string variableName,
242 set<string>& stringSetVariable);
243
244 virtual ~msrOmitPartAtom ();
245
246 public:
247
248 // set and get
249 // ------------------------------------------------------
250
251 void setStringSetVariable (
252 string partName)
253 { fStringSetVariable.insert (partName); }
254
255 const set<string>& getStringSetVariable ()
256 { return fStringSetVariable; }
257
258 public:
259
260 // services
261 // ------------------------------------------------------
262
263 S_oahValuedAtom handleOptionUnderName (
264 string optionName,
265 ostream& os);
266
267 void handleValue (
268 string theString,
269 ostream& os);
270
271 public:
272
273 // visitors
274 // ------------------------------------------------------
275
276 virtual void acceptIn (basevisitor* v);
277 virtual void acceptOut (basevisitor* v);
278
279 virtual void browseData (basevisitor* v);
280
281 public:
282
283 // print
284 // ------------------------------------------------------
285
286 string asShortNamedOptionString () const;
287 string asActualLongNamedOptionString () const;
288
289 void print (ostream& os) const;
290
291 void printAtomOptionsValues (
292 ostream& os,
293 int valueFieldWidth) const;
294
295 private:
296
297 // fields
298 // ------------------------------------------------------
299
300 set<string>& fStringSetVariable;
301};
303EXP ostream& operator<< (ostream& os, const S_msrOmitPartAtom& elt);
304
305//______________________________________________________________________________
307{
308 public:
309
310 // creation
311 // ------------------------------------------------------
312
313 static SMARTP<msrKeepPartAtom> create (
314 string shortName,
315 string longName,
316 string description,
317 string valueSpecification,
318 string variableName,
319 set<string>& stringSetVariable);
320
321 protected:
322
323 // constructors/destructor
324 // ------------------------------------------------------
325
327 string shortName,
328 string longName,
329 string description,
330 string valueSpecification,
331 string variableName,
332 set<string>& stringSetVariable);
333
334 virtual ~msrKeepPartAtom ();
335
336 public:
337
338 // set and get
339 // ------------------------------------------------------
340
341 void setStringSetVariable (
342 string partName)
343 { fStringSetVariable.insert (partName); }
344
345 const set<string>& getStringSetVariable ()
346 { return fStringSetVariable; }
347
348 public:
349
350 // services
351 // ------------------------------------------------------
352
353 S_oahValuedAtom handleOptionUnderName (
354 string optionName,
355 ostream& os);
356
357 void handleValue (
358 string theString,
359 ostream& os);
360
361 public:
362
363 // visitors
364 // ------------------------------------------------------
365
366 virtual void acceptIn (basevisitor* v);
367 virtual void acceptOut (basevisitor* v);
368
369 virtual void browseData (basevisitor* v);
370
371 public:
372
373 // print
374 // ------------------------------------------------------
375
376 string asShortNamedOptionString () const;
377 string asActualLongNamedOptionString () const;
378
379 void print (ostream& os) const;
380
381 void printAtomOptionsValues (
382 ostream& os,
383 int valueFieldWidth) const;
384
385 private:
386
387 // fields
388 // ------------------------------------------------------
389
390 set<string>& fStringSetVariable;
391};
393EXP ostream& operator<< (ostream& os, const S_msrKeepPartAtom& elt);
394
395//______________________________________________________________________________
397{
398 public:
399
400 // creation
401 // ------------------------------------------------------
402
403 static SMARTP<msrPitchesLanguageAtom> create (
404 string shortName,
405 string longName,
406 string description,
407 string valueSpecification,
408 string variableName,
409 msrQuarterTonesPitchesLanguageKind&
410 msrMsrPitchesLanguageKindVariable);
411
412 protected:
413
414 // constructors/destructor
415 // ------------------------------------------------------
416
418 string shortName,
419 string longName,
420 string description,
421 string valueSpecification,
422 string variableName,
423 msrQuarterTonesPitchesLanguageKind&
424 msrMsrPitchesLanguageKindVariable);
425
426 virtual ~msrPitchesLanguageAtom ();
427
428 public:
429
430 // set and get
431 // ------------------------------------------------------
432
433 void setMsrQuarterTonesPitchesLanguageKindVariable (
434 msrQuarterTonesPitchesLanguageKind value)
435 {
436 fMsrQuarterTonesPitchesLanguageKindVariable = value;
437 }
438
439 public:
440
441 // services
442 // ------------------------------------------------------
443
444 S_oahValuedAtom handleOptionUnderName (
445 string optionName,
446 ostream& os);
447
448 void handleValue (
449 string theString,
450 ostream& os);
451
452 public:
453
454 // visitors
455 // ------------------------------------------------------
456
457 virtual void acceptIn (basevisitor* v);
458 virtual void acceptOut (basevisitor* v);
459
460 virtual void browseData (basevisitor* v);
461
462 public:
463
464 // print
465 // ------------------------------------------------------
466
467 string asShortNamedOptionString () const;
468 string asActualLongNamedOptionString () const;
469
470 void print (ostream& os) const;
471
472 void printAtomOptionsValues (
473 ostream& os,
474 int valueFieldWidth) const;
475
476 private:
477
478 // fields
479 // ------------------------------------------------------
480
481 msrQuarterTonesPitchesLanguageKind&
482 fMsrQuarterTonesPitchesLanguageKindVariable;
483};
485EXP ostream& operator<< (ostream& os, const S_msrPitchesLanguageAtom& elt);
486
487//______________________________________________________________________________
488class msrOah : public oahGroup
489{
490 public:
491
492 static SMARTP<msrOah> create (
493 S_oahHandler handlerUpLink);
494
495 SMARTP<msrOah> createCloneWithDetailedTrace ();
496
497 public:
498
499 // initialisation
500 // ------------------------------------------------------
501
502 void initializeMsrOah (
503 bool boolOptionsInitialValue);
504
505 public:
506
507 // constructors/destructor
508 // ------------------------------------------------------
509
510 msrOah (
511 S_oahHandler handlerUpLink);
512
513 virtual ~msrOah ();
514
515 // set and get
516 // ------------------------------------------------------
517
518 bool setMsrQuarterTonesPitchesLanguage (
519 string language);
520
521 public:
522
523 // quiet mode
524 // ------------------------------------------------------
525
526 void enforceQuietness ();
527
528 public:
529
530 // consistency check
531 // ------------------------------------------------------
532
533 virtual void checkOptionsConsistency ();
534
535 public:
536
537 // public services
538 // ------------------------------------------------------
539
540 private:
541
542 // private services
543 // ------------------------------------------------------
544
545#ifdef TRACE_OAH
546 void initializeMsrTraceOah (
547 bool boolOptionsInitialValue);
548#endif
549
550 void initializeMsrDisplayOptions (
551 bool boolOptionsInitialValue);
552
553 void initializeMsrLanguagesOptions (
554 bool boolOptionsInitialValue);
555
556 void initializeMsrPartsOptions (
557 bool boolOptionsInitialValue);
558
559 void initializeMsrStavesOptions (
560 bool boolOptionsInitialValue);
561
562 void initializeMsrVoicesOptions (
563 bool boolOptionsInitialValue);
564
565 void initializeMsrRepeatsOptions (
566 bool boolOptionsInitialValue);
567
568 void initializeMsrNotesOptions (
569 bool boolOptionsInitialValue);
570
571 void initializeMsrLyricsOptions (
572 bool boolOptionsInitialValue);
573
574 void initializeMsrHarmoniesOptions (
575 bool boolOptionsInitialValue);
576
577 void initializeMsrFiguredBassOptions (
578 bool boolOptionsInitialValue);
579
580 void initializeMsrExitAfterSomePassesOptions (
581 bool boolOptionsInitialValue);
582
583 public:
584
585 // visitors
586 // ------------------------------------------------------
587
588 virtual void acceptIn (basevisitor* v);
589 virtual void acceptOut (basevisitor* v);
590
591 virtual void browseData (basevisitor* v);
592
593 public:
594
595 // print
596 // ------------------------------------------------------
597
598 void printMsrOahHelp ();
599
600 void printMsrOahValues (int fieldWidth);
601
602 public:
603
604 // trace
605 // --------------------------------------
606
607 bool fTraceMsr;
608
609 bool fTraceMsrVisitors;
610
611 // display
612 // --------------------------------------
613
614 bool fDisplayPartGroups;
615
616 bool fDisplayMsr;
617 bool fDisplayMsrDetails;
618
619 bool fDisplayMsrNames;
620 bool fDisplayMsrSummary;
621
622
623 // languages
624 // --------------------------------------
625
626 msrQuarterTonesPitchesLanguageKind
627 fMsrQuarterTonesPitchesLanguageKind;
628
629 // parts
630 // --------------------------------------
631
632 map<string, string> fPartsRenamingMap;
633
634 map<string, S_msrSemiTonesPitchAndOctave>
635 fPartsTranspositionMap;
636
637 set<string> fPartsOmitIDSet;
638 set<string> fPartsKeepIDSet;
639
640 set<string> fPartsOmitNameSet;
641 set<string> fPartsKeepNameSet;
642
643 // for checkOptionsConsistency()
644 S_oahStringSetAtom fOmitPartIDAtom;
645 S_oahStringSetAtom fKeepPartIDAtom;
646
647 S_oahStringSetAtom fOmitPartNameAtom;
648 S_oahStringSetAtom fKeepPartNameAtom;
649
650
651 // staves
652 // --------------------------------------
653
654 bool fCreateSingleLineStavesAsRythmic;
655
656
657 // voices
658 // --------------------------------------
659
660 bool fCreateVoicesStaffRelativeNumbers;
661
662
663 // repeats
664 // --------------------------------------
665
666 bool fCreateImplicitInitialRepeatBarline;
667
668
669 // notes
670 // --------------------------------------
671
672 bool fDelayRestsDynamics;
673 bool fDelayRestsWords; // JMI
674 bool fDelayRestsBeams; // JMI
675 bool fDelayRestsSlurs; // JMI
676 bool fDelayRestsLigatures; // JMI
677 bool fDelayRestsPedals; // JMI
678 bool fDelayRestsSlashes; // JMI
679 bool fDelayRestsWedges; // JMI
680
681 bool fSlashAllGraceNotes;
682 bool fSlurAllGraceNotes;
683
684 // articulations
685 // --------------------------------------
686
687 bool fOmitArticulations;
688
689
690 // ornaments
691 // --------------------------------------
692
693
694 bool fOmitOrnaments;
695
696 // words
697 // --------------------------------------
698
699 bool fOmitWords;
700
701 // ties
702 // --------------------------------------
703
704 bool fOmitTies;
705
706 // dynamics
707 // --------------------------------------
708
709 bool fOmitDynamics;
710
711 // slurs
712 // --------------------------------------
713
714 bool fOmitSlurs;
715
716 // wedges
717 // --------------------------------------
718
719 bool fOmitWedges;
720
721 // lyrics
722 // --------------------------------------
723
724 bool fAddStanzasNumbers; // LPSR ??? JMI
725
726 bool fOmitLyrics;
727
728
729 // harmonies
730 // --------------------------------------
731
732 bool fShowHarmonyVoices;
733
734 bool fOmitHarmonies;
735
736
737 // figured bass
738 // --------------------------------------
739
740 bool fShowFiguredBassVoices;
741
742 bool fOmitFiguredBasses;
743
744
745 // exit after some passes
746 // --------------------------------------
747
748 bool fExit2a;
749 bool fExit2b;
750};
752EXP ostream& operator<< (ostream& os, const S_msrOah& elt);
753
754EXP extern S_msrOah gMsrOah;
755EXP extern S_msrOah gMsrOahUserChoices;
756EXP extern S_msrOah gMsrOahWithDetailedTrace;
757
758//______________________________________________________________________________
759void initializeMsrOahHandling (
760 S_oahHandler handler);
761
762
763}
764
765
766#endif
the smart pointer implementation
Definition: smartpointer.h:58
Definition: basevisitor.h:25
Definition: msrOah.h:307
Definition: msrOah.h:489
Definition: msrOah.h:217
Definition: msrOah.h:397
Definition: msrOah.h:26
Definition: msrOah.h:113
Definition: oahBasicTypes.h:2854
Definition: oahBasicTypes.h:964