X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fspan-bar.cc;h=45cfa80e15f6c3a815bfe262ff8499956dc97c2a;hb=9a38b47c4a4589f2e7c413fcdfff83de454719e6;hp=c1d82c6df047d96cc1c8f79615112c29d1d3b8a2;hpb=3130370f1e21481c80abc3e67fb33b3b505cb241;p=lilypond.git diff --git a/lily/span-bar.cc b/lily/span-bar.cc index c1d82c6df0..45cfa80e15 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -27,20 +27,22 @@ Span_bar::add_bar (Grob*me, Grob*b) MAKE_SCHEME_CALLBACK (Span_bar,brew_molecule,1); -/** - * Limitations/Bugs: - * - * (1) Elements from 'me->get_grob_property ("elements")' must be - * ordered according to their y coordinates relative to their common - * axis group parent. Otherwise, the computation goes mad. (TODO: - * apply a sort algorithm that ensures this precondition.) However, - * until now, I have seen no case where lily has not fulfilled this - * precondition. - * - * (2) This method depends on bar_engraver not being removed from - * staff context. If bar_engraver is removed, the size of the staff - * lines is evaluated as 0, which results in a solid span bar line - * with faulty y coordinate. +/* + Limitations/Bugs: + + (1) Elements from 'me->get_grob_property ("elements")' must be + ordered according to their y coordinates relative to their common + axis group parent. Otherwise, the computation goes mad. + + (TODO: + apply a sort algorithm that ensures this precondition.) However, + until now, I have seen no case where lily has not fulfilled this + precondition. + + (2) This method depends on bar_engraver not being removed from + staff context. If bar_engraver is removed, the size of the staff + lines is evaluated as 0, which results in a solid span bar line + with faulty y coordinate. */ /* @@ -72,7 +74,7 @@ Span_bar::brew_molecule (SCM smobbed_me) if (!gh_string_p (glyph)) return SCM_EOL; - String glyph_str = ly_scm2string (glyph); + String glyph_string = ly_scm2string (glyph); // compose span_bar_mol Molecule span_bar_mol; @@ -99,7 +101,7 @@ Span_bar::brew_molecule (SCM smobbed_me) else { Molecule interbar - = Bar_line::compound_barline (staff_bar, glyph_str, l.length()); + = Bar_line::compound_barline (staff_bar, glyph_string, l.length()); interbar.translate_axis (l.center (), Y_AXIS); span_bar_mol.add_molecule (interbar); } @@ -216,7 +218,7 @@ Span_bar::evaluate_glyph (Grob*me) type = ".|."; } - gl = ly_str02scm (type.ch_C ()); + gl = ly_str02scm (type.to_str0 ()); if (scm_equal_p (me->internal_get_grob_property (glyph_symbol), gl) != SCM_BOOL_T) me->internal_set_grob_property (glyph_symbol, gl); } @@ -245,17 +247,10 @@ Span_bar::get_bar_size (SCM smob) return gh_double2scm (iv.length ()); } -void -Span_bar::set_interface (Grob *me) -{ - Bar_line::set_interface (me); - - me->set_interface (ly_symbol2scm ("span-bar-interface")); - me->set_extent_callback (SCM_EOL, Y_AXIS); -} -bool -Span_bar::has_interface (Grob*m) -{ - return m && m->has_interface (ly_symbol2scm ("span-bar-interface")); -} + +ADD_INTERFACE (Span_bar,"span-bar-interface", + "A bar line that spans other barlines (typically used to get cross-staff barlines.", + ""); + +