(c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include <math.h>
+
#include "accidental-placement.hh"
-#include "libc-extension.hh" // isinf
#include "skyline.hh"
#include "music.hh"
#include "pitch.hh"
#include "warn.hh"
#include "note-column.hh"
-#include "group-interface.hh"
+#include "pointer-group-interface.hh"
#include "note-collision.hh"
#include "accidental-interface.hh"
position_accidentals (par);
}
- return scm_int2num (0);
+ return scm_from_int (0);
}
void
Music *mcause = unsmob_music (cause);
if (!mcause)
{
- programming_error ("Note head has no music cause!");
+ programming_error ("note head has no music cause");
return;
}
int n = p->get_notename ();
- SCM accs = me->get_property ("accidental-grobs");
- SCM key = scm_int2num (n);
+ SCM accs = me->get_object ("accidental-grobs");
+ SCM key = scm_from_int (n);
SCM entry = scm_assq (key, accs);
if (entry == SCM_BOOL_F)
- {
- entry = SCM_EOL;
- }
+ entry = SCM_EOL;
else
entry = scm_cdr (entry);
accs = scm_assq_set_x (accs, key, entry);
- me->set_property ("accidental-grobs", accs);
+ me->set_object ("accidental-grobs", accs);
}
/*
Link_array<Grob> *break_reminder,
Link_array<Grob> *real_acc)
{
- for (SCM acs = accs->get_property ("accidental-grobs"); scm_is_pair (acs);
+ for (SCM acs = accs->get_object ("accidental-grobs"); scm_is_pair (acs);
acs = scm_cdr (acs))
for (SCM s = scm_cdar (acs); scm_is_pair (s); s = scm_cdr (s))
{
Grob *a = unsmob_grob (scm_car (s));
- if (unsmob_grob (a->get_property ("tie")))
+ if (unsmob_grob (a->get_object ("tie")))
break_reminder->push (a);
else
real_acc->push (a);
Interval extent;
for (int i = 0; i < which->size (); i++)
- {
- extent.unite (which->elem (i)->extent (item_col, X_AXIS));
- }
+ extent.unite (which->elem (i)->extent (item_col, X_AXIS));
if (!extent.is_empty ())
{
if (!me->is_live ())
return SCM_UNSPECIFIED;
- SCM accs = me->get_property ("accidental-grobs");
+ SCM accs = me->get_object ("accidental-grobs");
if (!scm_is_pair (accs))
return SCM_UNSPECIFIED;
Grob *c = note_cols[i]->get_parent (X_AXIS);
if (Note_collision_interface::has_interface (c))
{
- Link_array<Grob> gs
- = extract_grob_array (c, ly_symbol2scm ("elements"));
+ extract_grob_set (c, "elements", gs);
note_cols.concat (gs);
}
}
for (int i = note_cols.size (); i--;)
- {
- heads.concat (extract_grob_array (note_cols[i], ly_symbol2scm ("note-heads")));
- }
+ heads.concat (extract_grob_array (note_cols[i], "note-heads"));
+
heads.default_sort ();
heads.uniq ();
common[Y_AXIS] = common_refpoint_of_array (heads, common[Y_AXIS], Y_AXIS);
Interval y;
for (int j = apes[i]->extents_.size (); j--;)
- {
- y.unite (apes[i]->extents_[j][Y_AXIS]);
- }
+ y.unite (apes[i]->extents_[j][Y_AXIS]);
apes[i]->vertical_extent_ = y;
total.unite (y);
}
insert_extent_into_skyline (&head_skyline, b, Y_AXIS, LEFT);
}
- head_ape-> left_skyline_ = head_skyline;
+ head_ape->left_skyline_ = head_skyline;
head_ape->offset_ = 0.0;
Real padding = robust_scm2double (me->get_property ("padding"), 0.2);
{
Accidental_placement_entry *ape = apes[i];
for (int j = ape->grobs_.size (); j--;)
- {
- ape->grobs_[j]->translate_axis (ape->offset_, X_AXIS);
- }
+ ape->grobs_[j]->translate_axis (ape->offset_, X_AXIS);
}
Interval left_extent, right_extent;