LibMusicXML  3.18
bsrOah.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 ___bsrOah___
14 #define ___bsrOah___
15 
16 #include "exports.h"
17 
18 #include "bsrBasicTypes.h"
19 
20 #include "oahBasicTypes.h"
21 
22 namespace MusicXML2
23 {
24 
25 //______________________________________________________________________________
26 enum bsrFacSimileKind {
27  kFacSimileYes, kFacSimileNo };
28 
29 string bsrFacSimileKindAsString (
30  bsrFacSimileKind facSimileKind);
31 
32 //______________________________________________________________________________
34 {
35  public:
36 
37  // creation
38  // ------------------------------------------------------
39 
40  static SMARTP<bsrFacSimileKindAtom> create (
41  string shortName,
42  string longName,
43  string description,
44  string valueSpecification,
45  string variableName,
46  bsrFacSimileKind bsrFacSimileKindVariable);
47 
48  protected:
49 
50  // constructors/destructor
51  // ------------------------------------------------------
52 
54  string shortName,
55  string longName,
56  string description,
57  string valueSpecification,
58  string variableName,
59  bsrFacSimileKind bsrFacSimileKindVariable);
60 
61  virtual ~bsrFacSimileKindAtom ();
62 
63  public:
64 
65  // set and get
66  // ------------------------------------------------------
67 
68  void setOptionsFacSimileKindVariable (
69  bsrFacSimileKind value)
70  { fBsrFacSimileKindVariable = value; }
71 
72  public:
73 
74  // services
75  // ------------------------------------------------------
76 
77  void handleValue (
78  string theString,
79  ostream& os);
80 
81  public:
82 
83  // visitors
84  // ------------------------------------------------------
85 
86  virtual void acceptIn (basevisitor* v);
87  virtual void acceptOut (basevisitor* v);
88 
89  virtual void browseData (basevisitor* v);
90 
91  public:
92 
93  // print
94  // ------------------------------------------------------
95 
96  string asShortNamedOptionString () const;
97  string asActualLongNamedOptionString () const;
98 
99  void print (ostream& os) const;
100 
101  void printAtomOptionsValues (
102  ostream& os,
103  int valueFieldWidth) const;
104 
105  private:
106 
107  // fields
108  // ------------------------------------------------------
109 
110  bsrFacSimileKind fBsrFacSimileKindVariable;
111 };
113 EXP ostream& operator<< (ostream& os, const S_bsrFacSimileKindAtom& elt);
114 
115 //______________________________________________________________________________
117 {
118  public:
119 
120  // creation
121  // ------------------------------------------------------
122 
123  static SMARTP<bsrTextsLanguageAtom> create (
124  string shortName,
125  string longName,
126  string description,
127  string valueSpecification,
128  string variableName,
129  bsrTextsLanguageKind&
130  bsrTextsLanguageKindVariable);
131 
132  protected:
133 
134  // constructors/destructor
135  // ------------------------------------------------------
136 
138  string shortName,
139  string longName,
140  string description,
141  string valueSpecification,
142  string variableName,
143  bsrTextsLanguageKind&
144  bsrTextsLanguageKindVariable);
145 
146  virtual ~bsrTextsLanguageAtom ();
147 
148  public:
149 
150  // set and get
151  // ------------------------------------------------------
152 
153  void setBsrTextsLanguageKindVariable (
154  bsrTextsLanguageKind value)
155  {
156  fBsrTextsLanguageKindVariable = value;
157  }
158 
159  public:
160 
161  // services
162  // ------------------------------------------------------
163 
164  void handleValue (
165  string theString,
166  ostream& os);
167 
168  public:
169 
170  // visitors
171  // ------------------------------------------------------
172 
173  virtual void acceptIn (basevisitor* v);
174  virtual void acceptOut (basevisitor* v);
175 
176  virtual void browseData (basevisitor* v);
177 
178  public:
179 
180  // print
181  // ------------------------------------------------------
182 
183  string asShortNamedOptionString () const;
184  string asActualLongNamedOptionString () const;
185 
186  void print (ostream& os) const;
187 
188  void printAtomOptionsValues (
189  ostream& os,
190  int valueFieldWidth) const;
191 
192  private:
193 
194  // fields
195  // ------------------------------------------------------
196 
197  bsrTextsLanguageKind& fBsrTextsLanguageKindVariable;
198 };
200 EXP ostream& operator<< (ostream& os, const S_bsrTextsLanguageAtom& elt);
201 
202 //______________________________________________________________________________
203 class bsrOah : public oahGroup
204 {
205  public:
206 
207  // creation
208  // ------------------------------------------------------
209 
210  static SMARTP<bsrOah> create (
211  S_oahHandler handlerUpLink);
212 
213  SMARTP<bsrOah> createCloneWithDetailedTrace ();
214 
215  public:
216 
217  // initialisation
218  // ------------------------------------------------------
219 
220  void initializeBsrOah (
221  bool boolOptionsInitialValue);
222 
223  public:
224 
225  // constructors/destructor
226  // ------------------------------------------------------
227 
228  bsrOah (
229  S_oahHandler handlerUpLink);
230 
231  virtual ~bsrOah ();
232 
233  public:
234 
235  // set and get
236  // ------------------------------------------------------
237 
238  bool setBsrTextsLanguage (
239  string language);
240 
241  public:
242 
243  // quiet mode
244  // ------------------------------------------------------
245 
246  void enforceQuietness ();
247 
248  public:
249 
250  // consistency check
251  // ------------------------------------------------------
252 
253  virtual void checkOptionsConsistency ();
254 
255  public:
256 
257  // public services
258  // ------------------------------------------------------
259 
260  private:
261 
262  // private services
263  // ------------------------------------------------------
264 
265  void initializeBsrDisplayOptions (
266  bool boolOptionsInitialValue);
267 
268  void initializeBsrLanguagesOptions (
269  bool boolOptionsInitialValue);
270 
271 
272  void initializeBsrMiscellaneousOptions (
273  bool boolOptionsInitialValue);
274 
275 
276  void initializeBsrExitAfterSomePassesOptions (
277  bool boolOptionsInitialValue);
278 
279 #ifdef TRACE_OAH
280  void initializeBsrTraceOah (
281  bool boolOptionsInitialValue);
282 #endif
283 
284  public:
285 
286  // visitors
287  // ------------------------------------------------------
288 
289  virtual void acceptIn (basevisitor* v);
290  virtual void acceptOut (basevisitor* v);
291 
292  virtual void browseData (basevisitor* v);
293 
294  public:
295 
296  // print
297  // ------------------------------------------------------
298 
299  void printBsrOahHelp ();
300 
301  void printBsrOahValues (int fieldWidth);
302 
303  public:
304 
305  // display
306  // --------------------------------------
307 
308  bool fDisplayBsr;
309  bool fDisplayBsrDetails;
310 
311  // languages
312  // --------------------------------------
313 
314  bsrTextsLanguageKind fBsrTextsLanguageKind;
315 
316  // miscellaneous
317  // --------------------------------------
318 
319  bool fNoBrailleMusicHeadings;
320 
321  bool fNoTempos;
322 
323  bool fNoPageNumbers;
324  bool fNoLineNumbers;
325  bool fNoMeasureNumbers;
326 
327  bool fNoBrailleLyrics;
328 
329  bool fBrailleCompileDate;
330 
331  bsrFacSimileKind fFacSimileKind;
332 
333  bool fIncludeClefs;
334 
335  // exit after some passes
336  // --------------------------------------
337 
338  bool fExit3a;
339  bool fExit3b;
340 
341  // trace
342  // --------------------------------------
343 
344 #ifdef TRACE_OAH
345  // BSR
346  bool fTraceBsr;
347 
348  // pages & lines
349  bool fTracePages;
350 
351  bool fTraceLines;
352 
353  bool fTraceSpaces;
354  bool fTraceNumbers;
355 
356  // parallels
357  bool fTraceParallels;
358 
359  // visitors
360  bool fTraceBsrVisitors;
361 #endif
362 };
363 typedef SMARTP<bsrOah> S_bsrOah;
364 EXP ostream& operator<< (ostream& os, const S_bsrOah& elt);
365 
366 EXP extern S_bsrOah gBsrOah;
367 EXP extern S_bsrOah gBsrOahUserChoices;
368 EXP extern S_bsrOah gBsrOahWithDetailedTrace;
369 
370 //______________________________________________________________________________
371 EXP void initializeBsrOahHandling (
372  S_oahHandler handler);
373 
374 
375 }
376 
377 
378 #endif
MusicXML2::oahGroup
Definition: oahBasicTypes.h:2854
MusicXML2::bsrFacSimileKindAtom
Definition: bsrOah.h:34
MusicXML2::SMARTP
the smart pointer implementation
Definition: smartpointer.h:58
MusicXML2::basevisitor
Definition: basevisitor.h:25
MusicXML2::oahValuedAtom
Definition: oahBasicTypes.h:964
MusicXML2::bsrOah
Definition: bsrOah.h:204
MusicXML2::bsrTextsLanguageAtom
Definition: bsrOah.h:117