]> git.donarmstrong.com Git - lilypond.git/blob - lily/translator.cc
* lily/translator.cc (derived_mark): new function.
[lilypond.git] / lily / translator.cc
1 /*
2   translator.cc -- implement Translator
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10 #include "translator.hh"
11 #include "warn.hh"
12 #include "translator-group.hh"
13 #include "context-def.hh"
14 #include "global-context.hh"
15 #include "moment.hh"
16 #include "context.hh"
17 #include "ly-smobs.icc"
18
19
20 Translator::~Translator ()
21 {
22 }
23
24 void
25 Translator::init ()
26 {
27   must_be_last_ = false;
28   self_scm_ = SCM_EOL;
29   daddy_context_ =0;
30   smobify_self ();
31 }
32
33 void
34 Translator::do_announces ()
35 {
36 }
37
38 void
39 Translator::process_music ()
40 {
41   
42 }
43
44 Translator::Translator ()
45 {
46   init ();
47 }
48
49 Translator::Translator (Translator const &src)
50 {
51   init ();
52   must_be_last_ = src.must_be_last_;
53 }
54
55 bool
56 Translator::try_music (Music *)
57 {
58   return false;
59 }
60                             
61
62 Moment
63 Translator::now_mom () const
64 {
65   return daddy_context_->now_mom ();
66 }
67
68 Output_def *
69 Translator::get_output_def () const
70 {
71   return daddy_context_->get_output_def ();
72 }
73
74
75 Translator_group*
76 Translator::get_daddy_translator () const
77 {
78   return daddy_context_->implementation ();
79 }
80
81
82 SCM
83 Translator::internal_get_property (SCM sym) const
84 {
85   return daddy_context_->internal_get_property (sym);
86 }
87
88 void
89 Translator::stop_translation_timestep ()
90 {
91 }
92
93 /*
94   this function has 2 properties
95
96   - It is called before try_music ()
97
98   - It is called before any user information enters the translators.
99   (i.e. any \property or event is not processed yet.)
100
101   */
102 void
103 Translator::start_translation_timestep ()
104 {
105 }
106
107 void
108 Translator::initialize ()
109 {
110 }
111
112 void
113 Translator::finalize ()
114 {
115 }
116
117
118 /*
119
120   SMOBS
121
122 */
123 SCM
124 Translator::mark_smob (SCM sm)
125 {
126   Translator * me = (Translator*) SCM_CELL_WORD_1 (sm);
127   me->derived_mark ();
128   return SCM_EOL;
129 }
130
131 SCM
132 Translator::translator_description () const
133 {
134   return SCM_EOL;
135 }
136
137
138 Global_context *
139 Translator::get_global_context () const
140 {
141   return daddy_context_ ->get_global_context ();
142 }
143
144
145 Score_context *
146 Translator::get_score_context () const
147 {
148   return daddy_context_->get_score_context ();
149 }  
150
151
152 SCM
153 Translator::static_translator_description ()const
154 {
155   return SCM_EOL;
156 }
157
158
159 IMPLEMENT_SMOBS (Translator);
160 IMPLEMENT_DEFAULT_EQUAL_P (Translator);
161 IMPLEMENT_TYPE_P (Translator,"ly:translator?");
162
163 bool
164 Translator::must_be_last () const
165 {
166   return must_be_last_;
167 }
168
169 void
170 Translator::derived_mark () const
171 {
172   
173 }