LibMusicXML  3.18
lpsrOah.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 ___lpsrOah___
14 #define ___lpsrOah___
15 
16 #include "lpsrBasicTypes.h"
17 
18 #include "oahBasicTypes.h"
19 
20 #include "oahBasicTypes.h"
21 
22 namespace MusicXML2
23 {
24 
25 //______________________________________________________________________________
27 {
28  public:
29 
30  // creation
31  // ------------------------------------------------------
32 
33  static SMARTP<lpsrScoreOutputKindAtom> create (
34  string shortName,
35  string longName,
36  string description,
37  string valueSpecification,
38  string variableName,
39  lpsrScoreOutputKind& lpsrScoreOutputKindVariable);
40 
41  protected:
42 
43  // constructors/destructor
44  // ------------------------------------------------------
45 
47  string shortName,
48  string longName,
49  string description,
50  string valueSpecification,
51  string variableName,
52  lpsrScoreOutputKind& lpsrScoreOutputKindVariable);
53 
54  virtual ~lpsrScoreOutputKindAtom ();
55 
56  public:
57 
58  // set and get
59  // ------------------------------------------------------
60 
61  void setLpsrScoreOutputKindVariable (
62  lpsrScoreOutputKind value)
63  { fLpsrScoreOutputKindVariable = value; }
64 
65  public:
66 
67  // services
68  // ------------------------------------------------------
69 
70  S_oahValuedAtom handleOptionUnderName (
71  string optionName,
72  ostream& os);
73 
74  void handleValue (
75  string theString,
76  ostream& os);
77 
78  public:
79 
80  // visitors
81  // ------------------------------------------------------
82 
83  virtual void acceptIn (basevisitor* v);
84  virtual void acceptOut (basevisitor* v);
85 
86  virtual void browseData (basevisitor* v);
87 
88  public:
89 
90  // print
91  // ------------------------------------------------------
92 
93  string asShortNamedOptionString () const;
94  string asActualLongNamedOptionString () const;
95 
96  void print (ostream& os) const;
97 
98  void printAtomOptionsValues (
99  ostream& os,
100  int valueFieldWidth) const;
101 
102  private:
103 
104  // fields
105  // ------------------------------------------------------
106 
107  lpsrScoreOutputKind& fLpsrScoreOutputKindVariable;
108 };
110 EXP ostream& operator<< (ostream& os, const S_lpsrScoreOutputKindAtom& elt);
111 
112 //______________________________________________________________________________
114 {
115  public:
116 
117  // creation
118  // ------------------------------------------------------
119 
120  static SMARTP<lpsrPitchesLanguageAtom> create (
121  string shortName,
122  string longName,
123  string description,
124  string valueSpecification,
125  string variableName,
126  msrQuarterTonesPitchesLanguageKind&
127  lpsrPitchesLanguageKindVariable);
128 
129  protected:
130 
131  // constructors/destructor
132  // ------------------------------------------------------
133 
135  string shortName,
136  string longName,
137  string description,
138  string valueSpecification,
139  string variableName,
140  msrQuarterTonesPitchesLanguageKind&
141  lpsrPitchesLanguageKindVariable);
142 
143  virtual ~lpsrPitchesLanguageAtom ();
144 
145  public:
146 
147  // set and get
148  // ------------------------------------------------------
149 
150  void setMsrQuarterTonesPitchesLanguageKindVariable (
151  msrQuarterTonesPitchesLanguageKind value)
152  {
153  fMsrQuarterTonesPitchesLanguageKindVariable = value;
154  }
155 
156  public:
157 
158  // services
159  // ------------------------------------------------------
160 
161  S_oahValuedAtom handleOptionUnderName (
162  string optionName,
163  ostream& os);
164 
165  void handleValue (
166  string theString,
167  ostream& os);
168 
169  public:
170 
171  // visitors
172  // ------------------------------------------------------
173 
174  virtual void acceptIn (basevisitor* v);
175  virtual void acceptOut (basevisitor* v);
176 
177  virtual void browseData (basevisitor* v);
178 
179  public:
180 
181  // print
182  // ------------------------------------------------------
183 
184  string asShortNamedOptionString () const;
185  string asActualLongNamedOptionString () const;
186 
187  void print (ostream& os) const;
188 
189  void printAtomOptionsValues (
190  ostream& os,
191  int valueFieldWidth) const;
192 
193  private:
194 
195  // fields
196  // ------------------------------------------------------
197 
198  msrQuarterTonesPitchesLanguageKind&
199  fMsrQuarterTonesPitchesLanguageKindVariable;
200 };
202 EXP ostream& operator<< (ostream& os, const S_lpsrPitchesLanguageAtom& elt);
203 
204 //______________________________________________________________________________
206 {
207  public:
208 
209  // creation
210  // ------------------------------------------------------
211 
212  static SMARTP<lpsrChordsLanguageAtom> create (
213  string shortName,
214  string longName,
215  string description,
216  string valueSpecification,
217  string variableName,
218  lpsrChordsLanguageKind&
219  lpsrChordsLanguageKindVariable);
220 
221  protected:
222 
223  // constructors/destructor
224  // ------------------------------------------------------
225 
227  string shortName,
228  string longName,
229  string description,
230  string valueSpecification,
231  string variableName,
232  lpsrChordsLanguageKind&
233  lpsrChordsLanguageKindVariable);
234 
235  virtual ~lpsrChordsLanguageAtom ();
236 
237  public:
238 
239  // set and get
240  // ------------------------------------------------------
241 
242  void setLpsrChordsLanguageKindVariable (
243  lpsrChordsLanguageKind value)
244  {
245  fLpsrChordsLanguageKindVariable = value;
246  }
247 
248  public:
249 
250  // services
251  // ------------------------------------------------------
252 
253  S_oahValuedAtom handleOptionUnderName (
254  string optionName,
255  ostream& os);
256 
257  void handleValue (
258  string theString,
259  ostream& os);
260 
261  public:
262 
263  // visitors
264  // ------------------------------------------------------
265 
266  virtual void acceptIn (basevisitor* v);
267  virtual void acceptOut (basevisitor* v);
268 
269  virtual void browseData (basevisitor* v);
270 
271  public:
272 
273  // print
274  // ------------------------------------------------------
275 
276  string asShortNamedOptionString () const;
277  string asActualLongNamedOptionString () const;
278 
279  void print (ostream& os) const;
280 
281  void printAtomOptionsValues (
282  ostream& os,
283  int valueFieldWidth) const;
284 
285  private:
286 
287  // fields
288  // ------------------------------------------------------
289 
290  lpsrChordsLanguageKind&
291  fLpsrChordsLanguageKindVariable;
292 };
294 EXP ostream& operator<< (ostream& os, const S_lpsrChordsLanguageAtom& elt);
295 
296 //______________________________________________________________________________
298 {
299  public:
300 
301  // creation
302  // ------------------------------------------------------
303 
304  static SMARTP<lpsrTransposeAtom> create (
305  string shortName,
306  string longName,
307  string description,
308  string valueSpecification,
309  string variableName,
311  lpsrTransposeVariable);
312 
313  protected:
314 
315  // constructors/destructor
316  // ------------------------------------------------------
317 
319  string shortName,
320  string longName,
321  string description,
322  string valueSpecification,
323  string variableName,
325  lpsrTransposeVariable);
326 
327  virtual ~lpsrTransposeAtom ();
328 
329  public:
330 
331  // set and get
332  // ------------------------------------------------------
333 
334  void setMsrSemiTonesPitchAndOctaveVariable (
336  {
337  fMsrSemiTonesPitchAndOctaveVariable = value;
338  }
339 
340  public:
341 
342  // services
343  // ------------------------------------------------------
344 
345  S_oahValuedAtom handleOptionUnderName (
346  string optionName,
347  ostream& os);
348 
349  void handleValue (
350  string theString,
351  ostream& os);
352 
353  public:
354 
355  // visitors
356  // ------------------------------------------------------
357 
358  virtual void acceptIn (basevisitor* v);
359  virtual void acceptOut (basevisitor* v);
360 
361  virtual void browseData (basevisitor* v);
362 
363  public:
364 
365  // print
366  // ------------------------------------------------------
367 
368  string asShortNamedOptionString () const;
369  string asActualLongNamedOptionString () const;
370 
371  void print (ostream& os) const;
372 
373  void printAtomOptionsValues (
374  ostream& os,
375  int valueFieldWidth) const;
376 
377  private:
378 
379  // fields
380  // ------------------------------------------------------
381 
383  fMsrSemiTonesPitchAndOctaveVariable;
384 };
386 EXP ostream& operator<< (ostream& os, const S_lpsrTransposeAtom& elt);
387 
388 //______________________________________________________________________________
389 class lpsrOah : public oahGroup
390 {
391  public:
392 
393  static SMARTP<lpsrOah> create (
394  S_oahHandler handlerUpLink);
395 
396  SMARTP<lpsrOah> createCloneWithDetailedTrace ();
397 
398  public:
399 
400  // initialisation
401  // ------------------------------------------------------
402 
403  void initializeLpsrOah (
404  bool boolOptionsInitialValue);
405 
406  public:
407 
408  // constructors/destructor
409  // ------------------------------------------------------
410 
411  lpsrOah (
412  S_oahHandler handlerUpLink);
413 
414  virtual ~lpsrOah ();
415 
416  // set and get
417  // ------------------------------------------------------
418 
419  bool setLpsrQuarterTonesPitchesLanguage (
420  string language);
421 
422  bool setLpsrChordsLanguage (
423  string language);
424 
425  public:
426 
427  // quiet mode
428  // ------------------------------------------------------
429 
430  void enforceQuietness ();
431 
432  public:
433 
434  // consistency check
435  // ------------------------------------------------------
436 
437  virtual void checkOptionsConsistency ();
438 
439  public:
440 
441  // public services
442  // ------------------------------------------------------
443 
444  void crackLilypondVersionNumber (
445  string theString,
446  int& generationNumber,
447  int& majorNumber,
448  int& minorNumber);
449 
450  bool versionNumberGreaterThanOrEqualTo (
451  string otherVersionNumber);
452 
453  private:
454 
455  // private
456  // ------------------------------------------------------
457 
458 #ifdef TRACE_OAH
459  void initializeLpsrTraceOah (
460  bool boolOptionsInitialValue);
461 #endif
462 
463  void initializeLpsrDisplayOptions (
464  bool boolOptionsInitialValue);
465 
466  void initializeLpsrScoreOutputOptions (
467  bool boolOptionsInitialValue);
468 
469  void initializeLpsrGlobalStaffSizeOptions (
470  bool boolOptionsInitialValue);
471 
472  void initializeLpsrPaperOptions (
473  bool boolOptionsInitialValue);
474 
475  void initializeLpsrMeasuresOptions (
476  bool boolOptionsInitialValue);
477 
478  void initializeLpsrWordsOptions (
479  bool boolOptionsInitialValue);
480 
481  void initializeLpsrLanguagesOptions (
482  bool boolOptionsInitialValue);
483 
484  void initializeLpsrTransposeOptions (
485  bool boolOptionsInitialValue);
486 
487  void initializeLpsrExitAfterSomePassesOptions (
488  bool boolOptionsInitialValue);
489 
490  public:
491 
492  // visitors
493  // ------------------------------------------------------
494 
495  virtual void acceptIn (basevisitor* v);
496  virtual void acceptOut (basevisitor* v);
497 
498  virtual void browseData (basevisitor* v);
499 
500  public:
501 
502  // print
503  // ------------------------------------------------------
504 
505  void printLpsrOahHelp ();
506 
507  void printLpsrOahValues (int fieldWidth);
508 
509  public:
510 
511  // trace
512  // --------------------------------------
513 
514 #ifdef TRACE_OAH
515  bool fTraceLpsr;
516 
517  bool fTraceLilypondVersion;
518 
519  bool fTraceLpsrVisitors;
520 
521  bool fTraceLpsrBlocks;
522 
523  bool fTraceSchemeFunctions;
524 #endif
525 
526  // display
527  // --------------------------------------
528 
529  bool fDisplayLpsr;
530 
531  // LilyPond version
532  // --------------------------------------
533 
534  string fLilyPondVersion;
535 
536  // score output kind
537  // --------------------------------------
538 
539  lpsrScoreOutputKind fScoreOutputKind;
540 
541  // global staff size
542  // --------------------------------------
543 
544  float fGlobalStaffSize;
545  float fStaffGlobalSizeDefaultValue;
546 
547  // paper
548  // --------------------------------------
549 
550  msrLengthUnitKind fLengthUnitKind;
551  msrLengthUnitKind fLengthUnitKindDefaultValue;
552 
553  msrLength fPaperHeight;
554  msrLength fPaperWidth;
555 
556  // indents
557  msrLength fPaperHorizontalShift;
558  msrLength fPaperIndent;
559  msrLength fPaperShortIndent;
560 
561  msrLength fMarkupSystemSpacingPadding;
562 
563  bool fRaggedBottom;
564  bool fRaggedLastBottom;
565 
566  bool fTagline;
567 
568  int fPageCount; // negative if not specified
569  int fSystemCount; // negative if not specified
570 
571 
572  // measures
573  // --------------------------------------
574 
575  // replicate empty measure JMI ???
576  string fReplicateEmptyMeasureNumber;
577  int fReplicateEmptyMeasureReplicas;
578 
579  // add empty measures
580  map<string,int> fAddEmptyMeasuresStringToIntMap;
581 
582  // words
583  // --------------------------------------
584 
585  // convert words to tempo
586  bool fConvertWordsToTempo;
587  // add words from the lyrics
588  bool fAddWordsFromTheLyrics;
589 
590  // rehearsal marks
591  // --------------------------------------
592 
593  // convert tempos to rehearsal marks
594  bool fConvertTemposToRehearsalMarks;
595  // convert words to rehearsal marks
596  bool fConvertWordsToRehearsalMarks;
597 
598  // languages
599  // --------------------------------------
600 
601  msrQuarterTonesPitchesLanguageKind
602  fLpsrQuarterTonesPitchesLanguageKind;
603 
604  lpsrChordsLanguageKind
605  fLpsrChordsLanguageKind;
606 
607  // transpose
608  // --------------------------------------
609 
611  fTransposeSemiTonesPitchAndOctave;
612 
613  // exit after some passes
614  // --------------------------------------
615 
616  bool fExit3;
617 };
618 typedef SMARTP<lpsrOah> S_lpsrOah;
619 EXP ostream& operator<< (ostream& os, const S_lpsrOah& elt);
620 
621 EXP extern S_lpsrOah gLpsrOah;
622 EXP extern S_lpsrOah gLpsrOahUserChoices;
623 EXP extern S_lpsrOah gLpsrOahWithDetailedTrace;
624 
625 //______________________________________________________________________________
626 EXP void initializeLpsrOahHandling (
627  S_oahHandler handler);
628 
629 
630 }
631 
632 
633 #endif
the smart pointer implementation
Definition: smartpointer.h:58
Definition: basevisitor.h:25
Definition: lpsrOah.h:206
Definition: lpsrOah.h:390
Definition: lpsrOah.h:114
Definition: lpsrOah.h:27
Definition: lpsrOah.h:298
Definition: msrBasicTypes.h:596
Definition: oahBasicTypes.h:2854
Definition: oahBasicTypes.h:964