1
/* Output from p2c 1.21alpha-07.Dec.93, the Pascal-to-C translator */
2
/* From input file "control.pas" */
17
/* enables Include: directive */
18
/* one-word shortcut is treated by simply inserting a blank */
19
/* detached form of shortcut allowed */
20
/* C: lines are taken into account */
21
/* U: lines are taken into account */
22
/* L: lines are taken into account */
23
/* non-melismatic eighth and shorter notes in vocal lines are unbeamed */
24
/* blind slurs are hidden */
25
/* U: lines synchronize with words and rests */
26
/* always insert duration into notes */
27
/* include macros in the count */
28
/* literally expand macros */
29
/* keep track of pitch and warn if unreal */
30
/* transform note words to canical form */
31
/* use solfa note names */
32
/* issue warnings even when default action is likely to be correct */
33
/* ignore all errors except fatal errors */
34
/* set instrument names */
35
/* report what is being done */
36
/* write all possible infomative messages */
38
noSuchFeature, FmultiFile, FsplitShortcut, FnewWordShortcut, FdoChords,
39
FdoUptext, FdoLyrics, FunbeamVocal, FhideBlindSlurs, FuptextOnRests,
40
FinsertDuration, FcountMacro, FexpandMacro, FcheckPitch, FrearrangeNote,
41
FsolfaNoteNames, FpedanticWarnings, FignoreErrors, FinstrumentNames,
42
FbeVerbose, FdebugMode
45
typedef struct Tfeature {
47
boolean active, changed;
51
#define firstFeature FmultiFile
52
#define lastFeature FdebugMode
55
Static Tfeature feat[21] = {
57
{ "multiFile", true, false },
58
{ "splitShortcut", true, false },
59
{ "newWordShortcut", true, false },
60
{ "doChords", true, false },
61
{ "doUptext", true, false },
62
{ "doLyrics", true, false },
63
{ "unbeamVocal", true, false },
64
{ "hideBlindSlurs", true, false },
65
{ "uptextOnRests", true, false },
66
{ "insertDuration", true, false },
67
{ "countMacro", false, false },
68
{ "expandMacro", false, false },
69
{ "checkPitch", true, false },
70
{ "rearrangeNote", true, false },
71
{ "solfaNoteNames", false, false },
72
{ "pedanticWarnings", false, false },
73
{ "ignoreErrors", false, false },
74
{ "instrumentNames", false, false },
75
{ "beVerbose", false, false },
76
{ "debugMode", false, false }
80
Void printFeatures(anyway)
86
for (i = firstFeature; (long)i <= (long)lastFeature; i = (feature)((long)i + 1)) {
87
WITH = &feat[(long)i];
88
if (WITH->changed || anyway)
89
printf("%s = %s\n", WITH->tag, WITH->active ? " TRUE" : "FALSE");
94
Static feature featureNamed(s)
99
for (i = firstFeature; (long)i <= (long)lastFeature; i = (feature)((long)i + 1)) {
100
if (equalsIgnoreCase(s, feat[(long)i].tag))
103
return noSuchFeature;
107
boolean setFeature(which, val)
111
boolean Result = false;
115
f = featureNamed(which);
116
if (f != noSuchFeature) {
117
WITH = &feat[(long)f];
119
WITH->changed = true;
122
if (f == FdebugMode && val)
123
feat[(long)FbeVerbose].active = true;
124
if (f == FbeVerbose && !val)
125
feat[(long)FdebugMode].active = false;
133
if (strcmp(level, "0.57") < 0) {
134
setFeature("splitShortcut", false);
135
setFeature("newWordShortcut", false);
140
/* Feature functions. To add a new feature "newFeature":
141
1. Insert a new value "FnewFeature" in the declaration of type "feature".
142
2. Insert an entry for it in array "feat".
143
3. Copy the template below and change "FEATURE" into "newFeature".
144
4. Copy the function header to the interface section.
145
5. (Optional) Insert code into "mtxLevel" to enable/disable the feature.
147
function FEATURE: boolean;
148
begin FEATURE := feat[FFEATURE].active end;
153
return (feat[(long)FcheckPitch].active);
159
return (feat[(long)FcountMacro].active);
163
boolean expandMacro()
165
return (feat[(long)FexpandMacro].active);
169
boolean insertDuration()
171
return (feat[(long)FinsertDuration].active);
175
boolean rearrangeNote()
177
return (feat[(long)FrearrangeNote].active);
183
return (feat[(long)FbeVerbose].active);
189
return (feat[(long)FdebugMode].active);
193
boolean instrumentNames()
195
return (feat[(long)FinstrumentNames].active);
199
boolean hideBlindSlurs()
201
return (feat[(long)FhideBlindSlurs].active);
207
return (feat[(long)FdoLyrics].active);
211
boolean ignoreErrors()
213
return (feat[(long)FignoreErrors].active);
217
boolean pedanticWarnings()
219
return (feat[(long)FpedanticWarnings].active);
223
boolean solfaNoteNames()
225
return (feat[(long)FsolfaNoteNames].active);
229
boolean uptextOnRests()
231
return (feat[(long)FuptextOnRests].active);
235
boolean unbeamVocal()
237
return (feat[(long)FunbeamVocal].active);
243
return (feat[(long)FdoChords].active);
249
return (feat[(long)FdoUptext].active);
253
boolean newWordShortcut()
255
return (feat[(long)FnewWordShortcut].active);
259
boolean splitShortcut()
261
return (feat[(long)FsplitShortcut].active);
267
return (feat[(long)FmultiFile].active);