X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fscript-engraver.cc;h=1e989ae55d7800aee0e3e5ba7b5e52ab229c3cb6;hb=8e2eaf4959bec63a1128a444591a540f4f1e2937;hp=1b9cf0b08a7c03fd061d740602d9e0b69e0b1df3;hpb=f1bb461ca8037b12343479b22d56bf96abe238b6;p=lilypond.git diff --git a/lily/script-engraver.cc b/lily/script-engraver.cc index 1b9cf0b08a..1e989ae55d 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--2011 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,22 +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 (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) { @@ -88,7 +90,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)) @@ -107,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:")); @@ -130,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. @@ -142,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); } @@ -199,6 +201,26 @@ Script_engraver::acknowledge_stem_tremolo (Grob_info info) } } +void +Script_engraver::acknowledge_tie (Grob_info info) +{ + for (vsize i = 0; i < scripts_.size (); i++) + { + Grob *e = scripts_[i].script_; + Side_position_interface::add_support (e, info.grob ()); + } +} + +void +Script_engraver::acknowledge_end_tie (Grob_info info) +{ + for (vsize i = 0; i < scripts_.size (); i++) + { + Grob *e = scripts_[i].script_; + Side_position_interface::add_support (e, info.grob ()); + } +} + void Script_engraver::acknowledge_inline_accidental (Grob_info info) { @@ -253,11 +275,19 @@ Script_engraver::stop_translation_timestep () scripts_.clear (); } -ADD_ACKNOWLEDGER (Script_engraver, rhythmic_head); -ADD_ACKNOWLEDGER (Script_engraver, stem); -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 */