+/*
+ ottava-bracket.cc -- implement Ottava_bracket
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ */
+
#include "molecule.hh"
#include "text-item.hh"
#include "text-spanner.hh"
struct Ottava_bracket
{
- DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
+ DECLARE_SCHEME_CALLBACK (print, (SCM));
static bool has_interface (Grob*);
};
*/
-MAKE_SCHEME_CALLBACK (Ottava_bracket, brew_molecule, 1);
+MAKE_SCHEME_CALLBACK (Ottava_bracket, print, 1);
SCM
-Ottava_bracket::brew_molecule (SCM smob)
+Ottava_bracket::print (SCM smob)
{
Spanner*me = dynamic_cast<Spanner*> (unsmob_grob (smob));
Drul_array<Real> shorten = robust_scm2interval (me->get_grob_property ("shorten-pair"),
Interval (0,0));
+
+
+ /*
+ TODO: we should check if there are ledgers, and modify length of
+ the spanner to that.
+ */
do
{
Item *b = me->get_bound (d);
edge_height,
0.0,
flare, shorten);
+
+ /*
+ The vertical lines should not take space, for the following scenario:
+
+ 8 -----+
+ o |
+ |
+ |
+
+
+ Just a small amount, yes. In tight situations, it is even
+ possible to center the `8' directly below the note, dropping the
+ ottava line completely...
+
+ */
+ b = Molecule (Box (b.extent (X_AXIS),
+ Interval (0.1,0.1)),
+ b.get_expr ());
b.translate_axis (bracket_span_points[LEFT], X_AXIS);
text.translate_axis (span_points[LEFT], X_AXIS);