]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/skyline.cc (merge_skyline): new function
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 28 Sep 2003 22:27:52 +0000 (22:27 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 28 Sep 2003 22:27:52 +0000 (22:27 +0000)
(heighten_skyline): new function

* lily/accidental-placement.cc (position_accidentals)
(position_accidentals): fix todo.

ChangeLog
GNUmakefile.in
input/regression/+.ly
input/regression/accidental-placement.ly
input/regression/bar-scripts.ly
input/test/+.ly
lily/accidental-placement.cc
lily/accidental.cc
lily/include/skyline.hh
lily/skyline.cc

index b6440f55d5a151f2c61de9705a58098bca103475..a9fdd433e3300791dc760ded3e63986cc2eef2d8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
+2003-09-29  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * lily/skyline.cc (merge_skyline): new function
+       (heighten_skyline): new function
+
+       * lily/accidental-placement.cc (position_accidentals) 
+       (position_accidentals): fix todo.
+
 2003-09-28  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
+       * input/test/+.ly (texidoc): put version number inline.
+
+       * GNUmakefile.in: remove rsync-web target.
+       
+       * input/regression/bar-scripts.ly (onestaff): raggedright
+
+v/pri2003-09-28  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
        * lily/*.cc: remove #if 0'd code in couple of places.
 
        * lily/midi-stream.cc (operator <<): rewrite.
index c69edbf9d939ea830f6a5a85ed878433555c4bf0..5b2716a8e8ca9c4046ac2a3aadf12f57a31d5a4e 100644 (file)
@@ -147,12 +147,3 @@ $(config_h): config.hh.in
        @false
 
 
-# maybe move into private script?
-rsync-web:
-       cd out-www &&  mkdir web && tar  -xzf web.tar.gz -C web
-       cd out-www/web && \
-       chgrp -R lilypond . && \
-       chmod -R g+w .  && \
-       chmod 2775 `find -type d` . && \
-       rsync --delete --stats --progress -gorltvu -e ssh . x:/var/www/lilypond/doc/v$(MAJOR_VERSION).$(MINOR_VERSION)/
-       cd out-www && rm -rf web/
index 6bb1c3596bb52fcb9173a69c8d4a237ae3c3fca3..75438d20b45fb6aee0458975c926c87c79e8b608 100644 (file)
@@ -5,30 +5,21 @@
 
 
 \header{
-texidoc = "
-@section Introduction
+texidoc =
 
-This document presents a brief overview of LilyPond features.  When the
+#(string-append "@section Introduction
+
+This document presents a feature test for
+LilyPond " (lilypond-version) ".  When the
 text correspond with the shown notation, we consider LilyPond Officially
 BugFree (tm).  This document is intended for finding bugs, and
 documenting bugfixes.
 
 TODO: order of tests (file names!), test only one feature per test.
 Smaller and neater tests.
-
-
-"
+")
 
 }
 
-\score { \context Lyrics \notes {
-    \property Score.RehearsalMark \set #'self-alignment-X = #LEFT
+\score { \context Lyrics \lyrics { " " }}
 
-\mark #(ly:export    (string-append "(For LilyPond version "
-(lilypond-version) ")"))
-s2
- }
- \paper { indent = 0.0\pt
- raggedright   = ##t 
- }
-}
index 2bc6cfbc795e80cd951eee047ebdce6a644b5bc3..8de4a256c97f01e81c25c222b94c7ff1084df723 100644 (file)
@@ -21,7 +21,7 @@ flats in a sixth should be staggered.  "
   <g! des'>
   <ges! es'!>
 }    
-    <cis d es fis gis ases bes ces d dis >4
+    <cis d es fis gis ases bes ces d e! >4
     <bes'! fis!>     
     <bes! cis!>
     <c! es ges beses>
index c72b9482bcf8821aaf9a5cbf52d4d175b5f847f6..8b55ed541bf6f5ea917c5b11b0f9162c0beacd0d 100644 (file)
@@ -1,4 +1,3 @@
-#(ly:set-option 'old-relative)
 \version "1.9.8"
 \header{
 texidoc="
@@ -9,6 +8,7 @@ knowing it.  Consequently, they fall over  often.
 "
 }
 
+\paper { raggedright = ##t }
 
 onestaff =  \new Staff\notes\relative c''  {
        \property Staff.instr = instr
index c764fabfbf717c5b8fe2da29798be388f9c203f0..4440e73cbd44fea1228a5eee54e89912a4208cb1 100644 (file)
@@ -4,28 +4,16 @@
 %% other .texi documents too?
 
 \header{
-texidoc = "
+texidoc = #(string-append "
 @section Introduction
 
-This document tests all kinds of features, from simple to advanced,
-that are not really suited for the reference manual, and are not
-needed as a regression test.
-
-Here you may also find dirty tricks, or very the very latest features
-that have not been documented or fully implemented yet.
-
-"
+This document shows all kinds of tips and tricks, from simple to
+advanced.  Here you may also find dirty tricks, or very the very
+latest features that have not been documented or fully implemented
+yet. 
+This document is for LilyPond version 
+" (lilypond-version) ".")
 }
 
 
-\score { \context Lyrics \notes {
-    \property Score.RehearsalMark \set #'self-alignment-X = #LEFT
-
-\mark #(ly:export    (string-append "(For LilyPond version "
-(lilypond-version) ")"))
-s2
- }
- \paper { indent = 0.0\pt
- raggedright   = ##t 
- }
-}
+\score { \context Lyrics \lyrics {  " " } }
index db4d5cb4389712983886033be675d7210b1ea4a0..763d6ea0951ba152a931ba900d790c4262a5513a 100644 (file)
@@ -244,7 +244,7 @@ Accidental_placement::position_accidentals (Grob * me)
 
   /*
     TODO: there is a bug in this code. If two accs are on the same
-    Y-position, they share an Ape, and will be pritned in overstrike.
+    Y-position, they share an Ape, and will be printed in overstrike.
    */
   Link_array<Accidental_placement_entry> apes;
   for (SCM s = accs; gh_pair_p (s); s =gh_cdr (s))
@@ -378,43 +378,27 @@ Accidental_placement::position_accidentals (Grob * me)
   if (gh_number_p (spad))
     padding = gh_scm2double (spad);
 
-
+  Array<Skyline_entry> left_skyline = head_ape->left_skyline_;
   /*
-    TODO:
-
-    There is a bug in this code: the left_skylines should be
-    accumulated, otherwise the b will collide with bb in
-
-      bb
-    b 
-      n 
-    
+    Add accs entries right-to-left.
    */
-  apes.push (head_ape);
-  for (int i= apes.size () -1 ; i-- > 0;)
+  for (int i= apes.size (); i-- > 0;)
     {
-      Accidental_placement_entry *ape = apes[i];
-      Real d = 0.0;
-      int j = i+1;
-      do {
-       d = - skyline_meshing_distance (ape->right_skyline_,
-                                       apes[j]->left_skyline_);
-
-       if (!isinf(d)
-           || j + 1 == apes.size())
-         break;
-       
-       j = j+ 1;
-      } while (1);
-
-      if (isinf(d))
-       d = 0.0;
-      
-      d -= padding;
-      ape->offset_ += apes[j]->offset_ + d;
-    }
+      Real offset =
+       -skyline_meshing_distance (apes[i]->right_skyline_, left_skyline);
+      if (isinf (offset))
+       offset = (i < apes.size ()) ? apes[i+1]->offset_ : 0.0;
+      else
+       offset -= padding;
+
+      apes[i]->offset_ = offset;
+
+      Array<Skyline_entry> new_left_skyline = apes[i]->left_skyline_;
+      heighten_skyline (&new_left_skyline, apes[i]->offset_);
+      merge_skyline (&new_left_skyline, left_skyline, LEFT);
+      left_skyline = new_left_skyline;
+    }      
 
-  apes.pop();
   for (int i = apes.size(); i--;)
     {
       Accidental_placement_entry* ape = apes[i];
index fa4c08407c3783f2e454f81ec308e726d5a4a5a8..3daa6f26c28c0211e04aa42ddf854f9c6c079cd1 100644 (file)
@@ -85,6 +85,7 @@ Accidental_interface::accurate_boxes (Grob *a,Grob**common)
          boxes.push (bulb);
          boxes.push (stem);
        }
+      
       /*
        TODO: add support for natural, double flat.
        */
index 9577755233e2497e754bdbe9726880aa8b72ee3f..8d8a640c7b5ebebb062805aebbfd91eb4a1ec568 100644 (file)
@@ -21,11 +21,16 @@ struct Skyline_entry
 };
 
 
+
+void
+merge_skyline (Array<Skyline_entry> *a1, Array<Skyline_entry> const  & a2,
+              Direction);
 void insert_extent_into_skyline (Array<Skyline_entry> *line, Box b, Axis line_axis,
                                 Direction d);
 Array<Skyline_entry>
 extents_to_skyline (Array<Box> const & extents, Axis a, Direction d);
 Array<Skyline_entry> empty_skyline (Direction d);
+void heighten_skyline (Array<Skyline_entry> *buildings, Real ground);
 Real
 skyline_meshing_distance (Array<Skyline_entry> const &buildings,
                          Array<Skyline_entry> const &clouds);
index 65f267aa176b9e9529e1c49d1549c6dddfa959b9..1cc6b6877e3405b7e57852303e91d2de1a2b24a6 100644 (file)
@@ -89,6 +89,22 @@ insert_extent_into_skyline (Array<Skyline_entry> *line, Box b, Axis line_axis,
     }
 }
 
+void
+merge_skyline (Array<Skyline_entry> * a1,
+              Array<Skyline_entry> const  & a2,
+              Direction dir)
+{
+  for (int i = 0; i < a2.size(); i++)
+    {
+      Box b;
+      b[X_AXIS] = a2[i].width_;
+      b[Y_AXIS][dir] = a2[i].height_;
+      b[Y_AXIS][-dir] = dir * infinity_f ;
+
+      insert_extent_into_skyline (a1, b, X_AXIS, dir);
+    }
+}
+
 
 Array<Skyline_entry>
 empty_skyline (Direction d)
@@ -125,6 +141,7 @@ extents_to_skyline (Array<Box> const &extents, Axis a, Direction d)
 }
 
 
+
 /*
   minimum distance that can be achieved between baselines. "Clouds" is
   a skyline pointing down.
@@ -172,3 +189,10 @@ Skyline_entry::Skyline_entry (Interval i, Real r)
   height_ = r;
   
 }
+
+void
+heighten_skyline (Array<Skyline_entry> *buildings, Real ground)
+{
+  for (int i = 0; i < buildings->size (); i++)
+    buildings->elem_ref (i).height_ += ground; 
+}