(c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+#include "rest-collision.hh"
+
#include <math.h> // ceil.
#include "warn.hh"
-#include "rest-collision.hh"
#include "note-column.hh"
#include "stem.hh"
#include "rhythmic-head.hh"
Rest_collision::force_shift_callback (SCM element_smob, SCM axis)
{
Grob *them = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) scm_to_int (axis);
assert (a == Y_AXIS);
if (Note_column::has_rests (them))
}
-/*
- Combination of dot-count and duration-log.
- */
-static SCM
-head_characteristic (Grob * col)
-{
- Grob * s = unsmob_grob (col->get_property ("rest"));
-
- if (!s)
- return SCM_BOOL_F;
- else
- return scm_cons (s->get_property ("duration-log"),
- scm_int2num (Rhythmic_head::dot_count (s)));
-}
/*
TODO: look at horizontal-shift to determine ordering between rests
Link_array<Grob> rests;
Link_array<Grob> notes;
- for (SCM s = elts; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = elts; scm_is_pair (s); s = scm_cdr (s))
{
- Grob * e = unsmob_grob (ly_car (s));
+ Grob * e = unsmob_grob (scm_car (s));
if (unsmob_grob (e->get_property ("rest")))
{
/*
center one should be centered on the staff.
*/
Drul_array< Link_array <Grob > > ordered_rests;
- for (int i= 0; i < rests.size (); i++)
+ for (int i = 0; i < rests.size (); i++)
{
Grob * r = Note_column::get_rest (rests[i]);
if (ordered_rests[d].size () < 1)
{
if (ordered_rests[-d].size() > 1)
- ordered_rests[-d][0]->warning (_("Too many colliding rests."));
+ ordered_rests[-d][0]->warning (_ ("too many colliding rests"));
return SCM_UNSPECIFIED;
}
Grob * rcol = 0;
Direction dir = CENTER;
- for (int i= rests.size (); !rcol && i--;)
+ for (int i = rests.size (); !rcol && i--;)
if (Note_column::dir (rests[i]))
{
dir = Note_column::dir (rests[i]);