2 translator.cc -- implement Translator
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "translator.hh"
12 #include "translator-group.hh"
14 #include "rational.hh"
17 Translator::name() const
19 return classname(this);
22 Translator::~Translator ()
26 Translator::Translator ()
33 Translator::Translator (Translator const &s)
38 output_def_l_ = s.output_def_l_;
39 type_str_ = s.type_str_;
43 Translator::is_alias_b (String s) const
45 return s == type_str_;
49 Translator::do_try_music (Music *)
56 Translator::now_mom () const
58 return daddy_trans_l_->now_mom ();
63 Translator::add_processing ()
73 Translator::do_add_processing ()
78 Translator::print () const
81 DOUT << classname (this) << " {";
82 if (classname (this) != type_str_)
83 DOUT << "type = " << type_str_;
90 Translator::do_print () const
98 Translator::creation_processing ()
100 if (status >= CREATION_INITED)
103 do_creation_processing ();
104 status = CREATION_INITED;
108 Translator::post_move_processing ()
110 if (status >= MOVE_INITED)
113 creation_processing ();
114 do_post_move_processing ();
115 status = MOVE_INITED;
119 Translator::removal_processing ()
121 if (status == ORPHAN)
123 creation_processing ();
124 do_removal_processing ();
131 Translator::try_music (Music * r)
133 if (status < MOVE_INITED)
134 post_move_processing ();
136 return do_try_music (r);
140 Translator::process_requests ()
142 if (status < PROCESSED_REQS)
143 post_move_processing ();
144 else if (status >= PROCESSED_REQS)
147 status = PROCESSED_REQS;
148 do_process_requests ();
152 Translator::pre_move_processing ()
154 do_pre_move_processing ();
155 status = CREATION_INITED;
161 Translator::output_def_l () const
163 return output_def_l_;
167 Translator::get_property (String id, Translator_group **where_l) const
169 return daddy_trans_l_->get_property (id, where_l);