lilypond-0.0.9
[lilypond.git] / command.hh
blob3e90067075cd4c45701dc028e5efbfe863307e2f
1 #ifndef COMMAND_HH
2 #define COMMAND_HH
3 #include "glob.hh"
5 #include "vray.hh"
6 #include "string.hh"
8 enum Commandcode {
9 NOP,
10 INTERPRET,
11 TYPESET,
12 BREAK_PRE,BREAK_MIDDLE, BREAK_POST, BREAK_END
14 /// set a nonrythmical symbol
15 struct Command {
16 Commandcode code;
18 Real when;
19 /// analogous to argv[]
20 svec<String> args;
21 int priority;
23 /****************/
25 Command();
26 Command(Real w);
27 bool isbreak()const;
28 void print() const;
31 /**
32 A nonrhythmical "thing" in a staff is called a "command".
33 Commands have these properties:
35 \begin{itemize}
36 \item They are \bf{not} rhythmical, i.e. they do not have a duration
37 \item They have a staff-wide impact, i.e. a command cannot be targeted at
38 only one voice in the staff: two voices sharing a staff can't have
39 different clefs
40 \item Commands are ordered, that is, when from musical point of view the
41 commands happen simultaneously, the order in which Staff receives the
42 commands can still make a difference in the output
43 \item Some commands are actually score wide, so Score has to issue these
44 commands to the Staff, eg. BREAK commands
45 \end{itemize}
47 At this moment we have three classes of commands:
48 \begin{description}
49 INTERPRET commands are not grouped.
50 \item[TYPESET] These commands instruct the Staff to
51 typeset symbols on the output, eg meter/clef/key changes
52 \item[INTERPRET] These commands do not produce output, instead,
53 they change the interpretation of other commands or requests.
54 example: shift output vertically, set the key.
55 \item[BREAK_XXX] These commands group TYPESET commands in
56 prebreak and postbreak commands. \See{Col}.
57 Staff can insert additional commands in a sequence of BREAK_XXX
58 commands, eg. key change commands
60 \end{description}
62 These commands are generated by Score, since they have to be the
63 same for the whole score.
66 \begin{description}
67 \item[BREAK_PRE]
68 \item[BREAK_MIDDLE]
69 \item[BREAK_POST]
70 \item[BREAK_END]
71 \item[TYPESET] METER,BAR
72 \end{description}
75 Commands can be freely copied, they do not have virtual methods.
79 #endif