2 measure-grouping-spanner.cc -- implement Measure_grouping
4 source file of the GNU LilyPond music typesetter
6 (c) 2002--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "output-def.hh"
12 #include "measure-grouping-spanner.hh"
15 #include "staff-symbol-referencer.hh"
17 MAKE_SCHEME_CALLBACK (Measure_grouping, print, 1);
19 Measure_grouping::print (SCM grob)
21 Spanner * me = dynamic_cast<Spanner*> (unsmob_grob (grob));
26 SCM which = me->get_property ("style");
27 Real height = robust_scm2double (me->get_property ("height"), 1);
29 Real t = Staff_symbol_referencer::line_thickness (me) * robust_scm2double (me->get_property ("thickness"), 1);
30 Grob *common = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT),
33 Interval rext = me->get_bound (RIGHT)->extent (common, X_AXIS);
34 Real w =robust_relative_extent (me->get_bound (RIGHT),
35 common, X_AXIS).linear_combination (CENTER);
36 - me->get_bound (LEFT)->relative_coordinate (common, X_AXIS);
43 TODO: use line interface
45 if (which == ly_symbol2scm ("bracket"))
47 m = Lookup::bracket (X_AXIS, iv, t, -height, t);
49 else if (which == ly_symbol2scm ("triangle"))
51 m = Lookup::triangle (iv, t, height);
54 m.align_to (Y_AXIS, DOWN);
55 return m.smobbed_copy ();
58 ADD_INTERFACE (Measure_grouping,"measure-grouping-interface",
59 "This objectt indicates groups of beats. "
60 "Valid choices for @code{style} are @code{bracket} and @code{triangle}.",
61 "thickness style height");