LibMusicXML 3.18
brailleOah.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 ___brailleOah___
14#define ___brailleOah___
15
16#include <set>
17
18#include "oahBasicTypes.h"
19
20#include "bsrBrailleCodeGenerators.h"
21
22
23namespace MusicXML2
24{
25
26//______________________________________________________________________________
28{
29 public:
30
31 // creation
32 // ------------------------------------------------------
33
34 static SMARTP<brailleOutputKindAtom> create (
35 string shortName,
36 string longName,
37 string description,
38 string valueSpecification,
39 string variableName,
40 bsrBrailleOutputKind& brailleOutputKindVariable);
41
42 protected:
43
44 // constructors/destructor
45 // ------------------------------------------------------
46
48 string shortName,
49 string longName,
50 string description,
51 string valueSpecification,
52 string variableName,
53 bsrBrailleOutputKind& brailleOutputKindVariable);
54
55 virtual ~brailleOutputKindAtom ();
56
57 public:
58
59 // set and get
60 // ------------------------------------------------------
61
62 public:
63
64 // services
65 // ------------------------------------------------------
66
67 S_oahValuedAtom handleOptionUnderName (
68 string optionName,
69 ostream& os);
70
71 void handleValue (
72 string theString,
73 ostream& os);
74
75 public:
76
77 // visitors
78 // ------------------------------------------------------
79
80 virtual void acceptIn (basevisitor* v);
81 virtual void acceptOut (basevisitor* v);
82
83 virtual void browseData (basevisitor* v);
84
85 public:
86
87 // print
88 // ------------------------------------------------------
89
90 string asShortNamedOptionString () const;
91 string asActualLongNamedOptionString () const;
92
93 void print (ostream& os) const;
94
95 void printAtomOptionsValues (
96 ostream& os,
97 int valueFieldWidth) const;
98
99 private:
100
101 // fields
102 // ------------------------------------------------------
103
104 bsrBrailleOutputKind& fBrailleOutputKindVariable;
105};
107EXP ostream& operator<< (ostream& os, const S_brailleOutputKindAtom& elt);
108
109//______________________________________________________________________________
111{
112 public:
113
114 // creation
115 // ------------------------------------------------------
116
117 static SMARTP<brailleUTFKindAtom> create (
118 string shortName,
119 string longName,
120 string description,
121 string valueSpecification,
122 string variableName,
123 bsrUTFKind& brailleUTFKindVariable);
124
125 protected:
126
127 // constructors/destructor
128 // ------------------------------------------------------
129
131 string shortName,
132 string longName,
133 string description,
134 string valueSpecification,
135 string variableName,
136 bsrUTFKind& brailleUTFKindVariable);
137
138 virtual ~brailleUTFKindAtom ();
139
140 public:
141
142 // set and get
143 // ------------------------------------------------------
144
145 public:
146
147 // services
148 // ------------------------------------------------------
149
150 void handleValue (
151 string theString,
152 ostream& os);
153
154 public:
155
156 // visitors
157 // ------------------------------------------------------
158
159 virtual void acceptIn (basevisitor* v);
160 virtual void acceptOut (basevisitor* v);
161
162 virtual void browseData (basevisitor* v);
163
164 public:
165
166 // print
167 // ------------------------------------------------------
168
169 string asShortNamedOptionString () const;
170 string asActualLongNamedOptionString () const;
171
172 void print (ostream& os) const;
173
174 void printAtomOptionsValues (
175 ostream& os,
176 int valueFieldWidth) const;
177
178 private:
179
180 // fields
181 // ------------------------------------------------------
182
183 bsrUTFKind& fBsrUTFKindVariable;
184};
186EXP ostream& operator<< (ostream& os, const S_brailleUTFKindAtom& elt);
187
188//______________________________________________________________________________
190{
191 public:
192
193 // creation
194 // ------------------------------------------------------
195
197 string shortName,
198 string longName,
199 string description,
200 string valueSpecification,
201 string variableName,
202 bsrByteOrderingKind& brailleByteOrderingKindVariable);
203
204 protected:
205
206 // constructors/destructor
207 // ------------------------------------------------------
208
210 string shortName,
211 string longName,
212 string description,
213 string valueSpecification,
214 string variableName,
215 bsrByteOrderingKind& brailleByteOrderingKindVariable);
216
218
219 public:
220
221 // set and get
222 // ------------------------------------------------------
223
224 // services
225 // ------------------------------------------------------
226
227 void handleValue (
228 string theString,
229 ostream& os);
230
231 public:
232
233 // visitors
234 // ------------------------------------------------------
235
236 virtual void acceptIn (basevisitor* v);
237 virtual void acceptOut (basevisitor* v);
238
239 virtual void browseData (basevisitor* v);
240
241 // print
242 // ------------------------------------------------------
243
244 string asShortNamedOptionString () const;
245 string asActualLongNamedOptionString () const;
246
247 void print (ostream& os) const;
248
249 void printAtomOptionsValues (
250 ostream& os,
251 int valueFieldWidth) const;
252
253 private:
254
255 // fields
256 // ------------------------------------------------------
257
258 bsrByteOrderingKind& fBsrByteOrderingKindVariable;
259};
261EXP ostream& operator<< (ostream& os, const S_brailleByteOrderingKindAtom& elt);
262
263//______________________________________________________________________________
264class brailleOah : public oahGroup
265{
266 public:
267
268 // creation
269 // ------------------------------------------------------
270
271 static SMARTP<brailleOah> create (
272 S_oahHandler handlerUpLink);
273
274 SMARTP<brailleOah> createCloneWithDetailedTrace ();
275
276 public:
277
278 // initialisation
279 // ------------------------------------------------------
280
281 void initializeBrailleOah (
282 bool boolOptionsInitialValue);
283
284 void printBrailleOahHelp ();
285
286 void printBrailleOahValues (int fieldWidth);
287
288 public:
289
290 // constructors/destructor
291 // ------------------------------------------------------
292
293 brailleOah (
294 S_oahHandler handlerUpLink);
295
296 virtual ~brailleOah ();
297
298 // set and get
299 // ------------------------------------------------------
300
301 public:
302
303 // quiet mode
304 // ------------------------------------------------------
305
306 void enforceQuietness ();
307
308 public:
309
310 // consistency check
311 // ------------------------------------------------------
312
313 virtual void checkOptionsConsistency ();
314
315 public:
316
317 // public services
318 // ------------------------------------------------------
319
320 public:
321
322 // visitors
323 // ------------------------------------------------------
324
325 virtual void acceptIn (basevisitor* v);
326 virtual void acceptOut (basevisitor* v);
327
328 virtual void browseData (basevisitor* v);
329
330 private:
331
332 // private services
333 // ------------------------------------------------------
334
335 void initializeBrailleEncodingOptions (
336 bool boolOptionsInitialValue);
337
338 void initializeBrailleByteOrderingOptions (
339 bool boolOptionsInitialValue);
340
341 void initializeBrailleMusicFileNameOptions (
342 bool boolOptionsInitialValue);
343
344 void initializeBraillePageParametersOptions (
345 bool boolOptionsInitialValue);
346
347 void initializeBrailleCodeGenerationOptions (
348 bool boolOptionsInitialValue);
349
350 public:
351
352 // braille output kind
353 // --------------------------------------
354
355 bsrBrailleOutputKind fBrailleOutputKind;
356
357 // UTF encoding
358 // --------------------------------------
359
360 bsrUTFKind fUTFKind;
361
362 // byte ordering
363 // --------------------------------------
364
365 bsrByteOrderingKind fByteOrderingKind;
366
367 // braille music file name
368 // --------------------------------------
369
370 bool fDontUseEncodingInFileName;
371
372 // page parameters
373 // --------------------------------------
374
375 int fCellsPerLine;
376 int fMeasuresPerLine;
377 int fLinesPerPage;
378
379 // code generation
380 // --------------------------------------
381
382 bool fXml2brlInfos;
383
384 bool fNoBrailleCode;
385};
387EXP ostream& operator<< (ostream& os, const S_brailleOah& elt);
388
389EXP extern S_brailleOah gBrailleOah;
390EXP extern S_brailleOah gBrailleOahUserChoices;
391EXP extern S_brailleOah gBrailleOahWithDetailedTrace;
392
393//______________________________________________________________________________
394void initializeBrailleOahHandling (
395 S_oahHandler handler);
396
397
398}
399
400
401#endif
the smart pointer implementation
Definition: smartpointer.h:58
Definition: basevisitor.h:25
Definition: brailleOah.h:190
Definition: brailleOah.h:265
Definition: brailleOah.h:28
Definition: brailleOah.h:111
Definition: oahBasicTypes.h:2854
Definition: oahBasicTypes.h:964