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