]> git.donarmstrong.com Git - lilypond.git/blob - hdr/command.hh
release: 0.0.31
[lilypond.git] / hdr / command.hh
1 #ifndef COMMAND_HH
2 #define COMMAND_HH
3
4 #include "glob.hh"
5 #include "varray.hh"
6 #include "scalar.hh"
7
8 /// what kind of command?
9 enum Commandcode {
10         NOP,
11         INTERPRET,
12         TYPESET,
13         BREAK_PRE,BREAK_MIDDLE, BREAK_POST, BREAK_END
14 };
15
16 /// set a nonrythmical symbol
17
18 /**
19     A nonrhythmical "thing" in a  staff is called a "command".
20     Commands have these properties:
21
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}
33
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    
44     
45     Staff can insert additional commands in a sequence of BREAK_XXX
46     commands, eg. key change commands
47
48     \end{description}
49     
50     These commands are generated by Score, since they have to be the
51     same for the whole score.
52     
53
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}
61  
62
63     Commands can be freely copied, they do not have virtual methods.
64     
65     */
66
67 struct Command {
68     Commandcode code;
69
70     /// analogous to argv[]
71     Array<Scalar> args;
72
73
74     /** in what order relative to other TYPESET commands (eg, bar
75        should precede meter). Highest priority first. */
76     int priority;
77     
78     /* *************** */
79     
80     Command();
81     bool isbreak()const;
82     void print() const;
83 };
84
85 #endif