]> git.donarmstrong.com Git - lilypond.git/blob - hdr/inputcommands.hh
release: 0.0.13
[lilypond.git] / hdr / inputcommands.hh
1 /*
2   inputcommands.hh -- part of LilyPond
3
4   (c) 1996 Han-Wen Nienhuys
5 */
6
7 #ifndef INPUTCOMMANDS_HH
8 #define INPUTCOMMANDS_HH
9 #include "pcursor.hh"
10 #include "proto.hh"
11 #include "plist.hh"
12 #include "real.hh"
13
14 struct Input_cursor : public PCursor<Command*>
15 {
16     /// current measure info
17     Real whole_per_measure;
18
19     /// where am i 
20     Real whole_in_measure;
21
22     /// Real last when which was read
23     Real last;
24     
25     int bars;
26     
27     Input_cursor(PCursor<Command*>);
28     /// hmm. not safe. Should rethink cursor.
29     void operator++(int);
30     /** warning: no optor -- () defined.. */
31     void reset();
32     Real when()const;
33     void add(Command*);
34     void setpartial(Real);
35     void addbot(Command*);
36     void sync();
37     void print()const;   
38     void last_command_here();
39 };
40
41 /// the list of commands in Score
42 struct Input_commands : public IPointerList<Command*> {
43     Input_cursor ptr;
44
45     /****************/
46
47     void find_moment(Real);
48     void do_skip(int & bars, Real & wholes);
49     void truncate(Real);
50     
51     Input_commands();
52     Input_commands(Input_commands const&);
53     void add(Command*);
54     void reset();
55     void print()const;
56     Staff_commands *parse() const;
57 };
58
59
60 void
61 interpret_meter(Command *c, int &beats_per_meas, int& one_beat,
62                 Real& whole_per_measure);
63 #endif // INPUTCOMMANDS_HH
64