]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/spacing-basic.cc (standard_breakable_column_spacing): also
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 7 Mar 2006 16:08:39 +0000 (16:08 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 7 Mar 2006 16:08:39 +0000 (16:08 +0000)
consider columns that have originals.  Unifies spacing for mm
rests around line breaks.

* lily/multi-measure-rest.cc (set_spacing_rods): read bound-padding.
(set_text_rods): idem.
(calculate_spacing_rods): new function: share code between
set_text_rods and set_spacing_rods.
(set_text_rods): take extents of bounds into account.

12 files changed:
ChangeLog
Documentation/user/basic-notation.itely
THANKS
VERSION
lily/include/multi-measure-rest.hh
lily/multi-measure-rest.cc
lily/paper-column-engraver.cc
lily/spacing-basic.cc
lily/spacing-spanner.cc
scm/define-grobs.scm
scm/lily.scm
stepmake/bin/package-diff.py

index b15e72a5f817b2dbb4ce80f929c9594d82786940..b3456ddd33426e1dfebcec1e69ae98153f92911f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2006-03-07    <hanwen@xs4all.nl>
+
+       * lily/spacing-basic.cc (standard_breakable_column_spacing): also
+       consider columns that have originals.  Unifies spacing for mm
+       rests around line breaks.
+
+       * lily/multi-measure-rest.cc (set_spacing_rods): read bound-padding.
+       (set_text_rods): idem.
+       (calculate_spacing_rods): new function: share code between
+       set_text_rods and set_spacing_rods.
+       (set_text_rods): take extents of bounds into account.  
+
+2006-03-07  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * Documentation/user/basic-notation.itely (Writing music in
+       parallel): don't use relative.
+
 2006-03-06  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
        * ly/music-functions-init.ly (Module): add shiftDurations
index ae070ba2aa4968c02ff5a254e9f468382f6a3bc7..e64483f204c3a18c20cd5b7017ea6fb9ba7ad509 100644 (file)
@@ -922,7 +922,7 @@ Program reference: @internalsref{Completion_heads_engraver}.
 
 Music for multiple parts can be interleaved
 
-@lilypond[quote,fragment,verbatim,relative=1]
+@lilypond[quote,fragment,verbatim]
 \parallelMusic #'(voiceA voiceB) {
   r8     g'16[ c''] e''[ g' c'' e''] r8     g'16[ c''] e''[ g' c'' e''] |
   c'2                                c'2                                |
diff --git a/THANKS b/THANKS
index a600fa9b9cd20ce234b12d1ef7b8a6e097f5c96a..e4385208eb3447dcab434ad4be2564293e2eb5cf 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -99,6 +99,7 @@ Steven Weber
 Sven Axelsson
 Thomas Scharkowski
 Thomas Bushnell BSG
+Toine Schreurs
 Trent Johnston
 Trevor Bača
 Vicente Solsona Dellá
diff --git a/VERSION b/VERSION
index 8c2457bbf0af613104735333e279fb2d9a426e84..35aa415477cbe702cd1642dc72b59b017817f117 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=7
-PATCH_LEVEL=37
+PATCH_LEVEL=38
 MY_PATCH_LEVEL=
 
index 694d26914f9881f511439b7f7407edfcbb5bb5dc..b5ea6f5895a751b336d070f7f9bf59b7a857425b 100644 (file)
@@ -23,6 +23,8 @@ public:
   DECLARE_SCHEME_CALLBACK (set_text_rods, (SCM));
   DECLARE_SCHEME_CALLBACK (centered_stencil, (SCM));
 
+
+  static void calculate_spacing_rods (Grob *me, Real length);
   static Stencil big_rest (Grob *, Real);
   static Stencil symbol_stencil (Grob *, Real);
   static Stencil church_rest (Grob *, Font_metric *, int, Real);
index 95f2d89569dd0e843d77769f7d80094302a16017..997e76105d2a1764d8d2cdc8915375ec331b2a3d 100644 (file)
@@ -279,17 +279,14 @@ Multi_measure_rest::add_column (Grob *me, Item *c)
   add_bound_item (dynamic_cast<Spanner *> (me), c);
 }
 
-MAKE_SCHEME_CALLBACK (Multi_measure_rest, set_spacing_rods, 1);
-SCM
-Multi_measure_rest::set_spacing_rods (SCM smob)
+void
+Multi_measure_rest::calculate_spacing_rods (Grob *me, Real length)
 {
-  Grob *me = unsmob_grob (smob);
-
   Spanner *sp = dynamic_cast<Spanner *> (me);
   if (! (sp->get_bound (LEFT) && sp->get_bound (RIGHT)))
     {
       programming_error ("Multi_measure_rest::get_rods (): I am not spanned!");
-      return SCM_UNSPECIFIED;
+      return ;
     }
 
   Item *li = sp->get_bound (LEFT)->get_column ();
@@ -302,8 +299,6 @@ Multi_measure_rest::set_spacing_rods (SCM smob)
                              {li, rb},
                              {lb, rb}};
 
-  Real sym_width = symbol_stencil (me, 0.0).extent (X_AXIS).length ();
-
   for (int i = 0; i < 4; i++)
     {
       Item *li = combinations[i][0];
@@ -318,71 +313,42 @@ Multi_measure_rest::set_spacing_rods (SCM smob)
 
       rod.distance_ = li->extent (li, X_AXIS)[BIGGER]
        - ri->extent (ri, X_AXIS)[SMALLER]
-       /* 2.0 = magic! */
-       + sym_width + 2.0;
+       + length
+       + 2 * robust_scm2double (me->get_property ("bound-padding"), 1.0);
 
       Real minlen = robust_scm2double (me->get_property ("minimum-length"), 0);
       rod.distance_ = max (rod.distance_, minlen);
       rod.add_to_cols ();
     }
-  return SCM_UNSPECIFIED;
 }
 
-/*
-  Ugh. Cut & paste.
- */
+MAKE_SCHEME_CALLBACK (Multi_measure_rest, set_spacing_rods, 1);
+SCM
+Multi_measure_rest::set_spacing_rods (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+  Real sym_width = symbol_stencil (me, 0.0).extent (X_AXIS).length ();
+  calculate_spacing_rods (me, sym_width);
+
+  return SCM_UNSPECIFIED;  
+}
+  
 MAKE_SCHEME_CALLBACK (Multi_measure_rest, set_text_rods, 1);
 SCM
 Multi_measure_rest::set_text_rods (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-
-  Spanner *sp = dynamic_cast<Spanner *> (me);
-  if (! (sp->get_bound (LEFT) && sp->get_bound (RIGHT)))
-    {
-      programming_error ("Multi_measure_rest::get_rods (): I am not spanned!");
-      return SCM_UNSPECIFIED;
-    }
-
-  Item *li = sp->get_bound (LEFT)->get_column ();
-  Item *ri = sp->get_bound (RIGHT)->get_column ();
-  Item *lb = li->find_prebroken_piece (RIGHT);
-  Item *rb = ri->find_prebroken_piece (LEFT);
-
-  Item *combinations[4][2] = {{li, ri},
-                             {lb, ri},
-                             {li, rb},
-                             {lb, rb}};
-
   Stencil *stil = me->get_stencil ();
 
   /* FIXME uncached */
   Real len = (stil && !stil->extent (X_AXIS).is_empty ())
     ? stil->extent (X_AXIS).length ()
     : 0.0;
+  calculate_spacing_rods (me, len);
 
-  for (int i = 0; i < 4; i++)
-    {
-      Item *li = combinations[i][0];
-      Item *ri = combinations[i][1];
-
-      if (!li || !ri)
-       continue;
-
-      Rod rod;
-      rod.item_drul_[LEFT] = li;
-      rod.item_drul_[RIGHT] = ri;
-
-      rod.distance_ = len; 
-
-      Real minlen = robust_scm2double (me->get_property ("minimum-length"), 0);
-      rod.distance_ = max (rod.distance_, minlen);
-      rod.add_to_cols ();
-    }
   return SCM_UNSPECIFIED;
 }
 
-
 ADD_INTERFACE (Multi_measure_rest, "multi-measure-rest-interface",
               "A rest that spans a whole number of measures.",
 
@@ -392,5 +358,6 @@ ADD_INTERFACE (Multi_measure_rest, "multi-measure-rest-interface",
               "hair-thickness "
               "thick-thickness "
               "use-breve-rest "
+              "bound-padding "
               "minimum-length");
 
index 13cc58fedd3045ad1a79d6cdfd7184963fbc7b10..517d1c565333b3188f440bd1bdd056d432db71a8 100644 (file)
@@ -21,6 +21,7 @@
 
 Paper_column_engraver::Paper_column_engraver ()
 {
+  last_moment_.main_part_ = Rational (-1,1); 
   command_column_ = 0;
   musical_column_ = 0;
   breaks_ = 0;
index a4c002aba700d881b1a68c6ade8352c692866ff1..2c43f54a9e1244edc112c2b0a2805804698aab63 100644 (file)
@@ -93,7 +93,8 @@ Spacing_spanner::standard_breakable_column_spacing (Grob *me, Item *l, Item *r,
     }
   while (flip (&d) != LEFT);
 
-  if (l->is_breakable (l) && r->is_breakable (r))
+  if ((l->is_breakable (l) || l->original ())
+      && (r->is_breakable (r) || r->original ()))
     {
       Moment *dt = unsmob_moment (l->get_property ("measure-length"));
       Moment mlen (1);
index 73fb9880f469a7e36d8ba1e9ea6e186701ea896c..4fe3b25a0ea1f099abeec90f516261631491da88 100644 (file)
@@ -228,16 +228,16 @@ Spacing_spanner::generate_springs (Grob *me,
                                   vector<Grob*> const &cols,
                                   Spacing_options const *options)
 {
-  Paper_column *next = 0;
-  Paper_column *next_next = 0;
-  for (vsize i = cols.size (); i--;)
+  Paper_column *prev = 0;
+  for (vsize i = 0; i < cols.size (); i++)
     {
       Paper_column *col = dynamic_cast<Paper_column *> (cols[i]);
-      if (next)
-       generate_pair_spacing (me, col, next, next_next, options);
+      Paper_column *next = (i < cols.size()-1) ? dynamic_cast<Paper_column *> (cols[i+1]) : 0;
+      
+      if (i > 0)
+       generate_pair_spacing (me, prev, col, next, options);
 
-      next_next = next;
-      next = col;
+      prev = col;
     }
 }
 
index 9a4f2c86ca81e01925495dd1586d04b44e007ed4..2ecce335814a7fd5b629da832f5b8b81a19a5c9f 100644 (file)
 
     (MultiMeasureRestNumber
      . (
-       (springs-and-rods . ,ly:multi-measure-rest::set-spacing-rods)
+       (bound-padding  . 2.0)
+       (springs-and-rods . ,ly:multi-measure-rest::set-text-rods)
        (stencil . ,ly:text-interface::print)
        (X-offset . ,(ly:make-simple-closure
                      `(,+ ,(ly:make-simple-closure (list ly:self-alignment-interface::x-aligned-on-self))
index 5f9e364b7f5ba554f2ca324868ffae1aebac6b53..db729e6567beb0c6f3c8490107e6614dc22abba9 100644 (file)
@@ -44,7 +44,10 @@ similar to chord syntax")
              )
            ))
 
-;; FIXME: stray statement
+
+;; need to do this in the beginning. Other parts of the
+;; Scheme init depend on these options.
+;;
 (define-scheme-options)
 
 (if (defined? 'set-debug-cell-accesses!)
index 6837116e0a8aeb522a266384cbd2d102fd69307f..8d162c1b54b94c3456a977a78f50a133eefd9826 100644 (file)
@@ -16,8 +16,9 @@ import pipes
 
 
 _debug = 0
-
 _prune = ['(*)']
+package_diff_dir = '/tmp/package-diff.%s/' % os.getlogin () 
+
 def system (cmd):
        print cmd
        s = os.system (cmd)
@@ -95,7 +96,7 @@ def help ():
 
 def cleanup ():
        global from_diff, to_diff, original_dir
-       os.chdir ('/tmp/package-diff')
+       os.chdir (package_diff_dir)
        sys.stderr.write ('Cleaning ... ')
        system ('rm -fr %s %s' % (from_diff, to_diff))
        sys.stderr.write ('\n')
@@ -287,9 +288,9 @@ if release:
 import tempfile
 original_dir = os.getcwd ();
 
-system ('rm -rf /tmp/package-diff'
+system ('rm -rf %s' % package_diff_dir
 try:
-       os.mkdir ('/tmp/package-diff')
+       os.mkdir (package_diff_dir)
 except:
        pass
 
@@ -317,11 +318,11 @@ if not patch_name:
 
        patch_name = compat_abspath (patch_name)
 
-from_diff = '/tmp/package-diff/' + from_diff
-to_diff =  '/tmp/package-diff/' + to_diff
+from_diff = package_diff_dir + from_diff
+to_diff =  package_diff_dir + to_diff
 
 if not from_src:
-       os.chdir ('/tmp/package-diff')
+       os.chdir (package_diff_dir)
        untar (released_tarball (flags.from_version))
        os.chdir (original_dir)
 else:
@@ -334,7 +335,7 @@ else:
 
 
 if not to_src:
-       os.chdir ('/tmp/package-diff')
+       os.chdir (package_diff_dir)
        untar (released_tarball (flags.to_version))
        os.chdir (original_dir)
 else: