line-of-score.
*/
if (ly_c_number_p (align))
- center_offset = total.linear_combination (ly_scm2double (align));
+ center_offset = total.linear_combination (scm_to_double (align));
for (int j = 0 ; j < all_grobs.size (); j++)
all_grobs[j]->translate_axis (all_translates[j] - center_offset, a);
Real ss = Staff_symbol_referencer::staff_space (me);
SCM size = me->get_property ("bar-size");
if (ly_c_number_p (size))
- return scm_make_real (ly_scm2double (size)*ss);
+ return scm_make_real (scm_to_double (size)*ss);
else if (Staff_symbol_referencer::get_staff_symbol (me))
{
/*
Grob *me = unsmob_grob (smob);
SCM s = me->get_property ("positions");
- Real yl = ly_scm2double (ly_car (s));
- Real yr = ly_scm2double (ly_cdr (s));
+ Real yl = scm_to_double (ly_car (s));
+ Real yr = scm_to_double (ly_cdr (s));
/*
Real slt = Staff_symbol_referencer::line_thickness (me) / ss;
SCM sdy = me->get_property ("least-squares-dy");
- Real dy_mus = ly_c_number_p (sdy) ? ly_scm2double (sdy) : 0.0;
+ Real dy_mus = ly_c_number_p (sdy) ? scm_to_double (sdy) : 0.0;
Real straddle = 0.0;
Real sit = (thickness - slt) / 2;
if (to_boolean (me->get_paper ()->lookup_variable (ly_symbol2scm ("debug-beam-quanting")))
&& ly_c_pair_p (inspect_quants))
{
- Drul_array<Real> ins = scm_to_interval (inspect_quants);
+ Drul_array<Real> ins = ly_scm2interval (inspect_quants);
int i = 0;
if (ly_c_procedure_p (func))
{
SCM s = scm_call_2 (func, me->self_scm (), scm_int2num (get_beam_count (me)));
- return ly_scm2double (s);
+ return scm_to_double (s);
}
else
{
SCM proc = me->get_property ("flag-width-function");
SCM result = scm_call_1 (proc, scm_int2num (t));
- nw_f = ly_scm2double (result);
+ nw_f = scm_to_double (result);
}
else
nw_f = break_overshoot / 2;
if (!ly_c_number_p (scm))
return ;
- Real threshold = ly_scm2double (scm);
+ Real threshold = scm_to_double (scm);
Int_set gaps;
SCM shorten_elt =
robust_list_ref (beam_count -1, shorten_list);
- Real shorten_f = ly_scm2double (shorten_elt) * staff_space;
+ Real shorten_f = scm_to_double (shorten_elt) * staff_space;
/* your similar cute comment here */
shorten_f *= forced_fraction;
Real dx = lvs->relative_coordinate (commonx, X_AXIS) - x0;
- Drul_array<Real> pos = scm_to_interval ( me->get_property ("positions"));
+ Drul_array<Real> pos = ly_scm2interval ( me->get_property ("positions"));
scale_drul (&pos, Staff_symbol_referencer::staff_space (me));
SCM gap = me->get_property ("concaveness-gap");
if (ly_c_number_p (gap))
{
- Real r1 = ly_scm2double (gap);
+ Real r1 = scm_to_double (gap);
Real dy = Stem::chord_start_y (stems.top ())
- Stem::chord_start_y (stems[0]);
Real r2 = infinity_f;
if (!is_concave1 && ly_c_number_p (thresh))
{
- r2 = ly_scm2double (thresh);
+ r2 = scm_to_double (thresh);
Interval iv;
iv.add_point (Stem::chord_start_y (stems[0]));
/* TODO: some sort of damping iso -> plain horizontal */
if (is_concave1 || concaveness2 > r2)
{
- Drul_array<Real> pos = scm_to_interval (me->get_property ("positions"));
+ Drul_array<Real> pos = ly_scm2interval (me->get_property ("positions"));
Real r = linear_combination (pos, 0.0);
r /= Staff_symbol_referencer::staff_space (me);
if (damping)
{
- Drul_array<Real> pos = scm_to_interval (me->get_property ("positions"));
+ Drul_array<Real> pos = ly_scm2interval (me->get_property ("positions"));
scale_drul (&pos, Staff_symbol_referencer::staff_space (me));
Real dy = pos[RIGHT] - pos[LEFT];
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 = scm_to_interval (s);
+ pos = ly_scm2interval (s);
Real staff_space = Staff_symbol_referencer::staff_space (rest);
scale_drul (&pos, staff_space);
Real
output_scale (Output_def *od)
{
- return ly_scm2double (od->lookup_variable (ly_symbol2scm ("outputscale")));
+ return scm_to_double (od->lookup_variable (ly_symbol2scm ("outputscale")));
}
/* TODO: should add nesting for Output_def here too. */
Book::process (String outname, Output_def *default_def)
{
Paper_book *paper_book = new Paper_book ();
- Real scale = ly_scm2double (bookpaper_->c_variable ("outputscale"));
+ Real scale = scm_to_double (bookpaper_->c_variable ("outputscale"));
Output_def * scaled_bookdef = scale_output_def (bookpaper_, scale);
{
entry = ly_cdr (entry);
- distance = ly_scm2double (ly_cdr (entry));
+ distance = scm_to_double (ly_cdr (entry));
type = ly_car (entry) ;
}
Real distance;
if (incr_scm != SCM_EOL)
{
- distance = ly_scm2double (incr_scm);
+ distance = scm_to_double (incr_scm);
}
else
{
{
Interval iv (0, 1);
if (ly_c_number_p (min))
- iv[MIN] = ly_scm2double (min);
+ iv[MIN] = scm_to_double (min);
if (ly_c_number_p (max))
- iv[MAX] = ly_scm2double (max);
+ iv[MAX] = scm_to_double (max);
volume = iv[MIN] + iv.length () * volume;
}
else
if (is_number_pair (s))
{
- Interval iv = scm_to_interval (s);
+ Interval iv = ly_scm2interval (s);
volume = iv[MIN] + iv.length () * volume;
}
}
SCM font_size = ly_assoc_chain (ly_symbol2scm ("font-size"), chain);
Real req = 0;
if (ly_c_pair_p (font_size))
- req = ly_scm2double (ly_cdr (font_size));
+ req = scm_to_double (ly_cdr (font_size));
- return get_font_by_mag_step (paper, req, vec, ly_scm2double (base_size),
+ return get_font_by_mag_step (paper, req, vec, scm_to_double (base_size),
input_encoding);
}
if (gi.origin_trans_->context () != context ())
return ;
- if (ly_c_number_p (sz) && ly_scm2double (sz))
+ if (ly_c_number_p (sz) && scm_to_double (sz))
{
- Real font_size = ly_scm2double (sz);
+ Real font_size = scm_to_double (sz);
font_size += robust_scm2double (gi.grob_->get_property ("font-size"), 0);
gi.grob_->set_property ("font-size", scm_make_real (font_size));
if (pc->original_)
{
SCM pen = pc->get_property ("penalty");
- if (ly_c_number_p (pen) && fabs (ly_scm2double (pen)) < 10000)
+ if (ly_c_number_p (pen) && fabs (scm_to_double (pen)) < 10000)
{
- break_penalties += ly_scm2double (pen);
+ break_penalties += scm_to_double (pen);
}
}
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 (scm_to_int (a)));
+ me->translate_axis (scm_to_double (d), Axis (scm_to_int (a)));
return SCM_UNSPECIFIED;
}
SCM cb = scm_list_ref (dim_cache_[a].offset_callbacks_, scm_int2num (l));
SCM retval = scm_call_2 (cb, self_scm (), scm_int2num (a));
- Real r = ly_scm2double (retval);
+ Real r = scm_to_double (retval);
if (isinf (r) || isnan (r))
{
programming_error (INFINITY_MSG);
if (!ly_c_pair_p (d->dimension_))
return ext;
- ext = scm_to_interval (d->dimension_);
+ ext = ly_scm2interval (d->dimension_);
SCM extra = get_property (a == X_AXIS
? "extra-X-extent"
/* Signs ? */
if (ly_c_pair_p (extra))
{
- ext[BIGGER] += ly_scm2double (ly_cdr (extra));
- ext[SMALLER] += ly_scm2double (ly_car (extra));
+ ext[BIGGER] += scm_to_double (ly_cdr (extra));
+ ext[SMALLER] += scm_to_double (ly_car (extra));
}
extra = get_property (a == X_AXIS
? "minimum-X-extent"
: "minimum-Y-extent");
if (ly_c_pair_p (extra))
- ext.unite (Interval (ly_scm2double (ly_car (extra)),
- ly_scm2double (ly_cdr (extra))));
+ ext.unite (Interval (scm_to_double (ly_car (extra)),
+ scm_to_double (ly_cdr (extra))));
ext.translate (x);
Direction grow_dir = to_dir (s);
- Real padding = ly_scm2double (me->get_property ("bound-padding"));
+ Real padding = scm_to_double (me->get_property ("bound-padding"));
Drul_array<bool> broken;
Drul_array<Item*> bounds ;
-/*
+ii/*
lily-guile.hh encapsulate guile
source file of the GNU LilyPond music typesetter
#define scm_i_string_chars(x) SCM_STRING_CHARS(x)
#define scm_i_string_length(x) SCM_STRING_LENGTH(x)
#define scm_is_number(x) (scm_number_p(x)==SCM_BOOL_T)
+inline int ly_scm2int (SCM x) { return scm_num2int (x, 0, "ly_scm2int"); }
#define scm_to_int(x) (ly_scm2int(x))
+
+inline double ly_scm2double (SCM x) { return scm_num2dbl (x, "ly_scm2double"); }
#define scm_to_double(x) (ly_scm2double(x))
#define scm_from_double(x) (scm_make_real(x))
#endif /* SCM_MINOR_VERSION < 7 */
inline bool ly_scm2bool (SCM x) { return SCM_NFALSEP (x); }
inline char ly_scm2char (SCM x) { return SCM_CHAR(x); }
-inline int ly_scm2int (SCM x) { return scm_num2int (x, 0, "ly_scm2int"); }
-inline double ly_scm2double (SCM x) { return scm_num2dbl (x, "ly_scm2double"); }
inline unsigned long ly_length (SCM x) {
return scm_num2ulong (scm_length (x), 0, "ly_length");
}
}
Interval
-scm_to_interval (SCM p)
+ly_scm2interval (SCM p)
{
- return Interval (ly_scm2double (ly_car (p)), ly_scm2double (ly_cdr (p)));
+ return Interval (scm_to_double (ly_car (p)), scm_to_double (ly_cdr (p)));
}
Drul_array<Real>
ly_scm2realdrul (SCM p)
{
- return Drul_array<Real> (ly_scm2double (ly_car (p)),
- ly_scm2double (ly_cdr (p)));
+ return Drul_array<Real> (scm_to_double (ly_car (p)),
+ scm_to_double (ly_cdr (p)));
}
SCM
Offset
ly_scm2offset (SCM s)
{
- return Offset (ly_scm2double (ly_car (s)),
- ly_scm2double (ly_cdr (s)));
+ return Offset (scm_to_double (ly_car (s)),
+ scm_to_double (ly_cdr (s)));
}
LY_DEFINE (ly_number2string, "ly:number->string",
if (scm_exact_p (s) == SCM_BOOL_F)
{
- Real r (ly_scm2double (s));
+ Real r (scm_to_double (s));
if (my_isinf (r) || my_isnan (r))
{
robust_scm2double (SCM k, double x)
{
if (ly_c_number_p (k))
- x = ly_scm2double (k);
+ x = scm_to_double (k);
return x;
}
i[LEFT]= v[LEFT];
i[RIGHT]= v[RIGHT];
if (is_number_pair (k))
- i = scm_to_interval (k);
+ i = ly_scm2interval (k);
return i;
}
robust_scm2drul (SCM k, Drul_array<Real> v)
{
if (is_number_pair (k))
- v = scm_to_interval (k);
+ v = ly_scm2interval (k);
return v;
}
SCM_ASSERT_TYPE (ly_c_number_p (p), a, SCM_ARG4, __FUNCTION__, "number") ;
- 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 ();
+ return Lookup::bracket ((Axis)scm_to_int (a), ly_scm2interval (iv),
+ scm_to_double (t),
+ scm_to_double (p),
+ 0.95 * scm_to_double (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 (scm_to_interval (xext), scm_to_interval (yext)),
- ly_scm2double (blot)).smobbed_copy ();
+ return Lookup::round_filled_box (Box (ly_scm2interval (xext), ly_scm2interval (yext)),
+ scm_to_double (blot)).smobbed_copy ();
}
}
distance +=
- ly_scm2double (current->get_property ("head-width")) -
- ly_scm2double (current->get_property ("thickness"));
+ scm_to_double (current->get_property ("head-width")) -
+ scm_to_double (current->get_property ("thickness"));
}
}
SCM desc = m->description_;
- Real total_mag = magn * ly_scm2double (ly_cdr (desc));
+ Real total_mag = magn * scm_to_double (ly_cdr (desc));
assert (total_mag);
description_ = scm_cons (ly_car (desc), scm_make_real (total_mag));
for (; ly_c_pair_p (hand); hand =ly_cdr (hand))
{
Grob * s = unsmob_grob (ly_caar (hand));
- Real amount = ly_scm2double (ly_cdar (hand)) * wid;
+ Real amount = scm_to_double (ly_cdar (hand)) * wid;
done.push (s);
amounts.push (amount);
for (; ly_c_pair_p (autos); autos =ly_cdr (autos))
{
Grob * s = unsmob_grob (ly_caar (autos));
- Real amount = ly_scm2double (ly_cdar (autos)) *wid;
+ Real amount = scm_to_double (ly_cdar (autos)) *wid;
if (!done.find (s))
{
Output_def::get_dimension (SCM s) const
{
SCM val = lookup_variable (s);
- return ly_scm2double (val);
+ return scm_to_double (val);
}
SCM
$$ = $1;
}
| REAL NUMBER_IDENTIFIER {
- $$ = scm_make_real (ly_scm2double ($1) *ly_scm2double ($2));
+ $$ = scm_make_real (scm_to_double ($1) *scm_to_double ($2));
}
| UNSIGNED NUMBER_IDENTIFIER {
- $$ = scm_make_real ($1 *ly_scm2double ($2));
+ $$ = scm_make_real ($1 *scm_to_double ($2));
}
;
if (m->is_mus_type ("break-event"))
{
SCM pen = command_column_->get_property ("penalty");
- Real total_penalty = ly_c_number_p (pen) ? ly_scm2double (pen) : 0.0;
+ Real total_penalty = ly_c_number_p (pen) ? scm_to_double (pen) : 0.0;
SCM mpen = m->get_property ("penalty");
if (ly_c_number_p (mpen))
- total_penalty += ly_scm2double (mpen);
+ total_penalty += scm_to_double (mpen);
command_column_->set_property ("penalty", scm_make_real (total_penalty));
forbid_breaks ();
SCM page_pen = command_column_->get_property ("page-penalty");
- Real total_pp = ly_c_number_p (page_pen) ? ly_scm2double (page_pen) : 0.0;
+ Real total_pp = ly_c_number_p (page_pen) ? scm_to_double (page_pen) : 0.0;
SCM mpage_pen = m->get_property ("page-penalty");
if (ly_c_number_p (mpage_pen))
- total_pp += ly_scm2double (mpage_pen);
+ total_pp += scm_to_double (mpage_pen);
command_column_->set_property ("page-penalty", scm_make_real (total_pp));
return true;
/* ugh. */
if (bpd->c_variable ("is-bookpaper") == SCM_BOOL_T)
{
- Real scale = ly_scm2double (bpd->c_variable ("outputscale"));
+ Real scale = scm_to_double (bpd->c_variable ("outputscale"));
Output_def *def = scale_output_def (unsmob_output_def (outdef), scale);
scaled_def = def->self_scm ();
Real scale = 1.0;
if (paperbook && paperbook->c_variable ("is-bookpaper") == SCM_BOOL_T)
- scale = ly_scm2double (paperbook->c_variable ("outputscale"));
+ scale = scm_to_double (paperbook->c_variable ("outputscale"));
SCM out = scm_makfrom0str (outname.to_str0 ());
SCM systems = SCM_EOL;
return scm_int2num (0);
Real x = 0.0;
- Real align = ly_scm2double (align_prop);
+ Real align = scm_to_double (align_prop);
Interval ext (me->extent (me, a));
if (ext.is_empty ())
if (ext.is_empty ())
programming_error ("I'm empty. Can't align on self");
else
- return scm_make_real (- ext.linear_combination (ly_scm2double (align)));
+ return scm_make_real (- ext.linear_combination (scm_to_double (align)));
}
return scm_make_real (0.0);
}
SCM sw = me->get_property ("X-extent");
if (is_number_pair (sw))
{
- return scm_to_interval (sw);
+ return ly_scm2interval (sw);
}
Item *item = dynamic_cast<Item*> (me);
Direction d = Side_position_interface::get_direction (me);
- Real o = ly_scm2double (aligned_on_support_extents (element_smob,axis));
+ Real o = scm_to_double (aligned_on_support_extents (element_smob,axis));
Interval iv = me->extent (me, a);
{
Real padding=
Staff_symbol_referencer::staff_space (me)
- * ly_scm2double (me->get_property ("staff-padding"));
+ * scm_to_double (me->get_property ("staff-padding"));
Grob *common = me->common_refpoint (st, Y_AXIS);
SCM p = positions->cols_[i]->get_property ( "penalty");
if (ly_c_number_p (p))
{
- if (ly_scm2double (p) < -9999)
+ if (scm_to_double (p) < -9999)
break_satisfy = break_satisfy && (i == 0 || i == sz -1);
- if (ly_scm2double (p) > 9999)
+ if (scm_to_double (p) > 9999)
break_satisfy = break_satisfy && !(i == 0 || i == sz -1);
}
int oi = cols.find_index (other);
if (oi >= 0)
{
- spacer_->add_rod (i, oi, ly_scm2double (ly_cdar (s)));
+ spacer_->add_rod (i, oi, scm_to_double (ly_cdar (s)));
}
}
}
->lookup_variable (ly_symbol2scm ("debug-slur-quanting")))
&& ly_c_pair_p (inspect_quants))
{
- Drul_array<Real> ins = scm_to_interval (inspect_quants);
+ Drul_array<Real> ins = ly_scm2interval (inspect_quants);
Real mindist = 1e6;
for (int i = 0; i < scores.size (); i ++)
{
(void) extremes;
Real staff_space = Staff_symbol_referencer::staff_space ((Grob *) me);
Real r_0 = robust_scm2double (me->get_property ("ratio"), 0.33);
- Real h_inf = staff_space * ly_scm2double (me->get_property ("height-limit"));
+ Real h_inf = staff_space * scm_to_double (me->get_property ("height-limit"));
for (int i = 0; i < scores->size(); i++)
{
Bezier bez= get_bezier (me,
Interval
Span_bar::get_spanned_interval (Grob*me)
{
- return scm_to_interval (Axis_group_interface::group_extent_callback
+ return ly_scm2interval (Axis_group_interface::group_extent_callback
(me->self_scm (), scm_int2num (Y_AXIS)));
}
}
space_def = ly_cdr (space_def);
- Real distance = ly_scm2double (ly_cdr (space_def));
+ Real distance = scm_to_double (ly_cdr (space_def));
SCM type = ly_car (space_def) ;
*fixed = last_ext[RIGHT];
if (ly_c_number_p (pos))
{
Real space = Staff_symbol_referencer::staff_space (me);
- off = ly_scm2double (pos) * space / 2.0;
+ off = scm_to_double (pos) * space / 2.0;
me->set_property ("staff-position", scm_int2num (0));
}
since that would make aligning staff symbols of different sizes to
one right margin hell.
*/
- span_points[RIGHT] = ly_scm2double (width_scm);
+ span_points[RIGHT] = scm_to_double (width_scm);
}
else
{
Real dy = 0;
SCM s = beam->get_property ("positions");
if (is_number_pair (s))
- dy = -ly_scm2double (ly_car (s)) +ly_scm2double (ly_cdr (s));
+ dy = -scm_to_double (ly_car (s)) +scm_to_double (ly_cdr (s));
Real dx = Beam::last_visible_stem (beam)->relative_coordinate (0, X_AXIS)
- Beam::first_visible_stem (beam)->relative_coordinate (0, X_AXIS);
Real beamthickness = 0.0;
SCM sbt = (beam) ? beam->get_property ("thickness") : SCM_EOL ;
if (ly_c_number_p (sbt))
- beamthickness = ly_scm2double (sbt) * ss;
+ beamthickness = scm_to_double (sbt) * ss;
Real end_y
= Stem::stem_end_position (stem) * ss / 2
me->set_property ("stem-end-position", scm_make_real (pos));
}
else
- pos = ly_scm2double (p);
+ pos = scm_to_double (p);
return pos;
}
Real length = 7;
SCM scm_len = me->get_property ("length");
if (ly_c_number_p (scm_len))
- length = ly_scm2double (scm_len);
+ length = scm_to_double (scm_len);
else
{
s = me->get_property ("lengths");
if (ly_c_pair_p (s))
- length = 2 * ly_scm2double (robust_list_ref (durlog - 2, s));
+ length = 2 * scm_to_double (robust_list_ref (durlog - 2, s));
}
/* URGURGURG
Real
Stem::thickness (Grob *me)
{
- return ly_scm2double (me->get_property ("thickness"))
+ return scm_to_double (me->get_property ("thickness"))
* Staff_symbol_referencer::line_thickness (me);
}
Stem_info si;
si.dir_ = get_grob_direction (me);
- si.ideal_y_ = ly_scm2double (ly_car (scm_info));
- si.shortest_y_ = ly_scm2double (ly_cadr (scm_info));
+ si.ideal_y_ = scm_to_double (ly_car (scm_info));
+ si.shortest_y_ = scm_to_double (ly_cadr (scm_info));
return si;
}
/* Simple standard stem length */
SCM lengths = me->get_property ("beamed-lengths");
Real ideal_length =
- ly_scm2double (robust_list_ref (beam_count - 1,lengths))
+ scm_to_double (robust_list_ref (beam_count - 1,lengths))
* staff_space
/* stem only extends to center of beam
/* Condition: sane minimum free stem length (chord to beams) */
lengths = me->get_property ("beamed-minimum-free-lengths");
Real ideal_minimum_free =
- ly_scm2double (robust_list_ref (beam_count - 1, lengths))
+ scm_to_double (robust_list_ref (beam_count - 1, lengths))
* staff_space;
ideal_y -= robust_scm2double (beam->get_property ("shorten"), 0);
Real minimum_free =
- ly_scm2double (robust_list_ref
+ scm_to_double (robust_list_ref
(beam_count - 1,
me->get_property
("beamed-extreme-minimum-free-lengths")))
SCM_ASSERT_TYPE (is_number_pair (np), np, SCM_ARG3, __FUNCTION__,
"number pair");
- Interval iv = scm_to_interval (np);
+ Interval iv = ly_scm2interval (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 (scm_to_int (axis)));
+ q->translate_axis (scm_to_double (amount), Axis (scm_to_int (axis)));
return new_s;
}
if (padding != SCM_UNDEFINED)
{
SCM_ASSERT_TYPE (ly_c_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number");
- p = ly_scm2double (padding);
+ p = scm_to_double (padding);
}
Real m = 0.0;
if (minimum != SCM_UNDEFINED)
{
SCM_ASSERT_TYPE (ly_c_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
- m = ly_scm2double (minimum);
+ m = scm_to_double (minimum);
}
if (s1)
if (padding != SCM_UNDEFINED)
{
SCM_ASSERT_TYPE (ly_c_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number");
- p = ly_scm2double (padding);
+ p = scm_to_double (padding);
}
Real m = 0.0;
if (minimum != SCM_UNDEFINED)
{
SCM_ASSERT_TYPE (ly_c_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
- m = ly_scm2double (minimum);
+ m = scm_to_double (minimum);
}
if (s1)
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 (scm_to_interval (xext), scm_to_interval (yext));
+ Box b (ly_scm2interval (xext), ly_scm2interval (yext));
Stencil s (b, expr);
return s.smobbed_copy ();
}
SCM_ASSERT_TYPE (ly_c_number_p (dir), dir, SCM_ARG3, __FUNCTION__, "number");
unsmob_stencil (stil)->align_to ((Axis)scm_to_int (axis),
- ly_scm2double (dir));
+ scm_to_double (dir));
return stil;
}
{
inf.grob_->translate_axis ( -0.8, X_AXIS); // ugh
inf.grob_->set_property ("arch-height",
- scm_make_real (ly_scm2double (inf.grob_->get_property
+ scm_make_real (scm_to_double (inf.grob_->get_property
("arch-height"))+0.5));
}
}
Stencil
System_start_delimiter::staff_bracket (Grob*me,Real height)
{
- Real arc_height = ly_scm2double (me->get_property ("arch-height")) ;
+ Real arc_height = scm_to_double (me->get_property ("arch-height")) ;
SCM at = scm_list_n (ly_symbol2scm ("bracket"),
me->get_property ("arch-angle"),
robust_relative_extent (b, common, X_AXIS).linear_combination (d * encl);
if (is_number_pair (shorten))
- span_points -= d * ly_scm2double (index_get_cell (shorten, d));
+ span_points -= d * scm_to_double (index_get_cell (shorten, d));
}
if (is_number_pair (flare))
- span_points -= d * ly_scm2double (index_get_cell (flare, d));
+ span_points -= d * scm_to_double (index_get_cell (flare, d));
}
while (flip (&d) != LEFT);
Real dx = 0.0;
if (is_number_pair (flare))
- dx = ly_scm2double (index_get_cell (flare, d)) * d;
+ dx = scm_to_double (index_get_cell (flare, d)) * d;
Real dy = - dir * edge_height[d] ;
if (dy)
SCM lim // groetjes aan de chirurgendochter.
= scm_assq (ly_symbol2scm ("height-limit"),details);
- Real h_inf = ly_scm2double (ly_cdr (lim)) * staff_space;
- Real r_0 = ly_scm2double (ly_cdr (scm_assq (ly_symbol2scm ("ratio"),details)));
+ Real h_inf = scm_to_double (ly_cdr (lim)) * staff_space;
+ Real r_0 = scm_to_double (ly_cdr (scm_assq (ly_symbol2scm ("ratio"),details)));
Bezier b = slur_shape (width, h_inf, r_0);
*/
Real ypos = Tie::get_position (me) * staff_space/2
- + dir * ly_scm2double (me->get_property ("y-offset"));;
+ + dir * scm_to_double (me->get_property ("y-offset"));;
/*
Make sure we don't start on a dots
Real diff = ry - y;
Real newy = y;
- Real clear = staff_space * ly_scm2double (me->get_property ("staffline-clearance"));
+ Real clear = staff_space * scm_to_double (me->get_property ("staffline-clearance"));
if (fabs (y) <=
Staff_symbol_referencer::staff_radius (me) * staff_space + clear
do {
flare[d] = height[d] = shorten[d] = 0.0;
if (is_number_pair (fl))
- flare[d] += ss * ly_scm2double (index_get_cell (fl, d));
+ flare[d] += ss * scm_to_double (index_get_cell (fl, d));
if (is_number_pair (eh))
- height[d] += - dir * ss *ly_scm2double (index_get_cell (eh, d));
+ height[d] += - dir * ss *scm_to_double (index_get_cell (eh, d));
if (is_number_pair (sp))
- shorten[d] += ss *ly_scm2double (index_get_cell (sp, d));
+ shorten[d] += ss *scm_to_double (index_get_cell (sp, d));
}
while (flip (&d) != LEFT);
}
// padding
- *offset += ly_scm2double (me->get_property ("padding")) *dir;
+ *offset += scm_to_double (me->get_property ("padding")) *dir;
/*
{
SCM ps = par_beam->get_property ("positions");
- Real lp = ly_scm2double (ly_car (ps));
- Real rp = ly_scm2double (ly_cdr (ps));
+ Real lp = scm_to_double (ly_car (ps));
+ Real rp = scm_to_double (ly_cdr (ps));
/*
duh. magic.
< */
- offset = lp + dir * (0.5 + ly_scm2double (me->get_property ("padding")));
+ offset = lp + dir * (0.5 + scm_to_double (me->get_property ("padding")));
dy = rp- lp;
}
if (ly_c_number_p (lp) && !ly_c_number_p (rp))
{
- rp = scm_make_real (ly_scm2double (lp) + dy);
+ rp = scm_make_real (scm_to_double (lp) + dy);
}
else if (ly_c_number_p (rp) && !ly_c_number_p (lp))
{
- lp = scm_make_real (ly_scm2double (rp) - dy);
+ lp = scm_make_real (scm_to_double (rp) - dy);
}
else if (!ly_c_number_p (rp) && !ly_c_number_p (lp))
{
(define (get-path node done)
"Follow NODE.PREV, and return as an ascending list of pages. DONE
is what have collected so far, and has ascending page numbers."
+
(if (is-a? node <optimally-broken-page-node>)
(get-path (node-prev node) (cons node done))
done))
#:penalty total-penalty)
current-best)))
- (if #t ;; debug
+ (if #f ;; debug
(display
(list
"\nuser pen " user-penalty