summaryrefslogtreecommitdiff
path: root/command.cc
blob: 6375c7e6d3101fe915d9baf93ff3b068ebef8403 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "string.hh"
#include "debug.hh"
#include "command.hh"

bool
Command::isbreak()const
{
    return (code >= BREAK_PRE&&code <= BREAK_END);
}

Command*
get_bar_command(Real w)
{
    Command*c = new Command;
    c->when = w;
    c->code = TYPESET;
    c->args.add( "BAR");
    c->args.add( "|");
    return c;
}

Command *
get_meter_command(Real w, int n, int m)
{
    Command*c = new Command;
    
    c->when = w;
    c->code = TYPESET;
    c->args.add( "METER");
    c->args.add( n );
    c->args.add( m );
    return c;
}



Command::Command()
{
    code = NOP;
    when = -1;
}



Command::Command(Real w)
{
    code = NOP;
    when = w;
}
void
Command::print() const
{
    mtor << "command code: " << code << " args: ";
    for (int i = 0; i<args.sz(); i++)
	mtor << args[i];
    mtor << "\n";
}