which defaults to quant-score if debug-XXX-scoring is set.
}
#if (DEBUG_BEAM_SCORING)
- SCM quant_score = me->get_property ("quant-score");
- SCM debug = me->layout ()->lookup_variable (ly_symbol2scm ("debug-beam-scoring"));
- if (to_boolean (debug) && scm_is_string (quant_score))
+ SCM annotation = me->get_property ("annotation");
+ if (!scm_is_string (annotation))
+ {
+ SCM debug = me->layout ()->lookup_variable (ly_symbol2scm ("debug-beam-scoring"));
+ if (to_boolean (debug))
+ annotation = me->get_property ("quant-score");
+ }
+
+ if (scm_is_string (annotation))
{
extract_grob_set (me, "stems", stems);
Direction stem_dir = stems.size () ? to_dir (stems[0]->get_property ("direction")) : UP;
Stencil score = *unsmob_stencil (Text_interface::interpret_markup
- (me->layout ()->self_scm (), properties, quant_score));
+ (me->layout ()->self_scm (), properties, annotation));
if (!score.is_empty ())
- the_beam.add_at_edge (Y_AXIS, stem_dir, score, 1.0);
+ {
+ score.translate_axis (me->relative_coordinate(commonx, X_AXIS), X_AXIS);
+ the_beam.add_at_edge (Y_AXIS, stem_dir, score, 1.0);
+ }
}
#endif
,
/* properties */
+ "annotation "
"auto-knee-gap "
"beamed-stem-shorten "
"beaming "
line_thick);
#if DEBUG_SLUR_SCORING
- SCM quant_score = me->get_property ("quant-score");
-
- if (to_boolean (me->layout ()
- ->lookup_variable (ly_symbol2scm ("debug-slur-scoring")))
- && scm_is_string (quant_score))
+ SCM annotation = me->get_property ("annotation");
+ if (!scm_is_string (annotation))
+ {
+ SCM debug = me->layout ()->lookup_variable (ly_symbol2scm ("debug-slur-scoring"));
+ if (to_boolean (debug))
+ annotation = me->get_property ("quant-score");
+ }
+
+ if (scm_is_string (annotation))
{
string str;
SCM properties = Font_interface::text_font_alist_chain (me);
-
if (!scm_is_number (me->get_property ("font-size")))
properties = scm_cons (scm_acons (ly_symbol2scm ("font-size"), scm_from_int (-6), SCM_EOL),
properties);
Stencil tm = *unsmob_stencil (Text_interface::interpret_markup
(me->layout ()->self_scm (), properties,
- quant_score));
+ annotation));
a.add_at_edge (Y_AXIS, get_grob_direction (me), tm, 1.0);
}
#endif
"A slur",
/* properties */
+ "annotation "
"avoid-slur " /* UGH. */
"control-points "
"dash-fraction "
line_thick);
#if DEBUG_TIE_SCORING
- SCM quant_score = me->get_property ("quant-score");
-
- if (to_boolean (me->layout ()
- ->lookup_variable (ly_symbol2scm ("debug-tie-scoring")))
- && scm_is_string (quant_score))
+ SCM annotation = me->get_property ("annotation");
+ if (!scm_is_string (annotation))
+ {
+ SCM debug = me->layout ()->lookup_variable (ly_symbol2scm ("debug-tie-scoring"));
+ if (to_boolean (debug))
+ annotation = me->get_property ("quant-score");
+ }
+ if (scm_is_string (annotation))
{
string str;
SCM properties = Font_interface::text_font_alist_chain (me);
Stencil tm = *unsmob_stencil (Text_interface::interpret_markup
(me->layout ()->self_scm (), properties,
- quant_score));
+ annotation));
tm.translate (Offset (b.control_[3][X_AXIS] + 0.5,
b.control_[0][Y_AXIS] * 2));
tm = tm.in_color (1, 0, 0);
/* properties */
+ "annotation "
"avoid-slur " // UGH.
"control-points "
"dash-fraction "
(alteration ,number? "Alteration numbers for accidental.")
(alteration-alist ,list? "List of @code{(@var{pitch}
. @var{accidental})} pairs for key signature.")
+ (annotation ,string? "Annotate a grob for debug purposes.")
(arpeggio-direction ,ly:dir? "If set, put an arrow on the
arpeggio squiggly line.")
(arrow-length ,number? "Arrow length.")
did its job. This ensures that a positioning is only done once.")
(pure-Y-extent ,number-pair? "The estimated height of a system.")
- (quant-score ,string? "The Beam quanting score -- can be stored for
+ (quant-score ,string? "The beam quanting score; stored for
debugging.")
(quantize-position ,boolean? "If set, a vertical alignment is aligned
to be within staff spaces.")
(begin
(ly:warning (_ "Error in beam quanting. Expected (~S,~S) found ~S.")
want-l want-r posns)
- (set! (ly:grob-property beam 'quant-score)
- (format "(~S,~S)" want-l want-r)))
- (set! (ly:grob-property beam 'quant-score) ""))
-
+ (set! (ly:grob-property beam 'annotation)
+ (format "(~S,~S)" want-l want-r))))
posns
))
"Check whether the slope of BEAM is correct wrt. COMPARISON."
(let* ((slope-sign (- (cdr posns) (car posns)))
(correct (comparison slope-sign 0)))
-
(if (not correct)
(begin
(ly:warning (_ "Error in beam quanting. Expected ~S 0, found ~S.")
- (procedure-name comparison) "0" slope-sign)
- (set! (ly:grob-property beam 'quant-score)
+ (procedure-name comparison) slope-sign)
+ (set! (ly:grob-property beam 'annotation)
(format "~S 0" (procedure-name comparison))))
-
- (set! (ly:grob-property beam 'quant-score) ""))
+ (set! (ly:grob-property beam 'annotation) ""))
posns))