diff options
author | Han-Wen Nienhuys <hanwen@xs4all.nl> | 2005-04-12 23:38:49 +0000 |
---|---|---|
committer | Han-Wen Nienhuys <hanwen@xs4all.nl> | 2005-04-12 23:38:49 +0000 |
commit | 933ea175663dc544f1357dc087a653d8a4e4a7bd (patch) | |
tree | deb2c316af0649dc83f4ee6f879d7a6042aac02a /lily/hairpin.cc | |
parent | 57be7394ffa2e7d7ba6d60548dba563f3409d472 (diff) |
* ly/performer-init.ly: add CueVoice to MIDI too.
* ps/music-drawing-routines.ps: new routine BeginEPSF /
EndEPSF.
* input/regression/markup-eps.ly: new file.
* scm/framework-ps.scm (write-preamble): change order: vars should
be inited before procedures.
* scm/output-ps.scm (glyph-string): break lines. 255 chars is max
for EPS files.
* scm/define-markup-commands.scm (epsfile): add epsfile command.
Diffstat (limited to 'lily/hairpin.cc')
-rw-r--r-- | lily/hairpin.cc | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/lily/hairpin.cc b/lily/hairpin.cc index 2c7368fa57..d4f7e8a6fb 100644 --- a/lily/hairpin.cc +++ b/lily/hairpin.cc @@ -19,13 +19,39 @@ #include "lookup.hh" #include "text-item.hh" + +MAKE_SCHEME_CALLBACK(Hairpin,after_line_breaking,1); +SCM +Hairpin::after_line_breaking (SCM smob) +{ + Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob)); + + Drul_array<bool> broken; + Drul_array<Item *> bounds; + Direction d = LEFT; + do + { + bounds[d] = me->get_bound (d); + broken[d] = bounds[d]->break_status_dir () != CENTER; + } + while (flip (&d) != LEFT); + + if (broken[LEFT] + && ly_c_equal_p (bounds[RIGHT]->get_column ()->get_property ("when"), + bounds[LEFT]->get_property ("when"))) + { + me->suicide (); + } + return SCM_UNSPECIFIED; +} + + MAKE_SCHEME_CALLBACK (Hairpin, print, 1); SCM Hairpin::print (SCM smob) { - Grob *me = unsmob_grob (smob); - Spanner *spanner = dynamic_cast<Spanner *> (me); + Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob)); SCM s = me->get_property ("grow-direction"); if (!is_direction (s)) @@ -42,14 +68,14 @@ Hairpin::print (SCM smob) Direction d = LEFT; do { - bounds[d] = spanner->get_bound (d); + bounds[d] = me->get_bound (d); broken[d] = bounds[d]->break_status_dir () != CENTER; } while (flip (&d) != LEFT); Grob *common = bounds[LEFT]->common_refpoint (bounds[RIGHT], X_AXIS); Drul_array<Real> x_points; - + do { Item *b = bounds[d]; |