lilypond-1.1.67
[lilypond.git] / lily / request-column.cc
blob24ec7dececb6d7a3986369101bd7a7bac9c55a4d
1 /*
2 request-column.cc -- implement Request_column
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8 #include "score-column.hh"
9 #include "request-column.hh"
10 #include "staff-column.hh"
11 #include "staff.hh"
13 Moment
14 Request_column::when()
16 if (command_column_l_ || musical_column_l_)
17 when_ = (command_column_l_)? command_column_l_->when()
18 : musical_column_l_->when();
20 return when_;
23 void
24 Request_column::add_reqs(int idx , Array<Request*> const & req_l_arr)
26 staff_col_l_arr_[idx]->add_reqs(req_l_arr);
29 Request_column::Request_column(Link_list<Staff*> const& list )
31 musical_column_l_ = command_column_l_ =0;
32 iter(list.top(), j);
33 for (int i=0; i < list.size(); i++,j++) {
34 Staff_column * col_p = new Staff_column;
35 col_p->set_req_col(this);
36 staff_col_l_arr_.push(col_p);
37 staff_cols_.bottom().add(col_p);
38 j->add_col(col_p);
40 when_ = 0;
43 void
44 Request_column::set_score_cols(Score_column* c1, Score_column *c2)
46 command_column_l_ = c1;
47 musical_column_l_ = c2;
49 bool
50 Request_column::used_b() const
52 bool b = false;
53 if (command_column_l_)
54 b |= command_column_l_->used_b();
55 if (musical_column_l_)
56 b |= command_column_l_->used_b();
57 return b;
59 void
60 Request_column::update_time(int idx, Time_description&t)
62 staff_col_l_arr_[idx]->update_time(t, 0);