X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fvaticana-ligature-engraver.cc;h=1785d4478b407b142b839c82f766e277d6f555ea;hb=5d84bfad4626892bcffd05adcced53c8a2329047;hp=2e3148cc2884ecfde792223b7bbed4cc567fe01f;hpb=e47e8dc419d5c9657a0ff357a3c32cd4d84a7fac;p=lilypond.git diff --git a/lily/vaticana-ligature-engraver.cc b/lily/vaticana-ligature-engraver.cc index 2e3148cc28..1785d4478b 100644 --- a/lily/vaticana-ligature-engraver.cc +++ b/lily/vaticana-ligature-engraver.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2003--2012 Juergen Reuter + Copyright (C) 2003--2015 Juergen Reuter LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -67,7 +67,7 @@ private: int context_info, int delta_pitch); bool is_stacked_head (int prefix_set, int context_info); - Real align_heads (vector primitives, + Real align_heads (vector const &primitives, Real flexa_width, Real thickness); void check_for_prefix_loss (Item *primitive); @@ -77,30 +77,15 @@ private: public: TRANSLATOR_DECLARATIONS (Vaticana_ligature_engraver); - + TRANSLATOR_INHERIT (Gregorian_ligature_engraver); protected: virtual Spanner *create_ligature_spanner (); virtual void transform_heads (Spanner *ligature, - vector primitives); - DECLARE_TRANSLATOR_LISTENER (pes_or_flexa); - DECLARE_TRANSLATOR_LISTENER (ligature); + vector const &primitives); }; -IMPLEMENT_TRANSLATOR_LISTENER (Vaticana_ligature_engraver, pes_or_flexa); -void -Vaticana_ligature_engraver::listen_pes_or_flexa (Stream_event *ev) -{ - Gregorian_ligature_engraver::listen_pes_or_flexa (ev); -} - -IMPLEMENT_TRANSLATOR_LISTENER (Vaticana_ligature_engraver, ligature); -void -Vaticana_ligature_engraver::listen_ligature (Stream_event *ev) -{ - Ligature_engraver::listen_ligature (ev); -} - -Vaticana_ligature_engraver::Vaticana_ligature_engraver () +Vaticana_ligature_engraver::Vaticana_ligature_engraver (Context *c) + : Gregorian_ligature_engraver (c) { brew_ligature_primitive_proc = Vaticana_ligature::brew_ligature_primitive_proc; @@ -166,7 +151,7 @@ Vaticana_ligature_engraver::need_extra_horizontal_space (int prev_prefix_set, in { if (prev_prefix_set & VIRGA) /* - * After a virga, make a an additional small space such that the + * After a virga, make an additional small space such that the * appendix on the right side of the head does not touch the * following head. */ @@ -181,7 +166,7 @@ Vaticana_ligature_engraver::need_extra_horizontal_space (int prev_prefix_set, in if ((context_info & FLEXA_LEFT) && ! (context_info & PES_UPPER)) /* - * Before a flexa (but not within a torculus), make a an + * Before a flexa (but not within a torculus), make an * additional small space such that the appendix on the left side * of the flexa does not touch the this head. */ @@ -199,7 +184,7 @@ Vaticana_ligature_engraver::need_extra_horizontal_space (int prev_prefix_set, in } Real -Vaticana_ligature_engraver::align_heads (vector primitives, +Vaticana_ligature_engraver::align_heads (vector const &primitives, Real flexa_width, Real thickness) { @@ -247,7 +232,7 @@ Vaticana_ligature_engraver::align_heads (vector primitives, */ SCM glyph_name_scm = primitive->get_property ("glyph-name"); - if (glyph_name_scm == SCM_EOL) + if (scm_is_null (glyph_name_scm)) { primitive->programming_error ("Vaticana_ligature:" " undefined glyph-name ->" @@ -260,7 +245,7 @@ Vaticana_ligature_engraver::align_heads (vector primitives, if (prev_primitive) /* urgh, need prev_primitive only here */ { SCM delta_pitch_scm = prev_primitive->get_property ("delta-position"); - if (delta_pitch_scm != SCM_EOL) + if (!scm_is_null (delta_pitch_scm)) delta_pitch = scm_to_int (delta_pitch_scm); else { @@ -455,11 +440,11 @@ Vaticana_ligature_engraver::check_for_ambiguous_dot_pitch (Grob_info primitive) // bitmask based O (1) test); where n= (which is typically small (n<10), though). Stream_event *new_cause = primitive.event_cause (); - int new_pitch = unsmob_pitch (new_cause->get_property ("pitch"))->steps (); + int new_pitch = unsmob (new_cause->get_property ("pitch"))->steps (); for (vsize i = 0; i < augmented_primitives_.size (); i++) { Stream_event *cause = augmented_primitives_[i].event_cause (); - int pitch = unsmob_pitch (cause->get_property ("pitch"))->steps (); + int pitch = unsmob (cause->get_property ("pitch"))->steps (); if (pitch == new_pitch) { primitive.grob ()-> @@ -473,7 +458,7 @@ Vaticana_ligature_engraver::check_for_ambiguous_dot_pitch (Grob_info primitive) void Vaticana_ligature_engraver::transform_heads (Spanner *ligature, - vector primitives) + vector const &primitives) { Real flexa_width = robust_scm2double (ligature->get_property ("flexa-width"), 2); @@ -491,7 +476,7 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, int delta_pitch; SCM delta_pitch_scm = primitive->get_property ("delta-position"); - if (delta_pitch_scm != SCM_EOL) + if (!scm_is_null (delta_pitch_scm)) delta_pitch = scm_to_int (delta_pitch_scm); else { @@ -741,8 +726,15 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, #endif } -ADD_ACKNOWLEDGER (Vaticana_ligature_engraver, rest); -ADD_ACKNOWLEDGER (Vaticana_ligature_engraver, ligature_head); +void +Vaticana_ligature_engraver::boot () +{ + ADD_LISTENER (Vaticana_ligature_engraver, pes_or_flexa); + ADD_LISTENER (Vaticana_ligature_engraver, ligature); + ADD_ACKNOWLEDGER (Vaticana_ligature_engraver, rest); + ADD_ACKNOWLEDGER (Vaticana_ligature_engraver, ligature_head); +} + ADD_TRANSLATOR (Vaticana_ligature_engraver, /* doc */ "Handle ligatures by glueing special ligature heads"