2 global-translator.cc -- implement Global_translator
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "global-translator.hh"
10 #include "music-iterator.hh"
13 Global_translator::Global_translator()
18 Global_translator::add_moment_to_process (Moment m
)
24 programming_error ("Trying to freeze in time.");
26 for (int i
=0; i
< extra_mom_pq_
.size(); i
++)
27 if (extra_mom_pq_
[i
] == m
)
29 extra_mom_pq_
.insert (m
);
33 Global_translator::modify_next (Moment
&w
)
35 while (extra_mom_pq_
.size() &&
36 extra_mom_pq_
.front() <= w
)
38 w
=extra_mom_pq_
.get();
42 Global_translator::moments_left_i() const
44 return extra_mom_pq_
.size();
48 Global_translator::prepare (Moment m
)
55 Global_translator::now_mom () const
63 Global_translator::get_output_p()
69 Global_translator::process ()
73 Global_translator::start ()
77 Global_translator::finish ()
82 Global_translator::run_iterator_on_me (Music_iterator
* iter
)
84 while (iter
->ok() || moments_left_i ())
90 w
= iter
->next_moment();
91 DEBUG_OUT
<< "proccing: " << w
<< '\n';
92 if (flower_dstream
&& !flower_dstream
->silent_b ("walking"))
99 if (flower_dstream
&& !flower_dstream
->silent_b ("walking"))
102 iter
->process_and_next (w
);