if (req_l_)
{
now_heads_.sort (&head_pitch_compare);
- stopped_heads_.sort (&head_pitch_compare);
+ /*
+ We could sort stopped_heads_ as well (and use a linear alg. in
+ stead of nested loop), but we'd have to use a stable sorting
+ algorithm, since the ordering of the stopped heads (of the
+ same pitch) is relevant.
+ */
SCM head_list = SCM_EOL;
- int j = stopped_heads_.size ()-1;
- int i = now_heads_.size ()-1;
-
- while (i >= 0 && j >=0)
+ for (int i = now_heads_.size(); i--;)
{
- int comp
- = head_pitch_compare (now_heads_[i], stopped_heads_[j]);
-
- if (comp)
+ for (int j = stopped_heads_.size(); j--;)
{
- (comp < 0) ? j -- : i--;
- continue;
- }
- else
- {
- head_list = gh_cons (gh_cons (stopped_heads_[j]->self_scm (),
- now_heads_[i]->self_scm ()),
- head_list);
-
- now_heads_.del (i);
- stopped_heads_.del (j);
- i--;
- j--;
+ int comp
+ = head_pitch_compare (now_heads_[i], stopped_heads_[j]);
+
+ if (!comp)
+ {
+ head_list = gh_cons (gh_cons (stopped_heads_[j]->self_scm (),
+ now_heads_[i]->self_scm ()),
+ head_list);
+
+ now_heads_.del (i);
+ stopped_heads_.del (j);
+ break ;
+ }
}
}
-
+
SCM basic = get_property ("Tie");
SCM sparse = get_property ("sparseTies");
if (to_boolean (sparse))
&& Note_head::has_interface (grob))
stopped_heads_.push (grob);
}
+
+
+ /*
+
+ The list starts with entries that start earlier. By going through
+ it, we reverse the order, where as we'd like to use the `last'
+ heads first.
+
+ This makes a difference for grace notes. If we have
+
+ c4 \grace c8 ~ c4
+
+ Then busyGrobs will have ((1/4 . gc8) (1/4 . c4)).
+
+ We want stopped_heads_ to contain (c4 gc8), because we start with
+ it at the top.
+ */
+ stopped_heads_.reverse();
}
")
(translator-property-description 'busyGrobs list? "
a queue of (END-MOMENT . GROB) conses. This is for internal (C++) use only.
-Use at your own risk.
+Use at your own risk. This property contains the grobs for which END-MOMENT >= NOW.
")
(translator-property-description 'centralCPosition number? "Place of the central C. Usually determined by looking at clefPosition and clefGlyph.")
(translator-property-description 'changeMoment moment-pair? "duration that voices are examined for differences, when part-combining. Usually unset or zero when combining threads into one voice, and 1 (or the duration of one measure) when combining voices into one staff.")