lilypond-1.3.19
[lilypond.git] / lily / complex-walker.cc
blobd32d9db2eb6545040be1d1cc74949a0e62ce64e0
1 /*
2 complex-walker.cc -- implement Complex_walker
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8 #include "score.hh"
9 #include "staff-column.hh"
10 #include "voice.hh"
11 #include "p-score.hh"
12 #include "debug.hh"
13 #include "complex-walker.hh"
14 #include "walk-regs.hh"
15 #include "score-elem.hh"
16 #include "staff.hh"
17 #include "staffline.hh"
19 void
20 Complex_walker::do_post_move()
22 walk_regs_p_->post_move_processing();
25 void
26 Complex_walker::do_pre_move()
28 walk_regs_p_->pre_move_processing();
31 void
32 Complex_walker::do_announces()
34 walk_regs_p_->do_announces();
38 void
39 Complex_walker::try_request(Request*req)
41 bool b =walk_regs_p_->try_request(req);
42 if (!b)
43 req->warning("junking request: " + String(req->name()));
46 void
47 Complex_walker::process_requests()
49 Staff_column*c =ptr();
51 for (int i=0; i < c->creationreq_l_arr_.size(); i++) {
52 try_request(c->creationreq_l_arr_[i]);
54 for (int i=0; i < c->commandreq_l_arr_.size(); i++) {
55 try_request(c->commandreq_l_arr_[i]);
58 for (int i=0; i < c->musicalreq_l_arr_.size(); i++) {
59 try_request(c->musicalreq_l_arr_[i]);
62 regs_process_requests();
63 do_announces();
66 void
67 Complex_walker::regs_process_requests()
69 walk_regs_p_->process_requests();
72 void
73 Complex_walker::typeset_element(Score_elem *elem_p)
75 if (!elem_p)
76 return;
77 staff_l_->staff_line_l_->add_element(elem_p);
78 if (elem_p->spanner())
79 pscore_l_->typeset_unbroken_spanner(elem_p->spanner());
80 else
81 ptr()->typeset_musical_item(elem_p->item());
84 Complex_walker::Complex_walker(Staff*s)
85 : Staff_walker(s, s->score_l_->pscore_p_)
87 walk_regs_p_ = new Walker_registers(this);
88 do_post_move();
92 Complex_walker::~Complex_walker()
94 delete walk_regs_p_;