]> git.donarmstrong.com Git - lilypond.git/blob - lily/global-translator.cc
release: 0.1.11
[lilypond.git] / lily / global-translator.cc
1 /*
2   global-translator.cc -- implement 
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #include "global-translator.hh"
10
11 Global_translator::Global_translator()
12 {
13   last_mom_ = 0;
14 }
15
16 Translator*
17 Global_translator::ancestor_l (int)
18 {
19   return this;
20 }
21
22 void
23 Global_translator::add_moment_to_process (Moment m)
24 {
25   if (m  > last_mom_)
26         return;
27   
28   for (int i=0; i <  extra_mom_pq_.size(); i++)
29         if (extra_mom_pq_[i] == m)
30             return;
31   extra_mom_pq_.insert (m);
32 }
33
34 int
35 Global_translator::depth_i() const
36 {
37   return 0;
38 }
39
40 void
41 Global_translator::modify_next (Moment &w)
42 {
43   while (extra_mom_pq_.size() && 
44         extra_mom_pq_.front() <= w)
45         
46         w =extra_mom_pq_.get();
47 }
48
49 int
50 Global_translator::moments_left_i() const
51 {
52   return extra_mom_pq_.size();
53 }
54
55 void
56 Global_translator::prepare (Moment)
57 {
58 }
59
60
61 IMPLEMENT_IS_TYPE_B1(Global_translator, Translator);
62
63 Music_output*
64 Global_translator::get_output_p()
65 {
66   return 0;
67 }