X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fscript-engraver.cc;h=8a7b122f1fb0c0be00bab174937f95d627f0206a;hb=65a0059b69385985896a24f407b3a791d33aef0f;hp=367739c374dd09455e78e9ad5fba44eb3e8c23b8;hpb=058370efc7e9710f149d0f444328bb1fcd7bdec1;p=lilypond.git diff --git a/lily/script-engraver.cc b/lily/script-engraver.cc index 367739c374..8a7b122f1f 100644 --- a/lily/script-engraver.cc +++ b/lily/script-engraver.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1997--2014 Han-Wen Nienhuys + Copyright (C) 1997--2015 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -54,14 +54,14 @@ 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); @@ -71,7 +71,6 @@ Script_engraver::Script_engraver () { } -IMPLEMENT_TRANSLATOR_LISTENER (Script_engraver, articulation); void Script_engraver::listen_articulation (Stream_event *ev) { @@ -90,7 +89,7 @@ Script_engraver::listen_articulation (Stream_event *ev) void copy_property (Grob *g, SCM sym, SCM alist) { - if (g->internal_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 +108,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 +131,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 +143,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 +274,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 */