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