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