lilypond-0.0.77.jcn1
[lilypond.git] / src / getcommands.cc
blob61a3f59f6297fad552063d63be25cb65fef5d026
1 #include "string.hh"
2 #include "inputcommand.hh"
3 #include "parseconstruct.hh"
4 #include "command.hh"
6 Command*
7 get_key_typeset_command(Array<Scalar>which)
9 Command*c = new Command;
10 c->code = TYPESET;
11 c->args = which;
12 String k("KEY");
13 c->args.insert(k,0 );
14 c->priority = 70;
15 return c;
18 Command *
19 get_meter_command(int n, int m)
21 Command*c = new Command;
23 c->code = TYPESET;
24 c->args.push( "METER");
25 c->args.push( n );
26 c->args.push( m );
27 c->priority = 40;
28 return c;
31 Command
32 get_defaultbar_command()
34 Command c;
35 c.code = TYPESET;
36 c.args.push("BAR");
37 c.args.push("default");
38 return c;
41 void
42 split_bar_command(Command &pre_com, Command &no_break_com, Command &post_com,
43 String s)
45 Command c;
46 c.code = TYPESET;
47 c.priority = (s=="default") ? 100: 110;
48 c.args.push("BAR");
49 if(s=="default")
50 s = "|";
52 if (s == ":|:") {
53 no_break_com=post_com=pre_com = c;
55 pre_com.args.push( ":|");
56 no_break_com.args.push( s);
57 post_com.args.push( "|:");
58 }else if (s=="|:") {
59 c.args.push(s);
60 no_break_com=post_com=c;
61 } else {
62 c.args.push(s);
63 pre_com= no_break_com= c;