]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/script-engraver.cc
Web-ja: update introduction
[lilypond.git] / lily / script-engraver.cc
index f2ef9697a1f86566c15e5a621f7f6b76020b7287..1e989ae55d7800aee0e3e5ba7b5e52ab229c3cb6 100644 (file)
@@ -54,24 +54,24 @@ protected:
   void stop_translation_timestep ();
   void process_music ();
 
-  DECLARE_TRANSLATOR_LISTENER (articulation);
-  DECLARE_ACKNOWLEDGER (rhythmic_head);
-  DECLARE_ACKNOWLEDGER (stem);
-  DECLARE_ACKNOWLEDGER (stem_tremolo);
-  DECLARE_ACKNOWLEDGER (tie);
-  DECLARE_END_ACKNOWLEDGER (tie);
-  DECLARE_ACKNOWLEDGER (note_column);
-  DECLARE_ACKNOWLEDGER (inline_accidental);
+  void listen_articulation (Stream_event *);
+  void acknowledge_rhythmic_head (Grob_info);
+  void acknowledge_stem (Grob_info);
+  void acknowledge_stem_tremolo (Grob_info);
+  void acknowledge_tie (Grob_info);
+  void acknowledge_end_tie (Grob_info);
+  void acknowledge_note_column (Grob_info);
+  void acknowledge_inline_accidental (Grob_info);
 
 public:
   TRANSLATOR_DECLARATIONS (Script_engraver);
 };
 
-Script_engraver::Script_engraver ()
+Script_engraver::Script_engraver (Context *c)
+  : Engraver (c)
 {
 }
 
-IMPLEMENT_TRANSLATOR_LISTENER (Script_engraver, articulation);
 void
 Script_engraver::listen_articulation (Stream_event *ev)
 {
@@ -90,7 +90,7 @@ Script_engraver::listen_articulation (Stream_event *ev)
 void
 copy_property (Grob *g, SCM sym, SCM alist)
 {
-  if (g->get_property (sym) == SCM_EOL)
+  if (scm_is_null (g->get_property (sym)))
     {
       SCM entry = scm_assoc (sym, alist);
       if (scm_is_pair (entry))
@@ -109,7 +109,7 @@ make_script_from_event (Grob *p, Context *tg,
   SCM alist = tg->get_property ("scriptDefinitions");
   SCM art = scm_assoc (art_type, alist);
 
-  if (art == SCM_BOOL_F)
+  if (scm_is_false (art))
     {
       /* FIXME: */
       warning (_ ("do not know how to interpret articulation:"));
@@ -132,7 +132,7 @@ make_script_from_event (Grob *p, Context *tg,
 
       SCM val = scm_cdar (s);
 
-      if (sym == ly_symbol2scm ("script-priority"))
+      if (scm_is_eq (sym, ly_symbol2scm ("script-priority")))
         {
           priority_found = true;
           /* Make sure they're in order of user input by adding index i.
@@ -144,8 +144,8 @@ make_script_from_event (Grob *p, Context *tg,
         }
 
       SCM preset = p->get_property_data (sym);
-      if (val == SCM_EOL
-          || scm_call_1 (type, preset) == SCM_BOOL_F)
+      if (scm_is_null (val)
+          || scm_is_false (scm_call_1 (type, preset)))
         p->set_property (sym, val);
     }
 
@@ -275,13 +275,19 @@ Script_engraver::stop_translation_timestep ()
   scripts_.clear ();
 }
 
-ADD_ACKNOWLEDGER (Script_engraver, rhythmic_head);
-ADD_ACKNOWLEDGER (Script_engraver, stem);
-ADD_ACKNOWLEDGER (Script_engraver, tie);
-ADD_END_ACKNOWLEDGER (Script_engraver, tie);
-ADD_ACKNOWLEDGER (Script_engraver, note_column);
-ADD_ACKNOWLEDGER (Script_engraver, stem_tremolo);
-ADD_ACKNOWLEDGER (Script_engraver, inline_accidental);
+
+void
+Script_engraver::boot ()
+{
+  ADD_LISTENER (Script_engraver, articulation);
+  ADD_ACKNOWLEDGER (Script_engraver, rhythmic_head);
+  ADD_ACKNOWLEDGER (Script_engraver, stem);
+  ADD_ACKNOWLEDGER (Script_engraver, tie);
+  ADD_END_ACKNOWLEDGER (Script_engraver, tie);
+  ADD_ACKNOWLEDGER (Script_engraver, note_column);
+  ADD_ACKNOWLEDGER (Script_engraver, stem_tremolo);
+  ADD_ACKNOWLEDGER (Script_engraver, inline_accidental);
+}
 
 ADD_TRANSLATOR (Script_engraver,
                 /* doc */