]> git.donarmstrong.com Git - lilypond.git/blob - src/stcol.cc
f3498db0e181d7a9e303ad003cab35cd7a2d1085
[lilypond.git] / src / stcol.cc
1 /*
2   stcol.cc -- implement Staff_column
3
4   source file of the LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #include "voice.hh"
10 #include "timedescription.hh"
11 #include "sccol.hh"
12 #include "stcol.hh"
13 #include "commandrequest.hh"
14 #include "musicalrequest.hh"
15
16 void
17 Staff_column::OK() const
18 {
19 #ifndef NDEBUG
20     assert (command_column_l_->when() == musical_column_l_->when());
21 #endif
22 }
23
24 Moment
25 Staff_column::when() const
26 {
27     return (command_column_l_)?
28         command_column_l_->when():
29         musical_column_l_->when();
30 }
31
32 void
33 Staff_column::add(Voice_element*ve)
34 {
35     for (iter_top(ve->reqs,j); j.ok(); j++) {
36         if (j->nonmus()) {
37             if (j->nonmus()->timing()) {
38                 timing_req_l_arr_.push(j->nonmus()->timing());
39             }
40             if (!j->barcheck() && !j->nonmus()->measuregrouping())
41                 setup_one_request(j);   // no need to bother children
42         } else {
43             if (j->rhythmic()) {
44                 musical_column_l_->add_duration(j->rhythmic()->duration());
45             }
46             setup_one_request(j);
47         }
48     }
49 }
50
51 Staff_column::Staff_column()
52 {
53     musical_column_l_ = 0;
54     command_column_l_ = 0;
55 }
56
57
58
59
60 Staff_column::~Staff_column()
61 {
62 }
63
64 void
65 Staff_column::set_cols(Score_column*c1, Score_column*c2)
66 {
67     command_column_l_ = c1;
68     musical_column_l_ = c2;
69 }