lilypond-1.1.23
[lilypond.git] / hdr / command.hh
blob2408ac0698939fd5d7ca3990aeaad89e396f3604
1 #ifndef COMMAND_HH
2 #define COMMAND_HH
4 #include "glob.hh"
5 #include "varray.hh"
6 #include "scalar.hh"
8 /// what kind of command?
9 enum Commandcode {
10 NOP,
11 INTERPRET,
12 TYPESET,
13 BREAK_PRE,BREAK_MIDDLE, BREAK_POST, BREAK_END
16 /// set a nonrythmical symbol
18 /**
19 A nonrhythmical "thing" in a staff is called a "command".
20 Commands have these properties:
22 \begin{itemize}
23 \item They are \bf{not} rhythmical, i.e. they do not have a duration
24 \item They have a staff-wide impact, i.e. a command cannot be targeted at
25 only one voice in the staff: two voices sharing a staff can't have
26 different clefs
27 \item Commands are ordered, that is, when from musical point of view the
28 commands happen simultaneously, the order in which Staff receives the
29 commands can still make a difference in the output
30 \item Some commands are actually score wide, so Score has to issue these
31 commands to the Staff, eg. BREAK commands
32 \end{itemize}
34 At this moment we have three classes of commands:
35 \begin{description}
36 INTERPRET commands are not grouped.
37 \item[TYPESET] These commands instruct the Staff to
38 typeset symbols on the output, eg meter/clef/key changes
39 \item[INTERPRET] These commands do not produce output, instead,
40 they change the interpretation of other commands or requests.
41 example: shift output vertically, set the key.
42 \item[BREAK_XXX] These commands group TYPESET commands in
43 prebreak and postbreak commands. See Documentation/breaking
45 Staff can insert additional commands in a sequence of BREAK_XXX
46 commands, eg. key change commands
48 \end{description}
50 These commands are generated by Score, since they have to be the
51 same for the whole score.
54 \begin{description}
55 \item[BREAK_PRE]
56 \item[BREAK_MIDDLE]
57 \item[BREAK_POST]
58 \item[BREAK_END]
59 \item[TYPESET] METER,BAR
60 \end{description}
63 Commands can be freely copied, they do not have virtual methods.
67 struct Command {
68 Commandcode code;
70 /// analogous to argv[]
71 Array<Scalar> args;
74 /** in what order relative to other TYPESET commands (eg, bar
75 should precede meter). Highest priority first. */
76 int priority;
78 /* *************** */
80 Command();
81 bool isbreak()const;
82 void print() const;
85 #endif