]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' of ssh+git://gpercival@git.sv.gnu.org/srv/git/lilypond
authorGraham Percival <graham@percival-music.ca>
Wed, 31 Jan 2007 20:25:22 +0000 (12:25 -0800)
committerGraham Percival <graham@percival-music.ca>
Wed, 31 Jan 2007 20:25:22 +0000 (12:25 -0800)
200 files changed:
Documentation/user/instrument-notation.itely
Documentation/user/spacing.itely
Documentation/user/templates.itely
Documentation/user/tutorial.itely
input/les-nereides.ly
input/regression/dynamics-text-spanner-abs-dynamic.ly [new file with mode: 0644]
input/regression/lyric-extender-rest.ly [new file with mode: 0644]
input/regression/markup-commands.ly
input/regression/midi-microtone-off.ly [new file with mode: 0644]
input/regression/note-head-style.ly
input/regression/skip-of-length.ly
input/test/music-box.ly
input/typography-demo.ly
lily/accidental-placement.cc
lily/accidental.cc
lily/align-interface.cc
lily/all-font-metrics-scheme.cc
lily/ambitus-engraver.cc
lily/audio-item.cc
lily/auto-beam-engraver.cc
lily/axis-group-interface-scheme.cc
lily/axis-group-interface.cc
lily/balloon-engraver.cc
lily/balloon.cc
lily/bar-line.cc
lily/bar-number-engraver.cc
lily/beam-engraver.cc
lily/beam.cc
lily/beaming-pattern.cc
lily/bezier-bow.cc
lily/bezier.cc
lily/book-scheme.cc
lily/book.cc
lily/break-alignment-interface.cc
lily/cluster.cc
lily/constrained-breaking.cc
lily/context-def.cc
lily/context-property.cc
lily/context-scheme.cc
lily/context-specced-music-iterator.cc
lily/control-track-performer.cc
lily/dispatcher-scheme.cc
lily/dispatcher.cc
lily/dot-column.cc
lily/dots-engraver.cc
lily/drum-note-performer.cc
lily/duration-scheme.cc
lily/dynamic-engraver.cc
lily/dynamic-performer.cc
lily/enclosing-bracket.cc
lily/engraver-group.cc
lily/extender-engraver.cc
lily/figured-bass-continuation.cc
lily/figured-bass-engraver.cc
lily/figured-bass-position-engraver.cc
lily/file-name-map.cc
lily/font-config-scheme.cc
lily/font-metric-scheme.cc
lily/freetype-error.cc
lily/function-documentation.cc
lily/general-scheme.cc
lily/global-context-scheme.cc
lily/grob-array-scheme.cc
lily/grob-interface-scheme.cc
lily/grob-interface.cc
lily/grob-property.cc
lily/grob-scheme.cc
lily/grob-smob.cc
lily/grob.cc
lily/hairpin.cc
lily/hara-kiri-group-spanner.cc
lily/horizontal-bracket.cc
lily/include/align-interface.hh
lily/include/audio-item.hh
lily/include/axis-group-interface.hh
lily/include/beam.hh
lily/include/constrained-breaking.hh
lily/include/grob-interface.hh
lily/include/grob.hh
lily/include/hara-kiri-group-spanner.hh
lily/include/simple-spacer.hh
lily/include/skyline.hh
lily/include/slur.hh
lily/include/stem.hh
lily/include/stream-event.hh
lily/include/system.hh
lily/include/volta-bracket.hh
lily/input-scheme.cc
lily/instrument-switch-engraver.cc
lily/key-engraver.cc
lily/key-signature-interface.cc
lily/ledger-line-spanner.cc
lily/lily-guile.cc
lily/lily-lexer-scheme.cc
lily/lily-lexer.cc
lily/lily-parser-scheme.cc
lily/line-interface.cc
lily/line-spanner.cc
lily/lyric-combine-music-iterator.cc
lily/main.cc
lily/mark-engraver.cc
lily/melody-spanner.cc
lily/metronome-engraver.cc
lily/midi-chunk.cc
lily/midi-item.cc
lily/midi-walker.cc
lily/moment-scheme.cc
lily/music-scheme.cc
lily/new-fingering-engraver.cc
lily/note-collision.cc
lily/note-head-scheme.cc
lily/note-head.cc
lily/note-performer.cc
lily/note-spacing.cc
lily/open-type-font-scheme.cc
lily/open-type-font.cc
lily/ottava-bracket.cc
lily/output-def.cc
lily/output-property-engraver.cc
lily/page-breaking.cc
lily/page-spacing.cc
lily/pango-font.cc
lily/paper-book.cc
lily/paper-column-engraver.cc
lily/paper-outputter-scheme.cc
lily/paper-score.cc
lily/paper-system.cc
lily/parenthesis-engraver.cc
lily/percent-repeat-engraver.cc
lily/percent-repeat-iterator.cc
lily/performance-scheme.cc
lily/piano-pedal-bracket.cc
lily/piano-pedal-performer.cc
lily/pitch-scheme.cc
lily/pitch.cc
lily/prob-scheme.cc
lily/prob.cc
lily/relocate.cc
lily/rest-collision.cc
lily/scale.cc
lily/score-engraver.cc
lily/score-scheme.cc
lily/script-interface.cc
lily/semi-tie-column.cc
lily/semi-tie.cc
lily/separation-item.cc
lily/simple-closure.cc
lily/simple-spacer-scheme.cc
lily/simple-spacer.cc
lily/skyline.cc
lily/slur-scoring.cc
lily/slur.cc
lily/smobs.cc
lily/source-file.cc
lily/spacing-spanner.cc
lily/spanner-scheme.cc
lily/spanner.cc
lily/staff-symbol.cc
lily/stem-tremolo.cc
lily/stem.cc
lily/stencil-scheme.cc
lily/stream-event-scheme.cc
lily/system-scheme.cc [new file with mode: 0644]
lily/system-start-delimiter-engraver.cc
lily/system-start-delimiter.cc
lily/system-start-text.cc
lily/system.cc
lily/tab-harmonic-engraver.cc
lily/tab-staff-symbol-engraver.cc
lily/text-engraver.cc
lily/text-interface.cc
lily/text-spanner-engraver.cc
lily/tie-column.cc
lily/tie-configuration.cc
lily/tie-details.cc
lily/tie-engraver.cc
lily/tie-formatting-problem.cc
lily/tie-performer.cc
lily/tie.cc
lily/time-scaled-music-iterator.cc
lily/translator.cc
lily/trill-spanner-engraver.cc
lily/ttf.cc
lily/tuplet-bracket.cc
lily/tuplet-engraver.cc
lily/tuplet-number.cc
lily/tweak-engraver.cc
lily/vaticana-ligature-engraver.cc
lily/volta-bracket.cc
lily/volta-engraver.cc
ly/engraver-init.ly
mf/feta-toevallig.mf
python/GNUmakefile
python/convertrules.py
scm/define-context-properties.scm
scm/define-grob-properties.scm
scm/define-grobs.scm
scm/define-markup-commands.scm
scm/layout-page-layout.scm
scripts/GNUmakefile

index 4be1671dea5586050a3aeed269836c3ae6bfdeb3..f17aad795354deecdd2287ea314c1602964ca4e6 100644 (file)
@@ -57,11 +57,6 @@ Dynamics are not centered, but workarounds do exist.  See the
 @cindex stem, cross staff
 @cindex distance between staves in piano music
 
-The distance between the two staves is the same for all systems in the
-score.  It is possible to override this per system, but it does require
-an arcane command incantation.  See
-@inputfileref{input/@/test,piano@/-staff@/-distance@/.ly}.
-
 
 @node Automatic staff changes
 @subsection Automatic staff changes
@@ -274,7 +269,10 @@ of the stem in the lower staff, so it reaches the stem in the upper
 staff, or vice versa.
 
 @lilypond[ragged-right,verbatim,quote]
-stemExtend = \once \override Stem #'length = #22
+stemExtend = {
+  \once \override Stem #'length = #10
+  \once \override Stem #'cross-staff = ##t
+}
 noFlag = \once \override Stem #'flag-style = #'no-flag
 \new PianoStaff <<
   \new Staff {
index a15df5904575ec5cccfe755ca847f45d73489974..377a74ea1392fb6d13a8cf68799b679ed76f08d5 100644 (file)
@@ -484,7 +484,6 @@ staves inside a system.
 
 @menu
 * Vertical spacing inside a system::  
-* Vertical spacing of piano staves::  
 * Vertical spacing between systems::  
 * Controlling spacing of individual systems::  
 * Two-pass vertical spacing::
@@ -538,53 +537,6 @@ Example files: @inputfileref{input/regression/,page-spacing.ly},
 @inputfileref{input/regression/,alignment-vertical-spacing.ly}.
 
 
-@node Vertical spacing of piano staves
-@subsection Vertical spacing of piano staves
-
-The distance between staves of a @internalsref{PianoStaff} cannot be
-computed during formatting.  Rather, to make cross-staff beaming work
-correctly, that distance has to be fixed beforehand.
-
-The distance of staves in a @code{PianoStaff} is set with the
-@code{forced-distance} property of the
-@internalsref{VerticalAlignment} object, created in
-@internalsref{PianoStaff}.
-
-It can be adjusted as follows
-@example
-\new PianoStaff \with @{
-  \override VerticalAlignment #'forced-distance = #7
-@} @{
-  ...
-@}
-@end example
-
-@noindent
-This would bring the staves together at a distance of 7 staff spaces,
-measured from the center line of each staff.
-
-The difference is demonstrated in the following example,
-@lilypond[quote,verbatim]
-\relative c'' <<
-  \new PianoStaff \with {
-    \override VerticalAlignment #'forced-distance = #7
-  } <<
-    \new Staff { c1 }
-    \new Staff { c }
-  >>
-  \new PianoStaff <<
-    \new Staff { c }
-    \new Staff { c }
-  >>
->>
-@end lilypond
-
-
-@seealso
-
-Example files: @inputfileref{input/regression/,alignment-vertical-spacing.ly}.
-
-
 @node Vertical spacing between systems
 @subsection Vertical spacing between systems
 
index bc41f8d617e53657dfbbb0e69c9cdd9192ce2dd2..51c27f4f573c702492c11ef2d807cd6f39324ffd 100644 (file)
@@ -366,7 +366,6 @@ pedal = {
     \context {
       \PianoStaff
       \accepts Dynamics
-      \override VerticalAlignment #'forced-distance = #7
     }
   }
 }
index 0bda8691044120c1b755641fb7a4e8c531eb7a5c..93a5db0ec07e7ad0f2f4dd1cc744196e8341067f 100644 (file)
@@ -823,7 +823,7 @@ of music is multiplied by the fraction.  Triplets make notes occupy
 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
 \times 2/3 { f8 g a }
 \times 2/3 { c r c }
-\times 2/3 { f,8 g16 a g a }
+\times 2/3 { f,8 g16[ a g a] }
 \times 2/3 { d4 a8 }
 @end lilypond
 
index c39e7f37b526d4bc22062a512fc7ef1c40eab1ee..9f91786efeb9c91742ee8109b88c5c5de7f834fb 100644 (file)
@@ -36,8 +36,6 @@ treble = \new Voice \relative c''{
 
     \change Staff=bass
 
-    \once\override TextScript  #'extra-offset = #'(-3 . -4) %tweak
-    
     cis,16^2(^\markup {\small \italic "m.d." }\sustainUp
     <fis fis,>8 <e! e,!>
     | %4
@@ -50,8 +48,6 @@ treble = \new Voice \relative c''{
 
     #(set-octavation 1)
 
-    \once\override TextScript  #'extra-offset = #'(-3 . -2) %tweak
-           
     \tieUp
     cis''''4^\markup { \small \italic "m.g." }\arpeggio~
     \grace {
@@ -121,7 +117,7 @@ bass = \new Voice \relative c{
 
     r8. e,16(\f_2 <a a,>8[ <b b,>]
     | %2
-    \override Staff.SustainPedalLineSpanner #'staff-padding = #5 %tweak
+    %\override Staff.SustainPedalLineSpanner #'staff-padding = #5 %tweak
                           
     <cis cis,>4\sustainDown
     \change Staff=treble
@@ -134,7 +130,7 @@ bass = \new Voice \relative c{
     r8. cis,,16(\sustainUp <fis fis,>8 <gis gis,>
     
     | %3
-%    \once \override Stem  #'length = #6 %tweak
+
     <a a,>4\sustainDown
     \change Staff=treble
                        
@@ -176,7 +172,7 @@ bass = \new Voice \relative c{
     \override Fingering  #'direction = #DOWN
 
                           
-    \override Staff.SustainPedalLineSpanner #'staff-padding = #3.5 %tweak
+    %\override Staff.SustainPedalLineSpanner #'staff-padding = #3.5 %tweak
     \set Staff.pedalSustainStyle = #'mixed
     %%a,8 e'[-5(<a-2 cis-3>])
 
@@ -210,7 +206,7 @@ bassTwo = \new Voice \relative c{
 }
 
 middleDynamics = {
-    \override Dynamics.TextScript  #'padding = #-1 %tweak
+    %\override Dynamics.TextScript  #'padding = #-1 %tweak
     s2
     s1*2
     | %4
@@ -219,9 +215,8 @@ middleDynamics = {
        s8
        s16 s s
        s32 s
-       \once\override Dynamics.Hairpin  #'extra-offset = #'(0 . 2) %tweak
        s\> s
-       s32 s s s\!
+       s32 s s\! s
     
     }
     \fatText
@@ -229,7 +224,6 @@ middleDynamics = {
     \emptyText
     | %5
     s2-"a tempo" s8
-    \once\override Dynamics.Hairpin  #'extra-offset = #'(1 . 0) %tweak
     s \> s s
     | %6 
     s8\!
@@ -263,7 +257,7 @@ theScore = \score{
            \type "Engraver_group"
            \name Dynamics
            \consists "Output_property_engraver"
-           \override VerticalAxisGroup #'minimum-Y-extent = #'(-1 . 1)
+           \override VerticalAxisGroup #'minimum-Y-extent = #'(0 . 0)
 
            \consists "Script_engraver"
            \consists "Dynamic_engraver"
@@ -280,7 +274,6 @@ theScore = \score{
        \context {
            \PianoStaff
            \accepts Dynamics
-           \override VerticalAlignment #'forced-distance = #7
         }
     }
 }
diff --git a/input/regression/dynamics-text-spanner-abs-dynamic.ly b/input/regression/dynamics-text-spanner-abs-dynamic.ly
new file mode 100644 (file)
index 0000000..199320e
--- /dev/null
@@ -0,0 +1,16 @@
+\header
+{
+
+  texidoc = "left attach dir for text crescendi starting on an
+  absolute dynamic is changed, so cresc. and the absolute dynamic
+  don't overstrike."
+  
+}
+
+\version "2.11.14"
+\paper { ragged-right = ##t }
+
+\relative c' {
+  \setTextCresc
+  c4\p\< c c c\!
+}
diff --git a/input/regression/lyric-extender-rest.ly b/input/regression/lyric-extender-rest.ly
new file mode 100644 (file)
index 0000000..ea096f7
--- /dev/null
@@ -0,0 +1,25 @@
+
+\header {
+
+  texidoc = "If @code{extendersOverRests} is set, an extender
+is not terminated upon encountering a rest. "
+
+}
+
+\paper {
+  ragged-right = ##T
+}
+
+\version "2.11.15"
+
+<<
+  \new Voice = "one" \relative c'' {
+    c4\melisma 
+    c4 r c\melismaEnd c
+  }
+  \new Lyrics \lyricsto "one" {
+    \set extendersOverRests = ##t 
+
+    Test __ end
+  }
+>>
index dc01e9e40b719eb49e96e5f97bb4d77b5dfcbb7d..1005cd1fa9406726a85e845bb2d9c51e9a122ca7 100644 (file)
@@ -29,6 +29,8 @@ blah.")
        wordwrap:
        \wordwrap-field #'bla
       }
+
+      draw-line: \draw-line #'(5 . 3)
       
     }
   }
diff --git a/input/regression/midi-microtone-off.ly b/input/regression/midi-microtone-off.ly
new file mode 100644 (file)
index 0000000..653b97f
--- /dev/null
@@ -0,0 +1,17 @@
+\header {
+
+  texidoc = "Microtonal shifts should be corrected before the start of
+  the next (possibly grace) note.  "
+}
+
+\version "2.10.14"
+
+\score
+{
+  
+  \relative  {
+    a geseh \acciaccatura a geseh
+  }
+
+  \midi {}
+}
index b5164e9e2349aab2d82c6a85047d189823ae159f..c561eec4d11ad2ce795155fb7fd33374ab09c652 100644 (file)
@@ -61,6 +61,16 @@ pattern = <<
 
   \break
 
+  \override Staff.NoteHead  #'style = #'harmonic-black
+  s1*0^\markup { "harmonic-black" }
+  \pattern
+
+  \override Staff.NoteHead  #'style = #'harmonic-mixed
+  s1*0^\markup { "harmonic-mixed" }
+  \pattern
+
+  \break
+
   \override Staff.NoteHead  #'style = #'diamond
   s1*0^\markup { "diamond" }
   \pattern
index e80bede98ca43d79f16525d1c4be6ae9e77ba096..b02a185afcdf942a8d85cd981cfcfeb45bc05087 100644 (file)
@@ -19,7 +19,7 @@ last as long as their arguments."
   \new Staff {
     \applyMusic #skip-of-length { c\breve } f4 r2.
     \applyMusic #mmrest-of-length { c\breve } f4 r2.
-    \displayMusic \musicMap #skip->rest s\breve 
+    \musicMap #skip->rest s\breve 
   }
 >>
   
index 9e5b09cdb8e3b23c64309e87c2c42cee75169937..ae4567dbf73ddbe01610aad35b62512973adbe20 100644 (file)
@@ -126,10 +126,6 @@ prelude =
    >>
 
    \layout {
-       \context {
-          \PianoStaff
-          \override VerticalAlignment #'forced-distance = #10
-       }
        line-width = 18.0 \cm
    }
 
index 0ea37e871d18464b4f18ad89b9ab359602596a51..9182285cf1b5dc7b64eaa335974dad928f8e03e5 100644 (file)
@@ -157,10 +157,6 @@ pianoLH =  \relative c'' \repeat volta 2\new Voice {
          \override Stem #'stemlet-length = #0.5
          \override Slur #'height-limit = #1.5
        }
-       \context {
-         \PianoStaff
-         \override VerticalAlignment #'forced-distance = #10
-       }
       }
       
   \midi {
index 15049f5bc0d076c568cc395608bd46a808407bb4..8e75206dc81bafeb5da5451d625ac70b4d1ca8aa 100644 (file)
@@ -243,7 +243,7 @@ stagger_apes (vector<Accidental_placement_entry*> *apes)
 
 */
 
-MAKE_SCHEME_CALLBACK(Accidental_placement, calc_positioning_done, 1);
+MAKE_SCHEME_CALLBACK (Accidental_placement, calc_positioning_done, 1);
 SCM
 Accidental_placement::calc_positioning_done (SCM smob)
 {
index 3bfd1b816d1e91f15f7257979381efde7df3c53d..571c33cbea497e5c8db3cf9eaa305c5b154dc952 100644 (file)
@@ -69,9 +69,7 @@ Accidental_interface::accurate_boxes (Grob *me, Grob **common)
   if (!me->is_live ())
     return boxes;
 
-  SCM scm_style = me->get_property ("style");
-  if (!scm_is_symbol (scm_style)
-      && !to_boolean (me->get_property ("restore-first"))
+  if (!to_boolean (me->get_property ("restore-first"))
       && !parens)
     {
       Rational alteration
index 09887a7c9fd893581d403f539f87fabc495e3570..786e91010bf00c10c9958306893a4caf72ab0588 100644 (file)
@@ -36,19 +36,15 @@ Align_interface::calc_positioning_done (SCM smob)
   SCM axis = scm_car (me->get_property ("axes"));
   Axis ax = Axis (scm_to_int (axis));
 
-  SCM force = me->get_property ("forced-distance");
-  if (scm_is_number (force))
-    Align_interface::align_to_fixed_distance (me, ax);
-  else
-    Align_interface::align_elements_to_extents (me, ax);
+  Align_interface::align_elements_to_extents (me, ax);
 
   return SCM_BOOL_T;
 }
 
 /*
-  merge with align-to-extents?
+  TODO: This belongs to the old two-pass spacing. Delete me.
 */
-MAKE_SCHEME_CALLBACK(Align_interface, stretch_after_break, 1)
+MAKE_SCHEME_CALLBACK (Align_interface, stretch_after_break, 1)
 SCM
 Align_interface::stretch_after_break (SCM grob)
 {
@@ -75,7 +71,7 @@ Align_interface::stretch_after_break (SCM grob)
 
       Direction stacking_dir = robust_scm2dir (me->get_property ("stacking-dir"),
                                               DOWN);
-      Real delta  = extra_space / elems.size() * stacking_dir;
+      Real delta  = extra_space / elems.size () * stacking_dir;
       for (vsize i = 0; i < elems.size (); i++)
        elems[i]->translate_axis (i * delta, Y_AXIS);
     }
@@ -83,55 +79,6 @@ Align_interface::stretch_after_break (SCM grob)
   return SCM_UNSPECIFIED;
 }
 
-/*
-  merge with align-to-extents?
-*/
-void
-Align_interface::align_to_fixed_distance (Grob *me, Axis a)
-{
-  Direction stacking_dir = robust_scm2dir (me->get_property ("stacking-dir"),
-                                          DOWN);
-
-  Real dy = robust_scm2double (me->get_property ("forced-distance"), 0.0);
-
-  extract_grob_set (me, "elements", elem_source);
-
-  vector<Grob*> elems (elem_source); // writable..
-
-  Real where = 0;
-
-  Interval v;
-  v.set_empty ();
-  vector<Real> translates;
-
-  for (vsize j = elems.size (); j--;)
-    {
-      /*
-       This is not very elegant, in that we need special support for
-       hara-kiri. Unfortunately, the generic wiring of
-       force_hara_kiri_callback () (extent and offset callback) is
-       such that we might get into a loop if we call extent () or
-       offset () the elements.
-      */
-      if (a == Y_AXIS
-         && Hara_kiri_group_spanner::has_interface (elems[j]))
-       Hara_kiri_group_spanner::consider_suicide (elems[j]);
-
-      if (!elems[j]->is_live ())
-       elems.erase (elems.begin () + j);
-    }
-
-  for (vsize j = 0; j < elems.size (); j++)
-    {
-      where += stacking_dir * dy;
-      translates.push_back (where);
-      v.unite (Interval (where, where));
-    }
-
-  for (vsize i = 0; i < translates.size (); i++)
-    elems[i]->translate_axis (translates[i] - v.center (), a);
-}
-
 /* for each grob, find its upper and lower skylines. If the grob has
    an empty extent, delete it from the list instead. If the extent is
    non-empty but there is no skyline available (or pure is true), just
@@ -168,52 +115,54 @@ get_skylines (Grob *me,
   for (vsize i = elements->size (); i--;)
     {
       Grob *g = (*elements)[i];
-      Interval extent = g->maybe_pure_extent (g, a, pure, start, end);
-      Interval other_extent = pure ? Interval (-infinity_f, infinity_f)
-       : g->extent (common_refpoint, other_axis (a));
-      Box b;
-      b[a] = extent;
-      b[other_axis (a)] = other_extent;
-
-      if (extent.is_empty ())
-       {
-         elements->erase (elements->begin () + i);
-         continue;
-       }
-
       Skyline_pair skylines;
-      if (!pure
-         && Skyline_pair::unsmob (g->get_property ("skylines")))
-       skylines = *Skyline_pair::unsmob (g->get_property ("skylines"));
-      else
-       {
-         if (!pure)
-           programming_error ("no skylines for alignment-child\n");
-         
-         skylines = Skyline_pair (b, 0, other_axis (a));
-       }
 
       /* each skyline is calculated relative to (potentially) a different other_axis
         coordinate. In order to compare the skylines effectively, we need to shift them
         to some absolute reference point */
       if (!pure)
        {
+         Skyline_pair *skys = Skyline_pair::unsmob (g->get_property ("skylines"));
+         if (skys)
+           skylines = *skys;
+         else
+           programming_error ("no skylines for alignment-child\n");
+
          /* this is perhaps an abuse of minimum-?-extent: maybe we should create
             another property? But it seems that the only (current) use of
             minimum-Y-extent is to separate vertically-aligned elements */
          SCM min_extent = g->get_property (a == X_AXIS ? "minimum-X-extent" : "minimum-Y-extent");
+
          if (is_number_pair (min_extent))
            {
+             Box b;
+             Interval other_extent = g->extent (common_refpoint, other_axis (a));
              b[a] = ly_scm2interval (min_extent);
-             skylines.insert (b, 0, other_axis (a));
+             b[other_axis (a)] = other_extent;
+             if (!other_extent.is_empty ())
+               skylines.insert (b, 0, other_axis (a));
            }
 
          Real offset = child_refpoints[i]->relative_coordinate (common_refpoint, other_axis (a));
          skylines.shift (offset);
        }
+      else
+       {
+         assert (a == Y_AXIS);
+         Interval extent = g->pure_height (g, start, end);
+         if (!extent.is_empty ())
+           {
+             Box b;
+             b[a] = extent;
+             b[other_axis (a)] = Interval (-infinity_f, infinity_f);
+             skylines.insert (b, 0, other_axis (a));
+           }
+       }
 
-
-      ret->push_back (skylines);
+      if (skylines.is_empty ())
+       elements->erase (elements->begin () + i);
+      else
+       ret->push_back (skylines);
     }
   reverse (*ret);
 }
@@ -250,6 +199,7 @@ Align_interface::get_extents_aligned_translates (Grob *me,
   get_skylines (me, &elems, a, pure, start, end, &skylines);
 
   Real where = 0;
+  /* TODO: extra-space stuff belongs to two-pass spacing. Delete me */
   SCM extra_space_handle = scm_assq (ly_symbol2scm ("alignment-extra-space"), line_break_details);
   Real extra_space = robust_scm2double (scm_is_pair (extra_space_handle)
                                        ? scm_cdr (extra_space_handle)
@@ -258,15 +208,21 @@ Align_interface::get_extents_aligned_translates (Grob *me,
 
   Real padding = robust_scm2double (me->get_property ("padding"), 0.0);
   vector<Real> translates;
+  Skyline down_skyline (stacking_dir);
   for (vsize j = 0; j < elems.size (); j++)
     {
       Real dy = 0;
       if (j == 0)
        dy = skylines[j][-stacking_dir].max_height ();
       else
-       dy = skylines[j-1][stacking_dir].distance (skylines[j][-stacking_dir]);
+       {
+         down_skyline.merge (skylines[j-1][stacking_dir]);
+         dy = down_skyline.distance (skylines[j][-stacking_dir]);
+       }
 
-      where += stacking_dir * max (0.0, dy + padding + extra_space / elems.size ());
+      dy = max (0.0, dy + padding + extra_space / elems.size ());
+      down_skyline.raise (-stacking_dir * dy);
+      where += stacking_dir * dy;
       translates.push_back (where);
     }
 
@@ -310,6 +266,25 @@ Align_interface::align_elements_to_extents (Grob *me, Axis a)
       all_grobs[j]->translate_axis (translates[j], a);
 }
 
+/* After we have already determined the y-offsets of our children, we may still
+   want to stretch them a little. */
+void
+Align_interface::stretch (Grob *me, Real amount, Axis a)
+{
+  extract_grob_set (me, "elements", elts);
+  Real non_empty_elts = stretchable_children_count (me);
+  Real offset = 0.0;
+  Direction dir = robust_scm2dir (me->get_property ("stacking-dir"), DOWN);
+  for (vsize i = 0; i < elts.size (); i++)
+    {
+      elts[i]->translate_axis (dir * offset, a);
+      if (!elts[i]->extent (me, a).is_empty ()
+         && !to_boolean (elts[i]->get_property ("keep-fixed-while-stretching")))
+       offset += amount / non_empty_elts;
+    }
+  me->flush_extent_cache (Y_AXIS);
+}
+
 Real
 Align_interface::get_pure_child_y_translation (Grob *me, Grob *ch, int start, int end)
 {
@@ -379,22 +354,59 @@ Align_interface::set_ordered (Grob *me)
   ga->set_ordered (true);
 }
 
+int
+Align_interface::stretchable_children_count (Grob const *me)
+{
+  extract_grob_set (me, "elements", elts);
+  int ret = 0;
+
+  /* start at 1: we will never move the first child while stretching */
+  for (vsize i = 1; i < elts.size (); i++)
+    if (!to_boolean (elts[i]->get_property ("keep-fixed-while-stretching"))
+       && !elts[i]->extent (elts[i], Y_AXIS).is_empty ())
+      ret++;
+
+  return ret;
+}
+
+MAKE_SCHEME_CALLBACK (Align_interface, calc_max_stretch, 1)
+SCM
+Align_interface::calc_max_stretch (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+  Spanner *spanner_me = dynamic_cast<Spanner*> (me);
+  Real ret = 0;
+
+  if (spanner_me && stretchable_children_count (me) > 0)
+    {
+      Paper_column *left = dynamic_cast<Paper_column*> (spanner_me->get_bound (LEFT));
+      Real height = me->extent (me, Y_AXIS).length ();
+      SCM line_break_details = left->get_property ("line-break-system-details");
+      SCM fixed_offsets = scm_assq (ly_symbol2scm ("alignment-offsets"),
+                                   line_break_details);
+
+      /* if there are fixed offsets, we refuse to stretch */
+      if (fixed_offsets != SCM_BOOL_F)
+       ret = 0;
+      else
+       ret = height * height / 80.0; /* why this, exactly? -- jneem */
+    }
+  return scm_from_double (ret);
+}
+
 /*
   Find Y-axis parent of G that has a #'forced-distance property. This
   has the effect of finding the piano-staff given an object in that
   piano staff.
+
+  FIXME: piano staves no longer have forced-distance. The code that
+  relies on this function (in line-spanner) is broken.
 */
 Grob *
 find_fixed_alignment_parent (Grob *g)
 {
-  while (g)
-    {
-      if (scm_is_number (g->get_property ("forced-distance")))
-       return g;
-
-      g = g->get_parent (Y_AXIS);
-    }
-
+  (void) g;
+  programming_error ("deprecated. We don't use forced-distance anymore");
   return 0;
 }
 
@@ -414,7 +426,6 @@ ADD_INTERFACE (Align_interface,
               "align-dir "
               "axes "
               "elements "
-              "forced-distance "
               "padding "
               "positioning-done "
               "stacking-dir "
index c74f9596b43ff3b2a9549631215384c7f91da9f6..793b4c58757f796f5ff6b07a4123139bf4c8c3dc 100644 (file)
@@ -26,7 +26,7 @@ LY_DEFINE (ly_font_load, "ly:font-load", 1, 0, 0,
           (SCM name),
           "Load the font @var{name}. ")
 {
-  LY_ASSERT_TYPE(scm_is_string, name, 1);
+  LY_ASSERT_TYPE (scm_is_string, name, 1);
   
   Font_metric *fm = all_fonts_global->find_font (ly_scm2string (name));
 
index e2fdcc9595cb38dcf50aa7b46155b29efe3ab705..cd5402b2a0ac50768f80209484a92dc9d435c3c6 100644 (file)
@@ -89,10 +89,7 @@ void
 Ambitus_engraver::process_music ()
 {
   /*
-   * Ensure that ambitus is created in the very first timestep (on
-   * which lily does not call start_translation_timestep ()).
-   * Otherwise, if a voice begins with a rest, the ambitus grob will
-   * be placed after the rest.
+   * Ensure that ambitus is created in the very first timestep
    */
   if (!ambitus_)
     create_ambitus ();
index 41381458f6e4f474a6d5c3167254d465c387d791..9916dd15af5cce2646ceb34cdc2164c30cc20bf0 100644 (file)
@@ -127,7 +127,7 @@ Audio_span_dynamic::render ()
 
   Real total_t = moment_to_real (dynamics_.back ()->get_column ()->when () - start);
   
-  for (vsize i = 1; i < dynamics_.size(); i ++)
+  for (vsize i = 1; i < dynamics_.size (); i ++)
     {
       Moment dt_moment = dynamics_[i]->get_column ()->when ()
        - start;
index d2cef6ae1693ecb2bd9bf8a928958b9978a7fb4a..481625606fa2056cd78c7ec46d64f9a8668f2ac4 100644 (file)
@@ -27,7 +27,6 @@ class Auto_beam_engraver : public Engraver
 
 protected:
   void stop_translation_timestep ();
-  void start_translation_timestep ();
   void process_music ();
   virtual void finalize ();
   virtual void derived_mark () const;
@@ -106,6 +105,16 @@ Auto_beam_engraver::check_bar_property ()
 void
 Auto_beam_engraver::process_music ()
 {
+  /*
+    don't beam over skips
+  */
+  if (stems_)
+    {
+      Moment now = now_mom ();
+      if (extend_mom_ < now)
+       end_beam ();
+    }
+
   if (scm_is_string (get_property ("whichBar")))
     {
       consider_end (shortest_mom_);
@@ -185,7 +194,7 @@ Auto_beam_engraver::create_beam ()
       return 0;
 
   /*
-    Can't use make_spanner_from_properties() because we have to use
+    Can't use make_spanner_from_properties () because we have to use
     beam_settings_.
   */
   Spanner *beam = new Spanner (beam_settings_);
@@ -273,26 +282,12 @@ Auto_beam_engraver::typeset_beam ()
     }
 }
 
-void
-Auto_beam_engraver::start_translation_timestep ()
-{
-  process_acknowledged_count_ = 0;
-  /*
-    don't beam over skips
-  */
-  if (stems_)
-    {
-      Moment now = now_mom ();
-      if (extend_mom_ < now)
-       end_beam ();
-    }
-  forbid_ = 0;
-}
-
 void
 Auto_beam_engraver::stop_translation_timestep ()
 {
   typeset_beam ();
+  process_acknowledged_count_ = 0;
+  forbid_ = 0;
 }
 
 void
index 11306233be02fb1e07f2be1b6f52a9427d8a1c78..3b529ed34e8b73a662081d204ba7b2001a63dd10 100644 (file)
@@ -19,8 +19,8 @@ LY_DEFINE (ly_relative_group_extent, "ly:relative-group-extent",
   Grob_array *ga = unsmob_grob_array (elements);
 
   SCM_ASSERT_TYPE (ga || scm_is_pair (elements), elements, SCM_ARG1, __FUNCTION__, "list or Grob_array");
-  LY_ASSERT_SMOB(Grob, common, 2);
-  LY_ASSERT_TYPE(is_axis, axis, 3);
+  LY_ASSERT_SMOB (Grob, common, 2);
+  LY_ASSERT_TYPE (is_axis, axis, 3);
 
   vector<Grob*> elts;
   if (!ga)
index 23c30872474d31267c92d093122dd1be452d6a1b..9f7c25c6c44e27c34d7b1b6bf60425287183967c 100644 (file)
@@ -61,9 +61,12 @@ Axis_group_interface::relative_group_extent (vector<Grob*> const &elts,
   for (vsize i = 0; i < elts.size (); i++)
     {
       Grob *se = elts[i];
-      Interval dims = se->extent (common, a);
-      if (!dims.is_empty ())
-       r.unite (dims);
+      if (!to_boolean (se->get_property ("cross-staff")))
+       {
+         Interval dims = se->extent (common, a);
+         if (!dims.is_empty ())
+           r.unite (dims);
+       }
     }
   return r;
 }
@@ -294,7 +297,7 @@ Axis_group_interface::calc_pure_elts_and_common (Grob *me)
   return common;
 }
 
-MAKE_SCHEME_CALLBACK(Axis_group_interface,calc_x_common, 1);
+MAKE_SCHEME_CALLBACK (Axis_group_interface, calc_x_common, 1);
 SCM
 Axis_group_interface::calc_x_common (SCM grob)
 {
@@ -305,7 +308,7 @@ Axis_group_interface::calc_x_common (SCM grob)
   return common->self_scm ();
 }
 
-MAKE_SCHEME_CALLBACK(Axis_group_interface,calc_y_common, 1);
+MAKE_SCHEME_CALLBACK (Axis_group_interface, calc_y_common, 1);
 SCM
 Axis_group_interface::calc_y_common (SCM grob)
 {
@@ -355,6 +358,12 @@ staff_priority_less (Grob * const &g1, Grob * const &g2)
   else if (priority_1 > priority_2)
     return false;
 
+  /* if neither grob has an outside-staff priority, the ordering will have no
+     effect -- we just need to choose a consistent ordering. We do this to
+     avoid the side-effect of calculating extents. */
+  if (isinf (priority_1))
+    return g1 < g2;
+
   /* if there is no preference in staff priority, choose the left-most one */
   Grob *common = g1->common_refpoint (g2, X_AXIS);
   Real start_1 = g1->extent (common, X_AXIS)[LEFT];
@@ -371,7 +380,8 @@ add_boxes (Grob *me, Grob *x_common, Grob *y_common, vector<Box> *const boxes)
       for (vsize i = 0; i < elements->size (); i++)
        add_boxes (elements->grob (i), x_common, y_common, boxes);
     }
-  else if (!scm_is_number (me->get_property ("outside-staff-priority")))
+  else if (!scm_is_number (me->get_property ("outside-staff-priority"))
+          && !to_boolean (me->get_property ("cross-staff")))
     boxes->push_back (Box (me->extent (x_common, X_AXIS),
                           me->extent (y_common, Y_AXIS)));
 }
@@ -486,6 +496,21 @@ Axis_group_interface::skyline_spacing (Grob *me, vector<Grob*> elements)
   return skylines;
 }
 
+MAKE_SCHEME_CALLBACK (Axis_group_interface, calc_max_stretch, 1)
+SCM
+Axis_group_interface::calc_max_stretch (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+  Real ret = 0;
+  extract_grob_set (me, "elements", elts);
+
+  for (vsize i = 0; i < elts.size (); i++)
+    if (Axis_group_interface::has_interface (elts[i]))
+      ret += robust_scm2double (elts[i]->get_property ("max-stretch"), 0.0);
+
+  return scm_from_double (ret);
+}
+
 ADD_INTERFACE (Axis_group_interface,
 
               "An object that groups other layout objects.",
@@ -495,6 +520,8 @@ ADD_INTERFACE (Axis_group_interface,
               "Y-common "
               "axes "
               "elements "
+              "keep-fixed-while-stretching "
+              "max-stretch "
               "pure-Y-common "
               "pure-relevant-elements "
               "skylines "
index 6239b9e31c9ed0c8038368973b71f95f0bbb1d3d..b1497ef4038341109283bcd980ea8e4ab82f477e 100644 (file)
 
 class Balloon_engraver : public Engraver
 {
-  TRANSLATOR_DECLARATIONS(Balloon_engraver);
+  TRANSLATOR_DECLARATIONS (Balloon_engraver);
 
-  DECLARE_TRANSLATOR_LISTENER(annotate_output);
-  DECLARE_ACKNOWLEDGER(grob);
+  DECLARE_TRANSLATOR_LISTENER (annotate_output);
+  DECLARE_ACKNOWLEDGER (grob);
   vector<Stream_event *> events_;
 
   void stop_translation_timestep ();
@@ -77,9 +77,9 @@ Balloon_engraver::acknowledge_grob (Grob_info info)
 
 
   
-ADD_ACKNOWLEDGER(Balloon_engraver,grob);
+ADD_ACKNOWLEDGER (Balloon_engraver, grob);
   
-ADD_TRANSLATOR(Balloon_engraver,
+ADD_TRANSLATOR (Balloon_engraver,
               "Create balloon texts",
               "BalloonTextItem ",
               /*read*/ "",
index 739fffcaf77ece7a1c6fa1bcbd5a8fb78397deca..afaaad8e3713140a71835985f30cfd670c4244a6 100644 (file)
@@ -30,7 +30,7 @@ Balloon_interface::print (SCM smob)
 
   Grob *p = me->get_parent (X_AXIS);
   
-  Offset off(me->relative_coordinate (p, X_AXIS),
+  Offset off (me->relative_coordinate (p, X_AXIS),
             me->relative_coordinate (p, Y_AXIS));
 
   Box b (p->extent (p, X_AXIS),
index 75dbc6c1be36779ab174971dd9a7cafc6f46aca4..78012a55a1a5d6630416b327daa2c5ecc71fa20e 100644 (file)
@@ -201,7 +201,7 @@ Bar_line::dashed_bar_line (Grob *me, Real h, Real thick)
          Real bot_y = max ((i - dash_size) * half_space,
                            -(count-1) * half_space - line_thick/2);
 
-         bar.add_stencil (Lookup::round_filled_box (Box (Interval (0,thick),
+         bar.add_stencil (Lookup::round_filled_box (Box (Interval (0, thick),
                                                          Interval (bot_y, top_y)),
                                                     blot));
        }
@@ -234,7 +234,7 @@ Bar_line::dashed_bar_line (Grob *me, Real h, Real thick)
       s.translate (Offset (thick/2, -h/2));
       return s;
     }
-  return Stencil();
+  return Stencil ();
 }
 
 
index ecc83ac756b6bfa315c6f788897d4f1d93bd67d1..7f35901d816bd08fd5146e66e9d11cc81168d3de 100644 (file)
@@ -98,12 +98,7 @@ Bar_number_engraver::acknowledge_break_alignment (Grob_info inf)
 void
 Bar_number_engraver::stop_translation_timestep ()
 {
-  if (text_)
-    {
-      text_->set_object ("side-support-elements",
-                        grob_list_to_grob_array (get_property ("stavesFound")));
-      text_ = 0;
-    }
+  text_ = 0;
 }
 
 void
@@ -116,8 +111,8 @@ Bar_number_engraver::create_items ()
 }
 
 
-ADD_ACKNOWLEDGER(Bar_number_engraver,break_aligned);
-ADD_ACKNOWLEDGER(Bar_number_engraver,break_alignment);
+ADD_ACKNOWLEDGER (Bar_number_engraver, break_aligned);
+ADD_ACKNOWLEDGER (Bar_number_engraver, break_alignment);
 
 ADD_TRANSLATOR (Bar_number_engraver,
                /* doc */ "A bar number is created whenever measurePosition "
index 51569b0e270b6582366f4e3cf0b7bb3412a97d9f..90357c5264f0929718127e52518240d3597ac580 100644 (file)
@@ -215,7 +215,7 @@ Beam_engraver::acknowledge_rest (Grob_info info)
   if (beam_
       && !scm_is_number (info.grob ()->get_property_data ("staff-position")))
     {
-      chain_offset_callback (info.grob(),
+      chain_offset_callback (info.grob (),
                             Beam::rest_collision_callback_proc, Y_AXIS);
     }
 }
index 28492eaee14f74722599118a5f344ea4621aea3a..c1ad71198a1805e805158578899d341e72b4c155 100644 (file)
@@ -233,7 +233,7 @@ position_with_maximal_common_beams (SCM left_beaming, SCM right_beaming,
   return best_start;
 }
 
-MAKE_SCHEME_CALLBACK(Beam, calc_beaming, 1)
+MAKE_SCHEME_CALLBACK (Beam, calc_beaming, 1)
 SCM
 Beam::calc_beaming (SCM smob)
 {
@@ -405,7 +405,7 @@ Beam::get_beam_segments (Grob *me_grob, Grob **common)
          do
            {
              bool on_bound = (event_dir == LEFT) ? j == 0 :
-               j == segs.size() - 1;
+               j == segs.size () - 1;
 
              bool inside_stem = (event_dir == LEFT)
                        ? segs[j].stem_index_ > 0
@@ -459,7 +459,7 @@ Beam::get_beam_segments (Grob *me_grob, Grob **common)
              if (event_dir == RIGHT)
                {
                  segments.push_back (current);
-                 current = Beam_segment();
+                 current = Beam_segment ();
                }
            }
          while (flip (&event_dir) != LEFT);
@@ -470,7 +470,7 @@ Beam::get_beam_segments (Grob *me_grob, Grob **common)
   return segments;
 }
 
-MAKE_SCHEME_CALLBACK(Beam, print, 1);
+MAKE_SCHEME_CALLBACK (Beam, print, 1);
 SCM
 Beam::print (SCM grob)
 {
@@ -695,7 +695,7 @@ Beam::consider_auto_knees (Grob *me)
            sets stem directions, a constant shift does not have an
            influence.
          */
-         head_extents += stem->relative_coordinate (common, Y_AXIS);
+         head_extents += stem->pure_relative_y_coordinate (common, 0, INT_MAX);
 
          if (to_dir (stem->get_property_data ("direction")))
            {
@@ -790,7 +790,7 @@ set_minimum_dy (Grob *me, Real *dy)
 
   
 
-MAKE_SCHEME_CALLBACK(Beam, calc_stem_shorten, 1)
+MAKE_SCHEME_CALLBACK (Beam, calc_stem_shorten, 1)
 SCM
 Beam::calc_stem_shorten (SCM smob)
 {
@@ -974,7 +974,6 @@ Beam::shift_region_to_valid (SCM grob, SCM posns)
   Real dx = lvs->relative_coordinate (commonx, X_AXIS) - x0;
 
   Drul_array<Real> pos = ly_scm2interval (posns);
-  
 
   scale_drul (&pos, Staff_symbol_referencer::staff_space (me));
 
@@ -1152,7 +1151,7 @@ Beam::calc_stem_y (Grob *me, Grob *stem, Grob **common,
   Hmm.  At this time, beam position and slope are determined.  Maybe,
   stem directions and length should set to relative to the chord's
   position of the beam.  */
-MAKE_SCHEME_CALLBACK(Beam, set_stem_lengths, 1); 
+MAKE_SCHEME_CALLBACK (Beam, set_stem_lengths, 1); 
 SCM
 Beam::set_stem_lengths (SCM smob)
 {
@@ -1421,6 +1420,24 @@ Beam::is_knee (Grob *me)
   return knee;
 }
 
+bool
+Beam::is_cross_staff (Grob *me)
+{
+  extract_grob_set (me, "stems", stems);
+  Grob *staff_symbol = Staff_symbol_referencer::get_staff_symbol (me);
+  for (vsize i = 0; i < stems.size (); i++)
+    if (Staff_symbol_referencer::get_staff_symbol (stems[i]) != staff_symbol)
+      return true;
+  return false;
+}
+
+MAKE_SCHEME_CALLBACK (Beam, cross_staff, 1)
+SCM
+Beam::cross_staff (SCM smob)
+{
+  return scm_from_bool (is_cross_staff (unsmob_grob (smob)));
+}
+
 int
 Beam::get_direction_beam_count (Grob *me, Direction d)
 {
index ba5b8a4a72dee519ba9e1f254c61523e698cc6f7..0f6f1e1b8fa46ef192f263494ef9bdbdadd5d734 100644 (file)
@@ -125,7 +125,7 @@ Beaming_pattern::beamify (Beaming_options const &options)
     de_grace ();
 
   if (infos_[0].start_moment_ < Moment (0))
-    for (vsize i = 0; i < infos_.size(); i++)
+    for (vsize i = 0; i < infos_.size (); i++)
       infos_[i].start_moment_ += options.measure_length_;
   
   Moment measure_pos (0);
@@ -134,7 +134,7 @@ Beaming_pattern::beamify (Beaming_options const &options)
   vector<Moment> beat_starts;
 
   SCM grouping = options.grouping_;
-  while (measure_pos <= infos_.back().start_moment_)
+  while (measure_pos <= infos_.back ().start_moment_)
     {
       int count = 2;
       if (scm_is_pair (grouping))
@@ -153,9 +153,9 @@ Beaming_pattern::beamify (Beaming_options const &options)
    
   vsize j = 0;
   vsize k = 0;
-  for (vsize i = 0; i  < infos_.size(); i++)
+  for (vsize i = 0; i  < infos_.size (); i++)
     {
-      while (j + 1 < group_starts.size()
+      while (j + 1 < group_starts.size ()
             && group_starts[j+1] <= infos_[i].start_moment_)
        j++;
 
@@ -163,11 +163,11 @@ Beaming_pattern::beamify (Beaming_options const &options)
        infos_[i].group_start_ = group_starts[j];
       
       infos_[i].beat_length_ = options.beat_length_;  
-      while (k + 1 < beat_starts.size() 
+      while (k + 1 < beat_starts.size () 
             && beat_starts[k+1] <= infos_[i].start_moment_)
        k++;
 
-      if (k < beat_starts.size())
+      if (k < beat_starts.size ())
        infos_[i].beat_start_ = beat_starts[k];
     }
   
index ccb27d58ea7f76e61cb1f4e00d3718d2821d12e6..1e3bb2f517ba0de936371345ae873cf5015ab0cd 100644 (file)
@@ -63,27 +63,27 @@ slur_height (Real width, Real h_inf, Real r_0)
   slurs.  For large slurs, this gives a certain hookiness at the end,
   so we increase the indent.
 
-  indent = G(w)
+  indent = G (w)
 
-  w -> 0,  G(w) -> .33 w
+  w -> 0,  G (w) -> .33 w
 
 
   (due to derivative constraints, we cannot have indent > len/3)
 
-  w -> inf, G(w) -> 2*h_inf
+  w -> inf, G (w) -> 2*h_inf
 
   i.e.
 
 
-  G(0) = 0 , G'(0) 1/3, G(infty) = 2h_inf
+  G (0) = 0 , G'(0) 1/3, G (infty) = 2h_inf
 
   solve from
 
-  G(w) = r  + p/(w+q)
+  G (w) = r  + p/(w+q)
 
   yields
 
-  G(w) = 2 h_inf - max_fraction * q^2/ (w + q)
+  G (w) = 2 h_inf - max_fraction * q^2/ (w + q)
 
   with q = 2 h_inf
 */
index 1808821029595f95bd707a31d9aff26ef087984f..1eaf041b886e8c782efdd802301b0f2ebf78a60a 100644 (file)
@@ -117,7 +117,7 @@ Bezier::curve_point (Real t) const
 }
 
 /*
-  Cache binom(3,j) t^j (1-t)^{3-j}
+  Cache binom (3, j) t^j (1-t)^{3-j}
 */
 struct Polynomial_cache {
   Polynomial terms_[4];
index 516ad6fbe40f2705e235826ec84f4b5de2dbafdc..7bb9ba0c6b15a3347701e1a5a72caff015b6995d 100644 (file)
@@ -46,9 +46,9 @@ LY_DEFINE (ly_book_process, "ly:book-process",
 {
   Book *book = unsmob_book (book_smob);
 
-  LY_ASSERT_SMOB(Book, book_smob, 1);
-  LY_ASSERT_SMOB(Output_def, default_paper, 2);
-  LY_ASSERT_SMOB(Output_def, default_layout, 3);
+  LY_ASSERT_SMOB (Book, book_smob, 1);
+  LY_ASSERT_SMOB (Output_def, default_paper, 2);
+  LY_ASSERT_SMOB (Output_def, default_layout, 3);
 
   Paper_book *pb = book->process (unsmob_output_def (default_paper),
                                  unsmob_output_def (default_layout));
@@ -73,8 +73,8 @@ LY_DEFINE (ly_book_process_to_systems, "ly:book-process-to-systems",
           "output).")
 {
   LY_ASSERT_SMOB (Book, book_smob, 1);
-  LY_ASSERT_SMOB(Output_def, default_paper, 2);
-  LY_ASSERT_SMOB(Output_def, default_layout, 3);
+  LY_ASSERT_SMOB (Output_def, default_paper, 2);
+  LY_ASSERT_SMOB (Output_def, default_layout, 3);
 
   Book *book = unsmob_book (book_smob); 
 
index 01e52ce9cdce87151b731a9301e653813a399af1..bf28d1b57dba46edf8673dac9096578c8e7b0853 100644 (file)
@@ -60,7 +60,7 @@ Book::Book (Book const &s)
       Score *newscore = unsmob_score (scm_car (p))->clone ();
 
       *t = scm_cons (newscore->self_scm (), SCM_EOL);
-      t = SCM_CDRLOC(*t);
+      t = SCM_CDRLOC (*t);
       newscore->unprotect ();
     }
 }
index c2c335434962a6e7b32d268580c276d7701bc5ea..4a2ab62cb73868a083a66170198ad339a953bb84 100644 (file)
@@ -86,7 +86,7 @@ Break_alignment_interface::add_element (Grob *me, Grob *toadd)
   Align_interface::add_element (me, toadd);
 }
 
-MAKE_SCHEME_CALLBACK(Break_alignment_interface, calc_positioning_done, 1)
+MAKE_SCHEME_CALLBACK (Break_alignment_interface, calc_positioning_done, 1)
 SCM
 Break_alignment_interface::calc_positioning_done (SCM smob)
 {
@@ -259,7 +259,7 @@ Break_alignment_interface::calc_positioning_done (SCM smob)
 
 
 
-MAKE_SCHEME_CALLBACK(Break_alignable_interface, self_align_callback, 1)
+MAKE_SCHEME_CALLBACK (Break_alignable_interface, self_align_callback, 1)
 SCM
 Break_alignable_interface::self_align_callback (SCM grob)
 {
@@ -291,7 +291,7 @@ Break_alignable_interface::self_align_callback (SCM grob)
     }  
 
   Direction which_edge = LEFT;
-  if (vsize (last_idx_found + 1) < elements.size())
+  if (vsize (last_idx_found + 1) < elements.size ())
     last_idx_found ++;
   else
     which_edge = RIGHT;
index 54b45ab862b91b8b8ee84a7b4b8832af976a8037..7a84195493df6efd7e3dedbe4562e0e168fb4c49 100644 (file)
@@ -204,7 +204,7 @@ struct Cluster_beacon
 {
 public:
   DECLARE_SCHEME_CALLBACK (height, (SCM));
-  DECLARE_GROB_INTERFACE();
+  DECLARE_GROB_INTERFACE ();
 };
 
 MAKE_SCHEME_CALLBACK (Cluster_beacon, height, 1);
index a4f3ac4b57a286d514518cb62bbe448f723fc80e..714f8ce6eed9dc5332489d3513918fe03f591121 100644 (file)
 #include "warn.hh"
 
 /*
-  We use the following optimal substructure. Let W(A) be our weight function.
+  We use the following optimal substructure. Let W (A) be our weight function.
 
-  Let A_{k,n} = (a_{k,n,1}, ... a_{k,n,k}) be the optimal set of line breaks
-  for k systems and n potential breakpoints. a_{k,n,k} = n (it is the end of
+  Let A_{k, n} = (a_{k, n,1}, ... a_{k, n, k}) be the optimal set of line breaks
+  for k systems and n potential breakpoints. a_{k, n, k} = n (it is the end of
   the piece)
 
   Then A_{k+1, m} is contructed from
-  min_ {k < j < m} ( W(A_{k,j} :: m) )
+  min_ {k < j < m} ( W (A_{k, j} :: m) )
   where by A::m we denote appending m to the list A
 
   Indices in the code:
 
   The above algorithm makes it easy to end at a point before the end of the
-  score (just find A_{k,m} for some m < breaks_.size () - 1). However, we must
+  score (just find A_{k, m} for some m < breaks_.size () - 1). However, we must
   add information for starting at a point after the beginning. One constructor
   allows the specification of a list of starting columns, start_. We then have
   start_.size () different solution arrays. state_[i] is the array for the
        .         .         .     .
        .         .         .       .
   where the X's mark invalid solutions (can't have more systems than
-  breakpoints). Note that each value is of the form a_{x,n,x}. This is because
-  a breakpoint of the form a_{x,n,x-1} will also be called a_{x-1,m,x-1} for
+  breakpoints). Note that each value is of the form a_{x, n, x}. This is because
+  a breakpoint of the form a_{x, n, x-1} will also be called a_{x-1, m, x-1} for
   some m < n. Each cell in the array stores the value of its m (ie. the
   ending breakpoint of the previous line) as "prev_".
 
-  For finding A_{sys, brk}, let "me" be the (sys_count,brk) cell in our
+  For finding A_{sys, brk}, let "me" be the (sys_count, brk) cell in our
   solution array (state_[start][sys * rank + brk]).
 
   Then A_{sys, brk} = A_{sys - 1, me.prev_} :: me
@@ -109,15 +109,6 @@ Constrained_breaking::calc_subproblem (vsize start, vsize sys, vsize brk)
   return found_something;
 }
 
-vector<Column_x_positions>
-Constrained_breaking::solve ()
-{
-  if (!systems_)
-    return get_best_solution (0, VPOS);
-
-  resize (systems_);
-  return get_solution(0, VPOS, systems_);
-}
 
 Column_x_positions
 Constrained_breaking::space_line (vsize i, vsize j)
@@ -127,7 +118,7 @@ Constrained_breaking::space_line (vsize i, vsize j)
   Column_x_positions col;
 
   vector<Grob*> line (all_.begin () + breaks_[i],
-                     all_.begin() + breaks_[j] + 1);
+                     all_.begin () + breaks_[j] + 1);
   Interval line_dims = line_dimensions_int (pscore_->layout (), i);
   bool last = j == breaks_.size () - 1;
   bool ragged = ragged_right || (last && ragged_last);
@@ -156,7 +147,7 @@ Constrained_breaking::resize (vsize systems)
 }
 
 vector<Column_x_positions>
-Constrained_breaking::get_solution (vsize start, vsize end, vsize sys_count)
+Constrained_breaking::solve (vsize start, vsize end, vsize sys_count)
 {
   vsize start_brk = starting_breakpoints_[start];
   vsize end_brk = prepare_solution (start, end, sys_count);
@@ -190,16 +181,16 @@ Constrained_breaking::get_solution (vsize start, vsize end, vsize sys_count)
         }
     }
   /* if we get to here, just put everything on one line */
-  warning (_ ("cannot find line breaking that satisfies constraints" ));
+  warning (_ ("cannot find line breaking that satisfies constraints"));
   ret.push_back (space_line (0, end_brk));
   return ret;
 }
 
 vector<Column_x_positions>
-Constrained_breaking::get_best_solution (vsize start, vsize end)
+Constrained_breaking::best_solution (vsize start, vsize end)
 {
-  vsize min_systems =  get_min_systems (start, end);
-  vsize max_systems = get_max_systems (start, end);
+  vsize min_systems =  min_system_count (start, end);
+  vsize max_systems = max_system_count (start, end);
   Real best_demerits = infinity_f;
   vector<Column_x_positions> best_so_far;
 
@@ -211,11 +202,11 @@ Constrained_breaking::get_best_solution (vsize start, vsize end)
       if (dem < best_demerits)
        {
          best_demerits = dem;
-         best_so_far = get_solution (start, end, i);
+         best_so_far = solve (start, end, i);
        }
       else
        {
-         vector<Column_x_positions> cur = get_solution (start, end, i);
+         vector<Column_x_positions> cur = solve (start, end, i);
          bool too_many_lines = true;
          
          for (vsize j = 0; j < cur.size (); j++)
@@ -230,11 +221,11 @@ Constrained_breaking::get_best_solution (vsize start, vsize end)
     }
   if (best_so_far.size ())
     return best_so_far;
-  return get_solution (start, end, max_systems);
+  return solve (start, end, max_systems);
 }
 
 std::vector<Line_details>
-Constrained_breaking::get_details (vsize start, vsize end, vsize sys_count)
+Constrained_breaking::line_details (vsize start, vsize end, vsize sys_count)
 {
   vsize brk = prepare_solution (start, end, sys_count);
   Matrix<Constrained_break_node> const &st = state_[start];
@@ -250,7 +241,7 @@ Constrained_breaking::get_details (vsize start, vsize end, vsize sys_count)
 }
 
 int
-Constrained_breaking::get_min_systems (vsize start, vsize end)
+Constrained_breaking::min_system_count (vsize start, vsize end)
 {
   vsize sys_count;
   vsize brk = prepare_solution (start, end, 1);
@@ -272,7 +263,7 @@ Constrained_breaking::get_min_systems (vsize start, vsize end)
 }
 
 int
-Constrained_breaking::get_max_systems (vsize start, vsize end)
+Constrained_breaking::max_system_count (vsize start, vsize end)
 {
   vsize brk = (end >= start_.size ()) ? breaks_.size () : starting_breakpoints_[end];
   return brk - starting_breakpoints_[start];
@@ -352,7 +343,7 @@ Constrained_breaking::initialize ()
 
          line.force_ = forces[i*breaks_.size () + j];
          if (ragged && last && !isinf (line.force_))
-           line.force_ = 0;
+           line.force_ = (line.force_ < 0) ? infinity_f : 0;
          if (isinf (line.force_))
            break;
 
index a5c13305d42f574c48e561cb6c81c601c4ec9867..f4023a09a110833cb56ad13f83d8c2dbf75a4059 100644 (file)
@@ -87,7 +87,7 @@ Context_def::print_smob (SCM smob, SCM port, scm_print_state*)
 SCM
 Context_def::mark_smob (SCM smob)
 {
-  ASSERT_LIVE_IS_ALLOWED();
+  ASSERT_LIVE_IS_ALLOWED ();
   
   Context_def *me = (Context_def *) SCM_CELL_WORD_1 (smob);
 
index d2210b3e104501becfb5c17dd3cf4121f9a51e67..bc7016babb89df2927b1ae088ee1702a52c9870a 100644 (file)
@@ -144,7 +144,7 @@ execute_general_pushpop_property (Context *context,
 
          /*
            tack onto alist.  We can use set_car, since
-           updated_grob_properties() in child contexts will check
+           updated_grob_properties () in child contexts will check
            for changes in the car.
          */
          if (ok)
index 30a876f36d3fbc44f89b64e3bd04109447d460c3..4ff48155e3877de14239337a36ccbbc3eba1e66c 100644 (file)
@@ -45,7 +45,7 @@ LY_DEFINE (ly_context_grob_definition, "ly:context-grob-definition",
   Context *tr = unsmob_context (context);
   
   LY_ASSERT_SMOB (Context, context, 1);
-  LY_ASSERT_TYPE(ly_is_symbol, name, 2);
+  LY_ASSERT_TYPE (ly_is_symbol, name, 2);
 
   return updated_grob_properties (tr, name);
 }
@@ -60,8 +60,8 @@ LY_DEFINE (ly_context_pushpop_property, "ly:context-pushpop-property",
   Context *tg = unsmob_context (context);
 
   LY_ASSERT_SMOB (Context, context, 1);
-  LY_ASSERT_TYPE(ly_is_symbol, grob, 2);
-  LY_ASSERT_TYPE(ly_is_symbol, eltprop, 3);
+  LY_ASSERT_TYPE (ly_is_symbol, grob, 2);
+  LY_ASSERT_TYPE (ly_is_symbol, eltprop, 3);
 
   execute_pushpop_property (tg, grob, eltprop, val);
 
@@ -73,7 +73,7 @@ LY_DEFINE (ly_context_property, "ly:context-property",
           "Return the value of @var{name} from context @var{c}")
 {
   LY_ASSERT_SMOB (Context, c, 1);
-  LY_ASSERT_TYPE(ly_is_symbol, name, 2);
+  LY_ASSERT_TYPE (ly_is_symbol, name, 2);
 
   Context *t = unsmob_context (c);
   return t->internal_get_property (name);
@@ -85,7 +85,7 @@ LY_DEFINE (ly_context_set_property_x, "ly:context-set-property!",
           "to @var{val}.")
 {
   LY_ASSERT_SMOB (Context, context, 1);
-  LY_ASSERT_TYPE(ly_is_symbol, name, 2);
+  LY_ASSERT_TYPE (ly_is_symbol, name, 2);
 
   Context *tr = unsmob_context (context);
 
@@ -100,7 +100,7 @@ LY_DEFINE (ly_context_property_where_defined, "ly:context-property-where-defined
           "where @var{name} is defined.")
 {
   LY_ASSERT_SMOB (Context, context, 1);
-  LY_ASSERT_TYPE(ly_is_symbol,name, 2);
+  LY_ASSERT_TYPE (ly_is_symbol, name, 2);
   
   Context *tr = unsmob_context (context);
 
@@ -117,7 +117,7 @@ LY_DEFINE (ly_context_unset_property, "ly:context-unset-property", 2, 0, 0,
           "Unset value of property @var{name} in context @var{context}.")
 {
   LY_ASSERT_SMOB (Context, context, 1);
-  LY_ASSERT_TYPE(ly_is_symbol,name, 2);
+  LY_ASSERT_TYPE (ly_is_symbol, name, 2);
   Context *tr = unsmob_context (context);
   
   tr->unset_property (name);
@@ -145,7 +145,7 @@ LY_DEFINE (ly_context_find, "ly:context-find",
           "Return @code{#f} if not found.")
 {
   LY_ASSERT_SMOB (Context, context, 1);
-  LY_ASSERT_TYPE(ly_is_symbol,name, 2);
+  LY_ASSERT_TYPE (ly_is_symbol, name, 2);
   Context *tr = unsmob_context (context);
 
   while (tr)
index fc4f35d666d11a6d55d38ee4084db131abd35e96..38f5549141d0c86780ceb8e423bfb5963dde3f78 100644 (file)
@@ -32,7 +32,7 @@ Context_specced_music_iterator::construct_children ()
 
   Context *a = 0;
 
-  if (to_boolean (get_music()->get_property ("create-new")))
+  if (to_boolean (get_music ()->get_property ("create-new")))
     a = get_outlet ()->create_unique_context (ct, c_id, ops);
   else
     a = get_outlet ()->find_create_context (ct, c_id, ops);
index 3583d48c5e70d624cdec6646f1294e9850987bd2..3275b467d531006f06bec4223b46aa1e9bc3211d 100644 (file)
@@ -15,7 +15,7 @@ class Control_track_performer : public Performer
   vector<Audio_item*> texts_;
 
   void add_text (Audio_text::Type, string);
-  TRANSLATOR_DECLARATIONS(Control_track_performer);
+  TRANSLATOR_DECLARATIONS (Control_track_performer);
 protected:
 
   virtual void initialize ();
index 00c52aca59b3a2989ac71b2e80f4291176376cb2..e467064bf417080c6d364b55cf01a22982eaf673 100644 (file)
@@ -23,7 +23,7 @@ LY_DEFINE (ly_connect_dispatchers, "ly:connect-dispatchers",
   Dispatcher *f = unsmob_dispatcher (from);
   
   LY_ASSERT_SMOB (Dispatcher, to, 1); 
-  LY_ASSERT_SMOB(Dispatcher, from,  2); 
+  LY_ASSERT_SMOB (Dispatcher, from,  2); 
 
   t->register_as_listener (f);
 
@@ -39,7 +39,7 @@ LY_DEFINE (ly_add_listener, "ly:add-listener",
   Dispatcher *d = unsmob_dispatcher (disp);
 
   LY_ASSERT_SMOB (Listener, list, 1); 
-  LY_ASSERT_SMOB(Dispatcher, disp, 2); 
+  LY_ASSERT_SMOB (Dispatcher, disp, 2); 
   
   for (int arg = SCM_ARG3; scm_is_pair (cl); cl = scm_cdr (cl), arg++)
     {
@@ -61,7 +61,7 @@ LY_DEFINE (ly_broadcast, "ly:broadcast",
  
   LY_ASSERT_SMOB (Dispatcher, disp, 1);
 
-  LY_ASSERT_SMOB(Stream_event, ev, 2); 
+  LY_ASSERT_SMOB (Stream_event, ev, 2); 
   d->broadcast (e);
   return SCM_UNDEFINED;
 }
index 6107594900b678e8a63d2c140ebfe1b3c3176300..64062139b0d133ce598da861aefb9fc3b100ec96 100644 (file)
@@ -100,10 +100,10 @@ Dispatcher::dispatch (SCM sev)
   */
   struct { int prio; SCM list; } lists[num_classes+1];
   int i = 0;
-  for (SCM cl = class_list; scm_is_pair(cl); cl = scm_cdr (cl))
+  for (SCM cl = class_list; scm_is_pair (cl); cl = scm_cdr (cl))
     {
       SCM list = scm_hashq_ref (listeners_, scm_car (cl), SCM_EOL);
-      if (!scm_is_pair(list))
+      if (!scm_is_pair (list))
        num_classes--;
       else
        {
@@ -141,9 +141,9 @@ Dispatcher::dispatch (SCM sev)
         }
       // go to the next listener; bubble-sort the class list.
       SCM next = scm_cdr (lists[0].list);
-      if (!scm_is_pair(next))
+      if (!scm_is_pair (next))
         num_classes--;
-      int prio = (scm_is_pair(next)) ? scm_to_int (scm_caar (next)) : INT_MAX;
+      int prio = (scm_is_pair (next)) ? scm_to_int (scm_caar (next)) : INT_MAX;
       for (i = 0; prio > lists[i+1].prio; i++)
         lists[i] = lists[i+1];
       lists[i].prio = prio;
@@ -176,7 +176,7 @@ Dispatcher::internal_add_listener (Listener l, SCM ev_class, int priority)
     {
       /* Tell all dispatchers that we listen to, that we want to hear ev_class 
          events */
-      for (SCM disp = dispatchers_; scm_is_pair(disp); disp = scm_cdr (disp))
+      for (SCM disp = dispatchers_; scm_is_pair (disp); disp = scm_cdr (disp))
        {
          int priority = scm_to_int (scm_cdar (disp));
          Dispatcher *d = unsmob_dispatcher (scm_caar (disp));
@@ -205,10 +205,10 @@ Dispatcher::remove_listener (Listener l, SCM ev_class)
 
   SCM dummy = scm_cons (SCM_EOL, list);
   SCM e = dummy;
-  while (scm_is_pair(scm_cdr (e)))
+  while (scm_is_pair (scm_cdr (e)))
     if (*unsmob_listener (scm_cdadr (e)) == l && first)
       {
-       scm_set_cdr_x (e, scm_cddr(e));
+       scm_set_cdr_x (e, scm_cddr (e));
        first = false;
        break;
       }
index b2ff0308fac19b82bd251167a4255d2698e9bcb0..3c1eff6c60dfc3815675eb35926aacfe61d0f94d 100644 (file)
@@ -208,7 +208,7 @@ remove_collision (Dot_configuration &cfg, int p)
     }
 }
 
-MAKE_SCHEME_CALLBACK(Dot_column, calc_positioning_done, 1);
+MAKE_SCHEME_CALLBACK (Dot_column, calc_positioning_done, 1);
 SCM
 Dot_column::calc_positioning_done (SCM smob)
 {
index 16a5b0a29052added4ee785540438be093ed4f90..b59a8d9a41d65dc3a5c1d288c8f9f310b2eb0cf6 100644 (file)
@@ -18,8 +18,8 @@
 
 class Dots_engraver : public Engraver 
 {
-  DECLARE_ACKNOWLEDGER(rhythmic_head);
-  TRANSLATOR_DECLARATIONS(Dots_engraver);
+  DECLARE_ACKNOWLEDGER (rhythmic_head);
+  TRANSLATOR_DECLARATIONS (Dots_engraver);
 };
 
 Dots_engraver::Dots_engraver ()
@@ -50,9 +50,9 @@ Dots_engraver::acknowledge_rhythmic_head (Grob_info gi)
 }
 
 
-ADD_ACKNOWLEDGER(Dots_engraver, rhythmic_head);
+ADD_ACKNOWLEDGER (Dots_engraver, rhythmic_head);
 
-ADD_TRANSLATOR(Dots_engraver,
+ADD_TRANSLATOR (Dots_engraver,
               "Create @ref{Dots} objects for @ref{rhythmic-head-interface}s.",
 
               /* create */
index c81fca04825bcfb2de26d93eb13ecaa646378753..a4187c187cfb83c1bb86d69e26724494be1b9bb5 100644 (file)
@@ -65,7 +65,7 @@ Drum_note_performer::process_music ()
             }
 
          Moment len = get_event_length (n);
-         if (now_mom().grace_part_)
+         if (now_mom ().grace_part_)
            {
              len.grace_part_ = len.main_part_;
              len.main_part_ = Rational (0);
index 11e6b58d0d5be3619db549045015bf1fbbc921bb..f62bba582a40ca02bcd7987e45e50ee2c31411a0 100644 (file)
@@ -27,8 +27,8 @@ LY_DEFINE (ly_duration_less_p, "ly:duration<?",
           2, 0, 0, (SCM p1, SCM p2),
           "Is @var{p1} shorter than @var{p2}?")
 {
-  LY_ASSERT_SMOB(Duration, p1, 1);
-  LY_ASSERT_SMOB(Duration, p2, 2);
+  LY_ASSERT_SMOB (Duration, p1, 1);
+  LY_ASSERT_SMOB (Duration, p2, 2);
 
   Duration *a = unsmob_duration (p1);
   Duration *b = unsmob_duration (p2);
@@ -65,7 +65,7 @@ LY_DEFINE (ly_make_duration, "ly:make-duration",
   bool compress = false;
   if (num != SCM_UNDEFINED)
     {
-      LY_ASSERT_TYPE (scm_is_number,num, 3);
+      LY_ASSERT_TYPE (scm_is_number, num, 3);
       compress = true;
     }
   else
@@ -73,7 +73,7 @@ LY_DEFINE (ly_make_duration, "ly:make-duration",
 
   if (den != SCM_UNDEFINED)
     {
-      LY_ASSERT_TYPE (scm_is_number,den, 4);
+      LY_ASSERT_TYPE (scm_is_number, den, 4);
       compress = true;
     }
   else
index fd22a33bf60f557ba73a4355310edda7708a57e1..7a5b5762789ef6f6d144d5f9f18031cbf53fb325 100644 (file)
@@ -64,10 +64,7 @@ class Dynamic_engraver : public Engraver
   void typeset_all ();
 
   TRANSLATOR_DECLARATIONS (Dynamic_engraver);
-  DECLARE_ACKNOWLEDGER (accidental);
-  DECLARE_ACKNOWLEDGER (stem_tremolo);
   DECLARE_ACKNOWLEDGER (note_column);
-  DECLARE_ACKNOWLEDGER (slur);
   DECLARE_TRANSLATOR_LISTENER (absolute_dynamic);
   DECLARE_TRANSLATOR_LISTENER (span_dynamic);
 
@@ -262,6 +259,16 @@ Dynamic_engraver::process_music ()
                  context ()->set_property ((start_type + "Text").c_str (),
                                            SCM_EOL);
                }
+
+             if (script_)
+               {
+                 set_nested_property (cresc_,
+                                      scm_list_3 (ly_symbol2scm ("attach-dir"),
+                                                  ly_symbol2scm ("left"),
+                                                  ly_symbol2scm ("bound-details")
+                                                  ),
+                                      scm_from_int (RIGHT));
+               }
            }
 
          if (script_)
@@ -395,27 +402,6 @@ Dynamic_engraver::typeset_all ()
     }
 }
 
-void
-Dynamic_engraver::acknowledge_accidental (Grob_info info)
-{
-  if (line_spanner_)
-    Side_position_interface::add_support (line_spanner_, info.grob ());
-}
-
-void
-Dynamic_engraver::acknowledge_stem_tremolo (Grob_info info)
-{
-  if (line_spanner_)
-    Side_position_interface::add_support (line_spanner_, info.grob ());
-}
-
-void
-Dynamic_engraver::acknowledge_slur (Grob_info info)
-{
-  if (line_spanner_)
-    Side_position_interface::add_support (line_spanner_, info.grob ());
-}
-
 void
 Dynamic_engraver::acknowledge_note_column (Grob_info info)
 {
@@ -454,10 +440,7 @@ Dynamic_engraver::acknowledge_note_column (Grob_info info)
     finished_cresc_->set_bound (RIGHT, info.grob ());
 }
 
-ADD_ACKNOWLEDGER (Dynamic_engraver, accidental);
 ADD_ACKNOWLEDGER (Dynamic_engraver, note_column);
-ADD_ACKNOWLEDGER (Dynamic_engraver, slur);
-ADD_ACKNOWLEDGER (Dynamic_engraver, stem_tremolo);
 
 ADD_TRANSLATOR (Dynamic_engraver,
                /* doc */
index fc85166f727718139fd783bd0ca950d2848c6f82..47abca1ead515d9d363639d3cb2f005cb0e8daf7 100644 (file)
@@ -100,7 +100,7 @@ Dynamic_performer::process_music ()
 
   if (span_events_[START])
     {
-      span_dynamic_ = new Audio_span_dynamic();
+      span_dynamic_ = new Audio_span_dynamic ();
       announce_element (Audio_element_info (span_dynamic_, span_events_[START]));
 
       span_dynamic_->grow_dir_ = grow_dir_[START];
index ef2dd18b6bd08a14bc8786dd68b7e3533e85ef89..61462de17a789f21595c3f4d1d0cfa4eb0ca04df 100644 (file)
 
 struct Enclosing_bracket
 {
-  DECLARE_GROB_INTERFACE();
+  DECLARE_GROB_INTERFACE ();
   
 public:
-  DECLARE_SCHEME_CALLBACK(print, (SCM));
-  DECLARE_SCHEME_CALLBACK(width, (SCM));
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
+  DECLARE_SCHEME_CALLBACK (width, (SCM));
 };
 
 
-ADD_INTERFACE(Enclosing_bracket,
+ADD_INTERFACE (Enclosing_bracket,
              
              "Brackets alongside bass figures.",
              
index 0158c532cd892dbcaf1635539e1695a3f57e6389..aaa2ed76250b50c2a8a0a7c9ad6859a3c37d4c9b 100644 (file)
@@ -88,7 +88,7 @@ Engraver_group::acknowledge_grobs ()
       else
        continue;
 
-      SCM acklist = scm_hashq_ref (acknowledge_hash_table_drul_[info.start_end()],
+      SCM acklist = scm_hashq_ref (acknowledge_hash_table_drul_[info.start_end ()],
                                   nm, SCM_BOOL_F);
       
       Engraver_dispatch_list *dispatch
index efbb82d05c433b299044b52c005fc8e10c353b4b..ced1f123ce2b0fd9ebefc5b62ada4b974d88d52c 100644 (file)
@@ -35,7 +35,9 @@ public:
 protected:
   DECLARE_TRANSLATOR_LISTENER (extender);
   DECLARE_ACKNOWLEDGER (lyric_syllable);
+
   virtual void finalize ();
+
   void stop_translation_timestep ();
   void process_music ();
 };
@@ -100,7 +102,8 @@ Extender_engraver::stop_translation_timestep ()
        }
       else
        {
-         if (pending_extender_)
+         if (pending_extender_
+             && !get_property ("extendersOverRests"))
            {
              completize_extender (pending_extender_);
              pending_extender_ = 0;
@@ -154,5 +157,5 @@ ADD_ACKNOWLEDGER (Extender_engraver, lyric_syllable);
 ADD_TRANSLATOR (Extender_engraver,
                /* doc */ "Create lyric extenders",
                /* create */ "LyricExtender",
-               /* read */ "",
+               /* read */ "extendersOverRests",
                /* write */ "");
index 2f97de6dac069d389ae0fd3362427138a7170d9c..16d60a5f5317ce07485489e61eaced68d9ab2a53 100644 (file)
 
 struct Figured_bass_continuation
 {
-  DECLARE_GROB_INTERFACE();
+  DECLARE_GROB_INTERFACE ();
   
 public:
-  DECLARE_SCHEME_CALLBACK(print, (SCM));
-  DECLARE_SCHEME_CALLBACK(center_on_figures, (SCM));
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
+  DECLARE_SCHEME_CALLBACK (center_on_figures, (SCM));
 };
 
 MAKE_SCHEME_CALLBACK (Figured_bass_continuation, center_on_figures, 1);
@@ -80,7 +80,7 @@ Figured_bass_continuation::print (SCM grob)
   return extender.smobbed_copy ();
 }
 
-ADD_INTERFACE(Figured_bass_continuation,
+ADD_INTERFACE (Figured_bass_continuation,
              "Simple extender line between bounds.",
              
              /* props */
index 5fe9624041c428109284624d048d73f217c3c476..29185bc2c847f1e907b63f4ef32d8b7f755e9e92 100644 (file)
@@ -57,8 +57,8 @@ struct Figure_group
 
 struct Figured_bass_engraver : public Engraver
 {
-  TRANSLATOR_DECLARATIONS(Figured_bass_engraver);
-  void clear_spanners();
+  TRANSLATOR_DECLARATIONS (Figured_bass_engraver);
+  void clear_spanners ();
   void add_brackets ();
   void create_grobs ();
 
@@ -144,7 +144,7 @@ Figured_bass_engraver::listen_rest (Stream_event *ev)
       new_event_found_ = true;
 
       /*
-       No ASSIGN_EVENT_ONCE() ; otherwise we get warnings about
+       No ASSIGN_EVENT_ONCE () ; otherwise we get warnings about
        polyphonic rests.
        */
       rest_event_ = ev;
@@ -184,13 +184,13 @@ Figured_bass_engraver::center_continuations (vector<Spanner*> const &consecutive
   if (consecutive_lines.size () == 2)
     {
       vector<Grob*> left_figs;
-      for (vsize j = consecutive_lines.size(); j--;)
+      for (vsize j = consecutive_lines.size (); j--;)
        left_figs.push_back (consecutive_lines[j]->get_bound (LEFT));
 
       SCM  ga = Grob_array::make_array ();
       unsmob_grob_array (ga)->set_array (left_figs);
 
-      for (vsize j = consecutive_lines.size(); j--;)
+      for (vsize j = consecutive_lines.size (); j--;)
        consecutive_lines[j]->set_object ("figures",
                                          unsmob_grob_array (ga)->smobbed_copy ());
     }
@@ -200,14 +200,14 @@ void
 Figured_bass_engraver::center_repeated_continuations ()
 {  
   vector<Spanner*> consecutive_lines;
-  for (vsize i = 0; i <= groups_.size(); i++)
+  for (vsize i = 0; i <= groups_.size (); i++)
     {
       if (i < groups_.size ()
          && groups_[i].continuation_line_
          && (consecutive_lines.empty ()
-             || (consecutive_lines[0]->get_bound(LEFT)->get_column ()
+             || (consecutive_lines[0]->get_bound (LEFT)->get_column ()
                  == groups_[i].continuation_line_->get_bound (LEFT)->get_column ()
-                 && consecutive_lines[0]->get_bound(RIGHT)->get_column ()
+                 && consecutive_lines[0]->get_bound (RIGHT)->get_column ()
                  == groups_[i].continuation_line_->get_bound (RIGHT)->get_column ())))
        consecutive_lines.push_back (groups_[i].continuation_line_);      
       else 
@@ -231,7 +231,7 @@ Figured_bass_engraver::clear_spanners ()
     }
 
   if (to_boolean (get_property ("figuredBassCenterContinuations")))
-    center_repeated_continuations();
+    center_repeated_continuations ();
   
   for (vsize i = 0; i < groups_.size (); i++)
     {
@@ -354,7 +354,7 @@ Figured_bass_engraver::process_music ()
   if (use_extenders)
     {
       vector<int> junk_continuations;
-      for (vsize i = 0; i < groups_.size(); i++)
+      for (vsize i = 0; i < groups_.size (); i++)
        {
          Figure_group &group = groups_[i];
 
@@ -389,7 +389,7 @@ Figured_bass_engraver::process_music ()
        {
          for (vsize i = 0; i <= junk_continuations.size (); i++)
            {
-             if (i < junk_continuations.size()
+             if (i < junk_continuations.size ()
                  && (i == 0 || junk_continuations[i-1] == junk_continuations[i] - 1))
                consecutive.push_back (groups_[junk_continuations[i]].continuation_line_);
              else 
@@ -421,7 +421,7 @@ Figured_bass_engraver::create_grobs ()
   alignment_->set_bound (RIGHT, muscol);
 
   SCM proc = get_property ("figuredBassFormatter");
-  for (vsize i = 0; i < groups_.size(); i++)
+  for (vsize i = 0; i < groups_.size (); i++)
     {
       Figure_group &group = groups_[i];
       
index a3ed1528f9592d462e06682955dbbb99d02a6644..ced3f7ef6e97787e445bd68e082d7dca2cec2003 100644 (file)
@@ -18,7 +18,7 @@
 
 class Figured_bass_position_engraver : public Engraver
 {
-  TRANSLATOR_DECLARATIONS(Figured_bass_position_engraver);
+  TRANSLATOR_DECLARATIONS (Figured_bass_position_engraver);
 
   Spanner *bass_figure_alignment_;
   Spanner *positioner_;
@@ -49,7 +49,7 @@ Figured_bass_position_engraver::start_spanner ()
 {
   assert (!positioner_);
 
-  positioner_ = make_spanner("BassFigureAlignmentPositioning", bass_figure_alignment_->self_scm ());
+  positioner_ = make_spanner ("BassFigureAlignmentPositioning", bass_figure_alignment_->self_scm ());
   positioner_->set_bound (LEFT, bass_figure_alignment_->get_bound (LEFT));
   Axis_group_interface::add_element (positioner_, bass_figure_alignment_);
 }
@@ -129,13 +129,13 @@ Figured_bass_position_engraver::acknowledge_bass_figure_alignment (Grob_info inf
 }
 
 
-ADD_ACKNOWLEDGER(Figured_bass_position_engraver,note_column);
-ADD_ACKNOWLEDGER(Figured_bass_position_engraver,slur);
-ADD_END_ACKNOWLEDGER(Figured_bass_position_engraver,slur);
+ADD_ACKNOWLEDGER (Figured_bass_position_engraver, note_column);
+ADD_ACKNOWLEDGER (Figured_bass_position_engraver, slur);
+ADD_END_ACKNOWLEDGER (Figured_bass_position_engraver, slur);
 
-ADD_ACKNOWLEDGER(Figured_bass_position_engraver,tie);
-ADD_ACKNOWLEDGER(Figured_bass_position_engraver,bass_figure_alignment);
-ADD_END_ACKNOWLEDGER(Figured_bass_position_engraver,bass_figure_alignment);
+ADD_ACKNOWLEDGER (Figured_bass_position_engraver, tie);
+ADD_ACKNOWLEDGER (Figured_bass_position_engraver, bass_figure_alignment);
+ADD_END_ACKNOWLEDGER (Figured_bass_position_engraver, bass_figure_alignment);
 
 ADD_TRANSLATOR (Figured_bass_position_engraver,
                /* doc */
index 2521d9717597860e7c63c10999c763a187800e5c..3f6939c1ff191228ae01d72c3407cd8ae6ee36da 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  file-name-map.cc --  implement map_file_name()
+  file-name-map.cc --  implement map_file_name ()
 
   source file of the GNU LilyPond music typesetter
 
index 5fa68f862c094f697b7a29cd031c245830901482..6ccc616793addc2e73ed3e30c7be7655393e6ad6 100644 (file)
@@ -55,9 +55,9 @@ string
 display_config (FcConfig *fcc)
 {
   string retval;
-  retval += display_strlist ("Config files", FcConfigGetConfigFiles(fcc));
-  retval +=  display_strlist ("Config dir", FcConfigGetConfigDirs(fcc));
-  retval +=  display_strlist ("Font dir", FcConfigGetFontDirs(fcc));
+  retval += display_strlist ("Config files", FcConfigGetConfigFiles (fcc));
+  retval +=  display_strlist ("Config dir", FcConfigGetConfigDirs (fcc));
+  retval +=  display_strlist ("Font dir", FcConfigGetFontDirs (fcc));
   return retval;
 }
 
@@ -96,7 +96,7 @@ LY_DEFINE (ly_font_config_get_font_file, "ly:font-config-get-font-file", 1, 0, 0
   
   val.type = FcTypeString;
   val.u.s = (const FcChar8*)ly_scm2string (name).c_str (); // FC_SLANT_ITALIC;
-  FcPatternAdd(pat, FC_FAMILY, val, FcFalse);
+  FcPatternAdd (pat, FC_FAMILY, val, FcFalse);
 
   FcResult result;
   SCM scm_result = SCM_BOOL_F;
@@ -104,7 +104,7 @@ LY_DEFINE (ly_font_config_get_font_file, "ly:font-config-get-font-file", 1, 0, 0
   FcConfigSubstitute (NULL, pat, FcMatchFont);
   FcDefaultSubstitute (pat);
   
-  pat = FcFontMatch(NULL, pat, &result);
+  pat = FcFontMatch (NULL, pat, &result);
   FcChar8 *str = 0;
   if (FcPatternGetString (pat, FC_FILE, 0, &str) == FcResultMatch)
     scm_result = scm_from_locale_string ((char const*) str);
index a1e18da2c24e120efabdaa078d1916d18440ecf4..aa49a29e23ee333607ae290880c0f69165469579 100644 (file)
@@ -21,7 +21,7 @@ LY_DEFINE (ly_font_get_glyph, "ly:font-get-glyph",
 {
   Font_metric *fm = unsmob_metrics (font);
   LY_ASSERT_SMOB (Font_metric, font, 1);
-  LY_ASSERT_TYPE(scm_is_string,name, 2);
+  LY_ASSERT_TYPE (scm_is_string, name, 2);
 
   Stencil m = fm->find_by_name (ly_scm2string (name));
 
@@ -37,7 +37,7 @@ LY_DEFINE (ly_get_glyph, "ly:get-glyph",
 {
   Font_metric *fm = unsmob_metrics (font);
   LY_ASSERT_SMOB (Font_metric, font, 1);
-  LY_ASSERT_TYPE(scm_is_number, index,2);
+  LY_ASSERT_TYPE (scm_is_number, index,2);
 
   return fm->get_ascii_char_stencil (scm_to_int (index)).smobbed_copy ();
 }
@@ -49,7 +49,7 @@ LY_DEFINE (ly_font_glyph_name_to_index, "ly:font-glyph-name-to-index",
 {
   Font_metric *fm = unsmob_metrics (font);
   LY_ASSERT_SMOB (Font_metric, font, 1);
-  LY_ASSERT_TYPE(scm_is_string,name, 2);
+  LY_ASSERT_TYPE (scm_is_string, name, 2);
 
   return scm_from_int (fm->name_to_index (ly_scm2string (name)));
 }
@@ -61,7 +61,7 @@ LY_DEFINE (ly_font_index_to_charcode, "ly:font-index-to-charcode",
 {
   Font_metric *fm = unsmob_metrics (font);
   LY_ASSERT_SMOB (Font_metric, font, 1);
-  LY_ASSERT_TYPE(scm_is_integer,index, 2);
+  LY_ASSERT_TYPE (scm_is_integer, index, 2);
 
   return scm_from_unsigned_integer (fm->index_to_charcode (scm_to_int (index)));
 }
@@ -73,7 +73,7 @@ LY_DEFINE (ly_font_glyph_name_to_charcode, "ly:font-glyph-name-to-charcode",
 {
   Font_metric *fm = unsmob_metrics (font);
   LY_ASSERT_SMOB (Font_metric, font, 1);
-  LY_ASSERT_TYPE(scm_is_string,name, 2);
+  LY_ASSERT_TYPE (scm_is_string, name, 2);
 
   return scm_from_unsigned_integer (fm->index_to_charcode (fm->name_to_index (ly_scm2string (name))));
 }
@@ -90,7 +90,7 @@ LY_DEFINE (ly_text_dimension, "ly:text-dimension",
     (unsmob_metrics (font));
 
   LY_ASSERT_SMOB (Font_metric, font, 1);
-  LY_ASSERT_TYPE(scm_is_string,text, 2);
+  LY_ASSERT_TYPE (scm_is_string, text, 2);
   Stencil stc (fm->text_stencil (ly_scm2string (text)));
   return scm_cons (ly_interval2scm (stc.extent (X_AXIS)),
                   ly_interval2scm (stc.extent (Y_AXIS)));
index 683671146c350055e2793cbd7f6627afe4bb84d2..5e4c377a751b5b188a1182bbb9dd1bd85d046647 100644 (file)
@@ -10,7 +10,7 @@
 #include "freetype.hh"
 
 #undef __FTERRORS_H__                                           
-#define FT_ERRORDEF( e, v, s )  { e, s },                       
+#define FT_ERRORDEF(e, v, s)  { e, s },                       
 #define FT_ERROR_START_LIST     {                               
 #define FT_ERROR_END_LIST       { 0, 0 } };                     
                                                                          
index 38e85837c0f6397b894c3f14b29cf67b59e6c5bc..d8e4ddc33b4cc08739c38256259c2c2248014146 100644 (file)
@@ -13,10 +13,6 @@ using namespace std;
 #include "lily-guile.hh"
 #include "warn.hh"
 
-/* type predicates. */
-#include "spanner.hh"
-#include "item.hh"
-
 
 static SCM doc_hash_table;
 
@@ -49,7 +45,7 @@ ly_add_function_documentation (SCM func,
   scm_set_procedure_property_x (func, ly_symbol2scm ("documentation"),
                                ly_string2scm (s));
   SCM entry = scm_cons (ly_string2scm (varlist), ly_string2scm (doc));
-  scm_hashq_set_x (doc_hash_table, ly_symbol2scm (fname.c_str()), entry);
+  scm_hashq_set_x (doc_hash_table, ly_symbol2scm (fname.c_str ()), entry);
 }
 
 LY_DEFINE (ly_get_all_function_documentation, "ly:get-all-function-documentation",
@@ -75,38 +71,51 @@ string
 predicate_to_typename (void *ptr)
 {
   if (type_names.find (ptr) == type_names.end ())
-    return "unknown type";
+    {
+      programming_error ("Unknown type predicate");
+      return "unknown type";
+    }
   else
     return type_names[ptr];
 }
 
-static int
-arg_dir (int a, int b)
-{
-  if (&a < &b)
-    return 1;
-  else
-    return -1;
-}
-
+/* type predicates. */
+#include "spanner.hh"
+#include "item.hh"
+#include "music.hh"
+#include "music-function.hh"
+#include "performance.hh"
+#include "paper-score.hh"
+#include "global-context.hh"
+#include "input.hh"
 
-int function_argument_direction;
 void
 init_func_doc ()
 {
-  function_argument_direction = arg_dir (2,3);
+  ly_add_type_predicate ((void*) &is_direction, "direction");
+  ly_add_type_predicate ((void*) &is_music_function, "Music_function");
+  ly_add_type_predicate ((void*) &ly_is_port, "port");
+  ly_add_type_predicate ((void*) &unsmob_global_context, "Global_context");
+  ly_add_type_predicate ((void*) &unsmob_input, "Input");
+  ly_add_type_predicate ((void*) &unsmob_moment, "Moment");
+  ly_add_type_predicate ((void*) &unsmob_paper_score, "Paper_score");
+  ly_add_type_predicate ((void*) &unsmob_performance, "Performance");
 
-  ly_add_type_predicate ((void*) &scm_is_integer, "integer");
-  ly_add_type_predicate ((void*) &scm_is_bool, "boolean");
-  ly_add_type_predicate ((void*) &scm_is_pair, "pair");
+  ly_add_type_predicate ((void*) &is_axis, "axis");
   ly_add_type_predicate ((void*) &is_number_pair, "number pair");
+  ly_add_type_predicate ((void*) &ly_is_list, "list");
+  ly_add_type_predicate ((void*) &ly_is_procedure, "procedure");
+  ly_add_type_predicate ((void*) &ly_is_symbol, "symbol");
+  ly_add_type_predicate ((void*) &scm_is_bool, "boolean");
+  ly_add_type_predicate ((void*) &scm_is_integer, "integer");
   ly_add_type_predicate ((void*) &scm_is_number, "number");
+  ly_add_type_predicate ((void*) &scm_is_pair, "pair");
+  ly_add_type_predicate ((void*) &scm_is_rational, "rational");
   ly_add_type_predicate ((void*) &scm_is_string, "string");
-  ly_add_type_predicate ((void*) &ly_is_symbol, "symbol");
   ly_add_type_predicate ((void*) &scm_is_vector, "vector");
-  ly_add_type_predicate ((void*) &is_axis, "axis");
-  ly_add_type_predicate ((void*) &unsmob_spanner, "spanner");
-  ly_add_type_predicate ((void*) &unsmob_item, "item");
+  ly_add_type_predicate ((void*) &unsmob_item, "Item");
+  ly_add_type_predicate ((void*) &unsmob_music, "Music");
+  ly_add_type_predicate ((void*) &unsmob_spanner, "Spanner");
 }
 
-ADD_SCM_INIT_FUNC(func_doc, init_func_doc);
+ADD_SCM_INIT_FUNC (func_doc, init_func_doc);
index 7f741d059cf2289d85772fa2f07c6cf1e3514a50..816dfeee0abad2220c5e30bf1e6597b2bb23f9bc 100644 (file)
@@ -55,7 +55,7 @@ LY_DEFINE (ly_gulp_file, "ly:gulp-file",
   int sz = INT_MAX;
   if (size != SCM_UNDEFINED)
     {
-      LY_ASSERT_TYPE(scm_is_number,size, 2);
+      LY_ASSERT_TYPE (scm_is_number, size, 2);
       sz = scm_to_int (size);
     }
   
@@ -153,8 +153,8 @@ LY_DEFINE (ly_string_substitute, "ly:string-substitute",
           "Replace @var{a} by @var{b} in @var{s}.")
 {
   LY_ASSERT_TYPE (scm_is_string, s, 1);
-  LY_ASSERT_TYPE(scm_is_string,b, 2);
-  LY_ASSERT_TYPE(scm_is_string,s, 3);
+  LY_ASSERT_TYPE (scm_is_string, b, 2);
+  LY_ASSERT_TYPE (scm_is_string, s, 3);
 
   string ss = ly_scm2string (s);
   replace_all (ss, string (scm_i_string_chars (a)),
@@ -334,7 +334,7 @@ accumulate_symbol (void *closure, SCM key, SCM val, SCM result)
   return scm_cons (key, result);
 }
 
-LY_DEFINE(ly_hash_table_keys, "ly:hash-table-keys",
+LY_DEFINE (ly_hash_table_keys, "ly:hash-table-keys",
          1,0,0, (SCM tab),
          "return a list of keys in @var{tab}")
 {
@@ -404,7 +404,7 @@ format_single_argument (SCM arg, int precision)
          warning (_ ("Found infinity or nan in output. Substituting 0.0"));
          return ("0.0");
          if (strict_infinity_checking)
-           abort();
+           abort ();
        }
       else
        return (String_convert::form_string ("%.*lf", precision, val));
@@ -433,7 +433,7 @@ LY_DEFINE (ly_format, "ly:format",
   vector<string> results;
 
   vsize i = 0;
-  while (i < format.size())
+  while (i < format.size ())
     {
       vsize tilde = format.find ('~', i);
 
@@ -495,15 +495,15 @@ LY_DEFINE (ly_format, "ly:format",
                       + ": too many  arguments");
 
   vsize len = 0;
-  for (vsize i = 0; i < results.size(); i++)
-    len += results[i].size();
+  for (vsize i = 0; i < results.size (); i++)
+    len += results[i].size ();
   
   char *result = (char*) scm_malloc (len + 1);
   char *ptr = result;
-  for (vsize i = 0; i < results.size(); i++)
+  for (vsize i = 0; i < results.size (); i++)
     {
-      strncpy (ptr, results[i].c_str (), results[i].size());
-      ptr += results[i].size();
+      strncpy (ptr, results[i].c_str (), results[i].size ());
+      ptr += results[i].size ();
     }
   *ptr = '\0';
     
index c888487776684bc24ed9a26109d3e6f64a3c0f66..18d1d807124b61deb5e5fc848ab5776f7d1bc5f5 100644 (file)
@@ -78,7 +78,7 @@ LY_DEFINE (ly_interpret_music_expression, "ly:interpret-music-expression",
           "final state.\n")
 {
   LY_ASSERT_SMOB (Music, mus, 1);
-  LY_ASSERT_TYPE (unsmob_global_context,ctx, 2);
+  LY_ASSERT_TYPE (unsmob_global_context, ctx, 2);
 
   Music *music = unsmob_music (mus);
   if (!music
index b74b10fc51aab43d39907c8ab8455c49c2f34cfe..e01468f9f3a1d0877e4a3b8e6f78f37be1135f76 100644 (file)
@@ -29,7 +29,7 @@ LY_DEFINE (ly_grob_array_ref, "ly:grob-array-ref",
 {
   Grob_array *me = unsmob_grob_array (grob_arr);
   LY_ASSERT_SMOB (Grob_array, grob_arr, 1);
-  LY_ASSERT_TYPE(scm_is_integer,index, 2);
+  LY_ASSERT_TYPE (scm_is_integer, index, 2);
 
   vsize i = scm_to_unsigned (index);
   if (i == VPOS || i >= me->size ())
index a174d264532d4c3747bbe6d108ae3af6db960b61..3438f7b3ec3455e0ff0ad0359614b980b3834ded 100644 (file)
 
 static SCM all_ifaces;
 
-LY_DEFINE (ly_add_interface, "ly:add-interface",
-          3, 0, 0, (SCM a, SCM b, SCM c),
-          "Add an interface description.")
+void
+internal_add_interface (SCM a, SCM b, SCM c)
 {
-  LY_ASSERT_TYPE (ly_is_symbol, a, 1);
-  LY_ASSERT_TYPE(scm_is_string,b, 2);
-  LY_ASSERT_TYPE(ly_is_list,c, 3);
   if (!all_ifaces)
     {
       SCM tab = scm_c_make_hash_table (59);
@@ -28,6 +24,17 @@ LY_DEFINE (ly_add_interface, "ly:add-interface",
   SCM entry = scm_list_n (a, b, c, SCM_UNDEFINED);
 
   scm_hashq_set_x (all_ifaces, a, entry);
+}
+
+LY_DEFINE (ly_add_interface, "ly:add-interface",
+          3, 0, 0, (SCM a, SCM b, SCM c),
+          "Add an interface description.")
+{
+  LY_ASSERT_TYPE (ly_is_symbol, a, 1);
+  LY_ASSERT_TYPE (scm_is_string, b, 2);
+  LY_ASSERT_TYPE (ly_is_list, c, 3);
+
+  internal_add_interface (a,b,c);
 
   return SCM_UNSPECIFIED;
 }
index 73cf230de7603b91b47d7ac2c482abe27cc57cf8..f73d5dcd769c8fb1a4e2dc4149aaadf865050fac 100644 (file)
@@ -29,7 +29,7 @@ SCM add_interface (char const *cxx_name,
   SCM d = scm_from_locale_string (descr);
   SCM l = parse_symbol_list (vars);
 
-  ly_add_interface (s, d, l);
+  internal_add_interface (s, d, l);
 
   return s;
 }
index 1a9c61dccc603c299c3ab3e15c6ec453e144bc5d..7bf13062a59d38523ba31cf8b8da99fb8ced07e7 100644 (file)
@@ -56,7 +56,7 @@ extern void check_interfaces_for_property (Grob const *me, SCM sym);
 /*
   We can't change signatures depending on NDEBUG, since NDEBUG comes
   over the command line and may be different per .cc file.  This
-  should be done through the macro expansion of get_property().
+  should be done through the macro expansion of get_property ().
  */
 void
 Grob::internal_set_property (SCM sym, SCM v, char const *file, int line, char const *fun)
@@ -152,7 +152,7 @@ Grob::internal_get_property (SCM sym) const
   if (val == ly_symbol2scm ("calculation-in-progress"))
     programming_error (_f ("cyclic dependency: calculation-in-progress encountered for #'%s (%s)",
                           ly_symbol2string (sym).c_str (),
-                          name().c_str ()));
+                          name ().c_str ()));
 #endif
   
   if (ly_is_procedure (val)
@@ -204,7 +204,7 @@ Grob::try_callback_on_alist (SCM *alist, SCM sym, SCM proc)
          
   /*
     If the function returns SCM_UNSPECIFIED, we assume the
-    property has been set with an explicit set_property()
+    property has been set with an explicit set_property ()
     call.
   */
   if (value == SCM_UNSPECIFIED)
@@ -280,3 +280,38 @@ call_pure_function (SCM unpure, SCM args, int start, int end)
   return scm_apply_0 (scm_call_pure_function,
                      scm_list_4 (unpure, args, scm_from_int (start), scm_from_int (end)));
 }
+
+
+/*
+  PROP_PATH should be big-to-small ordering
+ */
+SCM 
+nested_property_alist (SCM alist, SCM prop_path, SCM value)
+{
+  SCM new_value = SCM_BOOL_F;
+  if (scm_is_pair (scm_cdr (prop_path)))
+    {
+      SCM sub_alist = ly_assoc_get (scm_car (prop_path), alist, SCM_EOL);
+      new_value = nested_property_alist (sub_alist, scm_cdr (prop_path), value);
+    }
+  else
+    {
+      new_value = value;
+    }
+  
+  return scm_acons (scm_car (prop_path), new_value, alist);
+}
+
+
+void
+set_nested_property (Grob *me, SCM property_path, SCM value)
+{
+  SCM big_to_small = scm_reverse (property_path);
+  SCM alist = me->get_property (scm_car (big_to_small));
+
+  alist = nested_property_alist (alist, scm_cdr (big_to_small), value);
+  
+  me->set_property (scm_car (big_to_small),
+                   alist);
+}
+
index a76797a8d2a3741de885f9b782ec5cfafe71bf8f..a2d5b66739d85acd17ed740deeca5669a781580f 100644 (file)
@@ -7,7 +7,7 @@
   Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
-#include "warn.hh"             // error()
+#include "warn.hh"             // error ()
 #include "item.hh"
 #include "output-def.hh"
 #include "system.hh"
@@ -22,7 +22,7 @@ LY_DEFINE (ly_grob_property_data, "ly:grob-property-data",
   Grob *sc = unsmob_grob (grob);
 
   LY_ASSERT_SMOB (Grob, grob, 1);
-  LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
+  LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
 
   return sc->get_property_data (sym);
 }
@@ -34,7 +34,7 @@ LY_DEFINE (ly_grob_set_property_x, "ly:grob-set-property!",
   Grob *sc = unsmob_grob (grob);
  
   LY_ASSERT_SMOB (Grob, grob, 1);
-  LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
+  LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
 
   if (!ly_is_procedure (val)
       && !type_check_assignment (sym, val, ly_symbol2scm ("backend-type?")))
@@ -54,7 +54,7 @@ LY_DEFINE (ly_grob_property, "ly:grob-property",
   Grob *sc = unsmob_grob (grob);
    
   LY_ASSERT_SMOB (Grob, grob, 1);
-  LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
+  LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
   if (deflt == SCM_UNDEFINED)
     deflt = SCM_EOL;
 
@@ -87,7 +87,7 @@ LY_DEFINE (ly_grob_object, "ly:grob-object",
   Grob *sc = unsmob_grob (grob);
    
   LY_ASSERT_SMOB (Grob, grob, 1);
-  LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
+  LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
 
   return sc->internal_get_object (sym);
 }
@@ -137,8 +137,8 @@ LY_DEFINE (ly_grob_extent, "ly:grob-extent",
   
    
   LY_ASSERT_SMOB (Grob, grob, 1);
-  LY_ASSERT_SMOB(Grob, refp, 2);
-  LY_ASSERT_TYPE(is_axis,axis, 3);
+  LY_ASSERT_SMOB (Grob, refp, 2);
+  LY_ASSERT_TYPE (is_axis, axis, 3);
 
   Axis a = Axis (scm_to_int (axis));
 
@@ -161,8 +161,8 @@ LY_DEFINE (ly_grob_robust_relative_extent, "ly:grob-robust-relative-extent",
   
    
   LY_ASSERT_SMOB (Grob, grob, 1);
-  LY_ASSERT_SMOB(Grob, refp, 2);
-  LY_ASSERT_TYPE(is_axis,axis, 3);
+  LY_ASSERT_SMOB (Grob, refp, 2);
+  LY_ASSERT_TYPE (is_axis, axis, 3);
 
   Axis a = Axis (scm_to_int (axis));
     
@@ -185,8 +185,8 @@ LY_DEFINE (ly_grob_relative_coordinate, "ly:grob-relative-coordinate",
   
    
   LY_ASSERT_SMOB (Grob, grob, 1);
-  LY_ASSERT_SMOB(Grob,refp, 2);
-  LY_ASSERT_TYPE(is_axis,axis, 3);
+  LY_ASSERT_SMOB (Grob, refp, 2);
+  LY_ASSERT_TYPE (is_axis, axis, 3);
 
   Axis a = Axis (scm_to_int (axis));
 
@@ -197,7 +197,7 @@ LY_DEFINE (ly_grob_relative_coordinate, "ly:grob-relative-coordinate",
       SCM_ASSERT_TYPE (false, refp, SCM_ARG2, __FUNCTION__, "common refpoint");
     }
 
-  return scm_from_double (sc->relative_coordinate (ref,a));
+  return scm_from_double (sc->relative_coordinate (ref, a));
 }
 
 
@@ -209,7 +209,7 @@ LY_DEFINE (ly_grob_parent, "ly:grob-parent",
   Grob *sc = unsmob_grob (grob);
    
   LY_ASSERT_SMOB (Grob, grob, 1);
-  LY_ASSERT_TYPE(is_axis,axis, 2);
+  LY_ASSERT_TYPE (is_axis, axis, 2);
 
   Grob *par = sc->get_parent (Axis (scm_to_int (axis)));
   return par ? par->self_scm () : SCM_EOL;
@@ -283,8 +283,8 @@ LY_DEFINE (ly_grob_translate_axis_x, "ly:grob-translate-axis!",
   Grob *me = unsmob_grob (grob);
    
   LY_ASSERT_SMOB (Grob, grob, 1);
-  LY_ASSERT_TYPE(scm_is_number,d, 2);
-  LY_ASSERT_TYPE(is_axis,a, 3);
+  LY_ASSERT_TYPE (scm_is_number, d, 2);
+  LY_ASSERT_TYPE (is_axis, a, 3);
 
   me->translate_axis (scm_to_double (d), Axis (scm_to_int (a)));
   return SCM_UNSPECIFIED;
@@ -316,11 +316,11 @@ LY_DEFINE (ly_grob_common_refpoint, "ly:grob-common-refpoint",
   Grob *gr = unsmob_grob (grob);
    
   LY_ASSERT_SMOB (Grob, grob, 1);
-  LY_ASSERT_SMOB(Grob,other, 2);
+  LY_ASSERT_SMOB (Grob, other, 2);
 
   Grob *o = unsmob_grob (other);
 
-  LY_ASSERT_TYPE(is_axis,axis, 3);
+  LY_ASSERT_TYPE (is_axis, axis, 3);
 
   Grob *refp = gr->common_refpoint (o,  Axis (scm_to_int (axis)));
   return refp ? refp->self_scm () : SCM_BOOL_F;
@@ -335,10 +335,10 @@ LY_DEFINE (ly_grob_common_refpoint_of_array, "ly:grob-common-refpoint-of-array",
   Grob *gr = unsmob_grob (grob);
    
   LY_ASSERT_SMOB (Grob, grob, 1);
-  LY_ASSERT_SMOB(Grob_array,others, 2);
+  LY_ASSERT_SMOB (Grob_array, others, 2);
 
   Grob_array *ga = unsmob_grob_array (others);
-  LY_ASSERT_TYPE(is_axis,axis, 3);
+  LY_ASSERT_TYPE (is_axis, axis, 3);
 
   Grob *refp = common_refpoint_of_array (ga->array (), gr, Axis (scm_to_int (axis)));
   return refp ? refp->self_scm () : SCM_BOOL_F;
index 1011d47fdcf1f1a55441cfb31e6f703547880c56..730faa780eafe2f6676a44b276f664db9a390a8f 100644 (file)
@@ -20,7 +20,7 @@ IMPLEMENT_TYPE_P (Grob, "ly:grob?");
 SCM
 Grob::mark_smob (SCM ses)
 {
-  ASSERT_LIVE_IS_ALLOWED();
+  ASSERT_LIVE_IS_ALLOWED ();
   
   Grob *s = (Grob *) SCM_CELL_WORD_1 (ses);
   scm_gc_mark (s->immutable_property_alist_);
index e12152821b075a4a194f1f3b3e8facb80eb227be..18cb6280d3b840b5f0b67820806dd0d2af5f9043 100644 (file)
@@ -613,6 +613,7 @@ ADD_INTERFACE (Grob,
               "before-line-breaking "
               "cause "
               "color "
+              "cross-staff "
               "extra-X-extent "
               "extra-Y-extent "
               "extra-offset "
@@ -654,7 +655,7 @@ Grob::stencil_height (SCM smob)
   return grob_stencil_extent (me, Y_AXIS);
 }
 
-MAKE_SCHEME_CALLBACK(Grob, y_parent_positioning, 1);
+MAKE_SCHEME_CALLBACK (Grob, y_parent_positioning, 1);
 SCM
 Grob::y_parent_positioning (SCM smob)
 {
@@ -667,7 +668,7 @@ Grob::y_parent_positioning (SCM smob)
 }
 
 
-MAKE_SCHEME_CALLBACK(Grob, x_parent_positioning, 1);
+MAKE_SCHEME_CALLBACK (Grob, x_parent_positioning, 1);
 SCM
 Grob::x_parent_positioning (SCM smob)
 {
index 20808956ae9607264d9ee84699bf778835e19cd2..87f32017a491ca7b9d6a669bf8e25fa4c3c45c10 100644 (file)
@@ -236,7 +236,7 @@ Hairpin::print (SCM smob)
       Box extent (Interval (-rad, rad), Interval (-rad, rad));
       
       /* Hmmm, perhaps we should have a Lookup::circle () method? */
-      Stencil circle(extent,
+      Stencil circle (extent,
                     scm_list_4 (ly_symbol2scm ("circle"),
                                 scm_from_double (rad),
                                 scm_from_double (thick),
index 81e2c7d9713f067377b7fe1a56379d6da5aa0c64..73fe4d6775dc9b9fe16291e3cd0232f9e1f04825 100644 (file)
@@ -24,6 +24,15 @@ Hara_kiri_group_spanner::y_extent (SCM smob)
   return Axis_group_interface::generic_group_extent (me, Y_AXIS);
 }
 
+MAKE_SCHEME_CALLBACK (Hara_kiri_group_spanner, calc_skylines, 1);
+SCM
+Hara_kiri_group_spanner::calc_skylines (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+  consider_suicide (me);
+  return Axis_group_interface::calc_skylines (smob);
+}
+
 MAKE_SCHEME_CALLBACK (Hara_kiri_group_spanner, pure_height, 3);
 SCM
 Hara_kiri_group_spanner::pure_height (SCM smob, SCM start_scm, SCM end_scm)
index 9d92028ac4cc8806c66f8ab515f3749e57fefefb..07c32552649e16b0e89f74341b172748015740a9 100644 (file)
@@ -79,7 +79,7 @@ Horizontal_bracket::make_enclosing_bracket (Grob *me, Grob *refpoint,
     }
   else
     {
-      Stencil b = make_bracket (me, ext.length(), a, dir);
+      Stencil b = make_bracket (me, ext.length (), a, dir);
       b.translate_axis (ext[LEFT] - refpoint->relative_coordinate (common, a), a);
 
       return b;
index 4f1d3491419a228a2604d6bf789345d82d8738d8..8b0e9d94190a65bb8f0230c18f6a1c523c32acd3 100644 (file)
@@ -17,11 +17,13 @@ struct Align_interface
 {
   DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM));
   DECLARE_SCHEME_CALLBACK (stretch_after_break, (SCM element));
-  static void align_to_fixed_distance (Grob *, Axis a);
+  DECLARE_SCHEME_CALLBACK (calc_max_stretch, (SCM));
+  static void stretch (Grob *, Real amount, Axis a);
   static void align_elements_to_extents (Grob *, Axis a);
   static vector<Real> get_extents_aligned_translates (Grob *, vector<Grob*> const&,
                                                      Axis a,
                                                      bool safe, int start, int end);
+  static int stretchable_children_count (Grob const*);
   static void set_ordered (Grob *);
   static Axis axis (Grob *);
   static void add_element (Grob *, Grob *);
index c02eba58c19cbe04b4f118956ec60c6bafb9729e..81939867f3c6463b0df5b4ec45013ece28a67638 100644 (file)
 #include "moment.hh"
 #include "pitch.hh"
 
-/**
-
-Any piece of audio information.  We need virtual constructors, let's
-try decentralised factory for specific audio implemenations.
-*/
 class Audio_item : public Audio_element
 {
 public:
index d752a05bb46189557679157e372dbae27c51b492..2f4f501cee8db919a9f7992f9d030c51f45a1f4e 100644 (file)
@@ -25,6 +25,7 @@ struct Axis_group_interface
   DECLARE_SCHEME_CALLBACK (pure_height, (SCM smob, SCM start, SCM end));
   DECLARE_SCHEME_CALLBACK (calc_skylines, (SCM smob));
   DECLARE_SCHEME_CALLBACK (combine_skylines, (SCM smob));
+  DECLARE_SCHEME_CALLBACK (calc_max_stretch, (SCM smob));
   static Interval relative_group_extent (vector<Grob*> const &list,
                                         Grob *common, Axis);
   static Interval relative_pure_height (Grob *me, vector<Grob*> const &list,
index 412540b076a30ce78cfd5c0be0c5a56ece5fa51c..e505cd670926a193e10fb57dbd1e7452ddb4d135 100644 (file)
@@ -74,6 +74,7 @@ public:
   static Grob *last_normal_stem (Grob *);
   DECLARE_GROB_INTERFACE();
   static void add_stem (Grob *, Grob *);
+  static bool is_cross_staff (Grob *);
   static bool is_knee (Grob *);
   static void set_beaming (Grob *, Beaming_pattern const *);
   static void set_stemlens (Grob *);
@@ -93,6 +94,7 @@ public:
   DECLARE_SCHEME_CALLBACK (calc_normal_stems, (SCM));  
   DECLARE_SCHEME_CALLBACK (calc_concaveness, (SCM));
   DECLARE_SCHEME_CALLBACK (set_stem_lengths, (SCM));
+  DECLARE_SCHEME_CALLBACK (cross_staff, (SCM));
 
   /* position callbacks */
   DECLARE_SCHEME_CALLBACK (shift_region_to_valid, (SCM, SCM));
index 502e8c234a0fa24b940d6656aa305f3fa57818fb..2478afcacaa0281638fc1deed859a4b0ef7e8155 100644 (file)
@@ -93,17 +93,15 @@ struct Constrained_break_node
 class Constrained_breaking
 {
 public:
-  vector<Column_x_positions> solve ();
+  vector<Column_x_positions> solve (vsize start, vsize end, vsize sys_count);
+  vector<Column_x_positions> best_solution (vsize start, vsize end);
+  vector<Line_details> line_details (vsize start, vsize end, vsize sys_count);
+
   Constrained_breaking (Paper_score *ps);
   Constrained_breaking (Paper_score *ps, vector<vsize> const &start_col_posns);
 
-  vector<Column_x_positions> get_solution (vsize start, vsize end, vsize sys_count);
-  vector<Column_x_positions> get_best_solution (vsize start, vsize end);
-  vector<Line_details> get_details (vsize start, vsize end, vsize sys_count);
-  int get_max_systems (vsize start, vsize end);
-  int get_min_systems (vsize start, vsize end);
-
-  void resize (vsize systems);
+  int max_system_count (vsize start, vsize end);
+  int min_system_count (vsize start, vsize end);
 
 private:
   Paper_score *pscore_;
@@ -127,6 +125,7 @@ private:
   vector<vsize> breaks_;
 
   void initialize ();
+  void resize (vsize systems);
 
   Column_x_positions space_line (vsize start_col, vsize end_col);
   vsize prepare_solution (vsize start, vsize end, vsize sys_count);
index fe1d5565d969d863931961a6aab5ca2881822ebc..57ee505717e3cfe6330db9abc00dd1cafb0c11ce 100644 (file)
@@ -32,6 +32,7 @@ SCM add_interface (char const *cxx_name,
                    char const *vars);
 
 SCM ly_add_interface (SCM, SCM, SCM);
+void internal_add_interface (SCM, SCM, SCM);
 SCM ly_all_grob_interfaces ();
 
 #endif /* INTERFACE_HH */
index c7ecbbabfdeebad050a178490defc73b8bddb8a2..d134068568b6810e271203eb1d7b7fac1749a572 100644 (file)
@@ -80,6 +80,7 @@ public:
   SCM get_property_alist_chain (SCM) const;
   SCM internal_get_property (SCM symbol) const;
   SCM internal_get_property_data (SCM symbol) const;
+  SCM internal_get_non_callback_marker_property_data (SCM symbol) const;
   SCM internal_get_object (SCM symbol) const;
   void internal_set_object (SCM sym, SCM val);
   void internal_del_property (SCM symbol);
@@ -149,4 +150,7 @@ SCM axis_parent_positioning (Axis a);
 
 SCM call_pure_function (SCM unpure, SCM args, int start, int end);
 
+void set_nested_property (Grob *, SCM property_path, SCM value);
+
+
 #endif /* GROB_HH */
index 6505287a4d634b13b611a3aface80e7d0a08909a..7a5ddd6a7c66a0ae0dae335aeb362285e8fd5993 100644 (file)
@@ -17,6 +17,7 @@ class Hara_kiri_group_spanner
 public:
   DECLARE_SCHEME_CALLBACK (force_hara_kiri_callback, (SCM));
   DECLARE_SCHEME_CALLBACK (y_extent, (SCM smob));
+  DECLARE_SCHEME_CALLBACK (calc_skylines, (SCM smob));
   DECLARE_SCHEME_CALLBACK (pure_height, (SCM smob, SCM start, SCM end));
   DECLARE_SCHEME_CALLBACK (force_hara_kiri_in_y_parent_callback, (SCM));
   DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
index 73790d59638c2fb94848542f463ab7b702795eac..ae3206ac5f70c0c75ae452e27542872e7eb90136 100644 (file)
@@ -49,6 +49,7 @@ public:
   vector<Real> spring_positions () const;
 
   Real force () const;
+  Real force_penalty (bool ragged) const;
   bool fits () const;
 
   DECLARE_SIMPLE_SMOBS (Simple_spacer);
index a4ea033fdbab57af3c2e1c297bd751b9f484397d..bccac37238d1fbb7948027d92829732aeb87676b 100644 (file)
@@ -72,6 +72,7 @@ public:
   Real height (Real airplane) const;
   Real max_height () const;
   void set_minimum_height (Real height);
+  bool is_empty () const;
 };
 
 class Skyline_pair
@@ -90,6 +91,7 @@ public:
   void merge (Skyline_pair const &other);
   Skyline &operator [] (Direction d);
   Skyline const &operator [] (Direction d) const;
+  bool is_empty () const;
 };
 
 #endif /* SKYLINE_HH */
index 20fb7030ce60c134b9b20801e2eea5a4e98cba96..a5ea54e77e69fa0bd784114e4e77ab7facae6708 100644 (file)
@@ -27,6 +27,7 @@ public:
   DECLARE_SCHEME_CALLBACK (height, (SCM));
   DECLARE_SCHEME_CALLBACK (outside_slur_callback, (SCM, SCM));
   DECLARE_SCHEME_CALLBACK (pure_outside_slur_callback, (SCM, SCM, SCM, SCM));
+  DECLARE_SCHEME_CALLBACK (cross_staff, (SCM));
   DECLARE_GROB_INTERFACE();
   static Bezier get_curve (Grob *me);
 };
index d022175a7c2fbf2430265dd8cc0f9818d7742e8b..c9b509ce7dc036fa05fac8a0627b3c48864a0baf 100644 (file)
@@ -34,6 +34,7 @@ public:
   static int head_count (Grob *);
   static bool is_invisible (Grob *);
   static bool is_normal_stem (Grob *);
+  static bool is_cross_staff (Grob *);
   static Interval head_positions (Grob *);
   static Real stem_end_position (Grob *);
   static Stencil flag (Grob *);
@@ -53,5 +54,6 @@ public:
   DECLARE_SCHEME_CALLBACK (width, (SCM smob));
   DECLARE_SCHEME_CALLBACK (pure_height, (SCM, SCM, SCM));
   DECLARE_SCHEME_CALLBACK (height, (SCM));
+  DECLARE_SCHEME_CALLBACK (cross_staff, (SCM));
 };
 #endif
index 9f226f48db8d66017bcac533c21f06655a17ecdc..ebdc17925cc576dcce8f1e22deadc4ec6afd5e1e 100644 (file)
@@ -30,7 +30,6 @@ public:
 
   DECLARE_SCHEME_CALLBACK (undump, (SCM));
   DECLARE_SCHEME_CALLBACK (dump, (SCM));
-
 };
 
 #define in_event_class(class_name) internal_in_event_class (ly_symbol2scm (class_name))
index 48e6875dfb43e4aaa2d1984602a5658a7f928dfc..3a5b39ad4e75104cec0d141affe71dd26c78486b 100644 (file)
@@ -20,7 +20,7 @@ class System : public Spanner
 {
   int rank_;
   Grob_array *all_elements_;
-  Drul_array<Skyline> skylines_;
+  Skyline_pair skylines_;
   void build_skylines ();
   void init_elements ();
   friend class Paper_score;    // ugh.
@@ -29,9 +29,11 @@ class System : public Spanner
 public:
   Paper_score *paper_score () const;
   int get_rank () const;
+  void do_break_substitution_and_fixup_refpoints ();
   void post_processing ();
   SCM get_paper_system ();
   SCM get_paper_systems ();
+  SCM get_broken_system_grobs ();
 
   System (SCM);
   System (System const &);
index 4cc75a6ba5c017d7ba2330feb240e263edec28fd..cc69660a42727f03137c3ad99c09f232cbf7d6cc 100644 (file)
@@ -16,7 +16,6 @@ public:
   DECLARE_GROB_INTERFACE();
   DECLARE_SCHEME_CALLBACK (print, (SCM));
   static void modify_edge_height (Spanner *);
-  static void add_column (Grob *, Grob *col);
   static void add_bar (Grob *me, Item *bar);
 };
 
index e3d0312642fd8488b75db27dfcfea9f467dba3f9..f6f2a3f4490eb8c64e06a2e1cfe6d78de7a614a4 100644 (file)
@@ -25,7 +25,7 @@ LY_DEFINE (ly_input_message, "ly:input-message", 2, 0, 1, (SCM sip, SCM msg, SCM
   Input *ip = unsmob_input (sip);
 
   LY_ASSERT_TYPE (unsmob_input, sip, 1);
-  LY_ASSERT_TYPE(scm_is_string, msg,2);
+  LY_ASSERT_TYPE (scm_is_string, msg,2);
 
   msg = scm_simple_format (SCM_BOOL_F, msg, rest);
 
index a3694f075574ad8ffef4399426dd1ccd07ac0ace..2637fba441db31118cf194815415a7c430bc126c 100644 (file)
@@ -15,7 +15,7 @@
 class Instrument_switch_engraver : public Engraver
 {
 
-  TRANSLATOR_DECLARATIONS(Instrument_switch_engraver);
+  TRANSLATOR_DECLARATIONS (Instrument_switch_engraver);
 protected:
   Grob *text_;
   SCM cue_name_;
@@ -53,7 +53,7 @@ Instrument_switch_engraver::stop_translation_time_step ()
   text_ = 0;
 }
 
-ADD_TRANSLATOR(Instrument_switch_engraver,
+ADD_TRANSLATOR (Instrument_switch_engraver,
               "Create a cue text for taking instrument.",
                        
               "InstrumentSwitch ",
index 36199d704146b7b9b1609a5c971ee1929526a296..0b0a282064ec3b6bdb1dd03449f6507344b068ee 100644 (file)
@@ -66,7 +66,7 @@ Key_engraver::create_key (bool is_default)
 
       SCM last = get_property ("lastKeySignature");
       SCM key = get_property ("keySignature");
-      bool extranatural = to_boolean(get_property("extraNatural"));
+      bool extranatural = to_boolean (get_property ("extraNatural"));
 
       if ((to_boolean (get_property ("printKeyCancellation"))
           || key == SCM_EOL)
index 7c88268b624b9a70d1542932e354b3bab760f73e..d4ddb075e837fcf963f04dae4e5de0b9729140ac 100644 (file)
@@ -20,7 +20,7 @@
 struct Key_signature_interface
 {
   DECLARE_SCHEME_CALLBACK (print, (SCM));
-  DECLARE_GROB_INTERFACE();
+  DECLARE_GROB_INTERFACE ();
 };
 
 
index 62d52b64c19dbc7afc31c0c00ee8d839a9704d22..052e69ba1959daca8a6cf3fd64651460fdb1d99c 100644 (file)
@@ -28,7 +28,7 @@ struct Ledger_line_spanner
                                    Interval x_extent,
                                    Real left_shorten);
 
-  DECLARE_GROB_INTERFACE();
+  DECLARE_GROB_INTERFACE ();
 };
 
 Stencil
@@ -42,7 +42,7 @@ Ledger_line_spanner::brew_ledger_lines (Grob *staff,
 {
   int line_count = (staff_extent.contains (pos)
                    ? 0
-                   : sign (pos) * int (rint(pos -  staff_extent[Direction (sign (pos))])) / 2);
+                   : sign (pos) * int (rint (pos -  staff_extent[Direction (sign (pos))])) / 2);
   Stencil stencil;
   if (line_count)
     {
@@ -366,7 +366,7 @@ ADD_INTERFACE (Ledger_line_spanner,
 
 struct Ledgered_interface
 {
-  DECLARE_GROB_INTERFACE();
+  DECLARE_GROB_INTERFACE ();
 };
 
 ADD_INTERFACE (Ledgered_interface,
index 370dba2998e932f32b63520c3413da7d2b7af41d..e5cdbc77f2732aef18d0e38794ccbf950e9aa710 100644 (file)
@@ -118,7 +118,7 @@ ly_scm2string (SCM str)
 SCM
 ly_string2scm (string const &str)
 {
-  return scm_from_locale_stringn (str.c_str(),
+  return scm_from_locale_stringn (str.c_str (),
                                  str.length ());
 }
 
@@ -308,7 +308,7 @@ ly_offsets2scm (vector<Offset> os)
   for (vsize i = 0; i < os.size (); i++)
     {
       *tail = scm_cons (ly_offset2scm (os[i]), SCM_EOL);
-      tail = SCM_CDRLOC(*tail);
+      tail = SCM_CDRLOC (*tail);
     }
   return l;
 }
index a0501e9eab0df06692df8d1ee0138b6341530934..0d561f9d8b2bad8e96b664d94c02e49ec2f3d620 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "lily-lexer.hh"
 
-LY_DEFINE(ly_lexer_keywords, "ly:lexer-keywords",
+LY_DEFINE (ly_lexer_keywords, "ly:lexer-keywords",
          1, 0, 0, (SCM lexer),
          "Return a list of (KEY . CODE) pairs, signifying the lilypond reserved words list.")
 {
index 4a877f2d2e3e4bb6183b1773423202c3f81181cc..4eaa4415690e298d140047f6b5bae9dd65ae4e58 100644 (file)
@@ -197,7 +197,7 @@ Lily_lexer::keyword_list () const
                         scm_from_int (keytable_->table_[i].tokcode_),
                         SCM_EOL);
 
-      tail = SCM_CDRLOC(*tail);
+      tail = SCM_CDRLOC (*tail);
     }
 
   return l;
@@ -341,7 +341,7 @@ IMPLEMENT_DEFAULT_EQUAL_P (Lily_lexer);
 SCM
 Lily_lexer::mark_smob (SCM s)
 {
-  ASSERT_LIVE_IS_ALLOWED();
+  ASSERT_LIVE_IS_ALLOWED ();
   
   Lily_lexer *lexer = (Lily_lexer *) SCM_CELL_WORD_1 (s);
 
index 4e22461638f6354289208371c8f009f673f8be1d..6e628d8ae89dabdf451f848444eb2addca1954f3 100644 (file)
@@ -175,7 +175,7 @@ LY_DEFINE (ly_parser_define_x, "ly:parser-define!",
   LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
   Lily_parser *parser = unsmob_lily_parser (parser_smob);
 
-  LY_ASSERT_TYPE (ly_is_symbol,symbol, 2);
+  LY_ASSERT_TYPE (ly_is_symbol, symbol, 2);
     
   parser->lexer_->set_identifier (scm_symbol_to_string (symbol), val);
   return SCM_UNSPECIFIED;
@@ -190,7 +190,7 @@ LY_DEFINE (ly_parser_lookup, "ly:parser-lookup",
 
   Lily_parser *parser = unsmob_lily_parser (parser_smob);
  
-  LY_ASSERT_TYPE (ly_is_symbol,symbol, 2);
+  LY_ASSERT_TYPE (ly_is_symbol, symbol, 2);
 
   SCM val = parser->lexer_->lookup_identifier (ly_scm2string (scm_symbol_to_string (symbol)));
   if (val != SCM_UNDEFINED)
@@ -206,7 +206,7 @@ LY_DEFINE (ly_parser_parse_string, "ly:parser-parse-string",
 {
   LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
   Lily_parser *parser = unsmob_lily_parser (parser_smob); 
-  LY_ASSERT_TYPE(scm_is_string,ly_code, 2);
+  LY_ASSERT_TYPE (scm_is_string, ly_code, 2);
 
   parser->parse_string (ly_scm2string (ly_code));
 
@@ -248,7 +248,7 @@ LY_DEFINE (ly_parser_error, "ly:parser-error",
   LY_ASSERT_SMOB (Lily_parser, parser, 1);
   Lily_parser *p = unsmob_lily_parser (parser);
   
-  LY_ASSERT_TYPE(scm_is_string,msg, 2);
+  LY_ASSERT_TYPE (scm_is_string, msg, 2);
   string s = ly_scm2string (msg);
   
   Input *i = unsmob_input (input);
index b9155a07ab53b4c0a28638282392e23218deb6e7..8720bba596f14eb5085318c184057353c45107f9 100644 (file)
@@ -228,7 +228,7 @@ Line_interface::line (Grob *me, Offset from, Offset to)
       if (period <= 0)
        return Stencil ();
 
-      Real len = (to-from).length();
+      Real len = (to-from).length ();
       
       int n = (int) rint ((len - period * fraction) / period);
       if (n > 0)
@@ -237,7 +237,7 @@ Line_interface::line (Grob *me, Offset from, Offset to)
            TODO: figure out something intelligent for really short
            sections.
           */
-         period = ((to-from).length() - period * fraction) / n;
+         period = ((to-from).length () - period * fraction) / n;
        }
       stil = make_dashed_line (thick, from, to, period, fraction);
     }
index 5bbc1eeaf2652da44c720c597f163c63045a8bdd..db36434b04b252e7a33da6d629d94609ef29f9b2 100644 (file)
@@ -29,7 +29,7 @@ public:
   DECLARE_SCHEME_CALLBACK (calc_left_bound_info_and_text, (SCM));
   DECLARE_SCHEME_CALLBACK (calc_right_bound_info, (SCM));
   DECLARE_SCHEME_CALLBACK (calc_bound_info, (SCM, Direction));
-  DECLARE_GROB_INTERFACE();
+  DECLARE_GROB_INTERFACE ();
 };
 
 
@@ -138,7 +138,7 @@ Line_spanner::calc_bound_info (SCM smob, Direction dir)
       else
        {
          Grob *commony = me->common_refpoint (me->get_bound (dir), Y_AXIS);
-         y = me->get_bound (dir)->extent (commony, Y_AXIS).center();
+         y = me->get_bound (dir)->extent (commony, Y_AXIS).center ();
          details = scm_acons (ly_symbol2scm ("common-Y"), commony->self_scm (), details);
        }
 
index e6fcf4ea0a4a42d9cbb640b36e145cb9f360842d..ed2cff898667e2bb936bac8312410e7aaad89b3a 100644 (file)
@@ -96,13 +96,13 @@ Lyric_combine_music_iterator::set_music_context (Context *to)
 {
   if (music_context_)
     {
-      music_context_->event_source()->remove_listener (GET_LISTENER (set_busy), ly_symbol2scm ("music-event"));
+      music_context_->event_source ()->remove_listener (GET_LISTENER (set_busy), ly_symbol2scm ("music-event"));
     }
 
   music_context_ = to;
   if (to)
     {
-      to->event_source()->add_listener (GET_LISTENER (set_busy), ly_symbol2scm ("music-event"));
+      to->event_source ()->add_listener (GET_LISTENER (set_busy), ly_symbol2scm ("music-event"));
     }
 }
 
index 508b4b8f5bae126bbd6fe911afb5f37d47f72f03..4a539e0eea359ff68e26239ff51d7d04e253eddc 100644 (file)
@@ -138,7 +138,7 @@ static char const *WARRANTY
 */
 string prefix_directory;
 
-/* The jail specification: USER,GROUP,JAIL,DIR. */
+/* The jail specification: USER, GROUP, JAIL, DIR. */
 string jail_spec;
 
 /*  The option parser */
@@ -171,7 +171,7 @@ static Long_option_init options_static[]
   {_i ("DIR"), "include", 'I',  _i ("add DIR to search path")},
   {_i ("FILE"), "init", 'i',  _i ("use FILE as init file")},
 #if HAVE_CHROOT
-  {_i ("USER,GROUP,JAIL,DIR"), "jail", 'j', _i ("chroot to JAIL, become USER:GROUP\n"
+  {_i ("USER, GROUP, JAIL, DIR"), "jail", 'j', _i ("chroot to JAIL, become USER:GROUP\n"
                                                "and cd into DIR")},
 #endif
   {0, "no-print", 0, _i ("do not generate printed output")},
index 984eb687a096a58bd3902234c952d587704ada98..1f4a0c3f728dc174e451b5f26390955fbe06cd49 100644 (file)
@@ -91,12 +91,7 @@ Mark_engraver::acknowledge_break_alignment (Grob_info inf)
 void
 Mark_engraver::stop_translation_timestep ()
 {
-  if (text_)
-    {
-      text_->set_object ("side-support-elements",
-                        grob_list_to_grob_array (get_property ("stavesFound")));
-      text_ = 0;
-    }
+  text_ = 0;
   mark_ev_ = 0;
 }
 
index e11163bf4d23c2e7093432a75a4426467c99296f..a3e185bbdbd7fd3671a56da1392f3b7c3a3db8fe 100644 (file)
@@ -20,7 +20,7 @@
 /*
   Interpolate stem directions for neutral stems.
  */
-MAKE_SCHEME_CALLBACK(Melody_spanner,calc_neutral_stem_direction, 1);
+MAKE_SCHEME_CALLBACK (Melody_spanner, calc_neutral_stem_direction, 1);
 SCM
 Melody_spanner::calc_neutral_stem_direction (SCM smob)
 {
index a663e573515cf5dbf7f6d0e5fe895b2f079d3f59..897948d88b652a8de29aea4fb368212692ab2a45 100644 (file)
@@ -61,9 +61,6 @@ Metronome_mark_engraver::stop_translation_timestep ()
     {
       Grob *mc = unsmob_grob (get_property ("currentMusicalColumn"));
       text_->set_parent (mc, X_AXIS);
-      text_->set_object ("side-support-elements",
-                        grob_list_to_grob_array (get_property ("stavesFound")));
-
       text_ = 0;
     }
 }
index 5aaf5bd2e63aaaf012156f8199148e77f2e86c87..3e9f898993e9f076234e26acd56936e6961e1685 100644 (file)
@@ -65,8 +65,8 @@ Midi_track::data_string () const
 {
   string str = Midi_chunk::data_string ();
 
-  for (vector<Midi_event*>::const_iterator i (events_.begin());
-       i != events_.end(); i ++)
+  for (vector<Midi_event*>::const_iterator i (events_.begin ());
+       i != events_.end (); i ++)
     {
       str += (*i)->to_string ();
     }
index 3d2d67a38e6b56319516a4322d78ee35842ffb4f..9f9868c6a3f65b0102405d82fe2b24cc81e26fed 100644 (file)
@@ -201,9 +201,6 @@ Midi_note::to_string () const
   // print warning if fine tuning was needed, HJJ
   if (get_fine_tuning () != 0)
     {
-      warning (_f ("experimental: temporarily fine tuning (of %d cents) a channel.",
-                  get_fine_tuning ()));
-
       finetune = PITCH_WHEEL_CENTER;
       // Move pitch wheel to a shifted position.
       // The pitch wheel range (of 4 semitones) is multiplied by the cents.
@@ -217,7 +214,7 @@ Midi_note::to_string () const
 
   str += ::to_string ((char) status_byte);
   str += ::to_string ((char) (get_semitone_pitch () + c0_pitch_));
-  str += ::to_string ((char)dynamic_byte_);
+  str += ::to_string ((char) dynamic_byte_);
 
   return str;
 }
index cef858c92768ebacf1374fb6d8f9bddb418a6536..782c3e2932ea3d6cbf10066f43b82547746c064b 100644 (file)
@@ -70,6 +70,7 @@ void
 Midi_walker::do_start_note (Midi_note *note)
 {
   Audio_item *ptr = items_[index_];
+  assert (note->audio_ == ptr);
   int stop_ticks = int (moment_to_real (note->audio_->length_mom_) * Real (384 * 4))
     + ptr->audio_column_->ticks ();
 
@@ -114,9 +115,6 @@ Midi_walker::do_start_note (Midi_note *note)
     }
 }
 
-/**
-   Output note events for all notes which end before #max_mom#
-*/
 void
 Midi_walker::do_stop_notes (int max_ticks)
 {
index 16839f81bb568449ed83b7247584a0e1596123c3..4eb3086adf1331f816cf66659d4c86f9846fd15f 100644 (file)
@@ -22,19 +22,19 @@ LY_DEFINE (ly_make_moment, "ly:make-moment",
           "In absence of grace notes, @var{g} is zero.\n")
 {
   LY_ASSERT_TYPE (scm_is_integer, n, 1);
-  LY_ASSERT_TYPE(scm_is_integer,d, 2);
+  LY_ASSERT_TYPE (scm_is_integer, d, 2);
 
   int grace_num = 0;
   if (gn != SCM_UNDEFINED)
     {
-      LY_ASSERT_TYPE(scm_is_integer,gn, 3);
+      LY_ASSERT_TYPE (scm_is_integer, gn, 3);
       grace_num = scm_to_int (gn);
     }
 
   int grace_den = 1;
   if (gd != SCM_UNDEFINED)
     {
-      LY_ASSERT_TYPE(scm_is_integer,gd, 4);
+      LY_ASSERT_TYPE (scm_is_integer, gd, 4);
       grace_den = scm_to_int (gd);
     }
 
@@ -47,7 +47,7 @@ LY_DEFINE (ly_moment_sub, "ly:moment-sub",
           "Subtract two moments.")
 {
   LY_ASSERT_SMOB (Moment, a, 1); 
-  LY_ASSERT_SMOB (Moment,b, 2);
+  LY_ASSERT_SMOB (Moment, b, 2);
   
   Moment *ma = unsmob_moment (a);
   Moment *mb = unsmob_moment (b);
@@ -60,7 +60,7 @@ LY_DEFINE (ly_moment_add, "ly:moment-add",
           "Add two moments.")
 {
   LY_ASSERT_SMOB (Moment, a, 1); 
-  LY_ASSERT_SMOB(Moment,b, 2); 
+  LY_ASSERT_SMOB (Moment, b, 2); 
 
   Moment *ma = unsmob_moment (a);
   Moment *mb = unsmob_moment (b);
@@ -73,7 +73,7 @@ LY_DEFINE (ly_moment_mul, "ly:moment-mul",
           "Multiply two moments.")
 {
   LY_ASSERT_SMOB (Moment, a, 1); 
-  LY_ASSERT_SMOB(Moment, b, 2); 
+  LY_ASSERT_SMOB (Moment, b, 2); 
 
   Moment *ma = unsmob_moment (a);
   Moment *mb = unsmob_moment (b);
@@ -85,7 +85,7 @@ LY_DEFINE (ly_moment_div, "ly:moment-div",
           "Divide two moments.")
 {
   LY_ASSERT_SMOB (Moment, a, 1); 
-  LY_ASSERT_SMOB(Moment, b, 2); 
+  LY_ASSERT_SMOB (Moment, b, 2); 
 
   Moment *ma = unsmob_moment (a);
   Moment *mb = unsmob_moment (b);
@@ -98,7 +98,7 @@ LY_DEFINE (ly_moment_mod, "ly:moment-mod",
           "Modulo of two moments.")
 {
   LY_ASSERT_SMOB (Moment, a, 1); 
-  LY_ASSERT_SMOB(Moment, b, 2); 
+  LY_ASSERT_SMOB (Moment, b, 2); 
   
   Moment *ma = unsmob_moment (a);
   Moment *mb = unsmob_moment (b);
index 1e08ba26ef0d42956f5a6975c83857d9df2f9794..c52b1d6a8727a1ef591eea6201aba2d1220c5084 100644 (file)
@@ -26,7 +26,7 @@ LY_DEFINE (ly_music_property,
           "If @var{sym} is undefined, return @code{'()}.\n")
 {
   LY_ASSERT_TYPE (unsmob_music, mus, 1);
-  return ly_prob_property (mus,sym,dfault);
+  return ly_prob_property (mus, sym, dfault);
 }
 
 LY_DEFINE (ly_music_set_property_x, "ly:music-set-property!",
@@ -129,7 +129,7 @@ LY_DEFINE (ly_music_compress, "ly:music-compress",
           "Compress music object @var{m} by moment @var{factor}.")
 {
   LY_ASSERT_TYPE (unsmob_music, m, 1);
-  LY_ASSERT_TYPE(unsmob_moment,factor, 2);
+  LY_ASSERT_TYPE (unsmob_moment, factor, 2);
 
   Music *sc = unsmob_music (m);
   sc->compress (*unsmob_moment (factor));
index 7cb38bd95677910a6b566da3b030cb24a0137875..a4e05dadbfdc6d5c8ef31148d4667a92612785df 100644 (file)
@@ -289,7 +289,7 @@ New_fingering_engraver::position_scripts (SCM orientations,
 void
 New_fingering_engraver::stop_translation_timestep ()
 {
-  position_all();
+  position_all ();
   stem_ = 0;
   heads_.clear ();
 }
index 488d77f1b72b4cffc07969dc20c53172eb1068ee..23e3f98e018dff05e6c8d662f7765114a7c34348 100644 (file)
@@ -319,7 +319,7 @@ check_meshing_chords (Grob *me,
 }
 
 
-MAKE_SCHEME_CALLBACK(Note_collision_interface, calc_positioning_done, 1) 
+MAKE_SCHEME_CALLBACK (Note_collision_interface, calc_positioning_done, 1) 
 SCM
 Note_collision_interface::calc_positioning_done (SCM smob)
 {
@@ -331,7 +331,7 @@ Note_collision_interface::calc_positioning_done (SCM smob)
   Direction d = UP;
   do
     {
-      for (vsize i = cg[d].size(); i--; )
+      for (vsize i = cg[d].size (); i--; )
        {
          /*
            Trigger positioning
index 57919802694ae70582e83e21bf0ffa0106149746..89f17453cf6d2aa6dcc81880471ba92bdd657dbb 100644 (file)
 #include "font-metric.hh"
 
 
-LY_DEFINE(ly_note_head__stem_attachment, "ly:note-head::stem-attachment",
+LY_DEFINE (ly_note_head__stem_attachment, "ly:note-head::stem-attachment",
          2, 0, 0, (SCM font_metric, SCM glyph_name),
          "Get attachment in @var{font-metric} for attaching a stem to notehead "
          "@var{glyph-name}.")
 {
   LY_ASSERT_SMOB (Font_metric, font_metric, 1);
   Font_metric *fm = unsmob_metrics (font_metric);
-  LY_ASSERT_TYPE(scm_is_string,glyph_name, 2);
+  LY_ASSERT_TYPE (scm_is_string, glyph_name, 2);
   
   return ly_offset2scm (Note_head::get_stem_attachment (fm, ly_scm2string (glyph_name)));
 }
index bd00033bc717d80ebdd7291bb09997c2994fef9f..c711f8729ea42b5296223104dd1aa1c43f31b282 100644 (file)
@@ -129,7 +129,7 @@ Note_head::get_stem_attachment (Font_metric *fm, string key)
   return att;
 }
 
-MAKE_SCHEME_CALLBACK(Note_head, calc_stem_attachment, 1);
+MAKE_SCHEME_CALLBACK (Note_head, calc_stem_attachment, 1);
 SCM
 Note_head::calc_stem_attachment (SCM smob)
 {
index ff296311ffead109a8de2936f8542a3170b8aa0d..d6554bbdc8520a4ded490bd6c26a24b9420c4422 100644 (file)
@@ -15,9 +15,6 @@
 
 #include "translator.icc"
 
-/**
-   Convert evs to audio notes.
-*/
 class Note_performer : public Performer
 {
 public:
@@ -31,63 +28,83 @@ protected:
 private:
   vector<Stream_event*> note_evs_;
   vector<Audio_note*> notes_;
+
+
+  vector<Audio_note*> last_notes_;
+  Moment last_start_;
+  
 };
 
 void
 Note_performer::process_music ()
 {
-  if (note_evs_.size ())
+  if (!note_evs_.size ())
+    return;
+
+  Pitch transposing;
+  SCM prop = get_property ("instrumentTransposition");
+  if (unsmob_pitch (prop))
+    transposing = *unsmob_pitch (prop);
+
+  for (vsize i = 0; i < note_evs_.size (); i ++)
     {
-      Pitch transposing;
-      SCM prop = get_property ("instrumentTransposition");
-      if (unsmob_pitch (prop))
-       transposing = *unsmob_pitch (prop);
+      Stream_event *n = note_evs_[i];
+      SCM pit = n->get_property ("pitch");
 
-      while (note_evs_.size ())
+      if (Pitch *pitp = unsmob_pitch (pit))
        {
-         Stream_event *n = note_evs_.back ();
-         note_evs_.pop_back ();
-         SCM pit = n->get_property ("pitch");
+         SCM articulations = n->get_property ("articulations");
+         Stream_event *tie_event = 0;
+         for (SCM s = articulations;
+              !tie_event && scm_is_pair (s);
+              s = scm_cdr (s))
+           {
+             Stream_event *ev = unsmob_stream_event (scm_car (s));
+             if (!ev)
+               continue;
+         
+             if (ev->in_event_class ("tie-event"))
+               tie_event = ev;
+           }
 
-         if (Pitch *pitp = unsmob_pitch (pit))
+         Moment len = get_event_length (n);
+         if (now_mom ().grace_part_)
            {
-              SCM articulations = n->get_property ("articulations");
-              Stream_event *tie_event = 0;
-              for (SCM s = articulations;
-                   !tie_event && scm_is_pair (s);
-                   s = scm_cdr (s))
-                {
-                  Stream_event *ev = unsmob_stream_event (scm_car (s));
-                  if (!ev)
-                    continue;
+             len.grace_part_ = len.main_part_;
+             len.main_part_ = Rational (0);
+           }
          
-                  if (ev->in_event_class ("tie-event"))
-                    tie_event = ev;
-                }
+         Audio_note *p = new Audio_note (*pitp, len, 
+                                         tie_event, transposing.negated ());
+         Audio_element_info info (p, n);
+         announce_element (info);
+         notes_.push_back (p);
 
-             Moment len = get_event_length (n);
-             if (now_mom().grace_part_)
+         /*
+           shorten previous note.
+          */
+         if (now_mom ().grace_part_)
+           {
+             if (last_start_.grace_part_ == Rational (0))
                {
-                 len.grace_part_ = len.main_part_;
-                 len.main_part_ = Rational (0);
+                 for (vsize i = 0; i < last_notes_.size (); i++)
+                   last_notes_[i]->length_mom_ += Moment (0,
+                                                          now_mom().grace_part_);
                }
-             
-             Audio_note *p = new Audio_note (*pitp, len, 
-                                              tie_event, transposing.negated ());
-             Audio_element_info info (p, n);
-             announce_element (info);
-             notes_.push_back (p);
            }
        }
-      note_evs_.clear ();
     }
 }
 
 void
 Note_performer::stop_translation_timestep ()
 {
-  // why don't grace notes show up here?
-  // --> grace notes effectively do not get delayed
+  if (note_evs_.size ())
+    {
+      last_notes_ = notes_;
+      last_start_ = now_mom ();
+    }
+
   notes_.clear ();
   note_evs_.clear ();
 }
index c4a79e403f7b18bb0313ce9a823ab481cf2cd8d3..2839309ecb39c39aa065a1a2cc87b2693babb0dd 100644 (file)
@@ -79,7 +79,7 @@ Note_spacing::get_spacing (Grob *me, Item *right_col,
              if (g)
                {
                  if (g->common_refpoint (it_col, X_AXIS) != it_col)
-                   programming_error ("Note_spacing::get_spacing(): Common refpoint incorrect");
+                   programming_error ("Note_spacing::get_spacing (): Common refpoint incorrect");
                  else
                    left_head_wid = g->extent (it_col, X_AXIS);
                }
index 64b140f07e021b10cfc15f1e1390c2d936c63e28..6f95641325b5cdc977c5ad9f58f08dc1e243c94c 100644 (file)
@@ -29,7 +29,7 @@ LY_DEFINE (ly_otf_font_glyph_info, "ly:otf-font-glyph-info", 2, 0, 0,
   Open_type_font *otf = dynamic_cast<Open_type_font *> (fm->original_font ());
 
   SCM_ASSERT_TYPE (otf, font, SCM_ARG1, __FUNCTION__, "OTF font-metric");
-  LY_ASSERT_TYPE(scm_is_string, glyph, 2);
+  LY_ASSERT_TYPE (scm_is_string, glyph, 2);
 
   SCM sym = scm_string_to_symbol (glyph);
   return scm_hashq_ref (otf->get_char_table (), sym, SCM_EOL);
index 2e72d57af35ada1833d95f5c60807358b9ef606c..b8f65b45cca2b543c22d409f52012d9424ac19fb 100644 (file)
@@ -174,7 +174,7 @@ Open_type_font::get_indexed_char (size_t signed_idx) const
       char name[len];
       size_t code = FT_Get_Glyph_Name (face_, signed_idx, name, len);
       if (code)
-       warning (_f ("FT_Get_Glyph_Name() Freetype error: %s",
+       warning (_f ("FT_Get_Glyph_Name () Freetype error: %s",
                     freetype_error_string (code)));
 
       SCM sym = ly_symbol2scm (name);
@@ -299,7 +299,7 @@ Open_type_font::glyph_list () const
       char name[len];
       size_t code = FT_Get_Glyph_Name (face_, i, name, len);
       if (code)
-       warning (_f ("FT_Get_Glyph_Name() error: %s",
+       warning (_f ("FT_Get_Glyph_Name () error: %s",
                     freetype_error_string (code).c_str ()));
 
       *tail = scm_cons (scm_from_locale_string (name), SCM_EOL);
index 5dd1036ef1a9acec143abf2a2c2a24a537d999bf..cfd1d5d0363a294aa05617b71653fa6922a61efe 100644 (file)
@@ -23,7 +23,7 @@
 struct Ottava_bracket
 {
   DECLARE_SCHEME_CALLBACK (print, (SCM));
-  DECLARE_GROB_INTERFACE();
+  DECLARE_GROB_INTERFACE ();
 };
 
 /*
index 81e7f7a67158af44cc0de465d807c3fd31bebbcc..853704c5c98d478442499b28f2ea3ad22f367192 100644 (file)
@@ -109,7 +109,7 @@ SCM
 Output_def::lookup_variable (SCM sym) const
 {
   SCM var = ly_module_lookup (scope_, sym);
-  if (SCM_VARIABLEP (var) && SCM_VARIABLE_REF(var) != SCM_UNDEFINED)
+  if (SCM_VARIABLEP (var) && SCM_VARIABLE_REF (var) != SCM_UNDEFINED)
     return SCM_VARIABLE_REF (var);
   
   if (parent_)
index 8b42a6cbd3e7b5128a038ef186b5644d9ad1e9e8..e66faba789def2cd683e250bff19444ec82604f2 100644 (file)
@@ -64,7 +64,7 @@ Output_property_engraver::Output_property_engraver ()
 {
 }
 
-ADD_ACKNOWLEDGER (Output_property_engraver,grob);
+ADD_ACKNOWLEDGER (Output_property_engraver, grob);
 ADD_TRANSLATOR (Output_property_engraver,
 
                /* doc */
index 76a874d4e38f1aac87035c9c09016234fc8b5f23..abb2a3e2148436c3e9fb3a333c7e2800bcd37b0f 100644 (file)
@@ -80,7 +80,6 @@ Page_breaking::break_into_pieces (vsize start_break, vsize end_break, Line_divis
     {
       programming_error ("did not find a valid page breaking configuration");
       ignore_div = true;
-      assert (0);
     }
 
   for (vsize i = 0; i + 1 < chunks.size (); i++)
@@ -93,8 +92,8 @@ Page_breaking::break_into_pieces (vsize start_break, vsize end_break, Line_divis
          line_breaker_args (sys, chunks[i], chunks[i+1], &start, &end);
 
          vector<Column_x_positions> pos = ignore_div
-           ? line_breaking_[sys].get_best_solution (start, end)
-           : line_breaking_[sys].get_solution (start, end, div[i]);
+           ? line_breaking_[sys].best_solution (start, end)
+           : line_breaking_[sys].solve (start, end, div[i]);
          all_[sys].pscore_->root_system ()->break_into_pieces (pos);
        }
     }
@@ -108,8 +107,9 @@ Page_breaking::systems ()
     {
       if (all_[sys].pscore_)
        {
-         SCM lines = all_[sys].pscore_->root_system ()->get_paper_systems ();
-         ret = scm_cons (scm_vector_to_list (lines), ret);
+         all_[sys].pscore_->root_system ()->do_break_substitution_and_fixup_refpoints ();
+         SCM lines = all_[sys].pscore_->root_system ()->get_broken_system_grobs ();
+         ret = scm_cons (lines, ret);
        }
       else
        {
@@ -137,7 +137,7 @@ Page_breaking::line_details (vsize start_break, vsize end_break, Line_division c
          vsize end;
          line_breaker_args (sys, chunks[i], chunks[i+1], &start, &end);
 
-         vector<Line_details> details = line_breaking_[sys].get_details (start, end, div[i]);
+         vector<Line_details> details = line_breaking_[sys].line_details (start, end, div[i]);
          ret.insert (ret.end (), details.begin (), details.end ());
        }
       else
@@ -186,7 +186,7 @@ Page_breaking::make_pages (vector<vsize> lines_per_page, SCM systems)
   SCM layout_module = scm_c_resolve_module ("scm layout-page-layout");
   SCM page_module = scm_c_resolve_module ("scm page");
 
-  SCM make_page = scm_c_module_lookup (layout_module, "make-page-from-systems");
+  SCM make_page = scm_c_module_lookup (layout_module, "stretch-and-draw-page");
   SCM page_stencil = scm_c_module_lookup (page_module, "page-stencil");
   make_page = scm_variable_ref (make_page);
   page_stencil = scm_variable_ref (page_stencil);
@@ -358,8 +358,8 @@ Page_breaking::system_count_bounds (vector<Break_position> const &chunks, bool m
          vsize end;
          line_breaker_args (sys, chunks[i], chunks[i+1], &start, &end);
          ret[i] = min
-           ? line_breaking_[sys].get_min_systems (start, end)
-           : line_breaking_[sys].get_max_systems (start, end);
+           ? line_breaking_[sys].min_system_count (start, end)
+           : line_breaking_[sys].max_system_count (start, end);
        }
     }
 
index 2ebd53814e3927c3a8120b23befe94847561c3f3..0b8f8295d6b8b446369ca82139771b9c93ef28c2 100644 (file)
@@ -138,7 +138,7 @@ uncompress_solution (vector<vsize> const &systems_per_page,
   return ret;
 }
 
-/* the cases for page_count = 1 or 2 can be done in O(n) time. Since they
+/* the cases for page_count = 1 or 2 can be done in O (n) time. Since they
    are by far the most common cases, we have special functions for them */
 static Spacing_result
 space_systems_on_1_page (vector<Line_details> const &lines, Real page_height, bool ragged)
index 10cca5bfaf7734cec57c6f039043ee4f853a6f8f..f1fb20e6c58758c04c2b070e4294ec0587e28152 100644 (file)
@@ -163,8 +163,8 @@ Pango_font::pango_item_string_stencil (PangoItem const *item, string str,
        {
          int errorcode = FT_Get_Glyph_Name (ftface, pg, glyph_name, GLYPH_NAME_LEN);
          if (errorcode)
-           programming_error (_f ("FT_Get_Glyph_Name() error: %s",
-                                  freetype_error_string (errorcode).c_str()
+           programming_error (_f ("FT_Get_Glyph_Name () error: %s",
+                                  freetype_error_string (errorcode).c_str ()
                                   ));
        }
 
index 89e8b8ded33c3eaad7f28c8de1de17c5c345c1db..bf6a98e5363416673161cddb9410d655f6b60331 100644 (file)
@@ -227,7 +227,7 @@ Paper_book::score_title (SCM header)
 /* read the breakbefore property of a score block and set up the preceding
    system-spec to honour it. That is, SYM should be the system spec that
    immediately precedes the score (from which HEADER is taken)
-   in the get_system_specs() list */
+   in the get_system_specs () list */
 void
 set_system_penalty (SCM sys, SCM header)
 {
@@ -273,7 +273,7 @@ Paper_book::get_score_title (SCM header)
       Prob *ps = make_paper_system (props);
       paper_system_set_stencil (ps, title);
 
-      return ps->self_scm();
+      return ps->self_scm ();
     }
 
   return SCM_BOOL_F;
index 2dd184854f12ea3857cc5939ee09c462f40bb2ae..6a765628aa892424c8e9a81f94ad2d5eaeeb57b9 100644 (file)
@@ -154,7 +154,7 @@ Paper_column_engraver::process_music ()
                           && !measure_position (context ()).main_part_);
 
   /*
-    We can't do this in start_translation_timestep(), since time sig
+    We can't do this in start_translation_timestep (), since time sig
     changes won't have happened by then.
   */
   if (start_of_measure)
@@ -188,7 +188,13 @@ Paper_column_engraver::stop_translation_timestep ()
   items_.clear ();
 
   if (to_boolean (get_property ("forbidBreak")))
-    command_column_->set_property ("line-break-permission", SCM_EOL);
+    {
+      command_column_->set_property ("page-break-permission", SCM_EOL);
+      command_column_->set_property ("line-break-permission", SCM_EOL);
+      if (break_events_.size ())
+       warning (_f ("break event at moment %d/%d was overridden by some other event, are you using bar checks?",
+                    now_mom ().num (), now_mom ().den ()));
+    }
   else if (Paper_column::is_breakable (command_column_))
     {
       breaks_++;
index 3c00d79308e40ec3f010349dd7da8d21ee968069..672eab7ce72c07838c780ede3ad5030d9ffac913 100644 (file)
@@ -45,7 +45,7 @@ LY_DEFINE (ly_outputter_dump_stencil, "ly:outputter-dump-stencil",
 {
   
   LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
-  LY_ASSERT_SMOB(Stencil, stencil, 2);
+  LY_ASSERT_SMOB (Stencil, stencil, 2);
 
   Paper_outputter *po = unsmob_outputter (outputter);
   Stencil *st = unsmob_stencil (stencil);
@@ -59,7 +59,7 @@ LY_DEFINE (ly_outputter_dump_string, "ly:outputter-dump-string",
           "Dump @var{str} onto @var{outputter}.")
 {
   LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
-  LY_ASSERT_TYPE(scm_is_string, str, 2);
+  LY_ASSERT_TYPE (scm_is_string, str, 2);
 
   Paper_outputter *po = unsmob_outputter (outputter);
 
index 4a2eceef12e8e6462da1474efe5f798a537bfdd5..db0258328232ee30cec1a199bd7862c0e51f8f61 100644 (file)
@@ -106,9 +106,9 @@ Paper_score::calc_breaking ()
 
   int system_count = robust_scm2int (layout ()->c_variable ("system-count"), 0);
   if (system_count)
-    algorithm.resize (system_count);
+    return algorithm.solve (0, VPOS, system_count);
 
-  return algorithm.solve ();
+  return algorithm.best_solution (0, VPOS);
 }
 
 void
@@ -152,6 +152,7 @@ Paper_score::get_paper_systems ()
       vector<Column_x_positions> breaking = calc_breaking ();
       system_->break_into_pieces (breaking);
       message (_ ("Drawing systems...") + " ");
+      system_->do_break_substitution_and_fixup_refpoints ();
       paper_systems_ = system_->get_paper_systems ();
     }
   return paper_systems_;
index 544f64d8b05eefed05652ab79d7fc47dd0113397..9ff1a55c12769ea7ff61d8cdbdaddf3b0fa4db91 100644 (file)
@@ -23,7 +23,7 @@ paper_system_set_stencil (Prob *prob, Stencil s)
 
   if (is_number_pair (yext))
     {
-      Box b = s.extent_box();
+      Box b = s.extent_box ();
       b[Y_AXIS] = ly_scm2interval (yext);
 
       s = Stencil (b, s.expr ());
index 8f190f969cca7b4aa43a540c3ab8fb063cac0ba7..10e3be740e8f55156af9cb877883d346cfd79ea0 100644 (file)
@@ -25,7 +25,7 @@ protected:
   DECLARE_ACKNOWLEDGER (grob);
 };
 
-Parenthesis_engraver::Parenthesis_engraver()
+Parenthesis_engraver::Parenthesis_engraver ()
 {
 }
 
index 55f99cd5cfca149a66974c2cc00b503a933f17e0..fc3d2a727a119aa95c39190dfe5c4fb323d439b9 100644 (file)
@@ -171,7 +171,7 @@ Percent_repeat_engraver::process_music ()
              && to_boolean (get_property ("countPercentRepeats")))
            {
              Item *double_percent_counter = make_item ("DoublePercentRepeatCounter",
-                                                       percent_event_->self_scm());
+                                                       percent_event_->self_scm ());
 
              SCM text = scm_number_to_string (count,
                                               scm_from_int (10));
@@ -199,7 +199,7 @@ Percent_repeat_engraver::finalize ()
     {
       percent_event_->origin ()->warning (_ ("unterminated percent repeat"));
       percent_->suicide ();
-      percent_counter_->suicide();
+      percent_counter_->suicide ();
     }
 }
 
index 0039b36415fffd906ca88cc16a981fdf86342bd3..726b3a6e1d7ca2202f703fdfd18313b6d830f538 100644 (file)
@@ -14,7 +14,7 @@
 class Percent_repeat_iterator : public Sequential_iterator
 {
 public:
-  DECLARE_CLASSNAME(Percent_repeat_iterator);
+  DECLARE_CLASSNAME (Percent_repeat_iterator);
   DECLARE_SCHEME_CALLBACK (constructor, ());
   Percent_repeat_iterator ();
 protected:
index 5da5e3ee729970eb02ad9082b783cf02d1ae803c..c16c0c375406a60862e548a27089f33cc43792ca 100644 (file)
@@ -13,7 +13,7 @@ LY_DEFINE (ly_performance_write, "ly:performance-write",
           "Write @var{performance} to @var{filename}")
 {
   LY_ASSERT_TYPE (unsmob_performance, performance, 1);
-  LY_ASSERT_TYPE(scm_is_string, filename, 2);
+  LY_ASSERT_TYPE (scm_is_string, filename, 2);
 
   unsmob_performance (performance)->write_output (ly_scm2string (filename));
   return SCM_UNSPECIFIED;
index 86964ce53f6de2c8fab41b516385405d06b5ea5b..efda1be5cde7968e8949c89b41cef734ac3cf155 100644 (file)
@@ -14,7 +14,7 @@
 struct Piano_pedal_bracket
 {
   DECLARE_SCHEME_CALLBACK (print, (SCM));
-  DECLARE_GROB_INTERFACE();
+  DECLARE_GROB_INTERFACE ();
 };
 
 MAKE_SCHEME_CALLBACK (Piano_pedal_bracket, print, 1);
index ef01942221f26ebffd24c620927ffaf7360de17a..0c52377670e0e5efa8ee1ff5d0c089a7b464b5f1 100644 (file)
@@ -97,7 +97,7 @@ Piano_pedal_performer::process_music ()
              a->type_string_ = pedal_type;
              a->dir_ = STOP;
              audios_.push_back (a);
-              Audio_element_info info(a, p->event_drul_[STOP]);
+              Audio_element_info info (a, p->event_drul_[STOP]);
               announce_element (info);
            }
          p->start_event_ = 0;
@@ -110,7 +110,7 @@ Piano_pedal_performer::process_music ()
          a->type_string_ = pedal_type;
          a->dir_ = START;
          audios_.push_back (a);
-          Audio_element_info info(a, p->event_drul_[START]);
+          Audio_element_info info (a, p->event_drul_[START]);
           announce_element (info);
        }
       p->event_drul_[START] = 0;
index aa1ac5cbfeb1617f2984dca2ed5be8adb1a4cc74..e2f3aecf694632c03bb315d9d8098d47537528ce 100644 (file)
@@ -31,8 +31,8 @@ LY_DEFINE (ly_make_pitch, "ly:make-pitch",
           "The @var{alter} is a rational number of whole tones for alteration.")
 {
   LY_ASSERT_TYPE (scm_is_integer, octave, 1);
-  LY_ASSERT_TYPE(scm_is_integer, note, 2);
-  LY_ASSERT_TYPE(scm_is_rational, alter, 3);
+  LY_ASSERT_TYPE (scm_is_integer, note, 2);
+  LY_ASSERT_TYPE (scm_is_rational, alter, 3);
   
   Pitch p (scm_to_int (octave), scm_to_int (note),
           ly_scm2rational (alter));
index 7c43708890d506db29b1059ecafc77ef4d56b7bc..fa68b2d1bab2a4041653d2148648b4bc5dd00658 100644 (file)
@@ -119,7 +119,7 @@ Pitch::normalize ()
       alteration_ = Rational (0);
       alteration_ -= tone_pitch () - pitch;
     }
-  while (alteration_ < Rational(-1))
+  while (alteration_ < Rational (-1))
     {
       if (notename_ == 0)
        {
index c22c88bc729ab57a1c189ce10def62f0c730fdd7..3f729e4894c4407d89536817efffa23eb31e4609 100644 (file)
@@ -7,6 +7,7 @@
 */
 
 #include "prob.hh"
+#include "skyline.hh"
 
 LY_DEFINE (ly_prob_set_property_x, "ly:prob-set-property!",
           2, 1, 0, (SCM obj, SCM sym, SCM value),
@@ -36,7 +37,7 @@ LY_DEFINE (ly_prob_property, "ly:prob-property",
 {
   LY_ASSERT_SMOB (Prob, obj, 1);
   Prob *ps = unsmob_prob (obj);
-  LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
+  LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
 
   if (dfault == SCM_UNDEFINED)
     dfault = SCM_EOL;
@@ -54,7 +55,7 @@ LY_DEFINE (ly_prob_type_p, "ly:prob-type?",
           "If obj the specified prob-type?")
 {
   Prob*prob = unsmob_prob (obj);
-  return scm_from_bool (prob && prob->type() == type);
+  return scm_from_bool (prob && prob->type () == type);
 }
 
 LY_DEFINE (ly_make_prob, "ly:make-prob",
@@ -77,9 +78,34 @@ LY_DEFINE (ly_make_prob, "ly:make-prob",
 }
 
   
-LY_DEFINE(ly_paper_system_p, "ly:paper-system?",
+LY_DEFINE (ly_paper_system_p, "ly:paper-system?",
          1, 0, 0, (SCM obj),
          "Type predicate.")
 {
   return ly_prob_type_p (obj, ly_symbol2scm ("paper-system"));
 }
+
+LY_DEFINE (ly_paper_system_minimum_distance, "ly:paper-system-minimum-distance",
+          2, 0, 0, (SCM sys1, SCM sys2),
+          "Measure the minimum distance between these two paper-systems "
+          "using their stored skylines if possible and falling back to "
+          "their extents otherwise.")
+{
+  Real ret = 0;
+  Prob *p1 = unsmob_prob (sys1);
+  Prob *p2 = unsmob_prob (sys2);
+  Skyline_pair *sky1 = Skyline_pair::unsmob (p1->get_property ("skylines"));
+  Skyline_pair *sky2 = Skyline_pair::unsmob (p2->get_property ("skylines"));
+
+  if (sky1 && sky2)
+    ret = (*sky1)[DOWN].distance ((*sky2)[UP]);
+  else
+    {
+      Stencil *s1 = unsmob_stencil (p1->get_property ("stencil"));
+      Stencil *s2 = unsmob_stencil (p2->get_property ("stencil"));
+      Interval iv1 = s1->extent (Y_AXIS);
+      Interval iv2 = s2->extent (Y_AXIS);
+      ret = iv2[UP] - iv1[DOWN];
+    }
+  return scm_from_double (ret);
+}
index e6facbddc5808f521d47bbfe4516d9d6159ddcc5..ce51546d8e0f83f50582e840cecb25b9b09988de 100644 (file)
@@ -47,7 +47,7 @@ Prob::equal_p (SCM sa, SCM sb)
       SCM bprop = props[1][i];
 
       for (;
-          scm_is_pair (aprop) && scm_is_pair(bprop);
+          scm_is_pair (aprop) && scm_is_pair (bprop);
           aprop = scm_cdr (aprop), bprop = scm_cdr (bprop))
        {
          SCM aval = scm_cdar (aprop);
@@ -111,7 +111,7 @@ Prob::derived_mark () const
 SCM
 Prob::mark_smob (SCM smob)
 {
-  ASSERT_LIVE_IS_ALLOWED();
+  ASSERT_LIVE_IS_ALLOWED ();
   
   Prob *system = (Prob *) SCM_CELL_WORD_1 (smob);
   scm_gc_mark (system->mutable_property_alist_);
index 47502f7dbda9f054f9524c0587763cf5b26bc91b..635b4165c9b2039bdda7fe8654795665ff81beaa 100644 (file)
@@ -233,7 +233,7 @@ setup_paths (char const *argv0_ptr)
   /*
     When running from build dir, a full LILYPOND_PREFIX is set-up at
 
-        $(OUTBASE)/{share,lib}/lilypond/current
+        $(OUTBASE)/{share, lib}/lilypond/current
 
   */
   
@@ -268,9 +268,9 @@ setup_paths (char const *argv0_ptr)
 string
 expand_environment_variables (string orig)
 {
-  const char *start_ptr = orig.c_str();
-  const char *ptr = orig.c_str();
-  size_t len = orig.length();
+  const char *start_ptr = orig.c_str ();
+  const char *ptr = orig.c_str ();
+  size_t len = orig.length ();
 
   string out;
   while (ptr < start_ptr + len)
@@ -318,7 +318,7 @@ expand_environment_variables (string orig)
          if (start_var < end_var)
            {
              string var_name (start_var, end_var - start_var);
-             const char *value = getenv (var_name.c_str());
+             const char *value = getenv (var_name.c_str ());
              if (value != NULL)
                out += string (value);
 
@@ -380,11 +380,11 @@ read_relocation_file (string filename)
       value = expand_environment_variables (value);
 
       if (command == "set")
-       sane_putenv (variable.c_str(), value, true);
+       sane_putenv (variable.c_str (), value, true);
       else if (command == "setdir")
-       set_env_dir (variable.c_str(), value);
+       set_env_dir (variable.c_str (), value);
       else if (command == "setfile")
-       set_env_file (variable.c_str(), value);
+       set_env_file (variable.c_str (), value);
       else if (command == "prependdir")
        prepend_env_path (variable.c_str (), value);
       else
index e470e9154c838263e3bf988513705fd01dc315e7..063b773a92ae2f3ccf58792ba566095bf884b0a2 100644 (file)
@@ -87,7 +87,7 @@ Rest_collision::add_column (Grob *me, Grob *p)
   TODO: look at horizontal-shift to determine ordering between rests
   for more than two voices.
 */
-MAKE_SCHEME_CALLBACK(Rest_collision, calc_positioning_done, 1);
+MAKE_SCHEME_CALLBACK (Rest_collision, calc_positioning_done, 1);
 SCM
 Rest_collision::calc_positioning_done (SCM smob)
 {
index 0859c25dba306de8fdddaca00c4a421fb0c7a9c6..ecd2b9357edb3a2ea4aec7c8ed10405c9008eb05 100644 (file)
@@ -111,5 +111,5 @@ Scale::~Scale ()
 {
 }
 
-IMPLEMENT_SMOBS(Scale);
-IMPLEMENT_DEFAULT_EQUAL_P(Scale);
+IMPLEMENT_SMOBS (Scale);
+IMPLEMENT_DEFAULT_EQUAL_P (Scale);
index eb89e555f83819771cc2054c6e7e1adde0f0d9e4..8d66adf0dda003a785d0f101004e5fb41fcba728 100644 (file)
@@ -131,7 +131,7 @@ Score_engraver::finalize ()
   typeset_all ();
 }
 
-IMPLEMENT_LISTENER(Score_engraver, one_time_step);
+IMPLEMENT_LISTENER (Score_engraver, one_time_step);
 void
 Score_engraver::one_time_step (SCM)
 {
index 4e08f46ae1e62841d253aa6220b12ed459a3077c..83111f670755cf74ae935c1ff5a938dcf4b9205e 100644 (file)
@@ -21,7 +21,6 @@ LY_DEFINE (ly_make_score, "ly:make-score",
           "Return score with @var{music} encapsulated in @var{score}.")
 {
   LY_ASSERT_SMOB (Music, music, 1);
-  Music *mus = unsmob_music (music);
 
   Score *score = new Score;
   score->set_music (music);
@@ -38,7 +37,7 @@ LY_DEFINE (ly_score_output_defs, "ly:score-output-defs",
 
   SCM l = SCM_EOL;
   for (vsize i = 0; i < sc->defs_.size (); i++)
-    l = scm_cons (sc->defs_[i]->self_scm(), l);
+    l = scm_cons (sc->defs_[i]->self_scm (), l);
   return scm_reverse_x (l, SCM_EOL);
 }
 
index 9087b88e6cd16ca1302a7a847bec7070de98e795..ff77193f179def3ba646fcdb507993a7036cf942 100644 (file)
@@ -79,7 +79,7 @@ Script_interface::print (SCM smob)
 
 struct Text_script
 {
-  DECLARE_GROB_INTERFACE();
+  DECLARE_GROB_INTERFACE ();
 };
 
 ADD_INTERFACE (Text_script,
index ee18953aef22247e8472eae4319ee81b20069cba..70d431f10591237996c81dd50bdac51b8824dae2 100644 (file)
@@ -20,7 +20,7 @@
 #include "tie-column-format.hh"
 
 
-ADD_INTERFACE(Semi_tie_column,
+ADD_INTERFACE (Semi_tie_column,
              "The interface for a column of l.v. ties.",
 
              /* properties */
@@ -34,7 +34,7 @@ ADD_INTERFACE(Semi_tie_column,
 /*
   Cut & paste from tie-column.cc
  */   
-MAKE_SCHEME_CALLBACK(Semi_tie_column, calc_positioning_done, 1);
+MAKE_SCHEME_CALLBACK (Semi_tie_column, calc_positioning_done, 1);
 SCM
 Semi_tie_column::calc_positioning_done (SCM smob)
 {
@@ -58,7 +58,7 @@ Semi_tie_column::calc_positioning_done (SCM smob)
   problem.set_manual_tie_configuration (manual_configs);
 
   Ties_configuration base = problem.generate_optimal_configuration ();
-  for (vsize i = 0; i < lv_ties.size(); i++)
+  for (vsize i = 0; i < lv_ties.size (); i++)
     {
       SCM cp = Tie::get_control_points (lv_ties[i], problem.common_x_refpoint (), base[i],
                                        problem.details_);
index a95b30737f263dda851cce80f9271b7934a4bc6c..a12156e6037ad0ef76b83ebadc4c1a49b4d664f0 100644 (file)
@@ -15,7 +15,7 @@
 #include "warn.hh"
 #include "staff-symbol-referencer.hh"
 
-ADD_INTERFACE(Semi_tie,
+ADD_INTERFACE (Semi_tie,
              
              "A tie which is only on one side connected to note heads. ",
 
@@ -28,7 +28,7 @@ ADD_INTERFACE(Semi_tie,
              "thickness "
              );
 
-MAKE_SCHEME_CALLBACK(Semi_tie, calc_control_points, 1)
+MAKE_SCHEME_CALLBACK (Semi_tie, calc_control_points, 1)
 SCM
 Semi_tie::calc_control_points (SCM smob)
 {
index c0536b6ce3ab69b95f545b860d45ba65a707ee8e..0e3a075100402c3fba1432e5a8097171b8c1eef0 100644 (file)
@@ -68,7 +68,7 @@ Separation_item::conditional_skyline (Grob *me, Grob *left)
 }
 
 
-MAKE_SCHEME_CALLBACK(Separation_item,calc_skylines,1);
+MAKE_SCHEME_CALLBACK (Separation_item, calc_skylines,1);
 SCM
 Separation_item::calc_skylines (SCM smob)
 {
index f473b30e47e446d79922cbcdd9c8d81bad69e84d..22ee294f49916b9e283c19745b944eafe7bb9673 100644 (file)
@@ -83,14 +83,14 @@ evaluate_with_simple_closure (SCM delayed_argument,
   return SCM_EOL;
 }
 
-LY_DEFINE(ly_simple_closure_p, "ly:simple-closure?",
+LY_DEFINE (ly_simple_closure_p, "ly:simple-closure?",
          1,0,0, (SCM clos),
          "Type predicate.")
 {
   return scm_from_bool (is_simple_closure (clos));
 }
 
-LY_DEFINE(ly_make_simple_closure, "ly:make-simple-closure",
+LY_DEFINE (ly_make_simple_closure, "ly:make-simple-closure",
          1, 0, 0, (SCM expr),
          "Make a simple closure. @var{expr} should be form of "
          "@code{(@var{func} @var{a1} @var{A2} ...)}, and will be invoked "
@@ -98,11 +98,11 @@ LY_DEFINE(ly_make_simple_closure, "ly:make-simple-closure",
 {
   SCM z;
 
-  SCM_NEWSMOB(z, simple_closure_tag, expr);
+  SCM_NEWSMOB (z, simple_closure_tag, expr);
   return z;
 }
 
-LY_DEFINE(ly_eval_simple_closure, "ly:eval-simple-closure",
+LY_DEFINE (ly_eval_simple_closure, "ly:eval-simple-closure",
          2, 2, 0, (SCM delayed, SCM closure, SCM scm_start, SCM scm_end),
          "Evaluate a simple closure with the given delayed argument. "
          "If start and end are defined, evaluate it purely with those "
index 2e0f4ba9f73883a31832c40afff776dd1b8821ed..6f7610670670be53853887ddd0818cafbef02a11 100644 (file)
@@ -29,7 +29,7 @@ LY_DEFINE (ly_solve_spring_rod_problem, "ly:solve-spring-rod-problem",
 
   SCM_ASSERT_TYPE (len >= 0, springs, SCM_ARG1, __FUNCTION__, "list of springs");
   SCM_ASSERT_TYPE (scm_ilength (rods)  > 0, rods, SCM_ARG1, __FUNCTION__, "list of rods");
-  LY_ASSERT_TYPE(scm_is_number, length, 3);
+  LY_ASSERT_TYPE (scm_is_number, length, 3);
 
   bool is_ragged = ragged == SCM_BOOL_T;
   Simple_spacer spacer;
index 5f28644ba6451acd847da9e2036f6f45b61282ec..9200554822b87030d8e0b6c452fd7b3fe5ba859a 100644 (file)
@@ -247,6 +247,20 @@ Simple_spacer::spring_positions () const
   return ret;
 }
 
+Real
+Simple_spacer::force_penalty (bool ragged) const
+{
+  /* If we are ragged-right, we don't want to penalise according to the force,
+     but according to the amount of whitespace that is present after the end
+     of the line. */
+  if (ragged)
+    return max (0.0, line_len_ - configuration_length (0.0));
+
+  /* Use a convex compression penalty. */
+  Real f = force_;
+  return f - (f < 0 ? f*f*f*f*4 : 0);
+}
+
 /****************************************************************/
 
 Spring_description::Spring_description ()
@@ -449,14 +463,7 @@ get_line_forces (vector<Grob*> const &columns,
                }
            }
          spacer.solve ((b == 0) ? line_len - indent : line_len, ragged);
-
-         /* add a (convex) penalty for compression. We do this _only_ in get_line_forces,
-            not get_line_configuration. This is temporary, for backwards compatibility;
-            the old line/page-breaking stuff ignores page breaks when it calculates line
-            breaks, so compression penalties can result in scores (eg. wtk-fugue) blowing
-            up to too many pages. */
-         Real f = spacer.force ();
-         force[b * breaks.size () + c] = f - (f < 0 ? f*f*f*f*4 : 0);
+         force[b * breaks.size () + c] = spacer.force_penalty (ragged);
 
          if (!spacer.fits ())
            {
@@ -513,12 +520,8 @@ get_line_configuration (vector<Grob*> const &columns,
     }
 
   spacer.solve (line_len, ragged);
-  ret.force_ = spacer.force ();
+  ret.force_ = spacer.force_penalty (ragged);
 
-  /*
-    We used to have a penalty for compression, no matter what, but that
-    fucked up wtk1-fugue2 (taking 3 full pages.)
-  */
   ret.config_ = spacer.spring_positions ();
   for (vsize i = 0; i < ret.config_.size (); i++)
     ret.config_[i] += indent;
index b729e5312b15a56471f9f7b58ca542e0db947281..99452189c65f7784678e82c71c7e94ec3fbd9a60 100644 (file)
@@ -153,7 +153,7 @@ Building::Building (Box const &b, Real horizon_padding, Axis horizon_axis, Direc
 void
 Building::precompute ()
 {
-  slope_ = (height_[RIGHT] - height_[LEFT]) / (iv_.length());
+  slope_ = (height_[RIGHT] - height_[LEFT]) / (iv_.length ());
   if (height_[LEFT] == height_[RIGHT]) /* in case they're both infinity */
     slope_ = 0;
 
@@ -381,7 +381,7 @@ Skyline::internal_build_skyline (list<Building> *buildings)
   while (!buildings->empty ())
     partials.push_back (non_overlapping_skyline (buildings));
 
-  /* we'd like to say while (partials->size () > 1) but that's O(n).
+  /* we'd like to say while (partials->size () > 1) but that's O (n).
      Instead, we exit in the middle of the loop */
   while (!partials.empty ())
     {
@@ -582,6 +582,12 @@ Skyline::to_points () const
   return out;
 }
 
+bool
+Skyline::is_empty () const
+{
+  return buildings_.empty ();
+}
+
 Skyline_pair::Skyline_pair ()
   : skylines_ (Skyline (DOWN), Skyline (UP))
 {
@@ -625,6 +631,13 @@ Skyline_pair::merge (Skyline_pair const &other)
   skylines_[DOWN].merge (other[DOWN]);
 }
 
+bool
+Skyline_pair::is_empty () const
+{
+  return skylines_[UP].is_empty ()
+    && skylines_[DOWN].is_empty ();
+}
+
 Skyline&
 Skyline_pair::operator [] (Direction d)
 {
@@ -651,7 +664,7 @@ IMPLEMENT_DEFAULT_EQUAL_P (Skyline_pair);
 SCM
 Skyline::mark_smob (SCM)
 {
-  ASSERT_LIVE_IS_ALLOWED();
+  ASSERT_LIVE_IS_ALLOWED ();
   return SCM_EOL;
 }
 
index 6dc6b5718ac487d2a1c6256df93ea3f4420d39ac..b89f12867219eec185c9dec4c4404860b48f0a96 100644 (file)
@@ -273,7 +273,7 @@ Slur_score_state::fill (Grob *me)
 }
 
 
-MAKE_SCHEME_CALLBACK(Slur, calc_control_points, 1)
+MAKE_SCHEME_CALLBACK (Slur, calc_control_points, 1)
 SCM
 Slur::calc_control_points (SCM smob)
 {
@@ -621,7 +621,7 @@ Slur_score_state::generate_avoid_offsets () const
 
          if (!xe.is_empty ()
              && !ye.is_empty ())
-           avoid.push_back (Offset (xe.center(), ye[dir_]));
+           avoid.push_back (Offset (xe.center (), ye[dir_]));
        }
     }  
   return avoid;
index 9ce45e61f59bbd515522d72f59eb306ad25cf6f5..3d22a2cb19a95355fe5730a8816e526e8a40fcf1 100644 (file)
@@ -32,7 +32,7 @@
 
 
 
-MAKE_SCHEME_CALLBACK(Slur, calc_direction, 1)
+MAKE_SCHEME_CALLBACK (Slur, calc_direction, 1)
 SCM
 Slur::calc_direction (SCM smob)
 {
@@ -356,6 +356,20 @@ Slur::auxiliary_acknowledge_extra_object (Grob_info const &info,
     e->warning ("Ignoring grob for slur. avoid-slur not set?");
 }
 
+MAKE_SCHEME_CALLBACK (Slur, cross_staff, 1)
+SCM
+Slur::cross_staff (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+  Grob *staff = Staff_symbol_referencer::get_staff_symbol (me);
+  assert (staff); // delete me
+  extract_grob_set (me, "note-columns", cols);
+
+  for (vsize i = 0; i < cols.size (); i++)
+    if (Staff_symbol_referencer::get_staff_symbol (cols[i]) != staff)
+      return SCM_BOOL_T;
+  return SCM_BOOL_F;
+}
 
 ADD_INTERFACE (Slur,
               
index 34b5bb36ab697e30da50d1480f01eb0bb6ea49d5..a4c88fe58b12f276406dcae0a9d5b78d4b04d343 100644 (file)
@@ -21,7 +21,7 @@ init_smob_protection ()
 }
 ADD_SCM_INIT_FUNC (init_smob_protection, init_smob_protection);
 
-LY_DEFINE(ly_smob_protects, "ly:smob-protects",
+LY_DEFINE (ly_smob_protects, "ly:smob-protects",
          0, 0, 0, (),
          "Return lily's internal smob protection list")
 {
index 879653dff0b050cb7fb283f91ebf6ca62bd6c870..90bc5fcabde4a01ecfd8d0e6a55e09d8aa1621f5 100644 (file)
@@ -188,7 +188,7 @@ Source_file::quote_input (char const *pos_str0) const
   string context = line.substr (0, ch)
     + to_string ('\n')
     + to_string (' ', col)
-    + line.substr (ch, line.length()-ch);
+    + line.substr (ch, line.length ()-ch);
   return context;
 }
 
@@ -365,9 +365,9 @@ Source_file::get_port () const
 
 #include "ly-smobs.icc"
 
-IMPLEMENT_SMOBS(Source_file);
-IMPLEMENT_DEFAULT_EQUAL_P(Source_file);
-IMPLEMENT_TYPE_P(Source_file, "ly:source-file?");
+IMPLEMENT_SMOBS (Source_file);
+IMPLEMENT_DEFAULT_EQUAL_P (Source_file);
+IMPLEMENT_TYPE_P (Source_file, "ly:source-file?");
 
 SCM
 Source_file::mark_smob (SCM smob)
index 50848ecc598a2ae8c33f944605e6efd3ce2967d5..ee4ddba35ddd25baeddedb90ee13aa65dacbaf94 100644 (file)
@@ -50,7 +50,7 @@ Spacing_spanner::set_springs (SCM smob)
   Spanner *me = unsmob_spanner (smob);
 
   /*
-    can't use get_system() ? --hwn.
+    can't use get_system () ? --hwn.
   */
   Spacing_options options;
   options.init_from_grob (me);
@@ -404,7 +404,7 @@ bool
 Spacing_spanner::fills_measure (Grob *me, Item *left, Item *col)
 {
   System *sys = get_root_system (me);
-  Item *next = sys->column (col->get_column()->get_rank () + 1);
+  Item *next = sys->column (col->get_column ()->get_rank () + 1);
   if (!next)
     return false;
 
index ec70ba6817b6e9bab5a4a9d51bd6c3f548eb2f1d..0dc62b3a51e041760350aeffe900f72accd65aca 100644 (file)
@@ -16,7 +16,7 @@ LY_DEFINE (ly_spanner_bound, "ly:spanner-bound",
           "for left, and @code{1} for right.")
 {
   LY_ASSERT_TYPE (unsmob_spanner, slur, 1);
-  LY_ASSERT_TYPE(is_direction, dir,2);
+  LY_ASSERT_TYPE (is_direction, dir,2);
   
   return unsmob_spanner (slur)->get_bound (to_dir (dir))->self_scm ();
 }
index 14ab378668eba48b12546c2febb4a4a29ffae231..8cc223b191ec89554bc7347247139b62a15bbeaf 100644 (file)
@@ -393,7 +393,7 @@ unsmob_spanner (SCM s)
   return dynamic_cast<Spanner *> (unsmob_grob (s));
 }
 
-MAKE_SCHEME_CALLBACK(Spanner, bounds_width, 1);
+MAKE_SCHEME_CALLBACK (Spanner, bounds_width, 1);
 SCM
 Spanner::bounds_width (SCM grob)
 {
index 9f6b1915e8cdf715df5724e315dd2ec3c9b269fa..d7102ac15b33aa576425728e3c1917ecdd529a37 100644 (file)
@@ -139,7 +139,7 @@ Staff_symbol::get_ledger_line_thickness (Grob *me)
   return z[X_AXIS] * get_line_thickness (me) + z[Y_AXIS] * staff_space (me);
 }
 
-MAKE_SCHEME_CALLBACK(Staff_symbol,height,1);
+MAKE_SCHEME_CALLBACK (Staff_symbol, height,1);
 SCM
 Staff_symbol::height  (SCM smob)
 {
index c8fbd63d18d3ec037f5fe3c8ed030622ffee6710..9bb588db4f73450917cfe182143ffad014aac300 100644 (file)
@@ -160,7 +160,7 @@ Stem_tremolo::untranslated_stencil (Grob *me, Real slope)
   if (!stem)
     {
       programming_error ("no stem for stem-tremolo");
-      return Stencil();
+      return Stencil ();
     }
 
   Direction stemdir = get_grob_direction (stem);
index 857dfb7d49fbbc37aceed0421697de11b9806566..862163fad9785987c6414eb58348998e557016a3 100644 (file)
@@ -239,6 +239,10 @@ Stem::pure_height (SCM smob, SCM start, SCM end)
 
   if (!is_normal_stem (me))
     return ly_interval2scm (iv);
+
+  /* if we are part of a cross-staff beam, return empty */
+  if (get_beam (me) && Beam::is_cross_staff (get_beam (me)))
+    return ly_interval2scm (iv);
   
   Real ss = Staff_symbol_referencer::staff_space (me);
   Real len = scm_to_double (calc_length (smob)) * ss / 2;
@@ -402,7 +406,7 @@ Stem::duration_log (Grob *me)
   return (scm_is_number (s)) ? scm_to_int (s) : 2;
 }
 
-MAKE_SCHEME_CALLBACK(Stem, calc_positioning_done, 1);
+MAKE_SCHEME_CALLBACK (Stem, calc_positioning_done, 1);
 SCM
 Stem::calc_positioning_done (SCM smob)
 {
@@ -508,7 +512,7 @@ Stem::calc_positioning_done (SCM smob)
   return SCM_BOOL_T;
 }
 
-MAKE_SCHEME_CALLBACK(Stem, calc_direction, 1);
+MAKE_SCHEME_CALLBACK (Stem, calc_direction, 1);
 SCM
 Stem::calc_direction (SCM smob)
 {
@@ -531,7 +535,7 @@ Stem::calc_direction (SCM smob)
   return scm_from_int (dir);
 }
 
-MAKE_SCHEME_CALLBACK(Stem, calc_default_direction, 1);
+MAKE_SCHEME_CALLBACK (Stem, calc_default_direction, 1);
 SCM
 Stem::calc_default_direction (SCM smob)
 {
@@ -570,11 +574,11 @@ Stem::height (SCM smob)
     }
 
   /*
-    Can't get_stencil(), since that would cache stencils too early.
+    Can't get_stencil (), since that would cache stencils too early.
     This causes problems with beams.
    */
   Stencil *stencil = unsmob_stencil (print (smob));
-  Interval iv = stencil ? stencil->extent (Y_AXIS) : Interval();
+  Interval iv = stencil ? stencil->extent (Y_AXIS) : Interval ();
   if (beam)
     {
       if (dir == CENTER)
@@ -857,7 +861,7 @@ Stem::get_stem_info (Grob *me)
   return si;
 }
 
-MAKE_SCHEME_CALLBACK(Stem, calc_stem_info, 1);
+MAKE_SCHEME_CALLBACK (Stem, calc_stem_info, 1);
 SCM
 Stem::calc_stem_info (SCM smob)
 {
@@ -1001,6 +1005,20 @@ Stem::beam_multiplicity (Grob *stem)
   return le;
 }
 
+bool
+Stem::is_cross_staff (Grob *stem)
+{
+  Grob *beam = unsmob_grob (stem->get_object ("beam"));
+  return beam && Beam::is_cross_staff (beam);
+}
+
+MAKE_SCHEME_CALLBACK (Stem, cross_staff, 1)
+SCM
+Stem::cross_staff (SCM smob)
+{
+  return scm_from_bool (is_cross_staff (unsmob_grob (smob)));
+}
+
 /* FIXME:  Too many properties  */
 ADD_INTERFACE (Stem,
               "The stem represent the graphical stem.  "
index 90a82ec466eeedd6dfc12f3754879487c24fd459..36f1406b66809d441076f79a0b8624c2e3ec2b5d 100644 (file)
@@ -22,8 +22,8 @@ LY_DEFINE (ly_stencil_translate_axis, "ly:stencil-translate-axis",
 {
   Stencil *s = unsmob_stencil (stil);
   LY_ASSERT_SMOB (Stencil, stil, 1);
-  LY_ASSERT_TYPE(scm_is_number,amount, 2);
-  LY_ASSERT_TYPE(is_axis,axis, 3);
+  LY_ASSERT_TYPE (scm_is_number, amount, 2);
+  LY_ASSERT_TYPE (is_axis, axis, 3);
 
   Real real_amount = scm_to_double (amount);
 
@@ -40,7 +40,7 @@ LY_DEFINE (ly_stencil_translate, "ly:stencil-translate",
 {
   Stencil *s = unsmob_stencil (stil);
   LY_ASSERT_SMOB (Stencil, stil, 1);
-  LY_ASSERT_TYPE(is_number_pair, offset, 2);
+  LY_ASSERT_TYPE (is_number_pair, offset, 2);
   Offset o = ly_scm2offset (offset);
 
   SCM new_s = s->smobbed_copy ();
@@ -65,7 +65,7 @@ LY_DEFINE (ly_stencil_extent, "ly:stencil-extent",
 {
   Stencil *s = unsmob_stencil (stil);
   LY_ASSERT_SMOB (Stencil, stil, 1);
-  LY_ASSERT_TYPE(is_axis, axis, 2);
+  LY_ASSERT_TYPE (is_axis, axis, 2);
 
   return ly_interval2scm (s->extent (Axis (scm_to_int (axis))));
 }
@@ -100,19 +100,19 @@ LY_DEFINE (ly_stencil_combine_at_edge, "ly:stencil-combine-at-edge",
                   first, SCM_ARG1, __FUNCTION__, "Stencil, #f or ()");
   SCM_ASSERT_TYPE (s2 || second == SCM_BOOL_F || second == SCM_EOL,
                   second, SCM_ARG4, __FUNCTION__, "Stencil, #f or ()");
-  LY_ASSERT_TYPE(is_axis, axis,  2);
-  LY_ASSERT_TYPE(is_direction, direction, 3);
+  LY_ASSERT_TYPE (is_axis, axis,  2);
+  LY_ASSERT_TYPE (is_direction, direction, 3);
 
   Real p = 0.0;
   if (padding != SCM_UNDEFINED)
     {
-      LY_ASSERT_TYPE(scm_is_number, padding, 5);
+      LY_ASSERT_TYPE (scm_is_number, padding, 5);
       p = scm_to_double (padding);
     }
   Real m = 0.0;
   if (minimum != SCM_UNDEFINED)
     {
-      LY_ASSERT_TYPE(scm_is_number, minimum, 6);
+      LY_ASSERT_TYPE (scm_is_number, minimum, 6);
       m = scm_to_double (minimum);
     }
 
@@ -174,14 +174,14 @@ LY_DEFINE (ly_make_stencil, "ly:make-stencil",
   Interval x; 
   if (xext != SCM_UNDEFINED)
     {
-      LY_ASSERT_TYPE(is_number_pair, xext, 2);
+      LY_ASSERT_TYPE (is_number_pair, xext, 2);
       x = ly_scm2interval (xext);
     }
 
   Interval y; 
   if (yext != SCM_UNDEFINED)
     {
-      LY_ASSERT_TYPE(is_number_pair,yext, 3);
+      LY_ASSERT_TYPE (is_number_pair, yext, 3);
       y = ly_scm2interval (yext);
     }
 
@@ -197,8 +197,8 @@ LY_DEFINE (ly_stencil_aligned_to, "ly:stencil-aligned-to",
           "Other values are interpolated (so 0 means the center).")
 {
   LY_ASSERT_SMOB (Stencil, stil, 1);
-  LY_ASSERT_TYPE(is_axis,axis, 2);
-  LY_ASSERT_TYPE(scm_is_number, dir, 3);
+  LY_ASSERT_TYPE (is_axis, axis, 2);
+  LY_ASSERT_TYPE (scm_is_number, dir, 3);
 
   Stencil target = *unsmob_stencil (stil);
 
@@ -264,9 +264,9 @@ LY_DEFINE (ly_bracket, "ly:bracket",
           "may be negative. The thickness is given by @var{t}.")
 {
   LY_ASSERT_TYPE (is_axis, a, 1);
-  LY_ASSERT_TYPE(is_number_pair,iv, 2);
-  LY_ASSERT_TYPE(scm_is_number, t,3);
-  LY_ASSERT_TYPE(scm_is_number, p,4);
+  LY_ASSERT_TYPE (is_number_pair, iv, 2);
+  LY_ASSERT_TYPE (scm_is_number, t,3);
+  LY_ASSERT_TYPE (scm_is_number, p,4);
 
   return Lookup::bracket ((Axis)scm_to_int (a), ly_scm2interval (iv),
                          scm_to_double (t),
@@ -280,9 +280,9 @@ LY_DEFINE (ly_stencil_rotate, "ly:stencil-rotate",
 {
   Stencil *s = unsmob_stencil (stil);
   LY_ASSERT_SMOB (Stencil, stil, 1);
-  LY_ASSERT_TYPE(scm_is_number,angle, 2);
-  LY_ASSERT_TYPE(scm_is_number, x,3);
-  LY_ASSERT_TYPE(scm_is_number, y, 4);
+  LY_ASSERT_TYPE (scm_is_number, angle, 2);
+  LY_ASSERT_TYPE (scm_is_number, x,3);
+  LY_ASSERT_TYPE (scm_is_number, y, 4);
   Real a = scm_to_double (angle);
   Real x_off = scm_to_double (x);
   Real y_off = scm_to_double (y);
@@ -301,8 +301,8 @@ LY_DEFINE (ly_round_filled_box, "ly:round-filled-box",
           "@var{yext} and roundness @var{blot}.")
 {
   LY_ASSERT_TYPE (is_number_pair, xext, 1);
-  LY_ASSERT_TYPE(is_number_pair, yext, 2);
-  LY_ASSERT_TYPE(scm_is_number, blot, 3);
+  LY_ASSERT_TYPE (is_number_pair, yext, 2);
+  LY_ASSERT_TYPE (scm_is_number, blot, 3);
 
   return Lookup::round_filled_box (Box (ly_scm2interval (xext), ly_scm2interval (yext)),
                                   scm_to_double (blot)).smobbed_copy ();
index 68aedd5497164eb09fa575b80e4b65756cac5a8e..04df26a7220c573c9532ef01d9e12ee8c704f801 100644 (file)
@@ -15,7 +15,7 @@ LY_DEFINE (ly_make_stream_event, "ly:make-stream-event",
   LY_ASSERT_TYPE (ly_is_symbol, cl, 1);
 
   /* should be scm_list_p, but scm_list_p is expensive. */
-  LY_ASSERT_TYPE(scm_is_pair, proplist, 2);
+  LY_ASSERT_TYPE (scm_is_pair, proplist, 2);
   
   if (proplist == SCM_UNDEFINED)
     proplist = SCM_EOL;
diff --git a/lily/system-scheme.cc b/lily/system-scheme.cc
new file mode 100644 (file)
index 0000000..d0b7cfc
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+  system-scheme.cc -- implement scheme bindings to System
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 2007 Joe Neeman <joeneeman@gmail.com>
+*/
+
+#include "align-interface.hh"
+#include "pointer-group-interface.hh"
+#include "system.hh"
+
+
+LY_DEFINE (ly_system_print, "ly:system-print",
+          1, 0, 0, (SCM system),
+          "Draw the system and return the prob containing its "
+          "stencil.")
+{
+  Grob *me = unsmob_grob (system);
+  System *me_system = dynamic_cast<System*> (me);
+  SCM_ASSERT_TYPE (me, system, SCM_ARG1, __FUNCTION__, "grob");
+
+  return me_system->get_paper_system ();
+}
+
+LY_DEFINE (ly_system_stretch, "ly:system-stretch",
+          2, 0, 0, (SCM system, SCM amount_scm),
+          "Stretch the system vertically by the given amount. "
+          "This must be called before the system is drawn (for example "
+          "with ly:system-print).")
+{
+  Grob *me = unsmob_grob (system);
+  Real amount = robust_scm2double (amount_scm, 0.0);
+  
+  extract_grob_set (me, "elements", elts);
+  for (vsize i = 0; i < elts.size (); i++)
+    if (Align_interface::has_interface (elts[i]))
+      {
+       Align_interface::stretch (elts[i], amount, Y_AXIS);
+       break;
+      }
+  return SCM_UNDEFINED;
+}
index 479618addcdb1b50aef2c4768a373964ce157aff..ee4bf6ef114a5265cbb595e91361c6c09647988b 100644 (file)
@@ -21,7 +21,7 @@
 struct Bracket_nesting_node
 {
 public:
-  virtual ~Bracket_nesting_node(){}
+  virtual ~Bracket_nesting_node (){}
   virtual bool add_staff (Grob *) { return false; }
   virtual void add_support (Grob *) { }
   virtual void set_bound (Direction, Grob *){}
@@ -219,7 +219,7 @@ System_start_delimiter_engraver::finalize ()
 void
 System_start_delimiter_engraver::acknowledge_staff_symbol (Grob_info inf)
 {
-  Grob *staff = inf.grob();
+  Grob *staff = inf.grob ();
   bool succ = nesting_->add_staff (staff);
 
   if (!succ)
index 206ccd84db7cf68dfede69e5c67c0095b75b64a7..0d12490ff931c99e7dc4264c80bb65250474b6a9 100644 (file)
@@ -167,7 +167,7 @@ System_start_delimiter::staff_brace (Grob *me, Real y)
   while (hi - lo > 1);
 
   Stencil stil (fm->find_by_name ("brace" + to_string (lo)));
-  stil.translate_axis (-b[X_AXIS].length()/2, X_AXIS);
+  stil.translate_axis (-b[X_AXIS].length ()/2, X_AXIS);
 
   stil.translate_axis (-0.2, X_AXIS);
   
index 00795d22d749a743b8b381508f0816477e7ecc93..494ab149b883f8f024df6d37ca685dca8e171dbf 100644 (file)
@@ -19,7 +19,7 @@ class System_start_text
 {
 public:
   static Stencil get_stencil (Grob *);
-  DECLARE_GROB_INTERFACE();
+  DECLARE_GROB_INTERFACE ();
 
   DECLARE_SCHEME_CALLBACK (print, (SCM));
 };
@@ -47,7 +47,7 @@ System_start_text::get_stencil (Grob *me_grob)
        p->align_to (Y_AXIS, robust_scm2double (align_y, 0.0));
       return *p;
     }
-  return Stencil();
+  return Stencil ();
 }
 
 
index 06ac09e39a224b6b31467474d88e14e54bf1d341..6e19d0a6f4f83c8a6613cdcb76f2cd7e7ceab0b1 100644 (file)
@@ -114,8 +114,8 @@ fixup_refpoints (vector<Grob*> const &grobs)
     grobs[i]->fixup_refpoint ();
 }
 
-SCM
-System::get_paper_systems ()
+void
+System::do_break_substitution_and_fixup_refpoints ()
 {
   for (vsize i = 0; i < all_elements_->size (); i++)
     {
@@ -178,7 +178,20 @@ System::get_paper_systems ()
 
   if (be_verbose_global)
     message (_f ("Element count %d.", count + element_count ()));
+}
+
+SCM
+System::get_broken_system_grobs ()
+{
+  SCM ret = SCM_EOL;
+  for (vsize i = 0; i < broken_intos_.size (); i++)
+    ret = scm_cons (broken_intos_[i]->self_scm (), ret);
+  return scm_reverse (ret);
+}
 
+SCM
+System::get_paper_systems ()
+{
   SCM lines = scm_c_make_vector (broken_intos_.size (), SCM_EOL);
   for (vsize i = 0; i < broken_intos_.size (); i++)
     {
@@ -187,14 +200,6 @@ System::get_paper_systems ()
 
       System *system = dynamic_cast<System *> (broken_intos_[i]);
 
-      system->post_processing ();
-      system->build_skylines ();
-      if (i > 0)
-       {
-         System *prev = dynamic_cast<System*> (broken_intos_[i-1]);
-         Real r = prev->skylines_[DOWN].distance (system->skylines_[UP]);
-         system->set_property ("skyline-distance", scm_from_double (r));
-       }
       scm_vector_set_x (lines, scm_from_int (i),
                        system->get_paper_system ());
 
@@ -334,6 +339,9 @@ System::get_paper_system ()
   SCM exprs = SCM_EOL;
   SCM *tail = &exprs;
 
+  post_processing ();
+  build_skylines ();
+
   vector<Layer_entry> entries;
   for (vsize j = 0; j < all_elements_->size (); j++)
     {
@@ -350,7 +358,7 @@ System::get_paper_system ()
       Grob *g = entries[j].grob_;
       Stencil st = g->get_print_stencil ();
 
-      if (st.expr() == SCM_EOL)
+      if (st.expr () == SCM_EOL)
        continue;
       
       Offset o;
@@ -391,25 +399,18 @@ System::get_paper_system ()
 
   /* information that the page breaker might need */
   Grob *right_bound = this->get_bound (RIGHT);
-  pl->set_property ("skyline-distance", get_property ("skyline-distance"));
+  pl->set_property ("skylines", skylines_.smobbed_copy ());
   pl->set_property ("page-break-permission", right_bound->get_property ("page-break-permission"));
   pl->set_property ("page-turn-permission", right_bound->get_property ("page-turn-permission"));
   pl->set_property ("page-break-penalty", right_bound->get_property ("page-break-penalty"));
   pl->set_property ("page-turn-penalty", right_bound->get_property ("page-turn-penalty"));
 
-  if (!scm_is_pair (pl->get_property ("refpoint-Y-extent")))
-    {
-      Interval staff_refpoints;
-      staff_refpoints.set_empty ();
-      extract_grob_set (this, "spaceable-staves", staves);
-      for (vsize i = 0; i < staves.size (); i++)
-       {
-         Grob *g = staves[i];
-         staff_refpoints.add_point (g->relative_coordinate (this, Y_AXIS));
-       }
-      pl->set_property ("refpoint-Y-extent", ly_interval2scm (staff_refpoints));
-    }
+  Interval staff_refpoints;
+  extract_grob_set (this, "spaceable-staves", staves);
+  for (vsize i = 0; i < staves.size (); i++)
+    staff_refpoints.add_point (staves[i]->relative_coordinate (this, Y_AXIS));
 
+  pl->set_property ("staff-refpoint-extent", ly_interval2scm (staff_refpoints));
   pl->set_property ("system-grob", this->self_scm ()); 
 
   return pl->unprotect ();
index 900f4816dc98bd1d6a9bdf89b88e3c019dfea019..1faa1141444fe76e00e128ee6bd93579151890fc 100644 (file)
@@ -25,7 +25,7 @@ protected:
   DECLARE_ACKNOWLEDGER (note_head);
 };
 
-Tab_harmonic_engraver::Tab_harmonic_engraver()
+Tab_harmonic_engraver::Tab_harmonic_engraver ()
 {
 }
 
index 03ba28679c65fc5c50b7b0e8e9ae6748d2f5f992..f103e0f6b40cae754c74f9fc4c4c0acc9344a9aa 100644 (file)
@@ -14,7 +14,7 @@ class Tab_staff_symbol_engraver : public Engraver
 public:
   TRANSLATOR_DECLARATIONS (Tab_staff_symbol_engraver);
 protected:
-  DECLARE_ACKNOWLEDGER(staff_symbol);
+  DECLARE_ACKNOWLEDGER (staff_symbol);
 };
 
 void
index c53cf3e4fd2cc6143bca02b6d9c1f6f4dee2eda4..14f519ec85434ad69c8a8234ba7645846ea37cb1 100644 (file)
@@ -31,9 +31,6 @@ protected:
   void process_acknowledged ();
 
   DECLARE_TRANSLATOR_LISTENER (text_script);
-  DECLARE_ACKNOWLEDGER (stem_tremolo);
-  DECLARE_ACKNOWLEDGER (stem);
-  DECLARE_ACKNOWLEDGER (rhythmic_head);
 };
 
 IMPLEMENT_TRANSLATOR_LISTENER (Text_engraver, text_script);
@@ -43,40 +40,6 @@ Text_engraver::listen_text_script (Stream_event *ev)
   evs_.push_back (ev);
 }
 
-void
-Text_engraver::acknowledge_rhythmic_head (Grob_info inf)
-{
-  for (vsize i = 0; i < texts_.size (); i++)
-    {
-      Grob *t = texts_[i];
-      Side_position_interface::add_support (t, inf.grob ());
-
-      /*
-       ugh.
-      */
-      if (Side_position_interface::get_axis (t) == X_AXIS
-         && !t->get_parent (Y_AXIS))
-       t->set_parent (inf.grob (), Y_AXIS);
-      else if (Side_position_interface::get_axis (t) == Y_AXIS
-              && !t->get_parent (X_AXIS))
-       t->set_parent (inf.grob (), X_AXIS);
-    }
-}
-
-void
-Text_engraver::acknowledge_stem (Grob_info inf)
-{
-  for (vsize i = 0; i < texts_.size (); i++)
-    Side_position_interface::add_support (texts_[i], inf.grob ());
-}
-
-void
-Text_engraver::acknowledge_stem_tremolo (Grob_info info)
-{
-  for (vsize i = 0; i < texts_.size (); i++)
-    Side_position_interface::add_support (texts_[i], info.grob ());
-}
-
 void
 Text_engraver::process_acknowledged ()
 {
@@ -119,9 +82,6 @@ Text_engraver::Text_engraver ()
 {
 }
 
-ADD_ACKNOWLEDGER (Text_engraver, stem);
-ADD_ACKNOWLEDGER (Text_engraver, stem_tremolo);
-ADD_ACKNOWLEDGER (Text_engraver, rhythmic_head);
 ADD_TRANSLATOR (Text_engraver,
                /* doc */ "Create text-scripts",
                /* create */ "TextScript",
index 86a1381bb411312e28b337640fe814e5a1dfcbb6..55e7bb7ec4c09a81ed73185271ef0c00a3ab3ef3 100644 (file)
@@ -26,7 +26,7 @@ Text_interface::interpret_string (SCM layout_smob,
                                  SCM markup)
 {
   LY_ASSERT_SMOB (Output_def, layout_smob, 1);
-  LY_ASSERT_TYPE (scm_is_string, props, 3);
+  LY_ASSERT_TYPE (scm_is_string, markup, 3);
 
   string str = ly_scm2string (markup);
   Output_def *layout = unsmob_output_def (layout_smob);
index 0bdc95efc03c183daf390641d7763d562b460e2e..f7b2576d85043c734d0dc9e55add6526ff762ddc 100644 (file)
@@ -22,7 +22,6 @@ public:
   TRANSLATOR_DECLARATIONS (Text_spanner_engraver);
 protected:
   virtual void finalize ();
-  DECLARE_ACKNOWLEDGER (note_column);
   DECLARE_TRANSLATOR_LISTENER (text_span);
   void stop_translation_timestep ();
   void process_music ();
@@ -82,20 +81,6 @@ Text_spanner_engraver::process_music ()
     }
 }
 
-void
-Text_spanner_engraver::acknowledge_note_column (Grob_info info)
-{
-  Spanner *spans[2] ={span_, finished_};
-  for (int i = 0; i < 2; i++)
-    {
-      if (spans[i])
-       {
-         Side_position_interface::add_support (spans[i], info.grob ());
-         add_bound_item (spans[i], info.grob ());
-       }
-    }
-}
-
 void
 Text_spanner_engraver::typeset_all ()
 {
@@ -136,8 +121,6 @@ Text_spanner_engraver::finalize ()
     }
 }
 
-ADD_ACKNOWLEDGER (Text_spanner_engraver, note_column);
-
 ADD_TRANSLATOR (Text_spanner_engraver,
                /* doc */
                "Create text spanner from an event.",
index b54428d986fca49ac7a1b2492cefd227c762c8f6..eb2a00d84cf60fed08e0ae5e483ce2f2169a2644 100644 (file)
@@ -69,7 +69,7 @@ Tie_column::before_line_breaking (SCM smob)
   return SCM_UNSPECIFIED;
 }
 
-MAKE_SCHEME_CALLBACK(Tie_column, calc_positioning_done, 1)
+MAKE_SCHEME_CALLBACK (Tie_column, calc_positioning_done, 1)
 SCM
 Tie_column::calc_positioning_done (SCM smob)
 {
@@ -93,7 +93,7 @@ Tie_column::calc_positioning_done (SCM smob)
 
   Ties_configuration base = problem.generate_optimal_configuration ();
 
-  for (vsize i = 0; i < base.size(); i++)
+  for (vsize i = 0; i < base.size (); i++)
     {
       SCM cp = Tie::get_control_points (ties[i], problem.common_x_refpoint (),
                                        base[i],
index 2491f7e3effaa6c52fbcc73975e82c660eb8d916..9cccd505b9daea335b02b10d2feeaf2053f4b649 100644 (file)
@@ -64,7 +64,7 @@ Tie_configuration::get_transformed_bezier (Tie_details const &details) const
 Bezier
 Tie_configuration::get_untransformed_bezier (Tie_details const &details) const
 {
-  Real l = attachment_x_.length();
+  Real l = attachment_x_.length ();
   if (isinf (l) || isnan (l))
     {
       programming_error ("Inf or NaN encountered");
@@ -106,14 +106,14 @@ Tie_configuration::add_score (Real s, string desc)
 Real
 Tie_configuration::height (Tie_details const &details) const
 {
-  Real l = attachment_x_.length();
+  Real l = attachment_x_.length ();
 
   return slur_shape (l,
                     details.height_limit_,
                     details.ratio_).curve_point (0.5)[Y_AXIS]; 
 }
 
-Ties_configuration::Ties_configuration()
+Ties_configuration::Ties_configuration ()
 {
   score_ = 0.0;
   scored_ = false;
@@ -184,7 +184,7 @@ string
 Ties_configuration::complete_score_card () const
 {
   string s; 
-  for (vsize i = 0; i < size(); i++)
+  for (vsize i = 0; i < size (); i++)
     {
       s += complete_tie_card (i);
     }
index ddb662fd308658cbe8df5a915aeb780e3efca0db..7c39b1c717cf20bbca5c7fbf8f7b7e10dc32623a 100644 (file)
@@ -32,20 +32,20 @@ Tie_details::from_grob (Grob *me)
   
   SCM details = me->get_property ("details");
 
-  height_limit_ = get_real_detail("height-limit", 0.75);
-  ratio_ = get_real_detail("ratio", .333);  
+  height_limit_ = get_real_detail ("height-limit", 0.75);
+  ratio_ = get_real_detail ("ratio", .333);  
   between_length_limit_ = get_real_detail ("between-length-limit", 1.0);
   
-  wrong_direction_offset_penalty_ = get_real_detail("wrong-direction-offset-penalty", 10);
+  wrong_direction_offset_penalty_ = get_real_detail ("wrong-direction-offset-penalty", 10);
   
-  min_length_ = get_real_detail("min-length", 1.0);
-  min_length_penalty_factor_ = get_real_detail("min-length-penalty-factor", 1.0);
+  min_length_ = get_real_detail ("min-length", 1.0);
+  min_length_penalty_factor_ = get_real_detail ("min-length-penalty-factor", 1.0);
 
 
   // in half-space
   center_staff_line_clearance_ = get_real_detail ("center-staff-line-clearance", 0.4);
   tip_staff_line_clearance_ = get_real_detail ("tip-staff-line-clearance", 0.4);
-  staff_line_collision_penalty_ = get_real_detail("staff-line-collision-penalty", 5);
+  staff_line_collision_penalty_ = get_real_detail ("staff-line-collision-penalty", 5);
   dot_collision_clearance_ = get_real_detail ( "dot-collision-clearance", 0.25);
   dot_collision_penalty_ = get_real_detail ( "dot-collision-penalty", 0.25);
   x_gap_ = get_real_detail ("note-head-gap", 0.2);
index b97a5ad9c2bbd71782b25f95952a902a376aef81..bdcd3dbb365040465e5aefe238e8a92178dcca06 100644 (file)
@@ -252,7 +252,7 @@ Tie_engraver::stop_translation_timestep ()
   if (!wait && new_heads_to_tie.size ())
     heads_to_tie_.clear ();
 
-  // hmmm, how to do with copy() ?
+  // hmmm, how to do with copy () ?
   for (vsize i = 0; i < new_heads_to_tie.size (); i++)
     heads_to_tie_.push_back (new_heads_to_tie[i]);
   
index 6c7e2a024f091d0f5af9adae860c0a790b1cb80c..f7682c904c56db5af97bcd4c9c3f0c240e6a7b84 100644 (file)
@@ -58,7 +58,7 @@ Tie_formatting_problem::get_attachment (Real y, Drul_array<int> columns) const
   return attachments;
 }
 
-Tie_formatting_problem::Tie_formatting_problem()
+Tie_formatting_problem::Tie_formatting_problem ()
 {
   x_refpoint_ = 0;
 }
@@ -128,7 +128,12 @@ Tie_formatting_problem::set_column_chord_outline (vector<Item*> bounds,
          x.add_point (stem->relative_coordinate (x_refpoint_, X_AXIS));
          x.widen (staff_space / 20); // ugh.
          Interval y;
-         y.add_point (Stem::stem_end_position (stem) * staff_space * .5);
+         Real stem_end_position =
+           Stem::is_cross_staff (stem)
+           ? get_grob_direction (stem) * infinity_f
+           : Stem::stem_end_position (stem) * staff_space * .5;
+
+         y.add_point (stem_end_position);
 
          Direction stemdir = get_grob_direction (stem);
          y.add_point (Stem::head_positions (stem)[-stemdir]
@@ -139,12 +144,12 @@ Tie_formatting_problem::set_column_chord_outline (vector<Item*> bounds,
          */
          boxes.push_back (Box (x, y));
 
-         stem_extents_[key].unite (Box (x,y));
+         stem_extents_[key].unite (Box (x, y));
 
          if (dir == LEFT)
            {
              Box flag_box = Stem::get_translated_flag (stem).extent_box ();
-             flag_box.translate( Offset (x[RIGHT], X_AXIS));
+             flag_box.translate ( Offset (x[RIGHT], X_AXIS));
              boxes.push_back (flag_box);
            }
        }
@@ -166,9 +171,9 @@ Tie_formatting_problem::set_column_chord_outline (vector<Item*> bounds,
        }
 
       extract_grob_set (stem, "note-heads", heads);
-      for (vsize i = 0; i < heads.size(); i ++)
+      for (vsize i = 0; i < heads.size (); i ++)
        {
-         if (find (bounds.begin(), bounds.end (), dynamic_cast<Item*> (heads[i])) ==  bounds.end ())
+         if (find (bounds.begin (), bounds.end (), dynamic_cast<Item*> (heads[i])) ==  bounds.end ())
            {
              /*
                other untied notes in the same chord.
@@ -196,7 +201,7 @@ Tie_formatting_problem::set_column_chord_outline (vector<Item*> bounds,
     {
       Interval x;
       Interval y;
-      if (head_boxes.size())
+      if (head_boxes.size ())
        {
          Box b = boundary (head_boxes, updowndir, 0);
          x = b[X_AXIS];
@@ -612,7 +617,7 @@ Tie_formatting_problem::score_aptitude (Tie_configuration *conf,
   while (flip (&d) != LEFT);
 
   if (ties_conf
-      && ties_conf->size() == 1)
+      && ties_conf->size () == 1)
     {
       Direction d = LEFT;
       Drul_array<Grob*> stems (0, 0);
@@ -1118,7 +1123,7 @@ Tie_formatting_problem::generate_collision_variations (Ties_configuration const
                                                       );
                  vars.push_back (var);
                }
-             if (i == ties.size() && !specifications_[i].has_manual_position_
+             if (i == ties.size () && !specifications_[i].has_manual_position_
                  && ties[i].dir_ == UP)
                {
                  Tie_configuration_variation var;
@@ -1190,7 +1195,7 @@ Tie_formatting_problem::set_debug_scoring (Ties_configuration const &base)
   if (to_boolean (x_refpoint_->layout ()
                  ->lookup_variable (ly_symbol2scm ("debug-tie-scoring"))))
     {
-      for (vsize i = 0; i < base.size(); i++)
+      for (vsize i = 0; i < base.size (); i++)
        {
          string card = base.complete_tie_card (i);
          specifications_[i].tie_grob_->set_property ("quant-score",
index 0519fcb930488afe9d61b96a044890f629524df9..2fe3df0733b045eb0e17df0abd0818832d9a145b 100644 (file)
@@ -101,7 +101,7 @@ Tie_performer::stop_translation_timestep ()
       heads_to_tie_ = now_heads_;
     }
 
-  for (vsize i = now_tied_heads_.size(); i--;)
+  for (vsize i = now_tied_heads_.size (); i--;)
     heads_to_tie_.push_back (now_tied_heads_[i]);
 
   event_ = 0;
index 1d4e7fca9ac296659d01bfdfd2deaeae3e9f7df6..87548a7056c538bb32867091085c5a2a7cf675cd 100644 (file)
@@ -139,7 +139,7 @@ Tie::get_default_dir (Grob *me)
 }
 
 
-MAKE_SCHEME_CALLBACK(Tie, calc_direction, 1);
+MAKE_SCHEME_CALLBACK (Tie, calc_direction, 1);
 SCM
 Tie::calc_direction (SCM smob)
 {
@@ -205,7 +205,7 @@ Tie::get_control_points (Grob *me,
 }
 
 
-MAKE_SCHEME_CALLBACK(Tie, calc_control_points, 1);
+MAKE_SCHEME_CALLBACK (Tie, calc_control_points, 1);
 SCM
 Tie::calc_control_points (SCM smob)
 {
index f5ca62dbfbc67c215b485092bf5f1822613930e5..b681a693421ee7f4ac041afc89be6685c1899e4e 100644 (file)
@@ -24,7 +24,7 @@ class Time_scaled_music_iterator : public Music_wrapper_iterator
 public:
   DECLARE_SCHEME_CALLBACK (constructor, ());
   /* construction */
-  DECLARE_CLASSNAME(Time_scaled_music_iterator);
+  DECLARE_CLASSNAME (Time_scaled_music_iterator);
   Time_scaled_music_iterator ();
 protected:
   virtual void process (Moment m);
@@ -96,7 +96,7 @@ Time_scaled_music_iterator::process (Moment m)
       m.main_part_ == next_split_mom_)
     {
       descend_to_bottom_context ();
-      if (tuplet_handler_.get_outlet())
+      if (tuplet_handler_.get_outlet ())
        create_event (STOP)->send_to_context (tuplet_handler_.get_outlet ());
 
       if (m.main_part_ < music_get_length ().main_part_)
@@ -111,7 +111,7 @@ Time_scaled_music_iterator::process (Moment m)
          tuplet_handler_.set_context (0);
        }
     }
-  Music_wrapper_iterator::process(m);
+  Music_wrapper_iterator::process (m);
   if (child_iter_ && child_iter_->ok ())
     descend_to_child (child_iter_->get_outlet ());
   
index 52274adc429f8b6952ca0027389829c9b9908f30..a6b4342de91ea43aaddfd07477f7b7c4f85bff1e 100644 (file)
@@ -278,7 +278,7 @@ add_acknowledger (Engraver_void_function_engraver_grob_info ptr,
   interface_name += "-interface";
 
   /*
-    this is only called during program init, so safe to use scm_gc_protect_object()
+    this is only called during program init, so safe to use scm_gc_protect_object ()
   */
   inf.symbol_ = scm_gc_protect_object (ly_symbol2scm (interface_name.c_str ()));
   ack_array->push_back (inf);
@@ -326,7 +326,7 @@ internal_event_assignment (Stream_event **old_ev, Stream_event *new_ev, const ch
       assert (0 == ev_class.find (prefix));
 
       /* "listen_foo_bar" -> "foo-bar" */
-      ev_class.erase (0, strlen(prefix));
+      ev_class.erase (0, strlen (prefix));
       replace_all (ev_class, '_', '-');
 
       new_ev->origin ()->warning (_f ("Two simultaneous %s events, junking this one", ev_class.c_str ()));
index 0100e66b52bc6f56082796ebd9f88d942db531ae..d2ef7e1eb8045c836316aa3c838ed8ebe3667374 100644 (file)
@@ -29,7 +29,6 @@ public:
   TRANSLATOR_DECLARATIONS (Trill_spanner_engraver);
 protected:
   virtual void finalize ();
-  DECLARE_ACKNOWLEDGER (note_column);
   DECLARE_TRANSLATOR_LISTENER (trill_span);
   void stop_translation_timestep ();
   void process_music ();
@@ -88,20 +87,6 @@ Trill_spanner_engraver::process_music ()
     }
 }
 
-void
-Trill_spanner_engraver::acknowledge_note_column (Grob_info info)
-{
-  Spanner *spans[2] ={span_, finished_};
-  for (int i = 0; i < 2; i++)
-    {
-      if (spans[i])
-       {
-         Side_position_interface::add_support (spans[i], info.grob ());
-         add_bound_item (spans[i], info.grob ());
-       }
-    }
-}
-
 void
 Trill_spanner_engraver::typeset_all ()
 {
@@ -141,7 +126,6 @@ Trill_spanner_engraver::finalize ()
     }
 }
 
-ADD_ACKNOWLEDGER (Trill_spanner_engraver, note_column);
 ADD_TRANSLATOR (Trill_spanner_engraver,
                /* doc */ "Create trill spanner from an event.",
                /* create */
index 574d1464af7492278189db36e8a7be379a3050e8..869cdbaed19898d49517d5656c3c78dbf3f99073 100644 (file)
@@ -25,7 +25,7 @@ make_index_to_charcode_map (FT_Face face)
   FT_UInt gindex;
 
   FT_CharMap current_cmap = face->charmap;
-  FT_Select_Charmap(face, FT_ENCODING_UNICODE);
+  FT_Select_Charmap (face, FT_ENCODING_UNICODE);
 
   int j = 0;
   for (charcode = FT_Get_First_Char (face, &gindex); gindex != 0;
@@ -168,7 +168,7 @@ print_trailer (void *out,
                                              GLYPH_NAME_LEN);
          if (error)
            {
-             programming_error ("FT_Get_Glyph_Name(): error.");
+             programming_error ("FT_Get_Glyph_Name (): error.");
              glyph_name[0] = 0;
            }
        }
index 53253f71ddc120b98c9fd5a93acadba1912bd5b3..489d3bc76e58eff0cf199c4b78b31fd398195e98 100644 (file)
@@ -92,7 +92,7 @@ Tuplet_bracket::parallel_beam (Grob *me_grob, vector<Grob*> const &cols,
                           Note_column::get_stem (cols.back ()));
 
   if (dynamic_cast<Item*> (stems[RIGHT])->get_column ()
-      != me->get_bound (RIGHT)->get_column())
+      != me->get_bound (RIGHT)->get_column ())
     return 0;
 
   Drul_array<Grob*> beams;
@@ -120,7 +120,7 @@ Tuplet_bracket::parallel_beam (Grob *me_grob, vector<Grob*> const &cols,
 }
 
 
-MAKE_SCHEME_CALLBACK(Tuplet_bracket,calc_connect_to_neighbors,1);
+MAKE_SCHEME_CALLBACK (Tuplet_bracket, calc_connect_to_neighbors,1);
 SCM
 Tuplet_bracket::calc_connect_to_neighbors (SCM smob)
 {
@@ -176,7 +176,7 @@ Tuplet_bracket::get_common_x (Spanner *me)
   return commonx;
 }
   
-MAKE_SCHEME_CALLBACK(Tuplet_bracket,calc_control_points,1)
+MAKE_SCHEME_CALLBACK (Tuplet_bracket, calc_control_points,1)
 SCM
 Tuplet_bracket::calc_control_points (SCM smob)
 {
index c25d2a9a4e6f547ac42cfc76a334aa5011730fb8..17eed00f35c11bde96d043c9b1603cc5161e912f 100644 (file)
@@ -105,7 +105,7 @@ Tuplet_engraver::process_music ()
   /*
     This may happen if the end of a tuplet is part of a quoted voice.
    */
-  Moment now = now_mom();
+  Moment now = now_mom ();
   for (vsize i = tuplets_.size (); i --; )
     {
       if (tuplets_[i].stop_moment_ == now)
index b29ab39aaa087bbc73b3044114b92abe3cfa6c85..aa0c343c589977f251100dd641ff7bb8df380b43 100644 (file)
 
 struct Tuplet_number
 {
-  DECLARE_SCHEME_CALLBACK(print, (SCM));
-  DECLARE_GROB_INTERFACE();
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
+  DECLARE_GROB_INTERFACE ();
 };
   
 
-MAKE_SCHEME_CALLBACK(Tuplet_number, print, 1);
+MAKE_SCHEME_CALLBACK (Tuplet_number, print, 1);
 SCM 
 Tuplet_number::print (SCM smob)
 {
index c87902f9ba1566d3406ab9dc3d7a8049ee51973a..e520f7d7c497367cdf5d8a71d14591473b4ffd76 100644 (file)
@@ -21,7 +21,7 @@ protected:
   DECLARE_ACKNOWLEDGER (grob);
 };
 
-Tweak_engraver::Tweak_engraver()
+Tweak_engraver::Tweak_engraver ()
 {
 }
 
index 5618465120c02a313bbff876e9ff15e9f5c23269..5007d553ca8b91bcf68ce50d09bfb1ea9f4e0de3 100644 (file)
@@ -433,10 +433,10 @@ Vaticana_ligature_engraver::add_mora_column (Paper_column *column)
 void
 Vaticana_ligature_engraver::check_for_ambiguous_dot_pitch (Grob_info primitive)
 {
-  // TODO: Fix performance, which is currently O(n^2) (since this
-  // method is called O(n) times and takes O(n) steps in the for
-  // loop), but could be O(n) (by replacing the for loop by e.g. a
-  // bitmask based O(1) test); where n=<number of primitives in the
+  // TODO: Fix performance, which is currently O (n^2) (since this
+  // method is called O (n) times and takes O (n) steps in the for
+  // loop), but could be O (n) (by replacing the for loop by e.g. a
+  // bitmask based O (1) test); where n=<number of primitives in the
   // ligature> (which is typically small (n<10), though).
   Stream_event *new_cause = primitive.event_cause ();
   int new_pitch = unsmob_pitch (new_cause->get_property ("pitch"))->steps ();
index 49018d8adb1692f4a3913bde223974ad6813a73f..fb3cb12fc604341342dfe847e77189fbb08bf07e 100644 (file)
@@ -160,12 +160,6 @@ Volta_bracket_interface::add_bar (Grob *me, Item *b)
   add_bound_item (dynamic_cast<Spanner *> (me), b);
 }
 
-void
-Volta_bracket_interface::add_column (Grob *me, Grob *c)
-{
-  Side_position_interface::add_support (me, c);
-}
-
 ADD_INTERFACE (Volta_bracket_interface,
               "Volta bracket with number",
 
index 604c53c573493721796b068f66db084b4ae0c5ba..d7611535a7bb9d9e0d9a5b5a062c5e17ddc0a29e 100644 (file)
@@ -33,7 +33,6 @@ protected:
 
   DECLARE_END_ACKNOWLEDGER (staff_symbol);
   DECLARE_ACKNOWLEDGER (staff_symbol);
-  DECLARE_ACKNOWLEDGER (note_column);
   DECLARE_ACKNOWLEDGER (bar_line);
 
   virtual void finalize ();
@@ -175,13 +174,6 @@ Volta_engraver::process_music ()
     }
 }
 
-void
-Volta_engraver::acknowledge_note_column (Grob_info i)
-{
-  if (volta_span_)
-    Volta_bracket_interface::add_column (volta_span_, i.grob ());
-}
-
 void
 Volta_engraver::acknowledge_bar_line (Grob_info i)
 {
@@ -255,7 +247,6 @@ Volta_engraver::stop_translation_timestep ()
 */
 ADD_ACKNOWLEDGER (Volta_engraver, staff_symbol);
 ADD_END_ACKNOWLEDGER (Volta_engraver, staff_symbol);
-ADD_ACKNOWLEDGER (Volta_engraver, note_column);
 ADD_ACKNOWLEDGER (Volta_engraver, bar_line);
 ADD_TRANSLATOR (Volta_engraver,
                /* doc */ "Make volta brackets.",
index aa78dd538ffb4d7633d1d46174d795da5e1fb1d7..0f8560c8106926083f3518db1cedc1f34bbd1cc5 100644 (file)
@@ -57,7 +57,6 @@
   \consists "Figured_bass_position_engraver"
   \consists "Script_row_engraver"
 
-  \override VerticalAxisGroup #'minimum-Y-extent = #'(-3.5 . 3.5)
   localKeySignature = #'()
   createSpacing = ##t
   ignoreFiguredBassRest = ##t 
@@ -307,11 +306,8 @@ contained staves are not connected vertically."
   \description
   "Just like @code{GrandStaff} but with a forced distance between
     the staves, so cross staff beaming and slurring can be used."
-  
-  \override VerticalAlignment #'forced-distance = #12
-  \override VerticalAlignment #'self-alignment-Y = #0
 
-  \consists "Vertical_align_engraver"
+  \override VerticalAxisGroup #'minimum-Y-extent = #'(-4 . 4)
   \consists "Instrument_name_engraver"
   
   instrumentName = #'()
@@ -380,6 +376,7 @@ printing of a single line of lyrics.  "
 
   \override VerticalAxisGroup #'remove-first = ##t
   \override VerticalAxisGroup #'remove-empty = ##t
+  \override VerticalAxisGroup #'keep-fixed-while-stretching = ##t
   \override SeparationItem #'padding = #0.2
   \override InstrumentName #'self-alignment-Y = ##f
 
index 9b69c5f0a0902e2e2479f2a35d1f8a1283d98577..45263f2fcc66de8cbce85c5bb7ab08a2f16dcf73 100644 (file)
@@ -545,7 +545,7 @@ fet_endchar;
 draw_shifted_too;
 
 fet_beginchar ("Flat (slashed)", "flat.slash");
-       set_char_box (1.2 stafflinethickness#, .8 staff_space#,
+       set_char_box (.4 staff_space#, .8 staff_space#,
                      0.6 staff_space#, 1.9 staff_space#);
 
        draw_meta_flat (0, w, 0.31 staff_space);
@@ -566,7 +566,7 @@ fet_beginchar ("Flat (slashed)", "flat.slash");
 fet_endchar;
 
 fet_beginchar ("Flat (slashed twice)", "flat.slashslash");
-       set_char_box (1.2 stafflinethickness#, .8 staff_space#,
+       set_char_box (.4 staff_space#, .8 staff_space#,
                      0.6 staff_space#, 1.9 staff_space#);
 
        draw_meta_flat (0, w, 0.31 staff_space);
@@ -609,6 +609,8 @@ draw_shifted_too;
 
 
 
+
+
 fet_beginchar ("Semi flat", "mirroredflat");
        set_char_box (1.2 stafflinethickness#, .8 staff_space#,
                      0.6 staff_space#, 1.9 staff_space#);
@@ -617,6 +619,28 @@ fet_beginchar ("Semi flat", "mirroredflat");
        currentpicture := currentpicture xscaled -1 shifted (w - b, 0);
 fet_endchar;
 
+fet_beginchar ("Semi flat", "mirroredflat.backslash");
+       set_char_box (.4 staff_space#, .8 staff_space#,
+                     0.6 staff_space#, 1.9 staff_space#);
+
+       draw_meta_flat (0, w, 0.31 staff_space);
+       clearxy;
+
+       save slope, slash_width;
+       slope = 0.5;
+       slash_width = w;
+       z1 = (0, h / 2);
+       z2 = z1 - (slash_width, slash_width * slope)/2;
+       z3 = z1 + (slash_width, slash_width * slope)/2;
+       pickup pencircle scaled 1.5 stafflinethickness;
+       draw  z2 .. z3;
+
+       currentpicture := currentpicture xscaled -1 shifted (w - b, 0);
+
+       labels (1, 2, 3);
+
+fet_endchar;
+
 
 fet_beginchar ("Double Flat", "flatflat");
        save left_wid, overlap, right_wid;
index c7dfe7b526c2955c2be07ae996abdf9e157c39c9..a520a5efd6504e16a20d2078a93b24085bc1f86e 100644 (file)
@@ -17,3 +17,5 @@ INSTALLATION_OUT_DIR1=$(local_lilypond_datadir)/python
 INSTALLATION_OUT_FILES1=$(OUT_PY_MODULES) $(OUT_PYC_MODULES)
 
 $(outdir)/midi.lo: $(outdir)/config.hh
+
+default: $(outdir)/relocate-preamble.py
index 71dbd10d427b2e80405508e273cb0a4a5ed83abf..906371760097b598a7de51864a4d1e2fd3d45ce8 100644 (file)
@@ -2969,3 +2969,24 @@ def conv (str):
     return str
 
 conversions.append (((2, 11, 13), conv, """#'arrow = ##t -> #'bound-details #'right #'arrow = ##t"""))
+
+def conv (str):
+    def sub_edge_height (m):
+        s = ''
+        for (var, h) in [('left', m.group (3)),
+                         ('right', m.group (4))]:
+
+            if h and float (h):
+                s += (r"%s \override %s #'bound-details #'%s #'text = \markup { \draw-line #'(0 . %s) }"
+                      % (m.group(1), m.group (2), var, h))
+
+                s += '\n'
+            
+        return s
+    
+                  
+    str = re.sub (r"(\\once)?\s*\\override\s*([a-zA-Z.]+)\s*#'edge-height\s*=\s*#'\(([0-9.-]+)\s+[.]\s+([0-9.-]+)\)",
+                  sub_edge_height, str)
+    return str
+
+conversions.append (((2, 11, 15), conv, """#'edge-height -> #'bound-details #'right/left #'text = ..."""))
index 7dda76b16bf885aa8986e1a502dc41573c1efdb3..0197dfea479ccadd62a70e88e2600a00e009daac 100644 (file)
@@ -205,6 +205,8 @@ note, one above and one below the chord.")
 changes. @samp{\\override} of the @code{break-visibility} property will set the
 visibility for normal (i.e. at the start of the line) key signatures.")
 
+     (extendersOverRests ,boolean? "Whether to continue extenders as
+they cross a rest.")
      (extraNatural ,boolean? "Whether to typeset an
 extra natural sign before accidentals changing from a non-natural to 
 another non-natural.")
index 7de42c3ae1cd6e5b6a5d45b4522a38180a453080..7cf4d853f8ea18c8329f0586af2c0e7884f4389d 100644 (file)
@@ -166,8 +166,6 @@ include @code{medium}, @code{bold}, @code{bold-narrow}, etc.")
      (font-shape ,symbol? "Select the shape of a font. Choices include @code{upright},
 @code{italic}, @code{caps}.")
      (forced ,boolean? "manually forced accidental")
-     (forced-distance ,ly:dimension? "A fixed distance between object
-reference points in an alignment.")
      (force-hshift ,number? "This specifies a manual shift for notes
 in collisions. The unit is the note head width of the first voice
 note.  This is used by @internalsref{note-collision-interface}.")
@@ -207,6 +205,7 @@ set beam/slur quant to this position, and print the respective scores.")
      (inspect-index ,integer? "If debugging is set,
 set beam/slur configuration to this index, and print the respective scores.")
      (implicit ,boolean? "Is this an implicit bass figure?")
+     (keep-fixed-while-stretching ,boolean? "A grob with this property set to true will be fixed relative to the staff above it when systems are stretched.")
      (keep-inside-line ,boolean? "If set, this column cannot have
 things sticking into the margin.")
      (kern ,ly:dimension? "Amount of extra white space to add. For
@@ -239,6 +238,8 @@ column is the start of a system.")
      (long-text ,markup? "Text markup.  See @usermanref{Text markup}.")
      (max-beam-connect ,integer? "Maximum number of beams to connect
 to beams from this stem. Further beams are typeset as beamlets.")
+     (max-stretch ,number? "The maximum amount that this vertical-axis-group
+can be vertically stretched (for example, in order to better fill a page).")
      (measure-length ,ly:moment? "Length of a
 measure. Used in some spacing situations.")
      (measure-count ,integer? "The number of measures for a
@@ -465,6 +466,7 @@ function is to protect objects from being garbage collected.")
      (arpeggio ,ly:grob? "pointer to arpeggio object.")
      (beam ,ly:grob? "pointer to the beam, if applicable.")
      (bracket ,ly:grob? "the bracket for a  number.")
+     (cross-staff ,boolean? "for a beam or a stem, true if we depend on inter-staff spacing")
      (direction-source ,ly:grob? "in case side-relative-direction is
 set, which grob to get the direction from .")
      (dot ,ly:grob? "reference to Dots object.")
index b7d25131bfee6c4afb5885162ad072105a7fa2cc..6cfc4ed18845310cf8dba7dd0d1c62920fcacef9 100644 (file)
        (beaming . ,ly:beam::calc-beaming)
        (stencil . ,ly:beam::print)
        (clip-edges . #t)
+       (cross-staff . ,ly:beam::cross-staff)
 
        (details .  ((hint-direction-penalty . 20)))
        ;; TODO: should be in SLT.
        (Y-offset . ,ly:side-position-interface::y-aligned-side)
        (staff-padding . 0.1)
        (padding . 0.6)
-       (avoid-slur . outside)
        (slur-padding . 0.3)
        (minimum-space . 1.2)
        (direction . ,DOWN)
        (font-series . bold)
        (font-encoding . fetaDynamic)
        (font-shape . italic)
-       (avoid-slur . around)
        (extra-spacing-width . (+inf.0 . -inf.0))
        (outside-staff-priority . 250)
        (meta . ((class . Item)
        (minimum-length . 1.5)
        (height-limit . 2.0)
        (ratio . 0.333)
+       (cross-staff . ,ly:slur::cross-staff)
        (meta . ((class . Spanner)
                 (interfaces . (slur-interface))))))
 
        (height-limit . 2.0)
        (ratio . 0.25)
        (avoid-slur . inside)
+       (cross-staff . ,ly:slur::cross-staff)
        (meta . ((class . Spanner)
                 (interfaces . (slur-interface))))))
 
        (Y-extent . ,ly:stem::height)
        (length . ,ly:stem::calc-length)
        (thickness . 1.3)
+       (cross-staff . ,ly:stem::cross-staff)
        (details
         . (
            ;; 3.5 (or 3 measured from note head) is standard length
        (X-extent . ,ly:axis-group-interface::width)
        (Y-extent . ,ly:axis-group-interface::height)
        (skylines . ,ly:axis-group-interface::calc-skylines)
+       (max-stretch . ,ly:axis-group-interface::calc-max-stretch)
        (skyline-horizontal-padding . 1.0)
        (meta . ((class . System)
                 (interfaces . (system-interface
        (stacking-dir . -1)
        (padding . 0.5)
        (skylines . ,ly:axis-group-interface::combine-skylines)
+       (max-stretch . ,ly:align-interface::calc-max-stretch)
        (meta . ((class . Spanner)
                 (object-callbacks . ((Y-common . ,ly:axis-group-interface::calc-y-common)))
                 (interfaces . (align-interface
        (Y-offset . ,ly:hara-kiri-group-spanner::force-hara-kiri-callback)
        (Y-extent . ,ly:hara-kiri-group-spanner::y-extent)
        (X-extent . ,ly:axis-group-interface::width)
-       (skylines . ,ly:axis-group-interface::calc-skylines);
+       (skylines . ,ly:hara-kiri-group-spanner::calc-skylines)
+       (max-stretch . ,ly:axis-group-interface::calc-max-stretch)
        (meta . ((class . Spanner)
                 (object-callbacks . ((X-common . ,ly:axis-group-interface::calc-x-common)))
                 (interfaces . (axis-group-interface
index 45833f08e0abf7e41cb01c8a31c3a1edaa704948..a2e128d5f0b0d966ab605dfc922d192ade1e3011 100644 (file)
 ;; geometric shapes
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
+(define-builtin-markup-command (draw-line layout props dest)
+  (number-pair?)
+  "A simple line. Uses the @code{thickness} property. "
+  (let*
+      ((th (chain-assoc-get 'thickness props  0.1))
+       (x (car dest))
+       (y (cdr dest)))
+
+    (ly:make-stencil
+     `(draw-line
+       ,th
+       0 0
+       ,x ,y)
+
+     (cons (min x 0) (min y 0))
+     (cons (max x 0) (max y 0)))))
+
 (define-builtin-markup-command (draw-circle layout props radius thickness fill)
   (number? number? boolean?)
   "A circle of radius @var{radius}, thickness @var{thickness} and
@@ -292,11 +309,6 @@ grestore
                           ;(map (lambda (s) (interpret-markup layout props s)) parts))
       (interpret-markup layout props str)))
 
-
-;; TODO: use font recoding.
-;;                   (make-line-markup
-;;                    (map make-word-markup (string-tokenize str)))))
-
 (define-public empty-markup
   (make-simple-markup ""))
 
index 264d38054871e015b83f2f0f6e5f09e99d24c1de..02583858e49015e5f027167df5ebe62315d4cc98 100644 (file)
   #:use-module (lily)
   #:export (post-process-pages optimal-page-breaks make-page-from-systems
            page-breaking-wrapper
+           stretchable-line? ; delete me
            ;; utilities for writing custom page breaking functions
             line-height line-next-space line-next-padding
            line-minimum-distance line-ideal-distance
            first-line-position
            line-ideal-relative-position line-minimum-relative-position
-            line-minimum-position-on-page stretchable-line?
+            line-minimum-position-on-page
            page-maximum-space-to-fill page-maximum-space-left space-systems))
 
+; this is for 2-pass spacing. Delete me.
+(define (stretchable-line? line)
+  "Say whether a system can be stretched."
+  (not (or (ly:prob-property? line 'is-title)
+          (let ((system-extent (paper-system-staff-extents line)))
+            (= (interval-start system-extent)
+               (interval-end   system-extent))))))
+
+(define (stretch-and-draw-page paper-book systems page-number ragged last)
+  (define (max-stretch sys)
+    (if (ly:grob? sys)
+       (ly:grob-property sys 'max-stretch)
+       0.0))
+
+  (define (stretchable? sys)
+    (and (ly:grob? sys)
+        (> (max-stretch sys) 0.0)))
+
+  (define (height-estimate sys)
+    (interval-length
+     (if (ly:grob? sys)
+        (ly:grob-property sys 'pure-Y-extent)
+        (paper-system-extent sys Y))))
+
+  (define (print-system sys)
+    (if (ly:grob? sys)
+       (ly:system-print sys)
+       sys))
+
+  (define (set-line-stretch! sorted-lines rest-height space-left)
+    (if (not (null? sorted-lines))
+       (let* ((line (first sorted-lines))
+              (height (height-estimate line))
+              (stretch (min (max-stretch line)
+                            (if (positive? rest-height)
+                                (/ (* height space-left) rest-height)
+                                  0.0))))
+         (if (stretchable? line)
+             (ly:system-stretch line stretch))
+         (set-line-stretch! (cdr sorted-lines)
+                            (if (stretchable? line)
+                                (- rest-height height)
+                                rest-height)
+                            (- space-left stretch)))))
+
+  (let* ((page (make-page paper-book
+                         'page-number page-number
+                         'is-last last))
+        (paper (ly:paper-book-paper paper-book))
+        (height (page-printable-height page))
+        ; there is a certain amount of impreciseness going on here:
+        ; the system heights are estimated, we aren't using skyline distances
+        ; yet, etc. If we overstretch because of underestimation, the result
+        ; is very bad. So we stick in some extra space, just to be sure.
+        (buffer (/ height 10.0))
+        (total-system-height (apply + (map height-estimate systems)))
+        (height-left (- height total-system-height buffer)))
+
+    (if (not ragged)
+       (set-line-stretch! (sort systems
+                                (lambda (s1 s2)
+                                  (< (height-estimate s1)
+                                     (height-estimate s2))))
+                          (apply + (map height-estimate
+                                        (filter stretchable? systems)))
+                          (- (page-printable-height page)
+                             total-system-height)))
+
+    (let* ((lines (map print-system systems))
+          (posns (if (null? lines)
+                     (list)
+                     (let* ((paper (ly:paper-book-paper paper-book))
+                            (space-to-fill (page-maximum-space-to-fill
+                                            page lines paper))
+                            (spacing (space-systems space-to-fill lines ragged paper #f)))
+                       (if (and (> (length lines) 1)
+                                (or (not (car spacing)) (inf? (car spacing))))
+                           (begin
+                             (ly:warning (_ "Can't fit systems on page -- ignoring between-system-padding"))
+                             (cdr (space-systems space-to-fill lines ragged paper #t)))
+                           (cdr spacing))))))
+      (page-set-property! page 'lines lines)
+      (page-set-property! page 'configuration posns)
+      page)))
+
 (define (page-breaking-wrapper paper-book)
   "Compute line and page breaks by calling the page-breaking paper variable,
   then performs the post process function using the page-post-process paper
 ;;;
 ;;; Utilities for computing line distances and positions
 ;;;
+(define (line-extent line)
+  "Return the extent of the line (its lowest and highest Y-coordinates)."
+  (paper-system-extent line Y))
+
 (define (line-height line)
   "Return the system height, that is the length of its vertical extent."
-  (interval-length (paper-system-extent line Y)))
+  (interval-length (line-extent line)))
 
 (define (line-next-space line next-line layout)
   "Return space to use between `line' and `next-line'.
   "Minimum distance between `line' reference position and `next-line'
  reference position. If next-line is #f, return #f."
   (and next-line
-       (let ((non-skyline-distance (- (interval-end (paper-system-extent next-line Y))
-                                     (interval-start (paper-system-extent line Y)))))
-        (max 0 (+ (ly:prob-property next-line 'skyline-distance non-skyline-distance)
-                  (if ignore-padding 0 (line-next-padding line next-line layout)))))))
+       (let ((padding (if ignore-padding
+                         0
+                         (line-next-padding line next-line layout))))
+        (if (or (ly:grob? line) (ly:grob? next-line))
+            (max 0 (+ padding
+                      (- (interval-start (line-extent line))
+                         (interval-end (line-extent next-line)))))
+            (max 0 (+ padding
+                      (ly:paper-system-minimum-distance line next-line)))))))
 
 (define (line-ideal-distance line next-line layout ignore-padding)
   "Ideal distance between `line' reference position and `next-line'
              0.0
            (ly:output-def-lookup layout 'page-top-space))
          (interval-end (paper-system-staff-extents line)))
-       (interval-end (paper-system-extent line Y))))
+       (interval-end (line-extent line))))
 
 (define (line-ideal-relative-position line prev-line layout ignore-padding)
   "Return ideal position of `line', relative to `prev-line' position.
          (position (+ (line-minimum-relative-position line prev-line layout #f)
                       (if prev-line prev-position 0.0)))
          (bottom-position (- position
-                             (interval-start (paper-system-extent line Y)))))
+                             (interval-start (line-extent line)))))
     (and (or (not prev-line)
              (< bottom-position (page-printable-height page)))
          position)))
 
-(define (stretchable-line? line)
-  "Say whether a system can be stretched."
-  (not (or (ly:prob-property? line 'is-title)
-          (let ((system-extent (paper-system-staff-extents line)))
-            (= (interval-start system-extent)
-               (interval-end   system-extent))))))
-
 (define (page-maximum-space-to-fill page lines paper)
   "Return the space between the first line top position and the last line
   bottom position. This constitutes the maximum space to fill on `page'
        (first-line-position (first lines) paper)
        (ly:prob-property last-line
                         'bottom-space 0.0)
-       (- (interval-start (paper-system-extent last-line Y))))))
+       (- (interval-start (line-extent last-line))))))
 
 (define (page-maximum-space-left page)
   (let ((paper (ly:paper-book-paper (page-property page 'paper-book))))
                 (and position
                      (- (page-printable-height page)
                         (- position
-                           (interval-start (paper-system-extent line Y)))))
+                           (interval-start (line-extent line)))))
                 (bottom-position (cdr lines) line position)))))))
 
 ;;;
                   (+ y topskip)))
               (cdr space-result)))))
 
-(define (make-page-from-systems paper-book lines page-number ragged last)
-  "Return a new page, filled with `lines'."
-  (let* ((page (make-page paper-book
-                         'lines lines
-                         'page-number page-number
-                         'is-last last))
-        (posns (if (null? lines)
-                   (list)
-                   (let* ((paper (ly:paper-book-paper paper-book))
-                          (space-to-fill (page-maximum-space-to-fill
-                                           page lines paper))
-                          (spacing (space-systems space-to-fill lines ragged paper #f)))
-                     (if (and (> (length lines) 1)
-                              (or (not (car spacing)) (inf? (car spacing))))
-                         (begin
-                           (ly:warning (_ "Can't fit systems on page -- ignoring between-system-padding"))
-                           (cdr (space-systems space-to-fill lines ragged paper #t)))
-                         (cdr spacing))))))
-    (page-set-property! page 'configuration posns)
-    page))
 
 ;;;
 ;;; Page breaking function
index 2a683a89751f9ba6ab786c752098519d7161e0b6..af9bf1b9e373f4fb94e995cedf4a4802fc2dcee6 100644 (file)
@@ -7,8 +7,8 @@ LOCALSTEPMAKE_TEMPLATES = lilypond
 HELP2MAN_EXECS = $(SEXECUTABLES)
 
 AT_FILES=relocate-preamble
-at-ext=.py.in
-at-dir=$(depth)/python
+at-ext=.py
+at-dir=$(top-build-dir)/python/$(outdir)
 
 include $(depth)/make/stepmake.make
 include $(stepdir)/executable-targets.make