/*
-
clef-engraver.cc -- implement Clef_engraver
source file of the GNU LilyPond music typesetter
#include "direction.hh"
#include "side-position-interface.hh"
#include "item.hh"
+#include "custos.hh"
/// where is c-0 in the staff?
class Clef_engraver : public Engraver
bool set_type (String);
};
-
Clef_engraver::Clef_engraver ()
{
first_b_ = true;
SCM glyph = gh_cadr (found);
SCM pos = gh_caddr (found);
- daddy_trans_l_->set_property ("glyph", glyph);
- daddy_trans_l_->set_property ("position", pos);
+ daddy_trans_l_->set_property ("clefGlyph", glyph);
+ daddy_trans_l_->set_property ("clefPosition", pos);
found = scm_assoc (glyph, p);
if (found == SCM_BOOL_F)
return false;
int c0_position = gh_scm2int (pos) + gh_scm2int (gh_cdr (found));
- daddy_trans_l_->set_property ("c0-position", gh_int2scm (c0_position));
+ daddy_trans_l_->set_property ("clefCentralCPosition", gh_int2scm (c0_position));
}
- int c0_position = gh_scm2int (get_property ("c0-position"));
+ int c0_position = gh_scm2int (get_property ("clefCentralCPosition"));
c0_position -= (int)octave_dir_ * 7;
- daddy_trans_l_->set_property ("c0-position", gh_int2scm (c0_position));
+ daddy_trans_l_->set_property ("clefCentralCPosition", gh_int2scm (c0_position));
SCM basic = ly_symbol2scm ("Clef");
- SCM c0 = ly_symbol2scm ("c0-position");
SCM gl = ly_symbol2scm ("glyph");
daddy_trans_l_->execute_single_pushpop_property (basic, gl, SCM_UNDEFINED);
- daddy_trans_l_->execute_single_pushpop_property (basic, c0, SCM_UNDEFINED);
daddy_trans_l_->execute_single_pushpop_property (basic, gl,
- get_property ("glyph"));
- daddy_trans_l_->execute_single_pushpop_property (basic, c0,
- get_property ("c0_position")
- );
+ get_property ("clefGlyph"));
+
return true;
}
if (item)
{
if (Bar::has_interface (info.elem_l_)
- && gh_string_p (get_property ("glyph")))
+ && gh_string_p (get_property ("clefGlyph")))
create_clef ();
if (Note_head::has_interface (item)
- || Local_key_item::has_interface (item))
+ || Local_key_item::has_interface (item)
+ || Custos::has_interface (item)
+ )
{
int p = int (Staff_symbol_referencer::position_f (item))
- + gh_scm2int (get_property ("c0-position"));
+ + gh_scm2int (get_property ("clefCentralCPosition"));
Staff_symbol_referencer::set_position (item, p);
}
else if (Key_item::has_interface (item))
{
- item->set_elt_property ("c0-position", get_property ("c0-position"));
+ /*
+ Key_item adapts its formatting to make sure that the
+ accidentals stay in the upper half of the staff. It needs
+ to know c0-pos for this. (?)
+ */
+
+ item->set_elt_property ("c0-position", get_property ("clefCentralCPosition"));
}
}
}
void
Clef_engraver::do_creation_processing ()
{
- daddy_trans_l_->set_property ("position", gh_int2scm (0));
- daddy_trans_l_->set_property ("glyph", SCM_EOL);
- daddy_trans_l_->set_property ("c0-position", gh_int2scm (0));
+ daddy_trans_l_->set_property ("clefPosition", gh_int2scm (0));
+ daddy_trans_l_->set_property ("clefGlyph", SCM_EOL);
+ daddy_trans_l_->set_property ("clefCentralCPosition", gh_int2scm (0));
SCM def = get_property ("defaultClef");
if (gh_string_p (def))
clef_p_ = c;
}
Staff_symbol_referencer::set_position (clef_p_,
- gh_scm2int (get_property ("position")
+ gh_scm2int (get_property ("clefPosition")
));
if (octave_dir_)
{
same as setting molecule-callback to #f, but this retains the
dimensions of this element, which means that you can erase elements
individually. ")
- (property-description 'molecule-callback procedure? "Function taking graphical element as argument, returning a Scheme encoded Molecule")
+ (property-description 'molecule-callback procedure? "Function taking graphical element as argument, returning a Scheme encoded Molecule
+
+This function can be called more than once (for instance once for
+computing dimensions, and once for computing the output). Therefore,
+this function should have no side-effects on its argument.
+Caching of computed values is permissible, and generally useful, though.
+
+")
))
)
(list
(property-description 'note-width 'number? "unit for horizontal translation, measured in staff-space.")
) ) )
+
+
+(define custos-interface
+ (lily-interface
+ 'custos-interface
+ "A custos is a staff context symbol that appears at the end of a
+ staff line with monophonic musical contents (i.e. with a single
+ voice). It anticipates the pitch of the first note of the following
+ line and thus helps the player or singer to manage line breaks
+ during performance, thus enhancing readability of a score.
+
+ Custodes were frequently used in music notation until the 16th
+ century. There were different appearences for different notation
+ styles. Nowadays, they have survived only in special forms of
+ musical notation such as via the editio vaticana dating back to the
+ beginning of the 20th century.
+
+[TODO: add to glossary]"
+
+ (list
+ (property-description 'style string? "a string determining what glyph is
+typeset. Current choices are mensural,
+hufnagel, vaticana and medicaea [TODO: should use symbol] ")
+ ))
+ )
+
+
+
(define dot-interface
(lily-interface
'dots-interface
"The dots to go with a notehead/rest. A separate interface, since they
are a party in collision resolution."
(list
+ (property-description 'direction dir? "Direction to handle staff-line collisions in.")
(property-description 'dot-count integer? "number of dots")
)))