2004-09-04 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/*: ly_scm2int -> scm_to_int
+
* lily/include/lily-guile.hh (scm_from_double): more compat glue.
2004-09-03 Han-Wen Nienhuys <hanwen@xs4all.nl>
if (ly_c_pair_p (ly_cdr (prev_local))
&& ly_c_number_p (laziness))
{
- int barnum = ly_scm2int (ly_cddr (prev_local));
+ int barnum = scm_to_int (ly_cddr (prev_local));
prev_local = scm_cons (ly_car (prev_local), ly_cadr (prev_local));
- if (curbarnum <= barnum + ly_scm2int (laziness))
+ if (curbarnum <= barnum + scm_to_int (laziness))
prev_alt = prev_local;
}
}
prev_alt = (prev_alt == SCM_BOOL_F) ? scm_int2num (0) : ly_cdr (prev_alt);
/* UGH. prev_acc can be #t in case of ties. What is this for? */
- int p = ly_c_number_p (prev_alt) ? ly_scm2int (prev_alt) : 0;
+ int p = ly_c_number_p (prev_alt) ? scm_to_int (prev_alt) : 0;
int num;
if (a == p && ly_c_number_p (prev_alt))
for (SCM s = accs; ly_c_pair_p (s); s =ly_cdr (s))
{
Accidental_placement_entry *ape = new Accidental_placement_entry;
- ape->notename_ = ly_scm2int (ly_caar (s));
+ ape->notename_ = scm_to_int (ly_caar (s));
for (SCM t = ly_cdar (s); ly_c_pair_p (t); t =ly_cdr (t))
ape->grobs_.push (unsmob_grob (ly_car (t)));
&& !parens
&& scm_ilength (accs) == 1)
{
- if (ly_scm2int (ly_car (accs)) == FLAT)
+ if (scm_to_int (ly_car (accs)) == FLAT)
{
Box stem = b;
Box bulb = b;
for (SCM s = me->get_property ("accidentals");
ly_c_pair_p (s); s = ly_cdr (s))
{
- int alteration = ly_scm2int (ly_car (s));
+ int alteration = scm_to_int (ly_car (s));
String font_char = get_fontcharname (style, alteration);
Stencil acc (fm->find_by_name ("accidentals-" + font_char));
Align_interface::alignment_callback (SCM element_smob, SCM axis)
{
Grob * me = unsmob_grob (element_smob);
- Axis ax = (Axis)ly_scm2int (axis);
+ Axis ax = (Axis)scm_to_int (axis);
Grob * par = me->get_parent (ax);
if (par && !to_boolean (par->get_property ("positioning-done")))
{
Align_interface::fixed_distance_alignment_callback (SCM element_smob, SCM axis)
{
Grob * me = unsmob_grob (element_smob);
- Axis ax = (Axis)ly_scm2int (axis);
+ Axis ax = (Axis)scm_to_int (axis);
Grob * par = me->get_parent (ax);
if (par && !to_boolean (par->get_property ("positioning-done")))
{
Axis
Align_interface::axis (Grob*me)
{
- return Axis (ly_scm2int (ly_car (me->get_property ("axes"))));
+ return Axis (scm_to_int (ly_car (me->get_property ("axes"))));
}
void
handle = scm_assoc (scm_from_int (p.get_notename ()),
start_key_sig_);
- int sig_alter = (handle != SCM_BOOL_F) ? ly_scm2int (ly_cdr (handle)) : 0;
+ int sig_alter = (handle != SCM_BOOL_F) ? scm_to_int (ly_cdr (handle)) : 0;
if (sig_alter == p.get_alteration ())
{
accidentals_[d]->suicide();
Arpeggio::width_callback (SCM smob, SCM axis)
{
Grob * me = unsmob_grob (smob);
- Axis a = (Axis)ly_scm2int (axis);
+ Axis a = (Axis)scm_to_int (axis);
assert (a == X_AXIS);
Stencil arpeggio = Font_interface::get_default_font (me)->find_by_name ("scripts-arpeggio");
{
for (SCM ax = me->get_property ("axes"); ax != SCM_EOL ; ax = ly_cdr (ax))
{
- Axis a = (Axis) ly_scm2int (ly_car (ax));
+ Axis a = (Axis) scm_to_int (ly_car (ax));
if (!e->get_parent (a))
e->set_parent (me, a);
Axis_group_interface::group_extent_callback (SCM element_smob, SCM scm_axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (scm_axis);
+ Axis a = (Axis) scm_to_int (scm_axis);
SCM elts = me->get_property ("elements");
Grob * common = common_refpoint_of_list (elts, me, a);
create_items ();
// guh.
text_->set_property
- ("text", scm_makfrom0str (to_string (ly_scm2int (bn)).to_str0 ()));
+ ("text", scm_makfrom0str (to_string (scm_to_int (bn)).to_str0 ()));
}
}
}
if (to_boolean (me->get_paper ()->lookup_variable (ly_symbol2scm ("debug-beam-quanting")))
&& ly_c_pair_p (inspect_quants))
{
- Drul_array<Real> ins = ly_scm2interval (inspect_quants);
+ Drul_array<Real> ins = scm_to_interval (inspect_quants);
int i = 0;
Real line = Staff_symbol_referencer::line_thickness (me);
Real thickness = get_thickness (me);
- Real beam_translation = ly_scm2int (beam_count) < 4
+ Real beam_translation = scm_to_int (beam_count) < 4
? (2*staff_space + line - thickness) / 2.0
: (3*staff_space + line - thickness) / 3.0;
int count =0;
for ( SCM s = ly_car (right_beaming); ly_c_pair_p (s); s = ly_cdr (s))
{
- int k = - right_dir * ly_scm2int (ly_car (s)) + i;
+ int k = - right_dir * scm_to_int (ly_car (s)) + i;
if (scm_c_memq (scm_int2num (k), left_beaming) != SCM_BOOL_F)
count ++;
}
for (; ly_c_pair_p (s); s = ly_cdr (s))
{
int new_beam_pos =
- start_point - this_dir * ly_scm2int (ly_car (s));
+ start_point - this_dir * scm_to_int (ly_car (s));
new_slice.add_point (new_beam_pos);
scm_set_car_x (s, scm_int2num (new_beam_pos));
SCM s = ly_cdr (this_beaming);
for (; ly_c_pair_p (s); s = ly_cdr (s))
{
- int np = - this_dir * ly_scm2int (ly_car (s));
+ int np = - this_dir * scm_to_int (ly_car (s));
scm_set_car_x (s, scm_int2num (np));
last_int.add_point (np);
}
for (SCM s = left;
ly_c_pair_p (s); s =ly_cdr (s))
{
- int b = ly_scm2int (ly_car (s));
+ int b = scm_to_int (ly_car (s));
if (scm_c_memq (ly_car (s), right) != SCM_BOOL_F)
{
full_beams.push (b);
for (SCM s = right;
ly_c_pair_p (s); s =ly_cdr (s))
{
- int b = ly_scm2int (ly_car (s));
+ int b = scm_to_int (ly_car (s));
if (scm_c_memq (ly_car (s), left) == SCM_BOOL_F)
{
rfliebertjes.push (b);
int gap_count = 0;
if (ly_c_number_p (me->get_property ("gap-count")))
{
- gap_count = ly_scm2int (me->get_property ("gap-count"));
+ gap_count = scm_to_int (me->get_property ("gap-count"));
gapped = Lookup::beam (dydx, w - 2 * gap_length, thick, blot);
full_beams.sort (default_compare);
scm_cons (scm_int2num (total[UP]),
scm_int2num (total[DOWN])));
- if (ly_c_number_p (s) && ly_scm2int (s))
+ if (ly_c_number_p (s) && scm_to_int (s))
return to_dir (s);
/* If dir is not determined: get default */
Real dx = lvs->relative_coordinate (commonx, X_AXIS) - x0;
- Drul_array<Real> pos = ly_scm2interval ( me->get_property ("positions"));
+ Drul_array<Real> pos = scm_to_interval ( me->get_property ("positions"));
scale_drul (&pos, Staff_symbol_referencer::staff_space (me));
/* TODO: some sort of damping iso -> plain horizontal */
if (is_concave1 || concaveness2 > r2)
{
- Drul_array<Real> pos = ly_scm2interval (me->get_property ("positions"));
+ Drul_array<Real> pos = scm_to_interval (me->get_property ("positions"));
Real r = linear_combination (pos, 0.0);
r /= Staff_symbol_referencer::staff_space (me);
return SCM_UNSPECIFIED;
SCM s = me->get_property ("damping");
- int damping = ly_scm2int (s);
+ int damping = scm_to_int (s);
if (damping)
{
- Drul_array<Real> pos = ly_scm2interval (me->get_property ("positions"));
+ Drul_array<Real> pos = scm_to_interval (me->get_property ("positions"));
scale_drul (&pos, Staff_symbol_referencer::staff_space (me));
Real dy = pos[RIGHT] - pos[LEFT];
{
if (scm_c_memq (ly_car (s), ly_cdr (beaming)) != SCM_BOOL_F)
- l.add_point (ly_scm2int (ly_car (s)));
+ l.add_point (scm_to_int (ly_car (s)));
}
return l;
bool gap = false;
Real thick =0.0;
if (ly_c_number_p (me->get_property ("gap-count"))
- &&ly_scm2int (me->get_property ("gap-count")))
+ &&scm_to_int (me->get_property ("gap-count")))
{
gap = true;
thick = get_thickness (me);
Beam::rest_collision_callback (SCM element_smob, SCM axis)
{
Grob *rest = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) scm_to_int (axis);
if (ly_c_number_p (rest->get_property ("staff-position")))
return scm_int2num (0);
Drul_array<Real> pos (0, 0);
SCM s = beam->get_property ("positions");
if (ly_c_pair_p (s) && ly_c_number_p (ly_car (s)))
- pos = ly_scm2interval (s);
+ pos = scm_to_interval (s);
Real staff_space = Staff_symbol_referencer::staff_space (rest);
scale_drul (&pos, staff_space);
Break_align_interface::alignment_callback (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) scm_to_int (axis);
assert (a == X_AXIS);
Grob *par = me->get_parent (a);
Break_align_interface::self_align_callback (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) scm_to_int (axis);
assert (a == X_AXIS);
Item* item = dynamic_cast<Item*> (me);
if (ly_c_number_p (oct))
{
Pitch *p = unsmob_pitch (inversion_event->get_property ("pitch"));
- int octavation = ly_scm2int (oct);
+ int octavation = scm_to_int (oct);
Pitch orig = p->transposed (Pitch (-octavation, 0,0));
pitches= scm_cons (orig.smobbed_copy (), pitches);
clef_->set_property ("staff-position", cpos);
SCM oct = get_property ("clefOctavation");
- if (ly_c_number_p (oct) && ly_scm2int (oct))
+ if (ly_c_number_p (oct) && scm_to_int (oct))
{
Item * g = make_item ("OctavateEight", SCM_EOL);
- int abs_oct = ly_scm2int (oct) ;
+ int abs_oct = scm_to_int (oct) ;
int dir = sign (abs_oct);
abs_oct = abs (abs_oct) + 1;
{
SCM c0scm = get_property ("middleCPosition");
- int c0 = ly_c_number_p (c0scm) ? ly_scm2int (c0scm) : 0;
+ int c0 = ly_c_number_p (c0scm) ? scm_to_int (c0scm) : 0;
int pmax = INT_MIN;
int pmin = INT_MAX;
/*
measly attempt to save an eeny-weenie bit of memory.
*/
- if (dots != ly_scm2int (d->get_property ("dot-count")))
+ if (dots != scm_to_int (d->get_property ("dot-count")))
d->set_property ("dot-count", scm_int2num (dots));
d->set_parent (note, Y_AXIS);
int pos = pit->steps ();
SCM c0 = get_property ("middleCPosition");
if (ly_c_number_p (c0))
- pos += ly_scm2int (c0);
+ pos += scm_to_int (c0);
note->set_property ("staff-position", scm_int2num (pos));
notes_.push (note);
int p = pitches_[i].steps ();
SCM c0 = get_property ("middleCPosition");
if (ly_c_number_p (c0))
- p += ly_scm2int (c0);
+ p += scm_to_int (c0);
c->set_property ("staff-position",
Dot_column::force_shift_callback (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) scm_to_int (axis);
assert (a == Y_AXIS);
me = me->get_parent (X_AXIS);
Dot_column::side_position (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) scm_to_int (axis);
assert (a == X_AXIS);
Grob * stem = unsmob_grob (me->get_property ("stem"));
mol = Lookup::blank (Box (Interval (0,0),
Interval (0,0)));
- for (int i = ly_scm2int (c); i--;)
+ for (int i = scm_to_int (c); i--;)
{
d.translate_axis (2*dw,X_AXIS);
mol.add_at_edge (X_AXIS, RIGHT, d, dw, 0);
{
SCM_ASSERT_TYPE (scm_integer_p (dotcount) == SCM_BOOL_T,
dotcount, SCM_ARG2, __FUNCTION__, "integer");
- dots = ly_scm2int (dotcount);
+ dots = scm_to_int (dotcount);
}
bool compress = false;
else
den = scm_int2num (1);
- Duration p (ly_scm2int (length), dots);
+ Duration p (scm_to_int (length), dots);
if (compress)
- p = p.compressed (Rational (ly_scm2int (num), ly_scm2int (den)));
+ p = p.compressed (Rational (scm_to_int (num), scm_to_int (den)));
return p.smobbed_copy ();
}
"The 2-logarithm of 1/@var{d}.")
{
SCM_ASSERT_TYPE (ly_c_number_p (d), d, SCM_ARG1, __FUNCTION__, "integer");
- int log = intlog2 (ly_scm2int (d));
+ int log = intlog2 (scm_to_int (d));
return scm_int2num (log);
}
DynamicText doesn't really have a script-priority field.
*/
if (ly_c_number_p (p)
- && ly_scm2int (p)
- < ly_scm2int (script_->get_property ("script-priority")))
+ && scm_to_int (p)
+ < scm_to_int (script_->get_property ("script-priority")))
Side_position_interface::add_support (line_spanner_, info.grob_);
}
else if (Slur::has_interface (info.grob_))
if (is_number_pair (s))
{
- Interval iv = ly_scm2interval (s);
+ Interval iv = scm_to_interval (s);
volume = iv[MIN] + iv.length () * volume;
}
}
SCM check = get_property ("absolute-octave");
if (ly_c_number_p (check) &&
- new_pit.get_octave () != ly_scm2int (check))
+ new_pit.get_octave () != scm_to_int (check))
{
- Pitch expected_pit (ly_scm2int (check),
+ Pitch expected_pit (scm_to_int (check),
new_pit.get_notename (),
new_pit.get_alteration ());
origin ()->warning (_f ("octave check failed; expected %s, found: %s",
SCM alter = ly_cdar (s);
if (ly_c_pair_p (key))
{
- Pitch orig (ly_scm2int (ly_car (key)),
- ly_scm2int (ly_cdr (key)),
- ly_scm2int (alter));
+ Pitch orig (scm_to_int (ly_car (key)),
+ scm_to_int (ly_cdr (key)),
+ scm_to_int (alter));
orig =orig.transposed (*p);
}
else if (ly_c_number_p (key))
{
- Pitch orig (0, ly_scm2int (key), ly_scm2int (alter));
+ Pitch orig (0, scm_to_int (key), scm_to_int (alter));
orig = orig.transposed (*p);
key =scm_int2num (orig.get_notename ());
int priority = 200;
SCM s = fingering->get_property ("script-priority");
if (ly_c_number_p (s))
- priority = ly_scm2int (s);
+ priority = scm_to_int (s);
/* See script-engraver.cc */
priority += i;
SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
SCM_ASSERT_TYPE (ly_c_number_p (index), index, SCM_ARG2, __FUNCTION__, "number");
- return fm->get_ascii_char_stencil (ly_scm2int (index)).smobbed_copy ();
+ return fm->get_ascii_char_stencil (scm_to_int (index)).smobbed_copy ();
}
LY_DEFINE (ly_text_dimension,"ly:text-dimension",
scm_makfrom0str (input_coding.to_str0 ()),
scm_makfrom0str (font_coding.to_str0 ()),
scm_int2num (code));
- return ly_scm2int (s);
+ return scm_to_int (s);
}
Music *music_cause = primitives[i].music_cause ();
int context_info = 0;
int pitch = unsmob_pitch (music_cause->get_property ("pitch"))->steps ();
- int prefix_set = ly_scm2int (primitive->get_property ("prefix-set"));
+ int prefix_set = scm_to_int (primitive->get_property ("prefix-set"));
if (prefix_set & PES_OR_FLEXA)
if (!i) // ligature may not start with 2nd head of pes or flexa
{
String str;
int prefix_set =
- ly_scm2int (primitive->get_property ("prefix-set"));
+ scm_to_int (primitive->get_property ("prefix-set"));
check_prefix ("virga", VIRGA, prefix_set, &str);
check_prefix ("stropha", STROPHA, prefix_set, &str);
check_prefix ("inclinatum", INCLINATUM, prefix_set, &str);
SCM_ASSERT_TYPE (ref, refp, SCM_ARG2, __FUNCTION__, "grob");
SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
- return ly_interval2scm ( sc->extent (ref, Axis (ly_scm2int (axis))));
+ return ly_interval2scm ( sc->extent (ref, Axis (scm_to_int (axis))));
}
LY_DEFINE (ly_grob_parent, "ly:grob-parent",
SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
- Grob *par = sc->get_parent (Axis (ly_scm2int (axis)));
+ Grob *par = sc->get_parent (Axis (scm_to_int (axis)));
return par ? par->self_scm () : SCM_EOL;
}
SCM_ASSERT_TYPE (ly_c_number_p (d), d, SCM_ARG2, __FUNCTION__, "dimension");
SCM_ASSERT_TYPE (is_axis (a), a, SCM_ARG3, __FUNCTION__, "axis");
- me->translate_axis (ly_scm2double (d), Axis (ly_scm2int (a)));
+ me->translate_axis (ly_scm2double (d), Axis (scm_to_int (a)));
return SCM_UNSPECIFIED;
}
Grob::stencil_extent (SCM element_smob, SCM scm_axis)
{
Grob *s = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (scm_axis);
+ Axis a = (Axis) scm_to_int (scm_axis);
Stencil *m = s->get_stencil ();
Interval e;
if (!ly_c_pair_p (d->dimension_))
return ext;
- ext = ly_scm2interval (d->dimension_);
+ ext = scm_to_interval (d->dimension_);
SCM extra = get_property (a == X_AXIS
? "extra-X-extent"
Hara_kiri_group_spanner::y_extent (SCM element_smob, SCM scm_axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (scm_axis);
+ Axis a = (Axis) scm_to_int (scm_axis);
assert (a == Y_AXIS);
consider_suicide (me);
Hara_kiri_group_spanner::force_hara_kiri_callback (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) scm_to_int (axis);
assert (a == Y_AXIS);
consider_suicide (me);
return scm_make_real (0.0);
Hara_kiri_group_spanner::force_hara_kiri_in_parent_callback (SCM element_smob, SCM axis)
{
Grob *daughter = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) scm_to_int (axis);
assert (a == Y_AXIS);
force_hara_kiri_callback (daughter->get_parent (a)->self_scm (), axis);
return scm_make_real (0.0);
}
for (SCM s = n ; ly_c_pair_p (s); s = ly_cdr (s))
- if (ly_scm2int (ly_cdar (s)))
+ if (scm_to_int (ly_cdar (s)))
accs = scm_cons (ly_car (s), accs);
context ()->set_property ("keySignature", accs);
SCM acc = scm_call_1 (proc, pitchlist);
Pitch key_do (0,
- ly_scm2int (ly_caar (pitchlist)),
- ly_scm2int (ly_cdar (pitchlist)));
+ scm_to_int (ly_caar (pitchlist)),
+ scm_to_int (ly_cdar (pitchlist)));
Pitch c_do (0, 0, 0);
/* MIDI keys are too limited for lilypond scales.
We check for minor scale and assume major otherwise. */
SCM minor = scm_c_eval_string ("minor");
- audio_ = new Audio_key (ly_scm2int (acc),
+ audio_ = new Audio_key (scm_to_int (acc),
SCM_BOOL_T != scm_equal_p (minor, c_pitchlist));
Audio_element_info info (audio_, key_req_);
alteration_pos (SCM what, int alter, int c0p)
{
if (ly_c_pair_p (what))
- return ly_scm2int (ly_car (what)) * 7 + ly_scm2int (ly_cdr (what)) + c0p;
+ return scm_to_int (ly_car (what)) * 7 + scm_to_int (ly_cdr (what)) + c0p;
- int p = ly_scm2int (what);
+ int p = scm_to_int (what);
// Find the c in the range -4 through 2
int from_bottom_pos = c0p + 4;
SCM c0s = me->get_property ("c0-position");
int c0p = 0;
if (ly_c_number_p (c0s))
- c0p = ly_scm2int (c0s);
+ c0p = scm_to_int (c0s);
/*
SCM lists are stacks, so we work from right to left, ending with
Font_metric *fm = Font_interface::get_default_font (me);
for (SCM s = newas; ly_c_pair_p (s); s = ly_cdr (s))
{
- int alteration = ly_scm2int (ly_cdar (s));
+ int alteration = scm_to_int (ly_cdar (s));
String font_char =
Accidental_interface::get_fontcharname (style, alteration);
Stencil acc (fm->find_by_name ("accidentals-" + font_char));
{
if (ly_c_number_p (s))
{
- int i = ly_scm2int (s);
+ int i = scm_to_int (s);
return (i>= -1 && i <= 1) ? SCM_BOOL_T : SCM_BOOL_F;
}
return SCM_BOOL_F;
{
if (ly_c_number_p (s))
{
- int i = ly_scm2int (s);
+ int i = scm_to_int (s);
return i>= -1 && i <= 1;
}
return false;
{
if (ly_c_number_p (s))
{
- int i = ly_scm2int (s);
+ int i = scm_to_int (s);
return i== 0 || i == 1;
}
return false;
Direction
to_dir (SCM s)
{
- return scm_is_integer (s) ? (Direction) ly_scm2int (s) : CENTER;
+ return scm_is_integer (s) ? (Direction) scm_to_int (s) : CENTER;
}
Interval
-ly_scm2interval (SCM p)
+scm_to_interval (SCM p)
{
return Interval (ly_scm2double (ly_car (p)), ly_scm2double (ly_cdr (p)));
}
sprintf (str, "%08.4f", r);
}
else
- sprintf (str, "%d", ly_scm2int (s));
+ sprintf (str, "%d", scm_to_int (s));
return scm_makfrom0str (str);
}
s.set_empty ();
for (; ly_c_pair_p (l); l = ly_cdr (l))
if (ly_c_number_p (ly_car (l)))
- s.add_point (ly_scm2int (ly_car (l)));
+ s.add_point (scm_to_int (ly_car (l)));
return s;
}
i[LEFT]= v[LEFT];
i[RIGHT]= v[RIGHT];
if (is_number_pair (k))
- i = ly_scm2interval (k);
+ i = scm_to_interval (k);
return i;
}
robust_scm2drul (SCM k, Drul_array<Real> v)
{
if (is_number_pair (k))
- v = ly_scm2interval (k);
+ v = scm_to_interval (k);
return v;
}
robust_scm2int (SCM k, int o)
{
if (scm_integer_p (k) == SCM_BOOL_T)
- o = ly_scm2int (k);
+ o = scm_to_int (k);
return o;
}
SCM_ASSERT_TYPE (ly_c_number_p (p), a, SCM_ARG4, __FUNCTION__, "number") ;
- return Lookup::bracket ((Axis)ly_scm2int (a), ly_scm2interval (iv),
+ return Lookup::bracket ((Axis)scm_to_int (a), scm_to_interval (iv),
ly_scm2double (t),
ly_scm2double (p),
0.95 * ly_scm2double (t)).smobbed_copy ();
SCM_ASSERT_TYPE (is_number_pair (yext), yext, SCM_ARG2, __FUNCTION__, "number pair") ;
SCM_ASSERT_TYPE (ly_c_number_p (blot), blot, SCM_ARG3, __FUNCTION__, "number") ;
- return Lookup::round_filled_box (Box (ly_scm2interval (xext), ly_scm2interval (yext)),
+ return Lookup::round_filled_box (Box (scm_to_interval (xext), scm_to_interval (yext)),
ly_scm2double (blot)).smobbed_copy ();
}
if (scm_integer_p (m) == SCM_BOOL_T
&& scm_exact_p (m) == SCM_BOOL_T)
{
- int mark_count = ly_scm2int (m);
+ int mark_count = scm_to_int (m);
mark_count ++;
context ()->set_property ("rehearsalMark",
scm_int2num (mark_count));
Rational where (0);
for (SCM s = grouping; ly_c_pair_p (s);
- where += Rational (ly_scm2int (ly_car (s))) * bl,
+ where += Rational (scm_to_int (ly_car (s))) * bl,
s = ly_cdr (s)
)
{
- int grouplen = ly_scm2int (ly_car (s));
+ int grouplen = scm_to_int (ly_car (s));
if (where == mp)
{
if (grouping_)
for (int i = 0; i < primitives.size (); i++)
{
Item *primitive = dynamic_cast<Item*> (primitives[i].grob_);
- int output = ly_scm2int (primitive->get_property ("primitive"));
+ int output = scm_to_int (primitive->get_property ("primitive"));
primitive->set_property ("thickness",
scm_make_real (thickness));
switch (output) {
if (i > 0)
{
Item *primitive = dynamic_cast<Item*> (info.grob_);
- int output = ly_scm2int (primitive->get_property ("primitive"));
+ int output = scm_to_int (primitive->get_property ("primitive"));
if (output & MLP_ANY)
{
int delta_pitch = (pitch.steps () - last_pitch.steps ());
}
Stencil out;
- int primitive = ly_scm2int (primitive_scm);
+ int primitive = scm_to_int (primitive_scm);
int delta_pitch = 0;
Real thickness = 0.0;
Real flexa_width = 0.0;
SCM join_left_scm = me->get_property ("join-left-amount");
if (join_left_scm != SCM_EOL)
{
- int join_left = ly_scm2int (join_left_scm);
+ int join_left = scm_to_int (join_left_scm);
if (!join_left)
programming_error (_f ("Mensural_ligature: (join_left == 0)"));
Real blotdiameter = (me->get_paper ()->get_dimension (ly_symbol2scm ("blotdiameter")));
SCM program = scm_call_1 (proc, ly_symbol2scm (audio_->str_.to_str0 ()));
found = (program != SCM_BOOL_F);
if (found)
- program_byte = ly_scm2int (program);
+ program_byte = scm_to_int (program);
else
warning (_f ("no such MIDI instrument: `%s'", audio_->str_.to_str0 ()));
if (gn != SCM_UNDEFINED)
{
SCM_ASSERT_TYPE (scm_is_integer (gn), gn, SCM_ARG3, __FUNCTION__, "integer");
- grace_num = ly_scm2int (gn);
+ grace_num = scm_to_int (gn);
}
int grace_den = 1;
if (gd != SCM_UNDEFINED)
{
SCM_ASSERT_TYPE (scm_is_integer (gd), gd, SCM_ARG4, __FUNCTION__, "integer");
- grace_den = ly_scm2int (gd);
+ grace_den = scm_to_int (gd);
}
- return Moment (Rational (ly_scm2int (n), ly_scm2int (d)),
+ return Moment (Rational (scm_to_int (n), scm_to_int (d)),
Rational (grace_num, grace_den)).smobbed_copy ();
}
}
start_measure_
- = ly_scm2int (get_property ("currentBarNumber"));
+ = scm_to_int (get_property ("currentBarNumber"));
}
bar_seen_ = scm_is_string (get_property ("whichBar"));
last_rest_ = mmrest_;
last_numbers_ = numbers_;
- int cur = ly_scm2int (get_property ("currentBarNumber"));
+ int cur = scm_to_int (get_property ("currentBarNumber"));
int num = cur - start_measure_;
/*
SCM thres = get_property ("restNumberThreshold");
int t = 1;
if (ly_c_number_p (thres))
- t = ly_scm2int (thres);
+ t = scm_to_int (thres);
if (num <= t)
last->suicide ();
SCM m (me->get_property ("measure-count"));
if (ly_c_number_p (m))
{
- measures = ly_scm2int (m);
+ measures = scm_to_int (m);
}
mol.translate_axis (x_off, X_AXIS);
SCM m (me->get_property ("measure-count"));
if (ly_c_number_p (m))
{
- measures = ly_scm2int (m);
+ measures = scm_to_int (m);
}
if (measures <= 0)
return Stencil ();
SCM limit = me->get_property ("expand-limit");
- if (measures > ly_scm2int (limit))
+ if (measures > scm_to_int (limit))
{
Real padding = 0.15;
Stencil s = big_rest (me, (1.0 - 2*padding) * space);
Side_position_interface::add_support (ft.script_, head);
- int d = ly_scm2int (event->get_property ("digit"));
+ int d = scm_to_int (event->get_property ("digit"));
/*
TODO:
*/
for (int i = 0; i < fingerings_.size (); i++)
{
- fingerings_[i].position_ = ly_scm2int (fingerings_[i].head_ -> get_property ( "staff-position"));
+ fingerings_[i].position_ = scm_to_int (fingerings_[i].head_ -> get_property ( "staff-position"));
}
for (int i = fingerings_.size (); i--;)
Note_collision_interface::force_shift_callback (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) scm_to_int (axis);
assert (a == X_AXIS);
me = me->get_parent (a);
= clashes[i]->get_property ("horizontal-shift");
if (ly_c_number_p (sh))
- shift.push (ly_scm2int (sh));
+ shift.push (scm_to_int (sh));
else
shift.push (0);
}
SCM s1 = p1->get_property ("horizontal-shift");
SCM s2 = p2->get_property ("horizontal-shift");
- int h1 = (ly_c_number_p (s1))? ly_scm2int (s1) :0;
- int h2 = (ly_c_number_p (s2)) ? ly_scm2int (s2):0;
+ int h1 = (ly_c_number_p (s1))? scm_to_int (s1) :0;
+ int h2 = (ly_c_number_p (s2)) ? scm_to_int (s2):0;
return h1 - h2;
}
{
Grob *me = unsmob_grob (smob);
- return ly_interval2scm (head_extent (me, (Axis) ly_scm2int (axis)));
+ return ly_interval2scm (head_extent (me, (Axis) scm_to_int (axis)));
}
MAKE_SCHEME_CALLBACK (Note_head,brew_ez_stencil,1);
Note_head::get_balltype (Grob*me)
{
SCM s = me->get_property ("duration-log");
- return ly_c_number_p (s) ? ly_scm2int (s) <? 2 : 0;
+ return ly_c_number_p (s) ? scm_to_int (s) <? 2 : 0;
}
ADD_INTERFACE (Note_head,"note-head-interface",
int pos = pit ? pit->steps () : 0;
SCM c0 = get_property ("middleCPosition");
if (ly_c_number_p (c0))
- pos += ly_scm2int (c0);
+ pos += scm_to_int (c0);
note->set_property ("staff-position", scm_int2num (pos));
notes_.push (note);
Paper_system *ps = unsmob_paper_system (system);
SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
- Axis ax = (Axis)ly_scm2int (axis);
+ Axis ax = (Axis)scm_to_int (axis);
return ly_interval2scm (ps->to_stencil().extent (ax));
}
Shouldn't scm_read () do this for us? */
scm_fill_input (port);
SCM to = scm_ftell (port);
- ps->nchars = ly_scm2int (to) - ly_scm2int (from);
+ ps->nchars = scm_to_int (to) - scm_to_int (from);
/* Don't close the port here; if we re-enter this function via a
continuation, then the next time we enter it, we'll get an error.
junk this ? there already is tempo stuff in
music.
*/
- int m = ly_scm2int ($2->get_property ("metronome-count"));
+ int m = scm_to_int ($2->get_property ("metronome-count"));
Duration *d = unsmob_duration ($2->get_property ("tempo-unit"));
set_tempo ($$, d->get_length (), m);
scm_gc_unprotect_object ($2->self_scm ());
fraction Music
{
- int n = ly_scm2int (ly_car ($3)); int d = ly_scm2int (ly_cdr ($3));
+ int n = scm_to_int (ly_car ($3)); int d = scm_to_int (ly_cdr ($3));
Music *mp = $4;
$$= MY_MAKE_MUSIC ("TimeScaledMusic");
}
if (ly_c_number_p (check))
{
- int q = ly_scm2int (check);
+ int q = scm_to_int (check);
n->set_property ("absolute-octave", scm_int2num (q-1));
}
$$ = unsmob_duration ($$)->compressed ( $3) .smobbed_copy ();
}
| multiplied_duration '*' FRACTION {
- Rational m (ly_scm2int (ly_car ($3)), ly_scm2int (ly_cdr ($3)));
+ Rational m (scm_to_int (ly_car ($3)), scm_to_int (ly_cdr ($3)));
$$ = unsmob_duration ($$)->compressed (m).smobbed_copy ();
}
Music *m = unsmob_music ($1);
if ($2) {
SCM salter = m->get_property ("alteration");
- int alter = ly_c_number_p (salter) ? ly_scm2int (salter) : 0;
+ int alter = ly_c_number_p (salter) ? scm_to_int (salter) : 0;
m->set_property ("alteration",
scm_int2num (alter + $2));
} else {
if (ly_c_number_p ($4))
{
- int q = ly_scm2int ($4);
+ int q = scm_to_int ($4);
n->set_property ("absolute-octave", scm_int2num (q-1));
}
bare_number {
if (scm_integer_p ($1) == SCM_BOOL_T)
{
- int k = ly_scm2int ($1);
+ int k = scm_to_int ($1);
$$ = k;
} else
{
SCM_ASSERT_TYPE (scm_integer_p (note)== SCM_BOOL_T, note, SCM_ARG2, __FUNCTION__, "integer");
SCM_ASSERT_TYPE (scm_integer_p (alter)== SCM_BOOL_T, alter, SCM_ARG3, __FUNCTION__, "integer");
- Pitch p (ly_scm2int (octave), ly_scm2int (note), ly_scm2int (alter));
+ Pitch p (scm_to_int (octave), scm_to_int (note), scm_to_int (alter));
return p.smobbed_copy ();
}
int
Repeated_music::repeat_count () const
{
- return ly_scm2int (get_property ("repeat-count"));
+ return scm_to_int (get_property ("repeat-count"));
}
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))
int pos= p->steps ();
SCM c0 = get_property ("middleCPosition");
if (ly_c_number_p (c0))
- pos += ly_scm2int (c0);
+ pos += scm_to_int (c0);
rest_->set_property ("staff-position", scm_int2num (pos));
}
Rest::after_line_breaking (SCM smob)
{
Grob *me = unsmob_grob (smob);
- int bt = ly_scm2int (me->get_property ("duration-log"));
+ int bt = scm_to_int (me->get_property ("duration-log"));
int lc = Staff_symbol_referencer::line_count (me);
Real ss = Staff_symbol_referencer::staff_space (me);
if (lc % 2)
if (!ly_c_number_p (balltype_scm))
return Stencil ().smobbed_copy ();
- int balltype = ly_scm2int (balltype_scm);
+ int balltype = scm_to_int (balltype_scm);
String style;
SCM style_scm = me->get_property ("style");
SCM
Rest::extent_callback (SCM smob, SCM ax)
{
- Axis a = (Axis) ly_scm2int (ax);
+ Axis a = (Axis) scm_to_int (ax);
/*
Don't want ledgers: ledgers depend on Y position, which depends on
Rhythmic_head::dot_count (Grob*me)
{
return get_dots (me)
- ? ly_scm2int (get_dots (me)->get_property ("dot-count")) : 0;
+ ? scm_to_int (get_dots (me)->get_property ("dot-count")) : 0;
}
void
Rhythmic_head::duration_log (Grob*me)
{
SCM s = me->get_property ("duration-log");
- return ly_c_number_p (s) ? ly_scm2int (s) : 0;
+ return ly_c_number_p (s) ? scm_to_int (s) : 0;
}
ADD_INTERFACE (Rhythmic_head,"rhythmic-head-interface",
else if (var == ly_symbol2scm ("midi-debug"))
midi_debug_global_b = to_boolean (val);
else if (var == ly_symbol2scm ("testing-level"))
- testing_level_global = ly_scm2int (val);
+ testing_level_global = scm_to_int (val);
else if (var == ly_symbol2scm ("parse-protect" ))
parse_protect_global = to_boolean (val);
else if (var == ly_symbol2scm ("internal-type-checking"))
SCM p1 = i1->get_property ("script-priority");
SCM p2 = i2->get_property ("script-priority");
- return ly_scm2int (p1) < ly_scm2int (p2) ? SCM_BOOL_T : SCM_BOOL_F;
+ return scm_to_int (p1) < scm_to_int (p2) ? SCM_BOOL_T : SCM_BOOL_F;
}
MAKE_SCHEME_CALLBACK (Script_column, before_line_breaking, 1);
/* Make sure they're in order of user input by adding index i.
Don't use the direction in this priority. Smaller means closer
to the head. */
- int prio = ly_scm2int (val) + index;
+ int prio = scm_to_int (val) + index;
val = scm_int2num (prio);
Self_alignment_interface::centered_on_parent (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) scm_to_int (axis);
Grob *him = me->get_parent (a);
Interval he = him->extent (him, a);
Self_alignment_interface::aligned_on_parent (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) scm_to_int (axis);
Grob *him = me->get_parent (a);
Interval he = him->extent (him, a);
SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) scm_to_int (axis);
Grob *him = me->get_parent (other_axis (a));
Interval he = him->extent (him, a);
Self_alignment_interface::aligned_on_self (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) scm_to_int (axis);
SCM sym= (a == X_AXIS) ? ly_symbol2scm ("self-alignment-X")
: ly_symbol2scm ("self-alignment-Y");
SCM sw = me->get_property ("X-extent");
if (is_number_pair (sw))
{
- return ly_scm2interval (sw);
+ return scm_to_interval (sw);
}
Item *item = dynamic_cast<Item*> (me);
Side_position_interface::aligned_on_support_extents (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) scm_to_int (axis);
return general_side_position (me, a, true);
}
Side_position_interface::aligned_on_support_refpoints (SCM smob, SCM axis)
{
Grob *me = unsmob_grob (smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) scm_to_int (axis);
return general_side_position (me, a, false);
}
Side_position_interface::aligned_side (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) scm_to_int (axis);
Direction d = Side_position_interface::get_direction (me);
->lookup_variable (ly_symbol2scm ("debug-slur-quanting")))
&& ly_c_pair_p (inspect_quants))
{
- Drul_array<Real> ins = ly_scm2interval (inspect_quants);
+ Drul_array<Real> ins = scm_to_interval (inspect_quants);
Real mindist = 1e6;
for (int i = 0; i < scores.size (); i ++)
{
&& scm_ilength (accs) == 1)
{
/* End copy accidental.cc */
- switch (ly_scm2int (ly_car (accs)))
+ switch (scm_to_int (ly_car (accs)))
{
case FLAT:
case DOUBLE_FLAT:
SCM
Slur::height (SCM smob, SCM ax)
{
- Axis a = (Axis)ly_scm2int (ax);
+ Axis a = (Axis)scm_to_int (ax);
Grob *me = unsmob_grob (smob);
assert (a == Y_AXIS);
Slur::outside_slur_callback (SCM grob, SCM axis)
{
Grob *script = unsmob_grob (grob);
- Axis a = Axis (ly_scm2int (axis));
+ Axis a = Axis (scm_to_int (axis));
assert (a == Y_AXIS);
Grob *slur = unsmob_grob (script->get_property ("slur"));
Span_bar::width_callback (SCM element_smob, SCM scm_axis)
{
Grob *se = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (scm_axis);
+ Axis a = (Axis) scm_to_int (scm_axis);
assert (a == X_AXIS);
String gl = ly_scm2string (se->get_property ("glyph"));
Span_bar::center_on_spanned_callback (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) scm_to_int (axis);
assert (a == Y_AXIS);
Interval i (get_spanned_interval (me));
Interval
Span_bar::get_spanned_interval (Grob*me)
{
- return ly_scm2interval (Axis_group_interface::group_extent_callback
+ return scm_to_interval (Axis_group_interface::group_extent_callback
(me->self_scm (), scm_int2num (Y_AXIS)));
}
{
SCM c = me->get_property ("line-count");
if (ly_c_number_p (c))
- return ly_scm2int (c);
+ return scm_to_int (c);
else
return 0;
}
the first and last (quarter) note bothe get one tremolo flag. */
int requested_type
- = ly_scm2int (tremolo_ev_->get_property ("tremolo-type"));
+ = scm_to_int (tremolo_ev_->get_property ("tremolo-type"));
SCM f = get_property ("tremoloFlags");
if (!requested_type)
{
if (ly_c_number_p (f))
- requested_type = ly_scm2int (f);
+ requested_type = scm_to_int (f);
else
requested_type = 8;
}
SCM prop = get_property ("stemLeftBeamCount");
if (ly_c_number_p (prop))
{
- Stem::set_beaming (stem_,ly_scm2int (prop),LEFT);
+ Stem::set_beaming (stem_,scm_to_int (prop),LEFT);
context ()->unset_property (ly_symbol2scm ("stemLeftBeamCount"));
}
prop = get_property ("stemRightBeamCount");
if (ly_c_number_p (prop))
{
- Stem::set_beaming (stem_,ly_scm2int (prop), RIGHT);
+ Stem::set_beaming (stem_,scm_to_int (prop), RIGHT);
context ()->unset_property (ly_symbol2scm ("stemRightBeamCount"));
}
stem_ = 0;
SCM
Stem_tremolo::height (SCM smob, SCM ax)
{
- Axis a = (Axis)ly_scm2int (ax);
+ Axis a = (Axis)scm_to_int (ax);
Grob *me = unsmob_grob (smob);
assert (a == Y_AXIS);
int tremolo_flags = 0;
SCM s = me->get_property ("flag-count");
if (ly_c_number_p (s))
- tremolo_flags = ly_scm2int (s);
+ tremolo_flags = scm_to_int (s);
if (!tremolo_flags)
{
Stem::is_invisible (Grob *me)
{
return !(head_count (me)
- && ly_scm2int (me->get_property ("duration-log")) >= 1);
+ && scm_to_int (me->get_property ("duration-log")) >= 1);
}
Direction
Stem::duration_log (Grob *me)
{
SCM s = me->get_property ("duration-log");
- return (ly_c_number_p (s)) ? ly_scm2int (s) : 2;
+ return (ly_c_number_p (s)) ? scm_to_int (s) : 2;
}
void
SCM
Stem::height (SCM smob, SCM ax)
{
- Axis a = (Axis)ly_scm2int (ax);
+ Axis a = (Axis)scm_to_int (ax);
Grob *me = unsmob_grob (smob);
assert (a == Y_AXIS);
SCM
Stem::dim_callback (SCM e, SCM ax)
{
- Axis a = (Axis) ly_scm2int (ax);
+ Axis a = (Axis) scm_to_int (ax);
assert (a == X_AXIS);
Grob *me = unsmob_grob (e);
SCM_ASSERT_TYPE (is_number_pair (np), np, SCM_ARG3, __FUNCTION__,
"number pair");
- Interval iv = ly_scm2interval (np);
- s->dim_[Axis (ly_scm2int (axis))] = iv;
+ Interval iv = scm_to_interval (np);
+ s->dim_[Axis (scm_to_int (axis))] = iv;
return SCM_UNSPECIFIED;
}
SCM new_s = s->smobbed_copy ();
Stencil *q = unsmob_stencil (new_s);
- q->translate_axis (ly_scm2double (amount), Axis (ly_scm2int (axis)));
+ q->translate_axis (ly_scm2double (amount), Axis (scm_to_int (axis)));
return new_s;
}
SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil");
SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
- return ly_interval2scm (s->extent (Axis (ly_scm2int (axis))));
+ return ly_interval2scm (s->extent (Axis (scm_to_int (axis))));
}
LY_DEFINE (ly_stencil_moved_to_edge, "ly:stencil-moved-to-edge",
first_stencil = *s1;
if (s2)
- return first_stencil.moved_to_edge (Axis (ly_scm2int (axis)),
- Direction (ly_scm2int (direction)),
+ return first_stencil.moved_to_edge (Axis (scm_to_int (axis)),
+ Direction (scm_to_int (direction)),
*s2, p, m).smobbed_copy ();
else
return Stencil().smobbed_copy ();
result = *s1;
if (s2)
- result.add_at_edge (Axis (ly_scm2int (axis)),
- Direction (ly_scm2int (direction)), *s2, p, m);
+ result.add_at_edge (Axis (scm_to_int (axis)),
+ Direction (scm_to_int (direction)), *s2, p, m);
return result.smobbed_copy ();
}
SCM_ASSERT_TYPE (is_number_pair (xext), xext, SCM_ARG2, __FUNCTION__, "number pair");
SCM_ASSERT_TYPE (is_number_pair (yext), yext, SCM_ARG3, __FUNCTION__, "number pair");
- Box b (ly_scm2interval (xext), ly_scm2interval (yext));
+ Box b (scm_to_interval (xext), scm_to_interval (yext));
Stencil s (b, expr);
return s.smobbed_copy ();
}
SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
SCM_ASSERT_TYPE (ly_c_number_p (dir), dir, SCM_ARG3, __FUNCTION__, "number");
- unsmob_stencil (stil)->align_to ((Axis)ly_scm2int (axis),
+ unsmob_stencil (stil)->align_to ((Axis)scm_to_int (axis),
ly_scm2double (dir));
return stil;
}
bool string_found;
if (tabstring_event)
{
- tab_string = ly_scm2int (tabstring_event->get_property ("string-number"));
+ tab_string = scm_to_int (tabstring_event->get_property ("string-number"));
string_found = true;
}
else
Rhythmic_head::set_dots (note, d);
if (dur.dot_count ()
- != ly_scm2int (d->get_property ("dot-count")))
+ != scm_to_int (d->get_property ("dot-count")))
d->set_property ("dot-count", scm_int2num (dur.dot_count ()));
d->set_parent (note, Y_AXIS);
SCM scm_pitch = event->get_property ("pitch");
SCM proc = get_property ("tablatureFormat");
SCM min_fret_scm = get_property ("minimumFret");
- int min_fret = ly_c_number_p (min_fret_scm) ? ly_scm2int (min_fret_scm) : 0;
+ int min_fret = ly_c_number_p (min_fret_scm) ? scm_to_int (min_fret_scm) : 0;
while (!string_found)
{
int fret = unsmob_pitch (scm_pitch)->semitone_pitch ()
- - ly_scm2int (scm_list_ref (stringTunings,scm_int2num (tab_string-1)));
+ - scm_to_int (scm_list_ref (stringTunings,scm_int2num (tab_string-1)));
if (fret<min_fret)
tab_string += high_string_one ? 1 : -1;
else
SCM met = tempo_req_->get_property ("metronome-count");
Duration *d = unsmob_duration (tempo_req_->get_property ("tempo-unit"));
- Rational r = (d->get_length () / Moment (Rational (1, 4)) * Moment (ly_scm2int (met))).main_part_;
+ Rational r = (d->get_length () / Moment (Rational (1, 4)) * Moment (scm_to_int (met))).main_part_;
audio_ = new Audio_tempo (int (r));
int priority = 200;
SCM s = text->get_property ("script-priority");
if (ly_c_number_p (s))
- priority = ly_scm2int (s);
+ priority = scm_to_int (s);
/* see script-engraver.cc */
priority += i;
&& last_time_fraction_ != fr
&& ly_c_pair_p (fr))
{
- int den = ly_scm2int (ly_cdr (fr));
+ int den = scm_to_int (ly_cdr (fr));
if (den != (1 << intlog2 (den)))
{
/*
*/
warning (_f ("Found strange time signature %d/%d.",
den,
- ly_scm2int (ly_car (fr))
+ scm_to_int (ly_car (fr))
));
}
if (ly_c_pair_p (fr) && !ly_c_equal_p (fr, prev_fraction_))
{
prev_fraction_ = fr;
- int b = ly_scm2int (ly_car (fr));
- int o = ly_scm2int (ly_cdr (fr));
+ int b = scm_to_int (ly_car (fr));
+ int o = scm_to_int (ly_cdr (fr));
audio_ = new Audio_time_signature (b,o);
Audio_element_info info (audio_, 0);
int d = 4;
if (ly_c_pair_p (frac))
{
- n = ly_scm2int (ly_car (frac));
- d = ly_scm2int (ly_cdr (frac));
+ n = scm_to_int (ly_car (frac));
+ d = scm_to_int (ly_cdr (frac));
}
Stencil m;
int b = 0;
if (ly_c_number_p (barn))
{
- b = ly_scm2int (barn);
+ b = scm_to_int (barn);
}
SCM cad = get_property ("timing");
SCM body = get_music ()->get_property ("element");
SCM alts = get_music ()->get_property ("elements");
int alt_count = scm_ilength (alts);
- int rep_count = ly_scm2int (get_music ()->get_property ("repeat-count"));
+ int rep_count = scm_to_int (get_music ()->get_property ("repeat-count"));
for (int i = 0; i < rep_count; i++)
{
SCM alts = get_music ()->get_property ("elements");
alt_count_ = scm_ilength (alts);
- rep_count_ = ly_scm2int (get_music ()->get_property ("repeat-count"));
+ rep_count_ = scm_to_int (get_music ()->get_property ("repeat-count"));
done_count_ = 0;
}
{
Item *primitive = dynamic_cast<Item*> (primitives[i].grob_);
int prefix_set =
- ly_scm2int (primitive->get_property ("prefix-set"));
+ scm_to_int (primitive->get_property ("prefix-set"));
int context_info =
- ly_scm2int (primitive->get_property ("context-info"));
+ scm_to_int (primitive->get_property ("context-info"));
/*
* Get glyph_name, delta_pitch and context_info for this head.
SCM delta_pitch_scm = prev_primitive->get_property ("delta-pitch");
if (delta_pitch_scm != SCM_EOL)
{
- delta_pitch = ly_scm2int (delta_pitch_scm);
+ delta_pitch = scm_to_int (delta_pitch_scm);
}
else
{
check_for_prefix_loss (Item *primitive)
{
int prefix_set =
- ly_scm2int (primitive->get_property ("prefix-set"));
+ scm_to_int (primitive->get_property ("prefix-set"));
if (prefix_set & ~PES_OR_FLEXA)
{
String prefs = Gregorian_ligature::prefixes_to_str (primitive);
SCM delta_pitch_scm = primitive->get_property ("delta-pitch");
if (delta_pitch_scm != SCM_EOL)
{
- delta_pitch = ly_scm2int (delta_pitch_scm);
+ delta_pitch = scm_to_int (delta_pitch_scm);
}
else
{
/* retrieve & complete prefix_set and context_info */
int prefix_set =
- ly_scm2int (primitive->get_property ("prefix-set"));
+ scm_to_int (primitive->get_property ("prefix-set"));
int context_info =
- ly_scm2int (primitive->get_property ("context-info"));
+ scm_to_int (primitive->get_property ("context-info"));
if (is_stacked_head (prefix_set, context_info))
{
context_info |= STACKED_HEAD;
SCM flexa_height_scm = me->get_property ("flexa-height");
if (flexa_height_scm != SCM_EOL)
{
- interval = ly_scm2int (flexa_height_scm);
+ interval = scm_to_int (flexa_height_scm);
}
else
{
SCM delta_pitch_scm = me->get_property ("delta-pitch");
int delta_pitch;
if (delta_pitch_scm != SCM_EOL)
- delta_pitch = ly_scm2int (delta_pitch_scm);
+ delta_pitch = scm_to_int (delta_pitch_scm);
else
delta_pitch = 0;