]> git.donarmstrong.com Git - lilypond.git/commitdiff
(struct Beam_stem_segment): add gapped_ for
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 5 May 2006 21:18:06 +0000 (21:18 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 5 May 2006 21:18:06 +0000 (21:18 +0000)
tremolo beams.

ChangeLog
lily/beam.cc
lily/include/beam.hh
scm/lily.scm

index 95b9a317f86a2eba05cb3c7f1389d9d78e54d4df..f024d45e2550383a23eafde98a72c8b6b69f244c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-05-05  Han-Wen Nienhuys  <hanwen@lilypond.org>
+
+       * lily/include/beam.hh (struct Beam_stem_segment): add gapped_ for
+       tremolo beams.
+
 2006-05-05  Erik Sandberg  <mandolaerik@gmail.com>
        * lily/context.cc, lily/global-context.cc: Added 'unique' member,
        used by music streams.
index 0c5246c501a2f453d44e1dfe99ca3a807a8ada11..ea68186213a7045dec61678791abd93ff6187764 100644 (file)
@@ -313,9 +313,14 @@ Beam::get_beam_segments (Grob *me_grob, Grob **common)
 
   *common = commonx;
   
+  int gap_count = robust_scm2int (me->get_property ("gap-count"), 0);
+  Real gap_length = robust_scm2double (me->get_property ("gap"), 0.0);
+
   Position_stem_segments_map stem_segments;
   Real lt = me->layout ()->get_dimension (ly_symbol2scm ("line-thickness"));
 
+  Slice ranks;
+  
   for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *stem = stems[i];
@@ -330,7 +335,18 @@ Beam::get_beam_segments (Grob *me_grob, Grob **common)
            {
              if (!scm_is_integer (scm_car (s)))
                continue;
-             
+
+             int beam_rank = scm_to_int (scm_car (s));
+             ranks.add_point (beam_rank);
+           }
+         
+         for (SCM s = index_get_cell (beaming, d);
+              scm_is_pair (s); s = scm_cdr (s))
+           {
+             if (!scm_is_integer (scm_car (s)))
+               continue;
+         
+             int beam_rank = scm_to_int (scm_car (s));
              Beam_stem_segment seg;
              seg.stem_ = stem;
              seg.stem_x_ = stem_x;
@@ -338,7 +354,11 @@ Beam::get_beam_segments (Grob *me_grob, Grob **common)
              seg.width_ = stem_width;
              seg.stem_index_ = i;
              seg.dir_ = d;
-             stem_segments[scm_to_int (scm_car (s))].push_back (seg);
+             Direction stem_dir = get_grob_direction (stem);
+             
+             seg.gapped_
+               = (stem_dir * beam_rank < (stem_dir * ranks[-stem_dir] + gap_count));
+             stem_segments[beam_rank].push_back (seg);
            }
        }
       while (flip (&d) != LEFT);
@@ -399,6 +419,8 @@ Beam::get_beam_segments (Grob *me_grob, Grob **common)
              else
                {
                  current.horizontal_[event_dir] += event_dir * segs[j].width_/2;
+                 if (segs[j].gapped_)
+                   current.horizontal_[event_dir] -= event_dir * gap_length;  
                }
 
              if (event_dir == RIGHT)
index 87cafa038cd456f6421d9ec74dd75979fa2103f1..0dbc485b53307fcc7b8cc9c33c9fdffd3980b9e1 100644 (file)
@@ -56,6 +56,7 @@ struct Beam_stem_segment
   Real stem_x_;
   int rank_;
   int stem_index_;
+  bool gapped_;
   Direction dir_;
 };
 
index b45f5987ff034338f8cb90be9ba4bab6fb1fbcfd..98d3b16261cff828f921cc405b368f93b0d28e2a 100644 (file)
@@ -106,6 +106,8 @@ similar to chord syntax")
   (let* ((file-name (%search-load-path x)))
     (if (ly:get-option 'verbose)
        (ly:progress "[~A" file-name))
+    (if (not file-name)
+       (ly:error (_ "Can't find ~A" x)))
     (primitive-load file-name)
     (if (ly:get-option 'verbose)
        (ly:progress "]"))))
@@ -223,7 +225,7 @@ The syntax is the same as `define*-public'."
          ;; load-from-path
          '("lily-library.scm"
            "file-cache.scm"
-           "define-event-classes.scm"
+;          "define-event-classes.scm"
            "define-music-types.scm"
            "output-lib.scm"
            "c++.scm"