lilypond-1.3.124
[lilypond.git] / lily / global-acceptor.cc
blob057881adc747f642fa53c1f38ad49969ab7e42e6
1 /*
2 global-acceptor.cc -- implement
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
9 #include "music.hh"
10 #include "global-acceptor.hh"
11 #include "score.hh"
12 #include "score-column.hh"
14 Global_acceptor::Global_acceptor()
16 score_l_ = 0;
17 last_mom_ = 0;
20 Acceptor*
21 Global_acceptor::ancestor_l(int)
23 return this;
26 void
27 Global_acceptor::add_moment_to_process(Moment m)
29 if (m > last_mom_)
30 return;
32 for (int i=0; i < extra_mom_pq_.size(); i++)
33 if (extra_mom_pq_[i] == m)
34 return;
35 extra_mom_pq_.insert(m);
38 int
39 Global_acceptor::depth_i()const
41 return 0;
44 void
45 Global_acceptor::set_score(Score *s)
47 score_l_ = s;
48 last_mom_ = score_l_->music_p_->time_int().max();
51 void
52 Global_acceptor::modify_next(Moment &w)
54 while (extra_mom_pq_.size() &&
55 extra_mom_pq_.front() <= w)
57 w =extra_mom_pq_.get();
60 int
61 Global_acceptor::moments_left_i()const
63 return extra_mom_pq_.size();
66 void
67 Global_acceptor::prepare(Moment)