summaryrefslogtreecommitdiff
path: root/lily/beam.cc
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@xs4all.nl>2006-05-05 21:18:06 +0000
committerHan-Wen Nienhuys <hanwen@xs4all.nl>2006-05-05 21:18:06 +0000
commit56f77a28d7c1d9723899f90889016ce4978d890c (patch)
tree6154b1afad553b764d8aee3d8b821bbf0105c763 /lily/beam.cc
parentb1bf1348924a5526a96bbc80f60a0d128b35522c (diff)
(struct Beam_stem_segment): add gapped_ for
tremolo beams.
Diffstat (limited to 'lily/beam.cc')
-rw-r--r--lily/beam.cc26
1 files changed, 24 insertions, 2 deletions
diff --git a/lily/beam.cc b/lily/beam.cc
index 0c5246c501..ea68186213 100644
--- a/lily/beam.cc
+++ b/lily/beam.cc
@@ -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)