source file of the GNU LilyPond music typesetter
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "translator.hh"
#include "debug.hh"
#include "translator-group.hh"
+#include "translator-def.hh"
#include "moment.hh"
#include "ly-smobs.icc"
char const*
-Translator::name() const
+Translator::name () const
{
- return classname(this);
+ return classname (this);
}
Translator::~Translator ()
void
Translator::init ()
{
- status_ = ORPHAN;
simple_trans_list_ = SCM_EOL;
trans_group_list_ = SCM_EOL;
properties_scm_ = SCM_EOL;
bool
Translator::is_alias_b (String s) const
{
- return s == type_str_;
+ bool b = s == type_str_;
+
+ for (SCM a = unsmob_translator_def (definition_)->type_aliases_;
+ !b && gh_pair_p (a); a = gh_cdr (a))
+ b = b || s == ly_scm2string (gh_car (a));
+
+ return b;
}
bool
-Translator::do_try_music (Music *)
+Translator::try_music (Music *)
{
return false;
}
}
-void
-Translator::add_processing ()
-{
- if (status_ > ORPHAN)
- return;
-
- do_add_processing ();
- status_ = VIRGIN;
-}
-
-void
-Translator::do_add_processing ()
-{
-}
-
-void
-Translator::print () const
-{
-#ifndef NPRINT
- DEBUG_OUT << classname (this) << " {";
- if (classname (this) != type_str_)
- DEBUG_OUT << "type = " << type_str_;
- do_print ();
- DEBUG_OUT << "}\n";
-#endif
-}
-
-void
-Translator::do_print () const
-{
-}
-void
-Translator::creation_processing ()
-{
- if (status_ >= CREATION_INITED)
- return ;
-
- do_creation_processing ();
- status_ = CREATION_INITED;
-}
-
-void
-Translator::post_move_processing ()
-{
- if (status_ >= MOVE_INITED)
- return;
-
- creation_processing ();
- do_post_move_processing ();
- status_ = MOVE_INITED;
-}
-
void
Translator::removal_processing ()
{
- if (status_ == ORPHAN)
- return;
- creation_processing ();
- do_removal_processing ();
- // elegancy ...
- // status_ = ORPHAN;
+ finalize ();
}
-bool
-Translator::try_music (Music * r)
-{
- if (status_ < MOVE_INITED)
- post_move_processing ();
-
- return do_try_music (r);
-}
-
void
-Translator::process_music ()
+Translator::announces ()
{
- if (status_ < PROCESSED_REQS)
- post_move_processing ();
- else if (status_ >= PROCESSED_REQS)
- return;
-
- status_ = PROCESSED_REQS;
- do_process_music ();
-}
-
-void
-Translator::pre_move_processing ()
-{
- do_pre_move_processing ();
- status_ = CREATION_INITED;
+ do_announces ();
}
-
Music_output_def *
Translator::output_def_l () const
{
}
void
-Translator:: do_pre_move_processing ()
+Translator:: stop_translation_timestep ()
{
}
void
-Translator::do_post_move_processing ()
+Translator::start_translation_timestep ()
{
}
void
-Translator::do_process_music ()
+Translator::do_announces ()
{
}
void
-Translator::do_creation_processing ()
+Translator::initialize ()
{
}
void
-Translator::do_removal_processing ()
+Translator::finalize ()
{
}
SCM
Translator::mark_smob (SCM sm)
{
- Translator * me = (Translator*) SCM_CELL_WORD_1(sm);
+ Translator * me = (Translator*) SCM_CELL_WORD_1 (sm);
scm_gc_mark (me->simple_trans_list_);
scm_gc_mark (me->trans_group_list_);
scm_gc_mark (me->definition_);
don't try to print properties, that is too much hassle.
*/
scm_puts (" >", port);
-
-
return 1;
}
-
-
-IMPLEMENT_UNSMOB(Translator, translator);
-IMPLEMENT_SMOBS(Translator);
-IMPLEMENT_DEFAULT_EQUAL_P(Translator);
+IMPLEMENT_UNSMOB (Translator, translator);
+IMPLEMENT_SMOBS (Translator);
+IMPLEMENT_DEFAULT_EQUAL_P (Translator);