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