]> git.donarmstrong.com Git - lilypond.git/blob - src/simplestaff.cc
release: 0.0.24
[lilypond.git] / src / simplestaff.cc
1 #include "request.hh"
2 #include "voice.hh"
3 #include "staffwalker.hh"
4 #include "debug.hh"
5 #include "clef.hh"
6 #include "staff.hh"
7 #include "command.hh"
8 #include "simplestaff.hh"
9 #include "sccol.hh" 
10 #include "simplewalker.hh"
11
12
13
14 Simple_column::Simple_column(Score_column*s, Simple_staff *rs)
15     : Staff_column(s)
16 {
17     stem_requester_len = 0;
18     stem_ = 0;    
19     staff_l_ = rs;
20     beam_ = 0;
21     text_=0;
22     lreq_p_ = 0;
23 }
24
25 Simple_staff::Simple_staff()
26 {
27     theline_l_ = 0;
28 }
29
30 /**
31  accept:
32
33     BREAK: all
34     TYPESET: bar, meter,
35 Scalar
36     */
37
38
39
40 void
41 Simple_column::process_requests()
42 {
43     for (int i = 0 ; i < v_elts.size(); i ++)
44         for (iter_top(v_elts[i]->reqs,j); j.ok(); j++) {
45             Request *rq= j;
46             if (rq->barcheck()) {
47                 if (tdescription_->whole_in_measure) {
48                     error("Barcheck failed, " + tdescription_->str());
49                 }
50             }
51             if (rq->rhythmic()){
52                 notes.add(rq->rhythmic());
53             }
54             if (rq->script()) {
55                 notes.last().scripts.add(rq->script());
56             }
57             if (rq->stem()) {
58                 stem_ = rq->stem();
59                 stem_requester_len = v_elts[i]->duration;
60             }
61             if (rq->text()) {
62                 text_ = rq->text();
63             }
64 #if 0
65             if (rq->lreq_l()) {
66                 lreq_p_ = rq->lreq_l();
67             }
68 #endif
69             if (rq->beam()) {
70                 beam_ = rq->beam();
71             }
72             if (rq->slur()) {
73                 slurs.add(rq->slur());
74             }
75         }
76 }
77
78 Staff_column*
79 Simple_staff::create_col(Score_column*s)
80 {
81     return new Simple_column(s,this);
82 }
83
84 void
85 Simple_staff::walk()
86 {
87     for (Simple_walker sc(this); sc.ok(); sc++) {
88         sc.col()->process_requests();// TODO
89         sc.process();
90     }
91 }
92 Note_info::Note_info()
93 {
94     rq =0;
95 }
96 Note_info::Note_info(Rhythmic_req*r) {
97     rq = r;
98 }