source file of the GNU LilyPond music typesetter
- (c) 2003--2006 Juergen Reuter <reuter@ipd.uka.de>
+ (c) 2003--2009 Juergen Reuter <reuter@ipd.uka.de>
*/
#include "gregorian-ligature-engraver.hh"
#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"
* negative impact, since dotted notes appear within a ligature
* usually always at the end of the ligature, such that the bug never
* should apply for valid ligatures.
+ *
+ * TODO: Graduale Triplex, tempus per annum, hebdomada septima,
+ * alleluia (page 280) shows a counter-example for collecting dots
+ * always in a single column behind the ligature. Maybe only the last
+ * two dots in a ligature should be collected and all other dots put
+ * behind or on top of the head?
*/
class Vaticana_ligature_engraver : public Gregorian_ligature_engraver
{
Real thickness);
void check_for_prefix_loss (Item *primitive);
void check_for_ambiguous_dot_pitch (Grob_info primitive);
- void add_mora_column (Grob *paper_column);
+ void add_mora_column (Paper_column *column);
vector<Grob_info> augmented_primitives_;
public:
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;
}
/*
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);
else
{
primitive->programming_error ("Vaticana_ligature:"
- "delta-position undefined -> "
- "ignoring grob");
+ " delta-position undefined ->"
+ " ignoring grob");
continue;
}
}
/*
* Horizontally line-up this head to form a ligature.
*/
- get_set_column (primitive, column);
- primitive->translate_axis (ligature_width, X_AXIS);
+ move_related_items_to_column (primitive, column, ligature_width);
ligature_width += head_width;
prev_primitive = primitive;
}
void
-Vaticana_ligature_engraver::add_mora_column (Grob *paper_column)
+Vaticana_ligature_engraver::add_mora_column (Paper_column *column)
{
if (augmented_primitives_.size () == 0) // no dot for column
return;
- if (!paper_column) // empty ligature???
+ if (!column) // empty ligature???
{
augmented_primitives_[0].grob ()->
programming_error ("no paper column to add dot");
return;
}
Item *dotcol = make_item ("DotColumn", SCM_EOL);
- dotcol->set_parent (paper_column, X_AXIS);
+ dotcol->set_parent (column, X_AXIS);
for (vsize i = 0; i < augmented_primitives_.size (); i++)
{
Item *primitive =
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);
}
}
void
Vaticana_ligature_engraver::check_for_ambiguous_dot_pitch (Grob_info primitive)
{
- // TODO: Fix performance, which is currently O(n^2) (since this
- // method is called O(n) times and takes O(n) steps in the for
- // loop), but could be O(n) (by replacing the for loop by e.g. a
- // bitmask based O(1) test); where n=<number of primitives in the
+ // TODO: Fix performance, which is currently O (n^2) (since this
+ // method is called O (n) times and takes O (n) steps in the for
+ // loop), but could be O (n) (by replacing the for loop by e.g. a
+ // bitmask based O (1) test); where n=<number of primitives in the
// ligature> (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 ();
else
{
primitive->programming_error ("Vaticana_ligature:"
- "delta-position undefined -> "
- "ignoring grob");
+ " delta-position undefined ->"
+ " ignoring grob");
continue;
}
else // (prev_delta_pitch == 0)
{
primitive->programming_error ("Vaticana_ligature:"
- "deminutum head must have different "
- "pitch -> ignoring grob");
+ " deminutum head must have different"
+ " pitch -> ignoring grob");
}
else if (prefix_set & (CAVUM | LINEA))
if ((prefix_set & CAVUM) && (prefix_set & LINEA))
if (prev_primitive)
prev_primitive->set_property ("glyph-name",
- scm_makfrom0str (prev_glyph_name.c_str ()));
+ ly_string2scm (prev_glyph_name));
/*
* In the backend, flexa shapes and joins need to know about line
}
prev_primitive->set_property ("glyph-name",
- scm_makfrom0str (prev_glyph_name.c_str ()));
+ ly_string2scm (prev_glyph_name));
align_heads (primitives, flexa_width, thickness);
// append all dots to paper column of ligature's last head
- add_mora_column (prev_primitive->get_parent (X_AXIS));
+ add_mora_column (prev_primitive->get_column ());
#if 0 // experimental code to collapse spacing after ligature
/* TODO: set to max (old/new spacing-increment), since other
ADD_ACKNOWLEDGER (Vaticana_ligature_engraver, rest);
ADD_ACKNOWLEDGER (Vaticana_ligature_engraver, note_head);
ADD_TRANSLATOR (Vaticana_ligature_engraver,
- /* doc */ "Handles ligatures by glueing special ligature heads together.",
- /* create */ "VaticanaLigature DotColumn",
- /* accept */ "ligature-event",
- /* read */ "",
- /* write */ "");
+ /* doc */
+ "Handle ligatures by glueing special ligature heads together.",
+
+ /* create */
+ "VaticanaLigature "
+ "DotColumn ",
+
+ /* read */
+ "",
+
+ /* write */
+ ""
+ );