]> git.donarmstrong.com Git - lilypond.git/blob - src/simplestaff.cc
20f291fa8aac52956675a8e81d2a89f0209276cb
[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
23 }
24
25 Simple_staff::Simple_staff()
26 {
27     theline_l_ = 0;
28 }
29
30
31
32 void
33 Simple_column::setup_requests()
34 {
35     for (int i = 0 ; i < v_elts.size(); i ++)
36         for (iter_top(v_elts[i]->reqs,j); j.ok(); j++) {
37             Request *rq= j;
38             if (rq->barcheck()) {
39                 if (tdescription_->whole_in_measure) {
40                     error("Barcheck failed, " + tdescription_->str());
41                 }
42             }
43             if (rq->rhythmic()){
44                 notes.push(rq->rhythmic());
45             }
46             if (rq->script()) {
47                 notes.last().scripts.push(rq->script());
48             }
49             if (rq->stem()) {
50                 stem_ = rq->stem();
51                 stem_requester_len = v_elts[i]->duration;
52             }
53             if (rq->text()) {
54                 text_ = rq->text();
55             }
56             if (rq->beam()) {
57                 beam_ = rq->beam();
58             }
59             if (rq->slur()) {
60                 slurs.push(rq->slur());
61             }
62         }
63 }
64
65 Staff_column*
66 Simple_staff::create_col(Score_column*s)
67 {
68     return new Simple_column(s,this);
69 }
70
71 void
72 Simple_staff::walk()
73 {
74     for (Simple_walker sc(this); sc.ok(); sc++) {
75         sc.col()->setup_requests();// TODO
76         sc.process();
77     }
78 }
79 Note_info::Note_info()
80 {
81     rq =0;
82 }
83 Note_info::Note_info(Rhythmic_req*r) {
84     rq = r;
85 }