X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fvaticana-ligature-engraver.cc;h=5402a8fb01da24f005a09caafe2c2b054f6bc42e;hb=e90f0536f9be39ada0bef0aeb0d275dec3b2fb5b;hp=5007d553ca8b91bcf68ce50d09bfb1ea9f4e0de3;hpb=d2300573cae3c1920400d040faddd33f17b43c2d;p=lilypond.git diff --git a/lily/vaticana-ligature-engraver.cc b/lily/vaticana-ligature-engraver.cc index 5007d553ca..5402a8fb01 100644 --- a/lily/vaticana-ligature-engraver.cc +++ b/lily/vaticana-ligature-engraver.cc @@ -1,9 +1,20 @@ /* - vaticana-ligature-engraver.cc -- implement Vaticana_ligature_engraver + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2003--2011 Juergen Reuter - (c) 2003--2007 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 + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #include "gregorian-ligature-engraver.hh" @@ -13,6 +24,7 @@ #include "international.hh" #include "output-def.hh" #include "paper-column.hh" +#include "separation-item.hh" #include "spanner.hh" #include "staff-symbol-referencer.hh" #include "stream-event.hh" @@ -90,7 +102,7 @@ Vaticana_ligature_engraver::listen_ligature (Stream_event *ev) Vaticana_ligature_engraver::Vaticana_ligature_engraver () { - brew_ligature_primitive_proc = + brew_ligature_primitive_proc = Vaticana_ligature::brew_ligature_primitive_proc; augmented_primitives_.clear (); } @@ -105,41 +117,41 @@ bool Vaticana_ligature_engraver::is_stacked_head (int prefix_set, int context_info) { - bool is_stacked_b; + bool is_stacked; // upper head of pes is stacked upon lower head of pes ... - is_stacked_b = context_info & PES_UPPER; + is_stacked = context_info & PES_UPPER; // ... unless this note starts a flexa if (context_info & FLEXA_LEFT) - is_stacked_b = false; + is_stacked = false; // ... or another pes if (context_info & PES_LOWER) - is_stacked_b = false; + is_stacked = false; // ... or the previous note is a semivocalis or inclinatum if (context_info & AFTER_DEMINUTUM) - is_stacked_b = false; + is_stacked = false; // auctum head is never stacked upon preceding note if (prefix_set & AUCTUM) - is_stacked_b = false; + is_stacked = false; // virga is never stacked upon preceding note if (prefix_set & VIRGA) - is_stacked_b = false; + is_stacked = false; // oriscus is never stacked upon preceding note if (prefix_set & ORISCUS) - is_stacked_b = false; + is_stacked = false; if ((prefix_set & DEMINUTUM) && ! (prefix_set & INCLINATUM) && (context_info & FLEXA_RIGHT)) - is_stacked_b = true; // semivocalis head of deminutus form + is_stacked = true; // semivocalis head of deminutus form - return is_stacked_b; + return is_stacked; } /* @@ -193,8 +205,8 @@ Vaticana_ligature_engraver::align_heads (vector primitives, { if (!primitives.size ()) { - programming_error ("Vaticana_ligature: " - "empty ligature [ignored]"); + programming_error ("Vaticana_ligature:" + " empty ligature [ignored]"); return 0.0; } @@ -238,8 +250,8 @@ Vaticana_ligature_engraver::align_heads (vector primitives, if (glyph_name_scm == SCM_EOL) { primitive->programming_error ("Vaticana_ligature:" - "undefined glyph-name -> " - "ignoring grob"); + " undefined glyph-name ->" + " ignoring grob"); continue; } string glyph_name = ly_scm2string (glyph_name_scm); @@ -253,8 +265,8 @@ Vaticana_ligature_engraver::align_heads (vector primitives, else { primitive->programming_error ("Vaticana_ligature:" - "delta-position undefined -> " - "ignoring grob"); + " delta-position undefined ->" + " ignoring grob"); continue; } } @@ -318,8 +330,8 @@ Vaticana_ligature_engraver::align_heads (vector primitives, { if (!prev_primitive) { - primitive->programming_error ("vaticana ligature: add-join: " - "missing previous primitive"); + primitive->programming_error ("Vaticana ligature: add-join:" + " missing previous primitive"); } else { @@ -385,8 +397,9 @@ Vaticana_ligature_engraver::check_for_prefix_loss (Item *primitive) if (prefix_set & ~PES_OR_FLEXA) { string prefs = Gregorian_ligature::prefixes_to_str (primitive); - primitive->warning (_f ("ignored prefix (es) `%s' of this head according " - "to restrictions of the selected ligature style", + primitive->warning (_f ("ignored prefix(es) `%s' of this head" + " according to restrictions of the selected" + " ligature style", prefs.c_str ())); } } @@ -413,6 +426,9 @@ Vaticana_ligature_engraver::add_mora_column (Paper_column *column) dot->set_parent (primitive, Y_AXIS); primitive->set_object ("dot", dot->self_scm ()); Dot_column::add_head (dotcol, primitive); + + // FIXME: why isn't the dot picked up by Paper_column_engraver? + Separation_item::add_item (column, dot); } } @@ -447,9 +463,9 @@ Vaticana_ligature_engraver::check_for_ambiguous_dot_pitch (Grob_info primitive) if (pitch == new_pitch) { primitive.grob ()-> - warning ("Ambiguous use of dots in ligature: there are " - "multiple dotted notes with the same pitch. " - "The ligature should be split."); + warning ("Ambiguous use of dots in ligature: there are" + " multiple dotted notes with the same pitch." + " The ligature should be split."); return; // supress multiple identical warnings } } @@ -480,8 +496,8 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, else { primitive->programming_error ("Vaticana_ligature:" - "delta-position undefined -> " - "ignoring grob"); + " delta-position undefined ->" + " ignoring grob"); continue; } @@ -505,10 +521,10 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, } else if (augmented_primitives_.size () > 0) { - primitive->warning ("This ligature has a dotted head followed by " - "a non-dotted head. The ligature should be " - "split after the last dotted head before " - "this head."); + primitive->warning ("This ligature has a dotted head followed by" + " a non-dotted head. The ligature should be" + " split after the last dotted head before" + " this head."); } if (is_stacked_head (prefix_set, context_info)) @@ -546,66 +562,70 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, else glyph_name = "vaticana.inclinatum"; else if (prefix_set & DEMINUTUM) - if (i == 0) - { - // initio debilis - glyph_name = "vaticana.reverse.plica"; - } - else if (prev_delta_pitch > 0) - { - // epiphonus - if (! (prev_context_info & FLEXA_RIGHT)) - /* correct head of previous primitive */ + { + if (i == 0) + { + // initio debilis + glyph_name = "vaticana.reverse.plica"; + } + else if (prev_delta_pitch > 0) + { + // epiphonus + if (! (prev_context_info & FLEXA_RIGHT)) + { + /* correct head of previous primitive */ + if (prev_delta_pitch > 1) + prev_glyph_name = "vaticana.epiphonus"; + else + prev_glyph_name = "vaticana.vepiphonus"; + } if (prev_delta_pitch > 1) - prev_glyph_name = "vaticana.epiphonus"; + glyph_name = "vaticana.plica"; else - prev_glyph_name = "vaticana.vepiphonus"; - if (prev_delta_pitch > 1) - glyph_name = "vaticana.plica"; - else - glyph_name = "vaticana.vplica"; - } - else if (prev_delta_pitch < 0) - { - // cephalicus - if (! (prev_context_info & FLEXA_RIGHT)) - /* correct head of previous primitive */ - { - if (i > 1) - { - /* cephalicus head with fixed size cauda */ - prev_glyph_name = "vaticana.inner.cephalicus"; - } - else - { - /* cephalicus head without cauda */ - prev_glyph_name = "vaticana.cephalicus"; - } - - /* - * Flexa has no variable size cauda if its left head is - * stacked on the right head. This is true for - * cephalicus. Hence, remove the cauda. - * - * Urgh: for the current implementation, this rule only - * applies for cephalicus; but it is a fundamental rule. - * Therefore, the following line of code should be - * placed somewhere else. - */ - prev_primitive->set_property ("add-cauda", - ly_bool2scm (false)); - } - if (prev_delta_pitch < - 1) - glyph_name = "vaticana.reverse.plica"; - else - glyph_name = "vaticana.reverse.vplica"; - } - else // (prev_delta_pitch == 0) - { - primitive->programming_error ("Vaticana_ligature:" - "deminutum head must have different " - "pitch -> ignoring grob"); - } + glyph_name = "vaticana.vplica"; + } + else if (prev_delta_pitch < 0) + { + // cephalicus + if (! (prev_context_info & FLEXA_RIGHT)) + /* correct head of previous primitive */ + { + if (i > 1) + { + /* cephalicus head with fixed size cauda */ + prev_glyph_name = "vaticana.inner.cephalicus"; + } + else + { + /* cephalicus head without cauda */ + prev_glyph_name = "vaticana.cephalicus"; + } + + /* + * Flexa has no variable size cauda if its left head is + * stacked on the right head. This is true for + * cephalicus. Hence, remove the cauda. + * + * Urgh: for the current implementation, this rule only + * applies for cephalicus; but it is a fundamental rule. + * Therefore, the following line of code should be + * placed somewhere else. + */ + prev_primitive->set_property ("add-cauda", + ly_bool2scm (false)); + } + if (prev_delta_pitch < - 1) + glyph_name = "vaticana.reverse.plica"; + else + glyph_name = "vaticana.reverse.vplica"; + } + else // (prev_delta_pitch == 0) + { + primitive->programming_error ("Vaticana_ligature:" + " deminutum head must have different" + " pitch -> ignoring grob"); + } + } else if (prefix_set & (CAVUM | LINEA)) if ((prefix_set & CAVUM) && (prefix_set & LINEA)) glyph_name = "vaticana.linea.punctum.cavum"; @@ -672,10 +692,12 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, if ((context_info & PES_UPPER) && (context_info & STACKED_HEAD)) { if (prev_glyph_name == "vaticana.punctum") - if (prev_delta_pitch > 1) - prev_glyph_name = "vaticana.lpes"; - else - prev_glyph_name = "vaticana.vlpes"; + { + if (prev_delta_pitch > 1) + prev_glyph_name = "vaticana.lpes"; + else + prev_glyph_name = "vaticana.vlpes"; + } } } @@ -711,8 +733,8 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, voices/staves also may want to set this property. */ Item *first_primitive = dynamic_cast (primitives[0].grob ()); Paper_column *paper_column = first_primitive->get_column (); - paper_column->warning (_f ("Vaticana_ligature_engraver: " - "setting `spacing-increment = %f': ptr =%ul", + paper_column->warning (_f ("Vaticana_ligature_engraver:" + " setting `spacing-increment = %f': ptr =%ul", ligature_width, paper_column)); paper_column-> set_property ("forced-spacing", scm_from_double (ligature_width)); @@ -720,9 +742,19 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, } ADD_ACKNOWLEDGER (Vaticana_ligature_engraver, rest); -ADD_ACKNOWLEDGER (Vaticana_ligature_engraver, note_head); +ADD_ACKNOWLEDGER (Vaticana_ligature_engraver, ligature_head); ADD_TRANSLATOR (Vaticana_ligature_engraver, - /* doc */ "Handles ligatures by glueing special ligature heads together.", - /* create */ "VaticanaLigature DotColumn", - /* read */ "", - /* write */ ""); + /* doc */ + "Handle ligatures by glueing special ligature heads" + " together.", + + /* create */ + "VaticanaLigature " + "DotColumn ", + + /* read */ + "", + + /* write */ + "" + );