2004-04-07 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/include/lily-guile.hh: many new ly_ functions. Thanks to
+ Michael Welsh Duggan
+
+ * lily/*.cc: deprecate gh_ interface. Thanks to Michael Welsh Duggan
+
* ly/nederlands.ly: add comment about digits.
* lily/scaled-font-metric.cc (derived_mark): idem.
CONTRIBUTORS
+Michael Welsh Duggan
+
BUG HUNTERS/SUGGESTIONS
Stephen Pollei
-Michael Welsh Duggan
Release 2.2
***********
MAJOR_VERSION=2
MINOR_VERSION=3
PATCH_LEVEL=0
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=mwd
set_property_on_children (Context * trans, const char * sym, SCM val)
{
trans->set_property (sym, val);
- for (SCM p = trans->context_list_; gh_pair_p (p); p = ly_cdr (p))
+ for (SCM p = trans->context_list_; ly_pair_p (p); p = ly_cdr (p))
{
Context *trg = unsmob_context (ly_car (p));
set_property_on_children (trg, sym, ly_deep_copy (val));
int n = pitch->get_notename ();
int o = pitch->get_octave ();
int a = pitch->get_alteration ();
- int curbarnum_i = gh_scm2int (curbarnum);
+ int curbarnum_i = ly_scm2int (curbarnum);
int accbarnum_i = 0;
SCM prev;
if (ignore_octave)
prev = ly_assoc_cdr (scm_int2num (n), sig);
else
- prev = scm_assoc (gh_cons (scm_int2num (o), scm_int2num (n)), sig);
+ prev = scm_assoc (scm_cons (scm_int2num (o), scm_int2num (n)), sig);
/* should really be true unless prev == SCM_BOOL_F */
- if (gh_pair_p (prev) && gh_pair_p (ly_cdr (prev)))
+ if (ly_pair_p (prev) && ly_pair_p (ly_cdr (prev)))
{
- accbarnum_i = gh_scm2int (ly_cddr (prev));
- prev = gh_cons (ly_car (prev), ly_cadr (prev));
+ accbarnum_i = ly_scm2int (ly_cddr (prev));
+ prev = scm_cons (ly_car (prev), ly_cadr (prev));
}
/* If an accidental was not found or the accidental was too old */
if (prev == SCM_BOOL_F ||
- (gh_number_p (lazyness) && curbarnum_i > accbarnum_i + gh_scm2int (lazyness)))
+ (ly_number_p (lazyness) && curbarnum_i > accbarnum_i + ly_scm2int (lazyness)))
prev = scm_assoc (scm_int2num (n), sig);
SCM prev_acc = (prev == SCM_BOOL_F) ? scm_int2num (0) : ly_cdr (prev);
- int p = gh_number_p (prev_acc) ? gh_scm2int (prev_acc) : 0;
+ int p = ly_number_p (prev_acc) ? ly_scm2int (prev_acc) : 0;
int num;
- if (a == p && gh_number_p (prev_acc))
+ if (a == p && ly_number_p (prev_acc))
num = 0;
else if ( (abs (a)<abs (p) || p*a<0) && a != 0 )
num = 2;
int number = 0;
*different = false;
- if (gh_pair_p (accidentals) && !gh_symbol_p (ly_car (accidentals)))
+ if (ly_pair_p (accidentals) && !ly_symbol_p (ly_car (accidentals)))
warning (_f ("Accidental typesetting list must begin with context-name: %s",
ly_scm2string (ly_car (accidentals)).to_str0 ()));
- for (; gh_pair_p (accidentals) && origin; accidentals = gh_cdr (accidentals))
+ for (; ly_pair_p (accidentals) && origin; accidentals = ly_cdr (accidentals))
{
// If pair then it is a new accidentals typesetting rule to be checked
- SCM rule = gh_car (accidentals);
- if (gh_pair_p (rule))
+ SCM rule = ly_car (accidentals);
+ if (ly_pair_p (rule))
{
- SCM type = gh_car (rule);
- SCM lazyness = gh_cdr (rule);
+ SCM type = ly_car (rule);
+ SCM lazyness = ly_cdr (rule);
SCM localsig = origin->get_property ("localKeySignature");
bool same_octave_b =
- gh_eq_p (ly_symbol2scm ("same-octave"), type);
+ ly_eq_p (ly_symbol2scm ("same-octave"), type);
bool any_octave_b =
- gh_eq_p (ly_symbol2scm ("any-octave"), type);
+ ly_eq_p (ly_symbol2scm ("any-octave"), type);
if (same_octave_b || any_octave_b)
{
/*
if symbol then it is a context name. Scan parent contexts to find it.
*/
- else if (gh_symbol_p (rule))
+ else if (ly_symbol_p (rule))
{
Context * dad = origin;
while (dad && !dad->is_alias (rule))
Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
if (mp.main_part_ < Rational (0)
- && gh_number_p (barnum))
- barnum = scm_int2num (gh_scm2int (barnum) - 1);
+ && ly_number_p (barnum))
+ barnum = scm_int2num (ly_scm2int (barnum) - 1);
return barnum ;
}
announce_grob (a, SCM_EOL);
- SCM accs = gh_cons (scm_int2num (pitch->get_alteration ()), SCM_EOL);
+ SCM accs = scm_cons (scm_int2num (pitch->get_alteration ()), SCM_EOL);
if (num == 2 && extra_natural_b)
- accs = gh_cons (scm_int2num (0), accs);
+ accs = scm_cons (scm_int2num (0), accs);
/* TODO:
int n = pitch->get_notename ();
int o = pitch->get_octave ();
int a = pitch->get_alteration ();
- SCM on_s = gh_cons (scm_int2num (o), scm_int2num (n));
+ SCM on_s = scm_cons (scm_int2num (o), scm_int2num (n));
while (origin)
{
that of the tied note and of the key signature.
*/
localsig = ly_assoc_front_x
- (localsig, on_s, gh_cons (SCM_BOOL_T, barnum));
+ (localsig, on_s, scm_cons (SCM_BOOL_T, barnum));
change = true;
}
noteheads with the same notename.
*/
localsig = ly_assoc_front_x
- (localsig, on_s, gh_cons (scm_int2num (a), barnum));
+ (localsig, on_s, scm_cons (scm_int2num (a), barnum));
change = true;
}
&& Rhythmic_head::has_interface (info.grob_))
{
if (to_boolean ( get_property ("harmonicAccidentals"))
- || !gh_equal_p (info.grob_->get_property ("style"),
+ || !ly_equal_p (info.grob_->get_property ("style"),
ly_symbol2scm ("harmonic")))
{
entry = SCM_EOL;
}
else
- entry = gh_cdr (entry);
+ entry = ly_cdr (entry);
- entry = gh_cons (a->self_scm (), entry);
+ entry = scm_cons (a->self_scm (), entry);
accs = scm_assq_set_x (accs, key, entry);
Link_array<Grob> *break_reminder,
Link_array<Grob> *real_acc)
{
- for (SCM acs =accs->get_property ("accidental-grobs"); gh_pair_p (acs);
- acs =gh_cdr (acs))
- for (SCM s = gh_cdar (acs); gh_pair_p (s); s = gh_cdr (s))
+ for (SCM acs =accs->get_property ("accidental-grobs"); ly_pair_p (acs);
+ acs =ly_cdr (acs))
+ for (SCM s = ly_cdar (acs); ly_pair_p (s); s = ly_cdr (s))
{
- Grob *a = unsmob_grob (gh_car (s));
+ Grob *a = unsmob_grob (ly_car (s));
if (unsmob_grob (a->get_property ("tie")))
break_reminder->push (a);
Y-position, they share an Ape, and will be printed in overstrike.
*/
Link_array<Accidental_placement_entry> apes;
- for (SCM s = accs; gh_pair_p (s); s =gh_cdr (s))
+ for (SCM s = accs; ly_pair_p (s); s =ly_cdr (s))
{
Accidental_placement_entry *ape = new Accidental_placement_entry;
- ape->notename_ = gh_scm2int (gh_caar (s));
+ ape->notename_ = ly_scm2int (ly_caar (s));
- for (SCM t = gh_cdar (s); gh_pair_p (t); t =gh_cdr (t))
- ape->grobs_.push (unsmob_grob (gh_car (t)));
+ for (SCM t = ly_cdar (s); ly_pair_p (t); t =ly_cdr (t))
+ ape->grobs_.push (unsmob_grob (ly_car (t)));
apes.push (ape);
}
if (to_boolean (a->get_property ("cautionary")))
{
SCM cstyle = a->get_property ("cautionary-style");
- parens = gh_equal_p (cstyle, ly_symbol2scm ("parentheses"));
+ parens = ly_equal_p (cstyle, ly_symbol2scm ("parentheses"));
}
SCM accs = a->get_property ("accidentals");
SCM scm_style = a->get_property ("style");
- if (!gh_symbol_p (scm_style)
+ if (!ly_symbol_p (scm_style)
&& !parens
&& scm_ilength (accs) == 1)
{
- if (gh_scm2int (gh_car (accs)) == FLAT)
+ if (ly_scm2int (ly_car (accs)) == FLAT)
{
Box stem = b;
Box bulb = b;
if (caut)
{
SCM cstyle = me->get_property ("cautionary-style");
- parens = gh_equal_p (cstyle, ly_symbol2scm ("parentheses"));
- smaller = gh_equal_p (cstyle, ly_symbol2scm ("smaller"));
+ parens = ly_equal_p (cstyle, ly_symbol2scm ("parentheses"));
+ smaller = ly_equal_p (cstyle, ly_symbol2scm ("smaller"));
}
SCM scm_style = me->get_property ("style");
String style;
- if (gh_symbol_p (scm_style))
+ if (ly_symbol_p (scm_style))
{
style = ly_symbol2string (scm_style);
}
if (smaller)
{
SCM ac = Font_interface::text_font_alist_chain (me);
- ac = gh_cons (gh_cons (gh_cons
+ ac = scm_cons (scm_cons (scm_cons
(ly_symbol2scm ("font-size"),
scm_int2num (-2)), SCM_EOL),
ac);
Stencil mol;
for (SCM s = me->get_property ("accidentals");
- gh_pair_p (s); s = gh_cdr (s))
+ ly_pair_p (s); s = ly_cdr (s))
{
- int alteration = gh_scm2int (gh_car (s));
+ int alteration = ly_scm2int (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)gh_scm2int (axis);
+ Axis ax = (Axis)ly_scm2int (axis);
Grob * par = me->get_parent (ax);
if (par && !to_boolean (par->get_property ("positioning-done")))
{
Align_interface::align_elements_to_extents (par, ax);
}
- return gh_double2scm (0.0);
+ return scm_make_real (0.0);
}
MAKE_SCHEME_CALLBACK (Align_interface,fixed_distance_alignment_callback,2);
Align_interface::fixed_distance_alignment_callback (SCM element_smob, SCM axis)
{
Grob * me = unsmob_grob (element_smob);
- Axis ax = (Axis)gh_scm2int (axis);
+ Axis ax = (Axis)ly_scm2int (axis);
Grob * par = me->get_parent (ax);
if (par && !to_boolean (par->get_property ("positioning-done")))
{
Align_interface::align_to_fixed_distance (par, ax);
}
- return gh_double2scm (0.0);
+ return scm_make_real (0.0);
}
/*
SCM d = me->get_property ("stacking-dir");
- Direction stacking_dir = gh_number_p (d) ? to_dir (d) : CENTER;
+ Direction stacking_dir = ly_number_p (d) ? to_dir (d) : CENTER;
if (!stacking_dir)
stacking_dir = DOWN;
SCM d = me->get_property ("stacking-dir");
- Direction stacking_dir = gh_number_p (d) ? to_dir (d) : CENTER;
+ Direction stacking_dir = ly_number_p (d) ? to_dir (d) : CENTER;
if (!stacking_dir)
stacking_dir = DOWN;
FIXME: uncommenting freaks out the Y-alignment of
line-of-score.
*/
- if (gh_number_p (align))
- center_offset = total.linear_combination (gh_scm2double (align));
+ if (ly_number_p (align))
+ center_offset = total.linear_combination (ly_scm2double (align));
for (int j = 0 ; j < all_grobs.size (); j++)
all_grobs[j]->translate_axis (all_translates[j] - center_offset, a);
Axis
Align_interface::axis (Grob*me)
{
- return Axis (gh_scm2int (ly_car (me->get_property ("axes"))));
+ return Axis (ly_scm2int (ly_car (me->get_property ("axes"))));
}
void
{
while (g)
{
- if (gh_number_p (g->get_property ("forced-distance")))
+ if (ly_number_p (g->get_property ("forced-distance")))
return g;
g = g->get_parent (Y_AXIS);
val = read_afm_file (filename);
unsmob_metrics (val)->filename_ = filename;
- unsmob_metrics (val)->description_ = gh_cons (name_string,
- gh_double2scm (1.0));
+ unsmob_metrics (val)->description_ = scm_cons (name_string,
+ scm_make_real (1.0));
if (verbose_global_b)
progress_indication ("]");
progress_indication ("]");
unsmob_metrics (val)->filename_ = filename;
- unsmob_metrics (val)->description_ = gh_cons (name_string,
- gh_double2scm (1.0));
+ unsmob_metrics (val)->description_ = scm_cons (name_string,
+ scm_make_real (1.0));
tfm_p_dict_->set (sname, val);
scm_gc_unprotect_object (val);
}
(SCM name),
"Load the font @var{name}. ")
{
- SCM_ASSERT_TYPE (gh_string_p (name), name, SCM_ARG1, __FUNCTION__, "string");
+ SCM_ASSERT_TYPE (ly_string_p (name), name, SCM_ARG1, __FUNCTION__, "string");
Font_metric * fm = all_fonts_global->find_font (ly_scm2string (name));
if (ignore_octave_b)
prev = ly_assoc_cdr (scm_int2num (notename), key_signature);
else
- prev = scm_assoc (gh_cons (scm_int2num (octave), scm_int2num (notename)),
+ prev = scm_assoc (scm_cons (scm_int2num (octave), scm_int2num (notename)),
key_signature);
/* should really be true unless prev == SCM_BOOL_F */
- if (gh_pair_p (prev) && gh_pair_p (ly_cdr (prev)))
+ if (ly_pair_p (prev) && ly_pair_p (ly_cdr (prev)))
{
- prev = gh_cons (ly_car (prev), ly_cadr (prev));
+ prev = scm_cons (ly_car (prev), ly_cadr (prev));
}
/* If an accidental was not found */
prev = scm_assoc (scm_int2num (notename), key_signature);
SCM prev_acc = (prev == SCM_BOOL_F) ? scm_int2num (0) : ly_cdr (prev);
- int sig_alteration = gh_number_p (prev_acc) ? gh_scm2int (prev_acc) : 0;
+ int sig_alteration = ly_number_p (prev_acc) ? ly_scm2int (prev_acc) : 0;
if (alteration == sig_alteration) // no accidental at all needed
return 0;
SCM scm_note_head_style = me->get_property ("note-head-style");
String note_head_style;
- if (gh_symbol_p (scm_note_head_style))
+ if (ly_symbol_p (scm_note_head_style))
{
String note_head_style =
ly_symbol2string (scm_note_head_style);
}
SCM c0 = me->get_property ("c0-position");
- if (gh_number_p (c0))
+ if (ly_number_p (c0))
{
- p_min += gh_scm2int (c0);
- p_max += gh_scm2int (c0);
+ p_min += ly_scm2int (c0);
+ p_max += ly_scm2int (c0);
}
// create heads
SCM key_signature = me->get_property ("key-signature");
SCM scm_accidentals_style = me->get_property ("accidentals-style");
String accidentals_style;
- if (gh_symbol_p (scm_accidentals_style))
+ if (ly_symbol_p (scm_accidentals_style))
{
accidentals_style =
ly_symbol2string (scm_accidentals_style);
Grob *me = unsmob_grob (smob);
Grob * common = me;
- for (SCM s = me->get_property ("stems"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("stems"); ly_pair_p (s); s = ly_cdr (s))
{
Grob * stem = unsmob_grob (ly_car (s));
common = common->common_refpoint (Staff_symbol_referencer::get_staff_symbol (stem),
Interval heads;
Real my_y = me->relative_coordinate (common, Y_AXIS);
- for (SCM s = me->get_property ("stems"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("stems"); ly_pair_p (s); s = ly_cdr (s))
{
Grob * stem = unsmob_grob (ly_car (s));
Grob * ss = Staff_symbol_referencer::get_staff_symbol (stem);
Grob *me = unsmob_grob (smob);
Grob * common = me;
- for (SCM s = me->get_property ("stems"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("stems"); ly_pair_p (s); s = ly_cdr (s))
{
Grob * stem = unsmob_grob (ly_car (s));
common = common->common_refpoint (Staff_symbol_referencer::get_staff_symbol (stem),
Interval heads;
Real my_y = me->relative_coordinate (common, Y_AXIS);
- for (SCM s = me->get_property ("stems"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("stems"); ly_pair_p (s); s = ly_cdr (s))
{
Grob * stem = unsmob_grob (ly_car (s));
Grob * ss = Staff_symbol_referencer::get_staff_symbol (stem);
Arpeggio::width_callback (SCM smob, SCM axis)
{
Grob * me = unsmob_grob (smob);
- Axis a = (Axis)gh_scm2int (axis);
+ Axis a = (Axis)ly_scm2int (axis);
assert (a == X_AXIS);
Stencil arpeggio = Font_interface::get_default_font (me)->find_by_name ("scripts-arpeggio");
void
Auto_beam_engraver::process_music ()
{
- if (gh_string_p (get_property ("whichBar")))
+ if (ly_string_p (get_property ("whichBar")))
{
consider_end (shortest_mom_);
junk_beam ();
}
/* second guess: property generic time exception */
- SCM m = scm_assoc (gh_append3 (function, wild, time), settings);
+ SCM m = scm_assoc (ly_append3 (function, wild, time), settings);
if (m != SCM_BOOL_F && unsmob_moment (ly_cdr (m)))
moment = * unsmob_moment (ly_cdr (m));
/* third guess: property time exception, specific for duration type */
- m = scm_assoc (gh_append3 (function, type, time), settings);
+ m = scm_assoc (ly_append3 (function, type, time), settings);
if (m != SCM_BOOL_F && unsmob_moment (ly_cdr (m)))
moment = * unsmob_moment (ly_cdr (m));
/* fourth guess [user override]: property plain generic */
- m = scm_assoc (gh_append3 (function, wild, wild), settings);
+ m = scm_assoc (ly_append3 (function, wild, wild), settings);
if (m != SCM_BOOL_F && unsmob_moment (ly_cdr (m)))
moment = * unsmob_moment (ly_cdr (m));
/* fifth guess [user override]: property plain, specific for duration type */
- m = scm_assoc (gh_append3 (function, type, wild), settings);
+ m = scm_assoc (ly_append3 (function, type, wild), settings);
if (m != SCM_BOOL_F && unsmob_moment (ly_cdr (m)))
moment = * unsmob_moment (ly_cdr (m));
beam_start_moment_ = now_mom ();
beam_start_location_ = *unsmob_moment (get_property ("measurePosition"));
- subdivide_beams_ = gh_scm2bool (get_property ("subdivideBeams"));
+ subdivide_beams_ = ly_scm2bool (get_property ("subdivideBeams"));
beat_length_ = *unsmob_moment (get_property ("beatLength"));
}
Moment now = get_outlet ()->now_mom ();
Moment *splitm = 0;
- for (; gh_pair_p (split_list_); split_list_ = gh_cdr (split_list_))
+ for (; ly_pair_p (split_list_); split_list_ = ly_cdr (split_list_))
{
- splitm = unsmob_moment (gh_caar (split_list_));
+ splitm = unsmob_moment (ly_caar (split_list_));
if ((*splitm + start_moment_) > now)
break ;
- SCM tag = gh_cdar (split_list_);
+ SCM tag = ly_cdar (split_list_);
Direction d = to_dir (tag);
if (d && d != where_dir_)
{
for (SCM ax = me->get_property ("axes"); ax != SCM_EOL ; ax = ly_cdr (ax))
{
- Axis a = (Axis) gh_scm2int (ly_car (ax));
+ Axis a = (Axis) ly_scm2int (ly_car (ax));
if (!e->get_parent (a))
e->set_parent (me, a);
Axis_group_interface::relative_group_extent (Axis a, Grob *common, SCM elts)
{
Interval r;
- for (SCM s = elts; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = elts; ly_pair_p (s); s = ly_cdr (s))
{
Grob * se = unsmob_grob (ly_car (s));
Interval dims = se->extent (common, a);
Axis_group_interface::group_extent_callback (SCM element_smob, SCM scm_axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (scm_axis);
+ Axis a = (Axis) ly_scm2int (scm_axis);
SCM elts = me->get_property ("elements");
Grob * common = common_refpoint_of_list (elts, me, a);
SCM axes = me->get_property ("axes");
- if (!gh_pair_p (axes)
+ if (!ly_pair_p (axes)
|| scm_c_memq (sa1, axes) == SCM_BOOL_F
|| scm_c_memq (sa2, axes) == SCM_BOOL_F)
{
- SCM ax = gh_cons (sa1, SCM_EOL);
+ SCM ax = scm_cons (sa1, SCM_EOL);
if (a1 != a2)
- ax= gh_cons (sa2, ax);
+ ax= scm_cons (sa2, ax);
me->set_property ("axes", ax);
}
if (!has_interface (me))
return childs;
- for (SCM ep = me->get_property ("elements"); gh_pair_p (ep); ep = ly_cdr (ep))
+ for (SCM ep = me->get_property ("elements"); ly_pair_p (ep); ep = ly_cdr (ep))
{
Grob* e = unsmob_grob (ly_car (ep));
if (e)
SCM cb = me->get_property ("balloon-original-callback");
SCM scm_mol = SCM_EOL;
- if (gh_procedure_p (cb))
+ if (ly_procedure_p (cb))
{
scm_mol = scm_call_1 (cb, smob);
}
SCM bt = me->get_property ("balloon-text");
SCM chain = Font_interface::text_font_alist_chain (me);
- chain = gh_cons (me->get_property ("balloon-text-props"), chain);
+ chain = scm_cons (me->get_property ("balloon-text-props"), chain);
SCM text = Text_item::interpret_markup (me->get_paper ()->self_scm (), chain, bt);
void
Bar_engraver::process_acknowledged_grobs ()
{
- if (!bar_ && gh_string_p (get_property ("whichBar")))
+ if (!bar_ && ly_string_p (get_property ("whichBar")))
{
create_bar ();
}
SCM s = me->get_property ("glyph");
SCM barsiz_proc = me->get_property ("bar-size-procedure");
- if (gh_string_p (s) && gh_procedure_p (barsiz_proc))
+ if (ly_string_p (s) && ly_procedure_p (barsiz_proc))
{
String str =ly_scm2string (s);
- SCM siz = gh_call1 (barsiz_proc, me->self_scm ());
+ SCM siz = scm_call_1 (barsiz_proc, me->self_scm ());
Real sz = robust_scm2double (siz, 0);
if (sz < 0)
return SCM_EOL;
SCM g = me->get_property ("glyph");
SCM orig = g;
Direction bsd = item->break_status_dir ();
- if (gh_string_p (g) && bsd)
+ if (ly_string_p (g) && bsd)
{
SCM proc = me->get_property ("break-glyph-function");
- g = gh_call2 (proc, g, scm_int2num (bsd));
+ g = scm_call_2 (proc, g, scm_int2num (bsd));
}
- if (!gh_string_p (g))
+ if (!ly_string_p (g))
{
me->set_property ("print-function", SCM_EOL);
me->set_extent (SCM_EOL, X_AXIS);
// leave y_extent for spanbar?
}
- if (! gh_equal_p (g, orig))
+ if (! ly_equal_p (g, orig))
me->set_property ("glyph", g);
return SCM_UNSPECIFIED;
Grob*me = unsmob_grob (smob);
Real ss = Staff_symbol_referencer::staff_space (me);
SCM size = me->get_property ("bar-size");
- if (gh_number_p (size))
- return gh_double2scm (gh_scm2double (size)*ss);
+ if (ly_number_p (size))
+ return scm_make_real (ly_scm2double (size)*ss);
else if (Staff_symbol_referencer::get_staff_symbol (me))
{
/*
calculation. That's a nonsense value, which would collapse the
barline so we return 0.0 in the next alternative.
*/
- return gh_double2scm ((Staff_symbol_referencer::line_count (me) -1) * ss);
+ return scm_make_real ((Staff_symbol_referencer::line_count (me) -1) * ss);
}
else
return scm_int2num (0);
SCM wb = get_property ("whichBar");
- if (gh_string_p (wb))
+ if (ly_string_p (wb))
{
SCM smp = get_property ("measurePosition");
{
SCM bn = get_property ("currentBarNumber");
SCM proc = get_property ("barNumberVisibility");
- if (gh_number_p (bn) && gh_procedure_p (proc)
- && to_boolean (gh_call1(proc, bn)))
+ if (ly_number_p (bn) && ly_procedure_p (proc)
+ && to_boolean (scm_call_1(proc, bn)))
{
create_items ();
// guh.
text_->set_property
- ("text", scm_makfrom0str (to_string (gh_scm2int (bn)).to_str0 ()));
+ ("text", scm_makfrom0str (to_string (ly_scm2int (bn)).to_str0 ()));
}
}
}
Grob *me = unsmob_grob (smob);
SCM s = me->get_property ("positions");
- Real yl = gh_scm2double (gh_car (s));
- Real yr = gh_scm2double (gh_cdr (s));
+ Real yl = ly_scm2double (ly_car (s));
+ Real yr = ly_scm2double (ly_cdr (s));
/*
Real slt = Staff_symbol_referencer::line_thickness (me) / ss;
SCM sdy = me->get_property ("least-squares-dy");
- Real dy_mus = gh_number_p (sdy) ? gh_scm2double (sdy) : 0.0;
+ Real dy_mus = ly_number_p (sdy) ? ly_scm2double (sdy) : 0.0;
Real straddle = 0.0;
Real sit = (thickness - slt) / 2;
#if DEBUG_QUANTING
SCM inspect_quants = me->get_property ("inspect-quants");
if (debug_beam_quanting_flag
- && gh_pair_p (inspect_quants))
+ && ly_pair_p (inspect_quants))
{
Drul_array<Real> ins = ly_scm2interval (inspect_quants);
{
SCM func = me->get_property ("space-function");
- if (gh_procedure_p (func))
+ if (ly_procedure_p (func))
{
- SCM s = gh_call2 (func, me->self_scm (), scm_int2num (get_beam_count (me)));
- return gh_scm2double (s);
+ SCM s = scm_call_2 (func, me->self_scm (), scm_int2num (get_beam_count (me)));
+ return ly_scm2double (s);
}
else
{
Beam::get_beam_count (Grob *me)
{
int m = 0;
- for (SCM s = me->get_property ("stems"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("stems"); ly_pair_p (s); s = ly_cdr (s))
{
Grob *stem = unsmob_grob (ly_car (s));
m = m >? (Stem::beam_multiplicity (stem).length () + 1);
Real line = Staff_symbol_referencer::line_thickness (me);
Real thickness = get_thickness (me);
- Real beam_translation = gh_scm2int (beam_count) < 4
+ Real beam_translation = ly_scm2int (beam_count) < 4
? (2*staff_space + line - thickness) / 2.0
: (3*staff_space + line - thickness) / 3.0;
- return gh_double2scm (beam_translation);
+ return scm_make_real (beam_translation);
}
{
me->warning (_ ("removing beam with less than two stems"));
- unsmob_grob (gh_car (stems))->set_property ("beam", SCM_EOL);
+ unsmob_grob (ly_car (stems))->set_property ("beam", SCM_EOL);
me->suicide ();
return SCM_UNSPECIFIED;
Direction left_dir,
Direction right_dir)
{
- Slice lslice = int_list_to_slice (gh_cdr (left_beaming));
+ Slice lslice = int_list_to_slice (ly_cdr (left_beaming));
int best_count = 0;
int best_start = 0;
(i - lslice[left_dir])* left_dir <= 0 ; i+= left_dir)
{
int count =0;
- for ( SCM s = gh_car (right_beaming); gh_pair_p (s); s = gh_cdr (s))
+ for ( SCM s = ly_car (right_beaming); ly_pair_p (s); s = ly_cdr (s))
{
- int k = - right_dir * gh_scm2int (gh_car (s)) + i;
+ int k = - right_dir * ly_scm2int (ly_car (s)) + i;
if (scm_c_memq (scm_int2num (k), left_beaming) != SCM_BOOL_F)
count ++;
}
SCM this_beaming = this_stem->get_property ("beaming");
Direction this_dir = get_grob_direction (this_stem);
- if (gh_pair_p (last_beaming) && gh_pair_p (this_beaming))
+ if (ly_pair_p (last_beaming) && ly_pair_p (this_beaming))
{
int start_point = position_with_maximal_common_beams
(last_beaming, this_beaming,
new_slice.set_empty ();
SCM s = index_get_cell (this_beaming, d);
- for (; gh_pair_p (s); s = gh_cdr (s))
+ for (; ly_pair_p (s); s = ly_cdr (s))
{
int new_beam_pos =
- start_point - this_dir * gh_scm2int (gh_car (s));
+ start_point - this_dir * ly_scm2int (ly_car (s));
new_slice.add_point (new_beam_pos);
- gh_set_car_x (s, scm_int2num (new_beam_pos));
+ scm_set_car_x (s, scm_int2num (new_beam_pos));
}
}
else
{
- gh_set_car_x ( this_beaming, SCM_EOL);
- SCM s = gh_cdr (this_beaming);
- for (; gh_pair_p (s); s = gh_cdr (s))
+ scm_set_car_x ( this_beaming, SCM_EOL);
+ SCM s = ly_cdr (this_beaming);
+ for (; ly_pair_p (s); s = ly_cdr (s))
{
- int np = - this_dir * gh_scm2int (gh_car (s));
- gh_set_car_x (s, scm_int2num (np));
+ int np = - this_dir * ly_scm2int (ly_car (s));
+ scm_set_car_x (s, scm_int2num (np));
last_int.add_point (np);
}
}
if (i == stems.size () -1)
{
- gh_set_cdr_x (this_beaming, SCM_EOL);
+ scm_set_cdr_x (this_beaming, SCM_EOL);
}
- if (scm_ilength (gh_cdr (this_beaming)) > 0)
+ if (scm_ilength (ly_cdr (this_beaming)) > 0)
{
last_beaming = this_beaming;
last_dir = this_dir;
right from the left stem, and rfliebertjes pointing left from
right stem.
*/
- SCM left = (i>0) ? gh_cdr (last_beaming) : SCM_EOL;
- SCM right = st ? gh_car (this_beaming) : SCM_EOL;
+ SCM left = (i>0) ? ly_cdr (last_beaming) : SCM_EOL;
+ SCM right = st ? ly_car (this_beaming) : SCM_EOL;
Array<int> full_beams;
Array<int> lfliebertjes;
Array<int> rfliebertjes;
for (SCM s = left;
- gh_pair_p (s); s =gh_cdr (s))
+ ly_pair_p (s); s =ly_cdr (s))
{
- int b = gh_scm2int (gh_car (s));
- if (scm_c_memq (gh_car (s), right) != SCM_BOOL_F)
+ int b = ly_scm2int (ly_car (s));
+ if (scm_c_memq (ly_car (s), right) != SCM_BOOL_F)
{
full_beams.push (b);
}
}
}
for (SCM s = right;
- gh_pair_p (s); s =gh_cdr (s))
+ ly_pair_p (s); s =ly_cdr (s))
{
- int b = gh_scm2int (gh_car (s));
- if (scm_c_memq (gh_car (s), left) == SCM_BOOL_F)
+ int b = ly_scm2int (ly_car (s));
+ if (scm_c_memq (ly_car (s), left) == SCM_BOOL_F)
{
rfliebertjes.push (b);
}
Stencil gapped;
int gap_count = 0;
- if (gh_number_p (me->get_property ("gap-count")))
+ if (ly_number_p (me->get_property ("gap-count")))
{
- gap_count = gh_scm2int (me->get_property ("gap-count"));
+ gap_count = ly_scm2int (me->get_property ("gap-count"));
gapped = Lookup::beam (dydx, w - 2 * gap_length, thick, blot);
full_beams.sort (default_compare);
int t = Stem::duration_log (st);
SCM proc = me->get_property ("flag-width-function");
- SCM result = gh_call1 (proc, scm_int2num (t));
- nw_f = gh_scm2double (result);
+ SCM result = scm_call_1 (proc, scm_int2num (t));
+ nw_f = ly_scm2double (result);
}
else
nw_f = break_overshoot / 2;
#if (DEBUG_QUANTING)
SCM quant_score = me->get_property ("quant-score");
if (debug_beam_quanting_flag
- && gh_string_p (quant_score))
+ && ly_string_p (quant_score))
{
/*
} while (flip (&d) != DOWN);
SCM func = me->get_property ("dir-function");
- SCM s = gh_call2 (func,
- gh_cons (scm_int2num (count[UP]),
+ SCM s = scm_call_2 (func,
+ scm_cons (scm_int2num (count[UP]),
scm_int2num (count[DOWN])),
- gh_cons (scm_int2num (total[UP]),
+ scm_cons (scm_int2num (total[UP]),
scm_int2num (total[DOWN])));
- if (gh_number_p (s) && gh_scm2int (s))
+ if (ly_number_p (s) && ly_scm2int (s))
return to_dir (s);
/* If dir is not determined: get default */
Beam::consider_auto_knees (Grob* me)
{
SCM scm = me->get_property ("auto-knee-gap");
- if (!gh_number_p (scm))
+ if (!ly_number_p (scm))
return ;
- Real threshold = gh_scm2double (scm);
+ Real threshold = ly_scm2double (scm);
Int_set gaps;
SCM shorten_elt =
robust_list_ref (beam_count -1, shorten_list);
- Real shorten_f = gh_scm2double (shorten_elt) * staff_space;
+ Real shorten_f = ly_scm2double (shorten_elt) * staff_space;
/* your similar cute comment here */
shorten_f *= forced_fraction;
if (shorten_f)
- me->set_property ("shorten", gh_double2scm (shorten_f));
+ me->set_property ("shorten", scm_make_real (shorten_f));
}
/* Call list of y-dy-callbacks, that handle setting of
{
// one wonders if such genericity is necessary --hwn.
SCM callbacks = me->get_property ("position-callbacks");
- for (SCM i = callbacks; gh_pair_p (i); i = ly_cdr (i))
- gh_call1 (ly_car (i), me->self_scm ());
+ for (SCM i = callbacks; ly_pair_p (i); i = ly_cdr (i))
+ scm_call_1 (ly_car (i), me->self_scm ());
}
set_stem_lengths (me);
where the second part goes.
*/
me->set_property ("least-squares-dy",
- gh_double2scm (pos[RIGHT] - pos[LEFT]));
+ scm_make_real (pos[RIGHT] - pos[LEFT]));
}
else
{
minimise_least_squares (&dydx, &y, ideals);
dy = dydx * dx;
- me->set_property ("least-squares-dy", gh_double2scm (dy));
+ me->set_property ("least-squares-dy", scm_make_real (dy));
pos = Interval (y, (y+dy));
}
*/
bool is_concave1 = false;
SCM gap = me->get_property ("concaveness-gap");
- if (gh_number_p (gap))
+ if (ly_number_p (gap))
{
- Real r1 = gh_scm2double (gap);
+ Real r1 = ly_scm2double (gap);
Real dy = Stem::chord_start_y (stems.top ())
- Stem::chord_start_y (stems[0]);
Real concaveness2 = 0;
SCM thresh = me->get_property ("concaveness-threshold");
Real r2 = infinity_f;
- if (!is_concave1 && gh_number_p (thresh))
+ if (!is_concave1 && ly_number_p (thresh))
{
- r2 = gh_scm2double (thresh);
+ r2 = ly_scm2double (thresh);
Interval iv;
iv.add_point (Stem::chord_start_y (stems[0]));
r /= Staff_symbol_referencer::staff_space (me);
me->set_property ("positions", ly_interval2scm (Drul_array<Real> (r, r)));
- me->set_property ("least-squares-dy", gh_double2scm (0));
+ me->set_property ("least-squares-dy", scm_make_real (0));
}
return SCM_UNSPECIFIED;
return SCM_UNSPECIFIED;
SCM s = me->get_property ("damping");
- int damping = gh_scm2int (s);
+ int damping = ly_scm2int (s);
if (damping)
{
{
Slice l;
- for ( SCM s = gh_car (beaming); gh_pair_p (s) ; s = gh_cdr (s))
+ for ( SCM s = ly_car (beaming); ly_pair_p (s) ; s = ly_cdr (s))
{
- if (scm_c_memq (gh_car (s), gh_cdr (beaming)) != SCM_BOOL_F)
+ if (scm_c_memq (ly_car (s), ly_cdr (beaming)) != SCM_BOOL_F)
- l.add_point (gh_scm2int (gh_car (s)));
+ l.add_point (ly_scm2int (ly_car (s)));
}
return l;
bool gap = false;
Real thick =0.0;
- if (gh_number_p (me->get_property ("gap-count"))
- &&gh_scm2int (me->get_property ("gap-count")))
+ if (ly_number_p (me->get_property ("gap-count"))
+ &&ly_scm2int (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) gh_scm2int (axis);
+ Axis a = (Axis) ly_scm2int (axis);
- if (gh_number_p (rest->get_property ("staff-position")))
- return gh_int2scm (0);
+ if (ly_number_p (rest->get_property ("staff-position")))
+ return scm_int2num (0);
assert (a == Y_AXIS);
Grob *st = unsmob_grob (rest->get_property ("stem"));
Grob *stem = st;
if (!stem)
- return gh_double2scm (0.0);
+ return scm_make_real (0.0);
Grob *beam = unsmob_grob (stem->get_property ("beam"));
if (!beam
|| !Beam::has_interface (beam)
|| !Beam::visible_stem_count (beam))
- return gh_double2scm (0.0);
+ return scm_make_real (0.0);
Drul_array<Real> pos (0, 0);
SCM s = beam->get_property ("positions");
- if (gh_pair_p (s) && gh_number_p (ly_car (s)))
+ if (ly_pair_p (s) && ly_number_p (ly_car (s)))
pos = ly_scm2interval (s);
Real staff_space = Staff_symbol_referencer::staff_space (rest);
< rad)
shift = ceil (fabs (shift)) *sign (shift);
- return gh_double2scm (staff_space * shift);
+ return scm_make_real (staff_space * shift);
}
bool
Beam::is_knee (Grob* me)
{
SCM k = me->get_property ("knee");
- if (gh_boolean_p (k))
- return gh_scm2bool (k);
+ if (ly_boolean_p (k))
+ return ly_scm2bool (k);
bool knee = false;
int d = 0;
- for (SCM s = me->get_property ("stems"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("stems"); ly_pair_p (s); s = ly_cdr (s))
{
Direction dir = get_grob_direction (unsmob_grob (ly_car (s)));
if (d && d != dir)
d = dir;
}
- me->set_property ("knee", gh_bool2scm (knee));
+ me->set_property ("knee", ly_bool2scm (knee));
return knee;
}
void
Break_align_engraver::stop_translation_timestep ()
{
- for (SCM p = column_alist_; gh_pair_p (p); p = ly_cdr (p))
+ for (SCM p = column_alist_; ly_pair_p (p); p = ly_cdr (p))
{
SCM pair = ly_car (p);
add_column (ly_cdr (pair));
return ;
SCM align_name = item->get_property ("break-align-symbol");
- if (!gh_symbol_p (align_name))
+ if (!ly_symbol_p (align_name))
return ;
if (!align_)
Break_align_interface::alignment_callback (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (axis);
+ Axis a = (Axis) ly_scm2int (axis);
assert (a == X_AXIS);
Grob *par = me->get_parent (a);
Break_align_interface::do_alignment (par);
}
- return gh_double2scm (0);
+ return scm_make_real (0);
}
MAKE_SCHEME_CALLBACK (Break_align_interface,self_align_callback,2);
Break_align_interface::self_align_callback (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (axis);
+ Axis a = (Axis) ly_scm2int (axis);
assert (a == X_AXIS);
Item* item = dynamic_cast<Item*> (me);
Item *me = dynamic_cast<Item*> (grob);
SCM elts = me->get_property ("elements");
SCM order_vec = me->get_property ("break-align-orders");
- if (!gh_vector_p (order_vec)
- || gh_vector_length (order_vec) < 3)
+ if (!ly_vector_p (order_vec)
+ || ly_vector_length (order_vec) < 3)
return Pointer_group_interface__extract_grobs (me, (Grob*)0,
"elements");
SCM order = scm_vector_ref (order_vec,
- gh_int2scm (me->break_status_dir() + 1));
+ scm_int2num (me->break_status_dir() + 1));
/*
Copy in order specified in BREAK-ALIGN-ORDER.
*/
Link_array<Grob> new_elts;
- for (; gh_pair_p (order); order = ly_cdr (order))
+ for (; ly_pair_p (order); order = ly_cdr (order))
{
- SCM sym = gh_car (order);
+ SCM sym = ly_car (order);
- for (SCM s =elts; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s =elts; ly_pair_p (s); s = ly_cdr (s))
{
- Grob *g = unsmob_grob (gh_car (s));
+ Grob *g = unsmob_grob (ly_car (s));
if (g && sym == g->get_property ("break-align-symbol"))
{
new_elts.push (g);
Find the first grob with a space-alist entry.
*/
for (SCM s = l->get_property ("elements");
- gh_pair_p (s) ; s = gh_cdr (s))
+ ly_pair_p (s) ; s = ly_cdr (s))
{
- Grob *elt = unsmob_grob (gh_car (s));
+ Grob *elt = unsmob_grob (ly_car (s));
if (edge_idx < 0
&& elt->get_property ("break-align-symbol")
edge_idx = idx;
SCM l =elt->get_property ("space-alist");
- if (gh_pair_p (l))
+ if (ly_pair_p (l))
{
alist= l;
break;
reason.
*/
for (SCM s = r ? r->get_property ("elements") : SCM_EOL;
- !gh_symbol_p (rsym) && gh_pair_p (s); s = gh_cdr (s))
+ !ly_symbol_p (rsym) && ly_pair_p (s); s = ly_cdr (s))
{
- Grob * elt =unsmob_grob (gh_car (s));
+ Grob * elt =unsmob_grob (ly_car (s));
rsym = elt->get_property ("break-align-symbol");
}
edge_idx = next_idx;
SCM entry = SCM_EOL;
- if (gh_symbol_p (rsym))
+ if (ly_symbol_p (rsym))
entry = scm_assq (rsym, alist);
- bool entry_found = gh_pair_p (entry);
+ bool entry_found = ly_pair_p (entry);
if (!entry_found)
{
String sym_string;
- if (gh_symbol_p (rsym))
+ if (ly_symbol_p (rsym))
sym_string = ly_symbol2string (rsym);
String orig_string ;
if (entry_found)
{
- entry = gh_cdr (entry);
+ entry = ly_cdr (entry);
- distance = gh_scm2double (gh_cdr (entry));
- type = gh_car (entry) ;
+ distance = ly_scm2double (ly_cdr (entry));
+ type = ly_car (entry) ;
}
if (r)
if (unsmob_grob (src))
return substitute_grob (unsmob_grob (src));
- else if (gh_vector_p (src))
+ else if (ly_vector_p (src))
{
int len = SCM_VECTOR_LENGTH (src);
SCM nv = scm_c_make_vector (len, SCM_UNDEFINED);
SCM oldcdr = ly_cdr (src);
if (newcar == SCM_UNDEFINED
- && (gh_pair_p (oldcdr) || oldcdr == SCM_EOL))
+ && (ly_pair_p (oldcdr) || oldcdr == SCM_EOL))
{
/*
This is tail-recursion, ie.
SCM l = SCM_EOL;
SCM * tail = &l;
- for (SCM s = grob_list; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = grob_list; ly_pair_p (s); s = ly_cdr (s))
{
- SCM n= substitute_grob (unsmob_grob (gh_car (s)));
+ SCM n= substitute_grob (unsmob_grob (ly_car (s)));
if (n != SCM_UNDEFINED)
{
- *tail = gh_cons (n, SCM_EOL);
+ *tail = scm_cons (n, SCM_EOL);
tail = SCM_CDRLOC (*tail);
}
}
int sp_index = len;
int it_index = 0;
- for (SCM s = grob_list; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = grob_list; ly_pair_p (s); s = ly_cdr (s))
{
- Grob * g = unsmob_grob (gh_car (s));
+ Grob * g = unsmob_grob (ly_car (s));
Slice sr = grob_system_range (g);
sr.intersect (system_range);
SCM l = SCM_EOL;
SCM *tail = &l;
- for (SCM s = alist; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = alist; ly_pair_p (s); s = ly_cdr (s))
{
- SCM sym = gh_caar (s);
- SCM val = gh_cdar (s);
+ SCM sym = ly_caar (s);
+ SCM val = ly_cdar (s);
SCM type = scm_object_property (sym, ly_symbol2scm ("backend-type?"));
if (type == grob_list_p)
else
val = do_break_substitution (val);
- *tail = gh_cons (gh_cons (sym, val), SCM_EOL);
+ *tail = scm_cons (scm_cons (sym, val), SCM_EOL);
tail = SCM_CDRLOC (*tail);
}
Real inter_f = Staff_symbol_referencer::staff_space (me)/2;
int sz = Staff_symbol_referencer::line_count (me)-1;
- return gh_double2scm (inter_f * sz * d);
+ return scm_make_real (inter_f * sz * d);
}
ADD_INTERFACE (Breathing_sign, "breathing-sign-interface",
else if (n->get_property ("bass") == SCM_BOOL_T)
bass = p;
else
- pitches = gh_cons (p, pitches);
+ pitches = scm_cons (p, pitches);
}
if (inversion_event)
{
SCM oct = inversion_event->get_property ("octavation");
- if (gh_number_p (oct))
+ if (ly_number_p (oct))
{
Pitch *p = unsmob_pitch (inversion_event->get_property ("pitch"));
- int octavation = gh_scm2int (oct);
+ int octavation = ly_scm2int (oct);
Pitch orig = p->transposed (Pitch (-octavation, 0,0));
- pitches= gh_cons (orig.smobbed_copy (), pitches);
+ pitches= scm_cons (orig.smobbed_copy (), pitches);
}
else
programming_error ("Inversion does not have original pitch.");
/*
Ugh.
*/
- SCM chord_as_scm = gh_cons (pitches, gh_cons (bass, inversion));
+ SCM chord_as_scm = scm_cons (pitches, scm_cons (bass, inversion));
chord_name_ = make_item ("ChordName");
chord_name_->set_property ("text", markup);
announce_grob (chord_name_, notes_[0]->self_scm ());
SCM s = get_property ("chordChanges");
- if (to_boolean (s) && gh_pair_p (last_chord_)
- && gh_equal_p (chord_as_scm, last_chord_))
+ if (to_boolean (s) && ly_pair_p (last_chord_)
+ && ly_equal_p (chord_as_scm, last_chord_))
chord_name_->set_property ("begin-of-line-visible", SCM_BOOL_T);
last_chord_ = chord_as_scm;
if (Stem::duration_log (s) != 1)
{
- beam_->set_property ("gap-count", gh_int2scm (flags_ - total_duration_flags_));
+ beam_->set_property ("gap-count", scm_int2num (flags_ - total_duration_flags_));
}
if (info.music_cause ()->is_mus_type ("rhythmic-event"))
if (item)
{
if (Bar_line::has_interface (info.grob_)
- && gh_string_p (get_property ("clefGlyph")))
+ && ly_string_p (get_property ("clefGlyph")))
create_clef ();
}
}
clef_ = c;
SCM cpos = get_property ("clefPosition");
- if (gh_number_p (cpos))
- Staff_symbol_referencer::set_position (clef_, gh_scm2int (cpos));
+ if (ly_number_p (cpos))
+ Staff_symbol_referencer::set_position (clef_, ly_scm2int (cpos));
SCM oct = get_property ("clefOctavation");
- if (gh_number_p (oct) && gh_scm2int (oct))
+ if (ly_number_p (oct) && ly_scm2int (oct))
{
Item * g = make_item ("OctavateEight");
- int abs_oct = gh_scm2int (oct) ;
+ int abs_oct = ly_scm2int (oct) ;
int dir = sign (abs_oct);
abs_oct = abs (abs_oct) + 1;
- SCM txt = scm_number_to_string (gh_int2scm (abs_oct),
+ SCM txt = scm_number_to_string (scm_int2num (abs_oct),
SCM_MAKINUM (10));
g->set_property ("text",
SCM glyph = s->get_property ("glyph-name");
- if (gh_string_p (glyph))
+ if (ly_string_p (glyph))
{
String str = ly_scm2string (glyph);
{
Grob *me = unsmob_grob (smob);
SCM glyph_scm = me->get_property ("glyph-name");
- if (!gh_string_p (glyph_scm))
+ if (!ly_string_p (glyph_scm))
return SCM_EOL;
String glyph = String (ly_scm2string (glyph_scm));
{
SCM c0scm = get_property ("middleCPosition");
- int c0 = gh_number_p (c0scm) ? gh_scm2int (c0scm) : 0;
+ int c0 = ly_number_p (c0scm) ? ly_scm2int (c0scm) : 0;
int pmax = INT_MIN;
int pmin = INT_MAX;
beacon_ = make_item ("ClusterSpannerBeacon");
beacon_->set_property ("positions",
- scm_cons (gh_int2scm (pmin),
- gh_int2scm (pmax)));
+ scm_cons (scm_int2num (pmin),
+ scm_int2num (pmax)));
announce_grob (beacon_, cluster_notes_[0]->self_scm ());
}
SCM shape_scm = me->get_property ("style");
String shape;
- if (gh_symbol_p (shape_scm))
+ if (ly_symbol_p (shape_scm))
{
shape = ly_symbol2string (shape_scm);
}
Grob *commonx = left_bound->common_refpoint (right_bound, X_AXIS);
SCM cols =me->get_property ("columns");
- if (!gh_pair_p (cols))
+ if (!ly_pair_p (cols))
{
me->warning ("junking empty cluster");
me->suicide ();
line with the center of the note heads?
*/
- for (SCM s = cols; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = cols; ly_pair_p (s); s = ly_cdr (s))
{
Grob * col = unsmob_grob (ly_car (s));
Interval yext = col->extent (commony, Y_AXIS);
{
Spanner * next = orig->broken_intos_[spanner->get_break_index () + 1];
SCM cols = next->get_property ("columns");
- if (gh_pair_p (cols))
+ if (ly_pair_p (cols))
{
Grob *next_commony = common_refpoint_of_list (cols, next, Y_AXIS);
Grob * col = unsmob_grob (ly_car (scm_last_pair (cols)));
Real distance;
if (incr_scm != SCM_EOL)
{
- distance = gh_scm2double (incr_scm);
+ distance = ly_scm2double (incr_scm);
}
else
{
// also for all associated grobs (NoteSpacing, SeparationItem).
Grob *sl = Staff_symbol_referencer::get_staff_symbol (item);
for (SCM tail = parent->get_property ("elements");
- gh_pair_p (tail);
+ ly_pair_p (tail);
tail = ly_cdr (tail))
{
Item *sibling = unsmob_item (ly_car (tail));
"setting `spacing-increment = "
"0.01': ptr=%ul", parent));
sibling_parent->set_property ("forced-spacing",
- gh_double2scm (0.01));
+ scm_make_real (0.01));
#endif
sibling->set_parent (column, X_AXIS);
}
{
delta_pitch = pitch - prev_pitch;
prev_primitive->set_property ("delta-pitch",
- gh_int2scm (delta_pitch));
+ scm_int2num (delta_pitch));
}
prev_pitch = pitch;
prev_primitive = primitive;
}
- primitive->set_property ("delta-pitch", gh_int2scm (0));
+ primitive->set_property ("delta-pitch", scm_int2num (0));
}
void
req->set_property ("duration", note_dur.smobbed_copy ());
note->set_property ("duration-log",
- gh_int2scm (note_dur.duration_log ()));
+ scm_int2num (note_dur.duration_log ()));
int dots= note_dur.dot_count ();
if (dots)
/*
measly attempt to save an eeny-weenie bit of memory.
*/
- if (dots != gh_scm2int (d->get_property ("dot-count")))
- d->set_property ("dot-count", gh_int2scm (dots));
+ if (dots != ly_scm2int (d->get_property ("dot-count")))
+ d->set_property ("dot-count", scm_int2num (dots));
d->set_parent (note, Y_AXIS);
announce_grob (d, SCM_EOL);
int pos = pit->steps ();
SCM c0 = get_property ("middleCPosition");
- if (gh_number_p (c0))
- pos += gh_scm2int (c0);
+ if (ly_number_p (c0))
+ pos += ly_scm2int (c0);
- note->set_property ("staff-position", gh_int2scm (pos));
+ note->set_property ("staff-position", scm_int2num (pos));
announce_grob (note,req->self_scm ());
notes_.push (note);
}
void
Context_def::add_context_mod (SCM mod)
{
- SCM tag = gh_car (mod);
+ SCM tag = ly_car (mod);
if (ly_symbol2scm ("description") == tag)
{
- description_ = gh_cadr (mod);
+ description_ = ly_cadr (mod);
return ;
}
- SCM sym = gh_cadr (mod);
- if (gh_string_p (sym))
+ SCM sym = ly_cadr (mod);
+ if (ly_string_p (sym))
sym = scm_string_to_symbol (sym);
if (ly_symbol2scm ("consists") == tag
if (!get_translator (sym))
error (_f ("Program has no such type: `%s'", ly_symbol2string (sym).to_str0 ()));
else
- translator_mods_ = gh_cons (scm_list_2 (tag, sym), translator_mods_ );
+ translator_mods_ = scm_cons (scm_list_2 (tag, sym), translator_mods_ );
}
else if (ly_symbol2scm ("accepts") == tag
|| ly_symbol2scm ("denies") == tag)
{
- accept_mods_ = gh_cons (scm_list_2 (tag, sym), accept_mods_);
+ accept_mods_ = scm_cons (scm_list_2 (tag, sym), accept_mods_);
}
else if (ly_symbol2scm ("poppush") == tag
|| ly_symbol2scm ("pop") == tag
|| ly_symbol2scm ("assign") == tag
|| ly_symbol2scm ("unset") == tag)
{
- property_ops_ = gh_cons (mod, property_ops_);
+ property_ops_ = scm_cons (mod, property_ops_);
}
else if (ly_symbol2scm ("alias") == tag)
{
- context_aliases_ = gh_cons (sym, context_aliases_);
+ context_aliases_ = scm_cons (sym, context_aliases_);
}
else if (ly_symbol2scm ("translator-type") == tag)
{
SCM mods = scm_reverse_x (scm_list_copy (accept_mods_),
user_mod);
SCM acc = SCM_EOL;
- for (SCM s = mods; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = mods; ly_pair_p (s); s = ly_cdr (s))
{
- SCM tag = gh_caar (s);
- SCM sym = gh_cadar (s);
+ SCM tag = ly_caar (s);
+ SCM sym = ly_cadar (s);
if (tag == ly_symbol2scm ("accepts"))
- acc = gh_cons (sym, acc);
+ acc = scm_cons (sym, acc);
else if (tag == ly_symbol2scm ("denies"))
acc = scm_delete_x (sym, acc);
}
Link_array<Context_def>
Context_def::path_to_acceptable_context (SCM type_sym, Music_output_def* odef) const
{
- assert (gh_symbol_p (type_sym));
+ assert (ly_symbol_p (type_sym));
SCM accepted = get_accepted (SCM_EOL);
Link_array<Context_def> accepteds;
- for (SCM s = accepted; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = accepted; ly_pair_p (s); s = ly_cdr (s))
{
Context_def *t = unsmob_context_def (odef->find_context_def (ly_car (s)));
if (!t)
/*
don't check aliases, because \context Staff should not create RhythmicStaff.
*/
- if (gh_equal_p (accepteds[i]->get_context_name (), type_sym))
+ if (ly_equal_p (accepteds[i]->get_context_name (), type_sym))
{
best_result.push (accepteds[i]);
return best_result;
SCM mods = scm_reverse_x (scm_list_copy (translator_mods_),
user_mod);
- for (SCM s = mods; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = mods; ly_pair_p (s); s = ly_cdr (s))
{
- SCM tag = gh_caar (s);
- SCM arg = gh_cadar (s);
+ SCM tag = ly_caar (s);
+ SCM arg = ly_cadar (s);
- if (gh_string_p (arg))
+ if (ly_string_p (arg))
arg = scm_string_to_symbol (arg);
if (ly_symbol2scm ("consists") == tag)
- l1 = gh_cons (arg, l1);
+ l1 = scm_cons (arg, l1);
else if (ly_symbol2scm ("consists-end") == tag)
- l2 = gh_cons (arg, l2);
+ l2 = scm_cons (arg, l2);
else if (ly_symbol2scm ("remove") == tag)
{
l1 = scm_delete_x (arg, l1);
SCM
filter_performers (SCM l)
{
- for (SCM *tail = &l; gh_pair_p (*tail); tail = SCM_CDRLOC (*tail))
+ for (SCM *tail = &l; ly_pair_p (*tail); tail = SCM_CDRLOC (*tail))
{
- if (dynamic_cast<Performer*> (unsmob_translator (gh_car (*tail))))
+ if (dynamic_cast<Performer*> (unsmob_translator (ly_car (*tail))))
{
- *tail = gh_cdr (*tail);
+ *tail = ly_cdr (*tail);
}
}
return l;
SCM
filter_engravers (SCM l)
{
- for (SCM *tail = &l; gh_pair_p (*tail) ; tail = SCM_CDRLOC (*tail))
+ for (SCM *tail = &l; ly_pair_p (*tail) ; tail = SCM_CDRLOC (*tail))
{
- if (dynamic_cast<Engraver*> (unsmob_translator (gh_car (*tail))))
+ if (dynamic_cast<Engraver*> (unsmob_translator (ly_car (*tail))))
{
- *tail = gh_cdr (*tail);
+ *tail = ly_cdr (*tail);
}
}
return l;
{
SCM l = SCM_EOL;
- l = gh_cons (gh_cons (ly_symbol2scm ("consists"),
+ l = scm_cons (scm_cons (ly_symbol2scm ("consists"),
get_translator_names (SCM_EOL)), l);
- l = gh_cons (gh_cons (ly_symbol2scm ("description"), description_), l);
- l = gh_cons (gh_cons (ly_symbol2scm ("aliases"), context_aliases_), l);
- l = gh_cons (gh_cons (ly_symbol2scm ("accepts"), get_accepted (SCM_EOL)), l);
- l = gh_cons (gh_cons (ly_symbol2scm ("property-ops"), property_ops_), l);
- l = gh_cons (gh_cons (ly_symbol2scm ("context-name"), context_name_), l);
-
- if (gh_symbol_p (translator_group_type_))
- l = gh_cons (gh_cons (ly_symbol2scm ("group-type"), translator_group_type_), l);
+ l = scm_cons (scm_cons (ly_symbol2scm ("description"), description_), l);
+ l = scm_cons (scm_cons (ly_symbol2scm ("aliases"), context_aliases_), l);
+ l = scm_cons (scm_cons (ly_symbol2scm ("accepts"), get_accepted (SCM_EOL)), l);
+ l = scm_cons (scm_cons (ly_symbol2scm ("property-ops"), property_ops_), l);
+ l = scm_cons (scm_cons (ly_symbol2scm ("context-name"), context_name_), l);
+
+ if (ly_symbol_p (translator_group_type_))
+ l = scm_cons (scm_cons (ly_symbol2scm ("group-type"), translator_group_type_), l);
return l;
}
{
Context *tg = unsmob_context (context);
SCM_ASSERT_TYPE (tg, context, SCM_ARG1, __FUNCTION__, "context");
- SCM_ASSERT_TYPE (gh_symbol_p (grob), grob, SCM_ARG2, __FUNCTION__, "symbol");
- SCM_ASSERT_TYPE (gh_symbol_p (eltprop), eltprop, SCM_ARG3, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_symbol_p (grob), grob, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_symbol_p (eltprop), eltprop, SCM_ARG3, __FUNCTION__, "symbol");
execute_pushpop_property (tg, grob, eltprop, val);
Context *t = unsmob_context (c);
Context * tr= (t);
SCM_ASSERT_TYPE (tr, c, SCM_ARG1, __FUNCTION__, "Translator group");
- SCM_ASSERT_TYPE (gh_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
return tr->internal_get_property (name);
}
{
Context *tr = unsmob_context (context);
SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
- SCM_ASSERT_TYPE (gh_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
tr->internal_set_property (name, val);
{
Context *tr = unsmob_context (context);
SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
- SCM_ASSERT_TYPE (gh_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
tr = tr->where_defined (name);
if (tr)
{
Context *tr = unsmob_context (context);
SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
- SCM_ASSERT_TYPE (gh_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
tr->unset_property (name);
return SCM_UNSPECIFIED;
{
Context *tr = unsmob_context (context);
SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "context");
- SCM_ASSERT_TYPE (gh_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
while (tr)
{
String c_id;
SCM ci = get_music ()->get_property ("context-id");
- if (gh_string_p (ci))
+ if (ly_string_p (ci))
c_id = ly_scm2string (ci);
SCM ops = get_music ()->get_property ("property-operations");
void
Context::check_removal ()
{
- for (SCM p = context_list_; gh_pair_p (p); p = gh_cdr (p))
+ for (SCM p = context_list_; ly_pair_p (p); p = ly_cdr (p))
{
Context *trg = unsmob_context (ly_car (p));
Context::add_context (Context*t)
{
SCM ts = t->self_scm ();
- context_list_ = gh_append2 (context_list_,
- gh_cons (ts, SCM_EOL));
+ context_list_ = ly_append2 (context_list_,
+ scm_cons (ts, SCM_EOL));
t->daddy_context_ = this;
if (!t->init_)
return this;
Context* r = 0;
- for (SCM p = context_list_; !r && gh_pair_p (p); p = ly_cdr (p))
+ for (SCM p = context_list_; !r && ly_pair_p (p); p = ly_cdr (p))
{
Context * t = unsmob_context (ly_car (p));
SCM
default_child_context_name (Context const *tg)
{
- return gh_pair_p (tg->accepts_list_)
+ return ly_pair_p (tg->accepts_list_)
? ly_car (scm_last_pair (tg->accepts_list_))
: SCM_EOL;
}
bool
Context::is_bottom_context () const
{
- return !gh_symbol_p (default_child_context_name (this));
+ return !ly_symbol_p (default_child_context_name (this));
}
Context*
Context::is_alias (SCM sym) const
{
if (sym == ly_symbol2scm ("Bottom")
- && !gh_pair_p (accepts_list_))
+ && !ly_pair_p (accepts_list_))
return true;
if (sym == unsmob_context_def (definition_)->get_context_name ())
return true;
Context * found = 0;
for (SCM s = where->context_list_;
- !found && gh_pair_p (s); s = gh_cdr (s))
+ !found && ly_pair_p (s); s = ly_cdr (s))
{
- Context * tr = unsmob_context (gh_car (s));
+ Context * tr = unsmob_context (ly_car (s));
found = find_context_below (tr, type, id);
}
void
Custos_engraver::process_acknowledged_grobs ()
{
- if (gh_string_p (get_property ("whichBar")))
+ if (ly_string_p (get_property ("whichBar")))
custos_permitted = true;
if (custos_permitted)
int p = pitches_[i].steps ();
SCM c0 = get_property ("middleCPosition");
- if (gh_number_p (c0))
- p += gh_scm2int (c0);
+ if (ly_number_p (c0))
+ p += ly_scm2int (c0);
c->set_property ("staff-position",
- gh_int2scm (p));
+ scm_int2num (p));
}
SCM scm_style = me->get_property ("style");
String style;
- if (gh_symbol_p (scm_style))
+ if (ly_symbol_p (scm_style))
{
style = ly_symbol2string (scm_style);
}
void
set_grob_direction (Grob*me, Direction d)
{
- SCM sd = gh_int2scm (d);
+ SCM sd = scm_int2num (d);
me->set_property ("direction", sd);
}
Dot_column::force_shift_callback (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (axis);
+ Axis a = (Axis) ly_scm2int (axis);
assert (a == Y_AXIS);
me = me->get_parent (X_AXIS);
do_shifts (me);
}
- return gh_double2scm (0.0);
+ return scm_make_real (0.0);
}
MAKE_SCHEME_CALLBACK (Dot_column,side_position, 2);
Dot_column::side_position (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (axis);
+ Axis a = (Axis) ly_scm2int (axis);
assert (a == X_AXIS);
Grob * stem = unsmob_grob (me->get_property ("stem"));
SCM c = sc->get_property ("dot-count");
- if (gh_number_p (c))
+ if (ly_number_p (c))
{
Stencil d = Font_interface::get_default_font (sc)->find_by_name (String ("dots-dot"));
Real dw = d.extent (X_AXIS).length ();
mol = Lookup::blank (Box (Interval (0,0),
Interval (0,0)));
- for (int i = gh_scm2int (c); i--;)
+ for (int i = ly_scm2int (c); i--;)
{
d.translate_axis (2*dw,X_AXIS);
mol.add_at_edge (X_AXIS, RIGHT, d, dw, 0);
Duration dur = *unsmob_duration (ev->get_property ("duration"));
- note->set_property ("duration-log", gh_int2scm (dur.duration_log ()));
+ note->set_property ("duration-log", scm_int2num (dur.duration_log ()));
if (dur.dot_count ())
{
if (dur.dot_count ()
!= robust_scm2int (d->get_property ("dot-count"), 0))
- d->set_property ("dot-count", gh_int2scm (dur.dot_count ()));
+ d->set_property ("dot-count", scm_int2num (dur.dot_count ()));
d->set_parent (note, Y_AXIS);
announce_grob (d, SCM_EOL);
if (scm_hash_table_p (tab) == SCM_BOOL_T)
defn = scm_hashq_ref (tab, drum_type, SCM_EOL);
- if (gh_pair_p (defn))
+ if (ly_pair_p (defn))
{
- SCM pos = gh_caddr (defn);
- SCM style =gh_car (defn);
- SCM script = gh_cadr (defn);
+ SCM pos = ly_caddr (defn);
+ SCM style =ly_car (defn);
+ SCM script = ly_cadr (defn);
if (scm_integer_p (pos) == SCM_BOOL_T)
note->set_property ("staff-position", pos);
- if (gh_symbol_p (style))
+ if (ly_symbol_p (style))
note->set_property ("style", style);
- if (gh_string_p (script))
+ if (ly_string_p (script))
{
Item *p = make_item ("Script");
SCM desc = SCM_EOL;
SCM sym = n->get_property ("drum-type");
SCM defn = SCM_EOL;
- if (gh_symbol_p (sym)
+ if (ly_symbol_p (sym)
&& (scm_hash_table_p (tab) == SCM_BOOL_T))
defn = scm_hashq_ref (tab, sym, SCM_EOL);
{
SCM_ASSERT_TYPE (scm_integer_p (dotcount) == SCM_BOOL_T,
dotcount, SCM_ARG2, __FUNCTION__, "integer");
- dots = gh_scm2int (dotcount);
+ dots = ly_scm2int (dotcount);
}
bool compress = false;
if (num != SCM_UNDEFINED)
{
- SCM_ASSERT_TYPE (gh_number_p (num), length, SCM_ARG3, __FUNCTION__, "integer");
+ SCM_ASSERT_TYPE (ly_number_p (num), length, SCM_ARG3, __FUNCTION__, "integer");
compress = true;
}
else
- num = gh_int2scm (1);
+ num = scm_int2num (1);
if (den != SCM_UNDEFINED)
{
- SCM_ASSERT_TYPE (gh_number_p (den), length, SCM_ARG4, __FUNCTION__, "integer");
+ SCM_ASSERT_TYPE (ly_number_p (den), length, SCM_ARG4, __FUNCTION__, "integer");
compress = true;
}
else
- den = gh_int2scm (1);
+ den = scm_int2num (1);
- Duration p (gh_scm2int (length), dots);
+ Duration p (ly_scm2int (length), dots);
if (compress)
- p = p.compressed (Rational (gh_scm2int (num), gh_scm2int (den)));
+ p = p.compressed (Rational (ly_scm2int (num), ly_scm2int (den)));
return p.smobbed_copy ();
}
"Extract the duration log from @var{dur}")
{
SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration");
- return gh_int2scm (unsmob_duration (dur)->duration_log ());
+ return scm_int2num (unsmob_duration (dur)->duration_log ());
}
LY_DEFINE (dot_count_log, "ly:duration-dot-count", 1, 0, 0, (SCM dur),
)
{
SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration");
- return gh_int2scm (unsmob_duration (dur)->dot_count ());
+ return scm_int2num (unsmob_duration (dur)->dot_count ());
}
1, 0, 0, (SCM d),
"The 2-logarithm of 1/@var{d}.")
{
- SCM_ASSERT_TYPE (gh_number_p (d), d, SCM_ARG1, __FUNCTION__, "integer");
- int log = intlog2 (gh_scm2int (d));
- return gh_int2scm (log);
+ SCM_ASSERT_TYPE (ly_number_p (d), d, SCM_ARG1, __FUNCTION__, "integer");
+ int log = intlog2 (ly_scm2int (d));
+ return scm_int2num (log);
}
LY_DEFINE (compression_factor, "ly:duration-factor",
{
SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration");
Rational r = unsmob_duration (dur)->factor ();
- return gh_cons (gh_int2scm (r.num ()), gh_int2scm (r.den ()));
+ return scm_cons (scm_int2num (r.num ()), scm_int2num (r.den ()));
}
int
start_type = "crescendo";
SCM s = get_property ((start_type + "Spanner").to_str0 ());
- if (!gh_symbol_p (s) || s == ly_symbol2scm ("hairpin"))
+ if (!ly_symbol_p (s) || s == ly_symbol2scm ("hairpin"))
{
cresc_ = make_spanner ("Hairpin");
cresc_->set_property ("grow-direction",
- gh_int2scm ((start_type == "crescendo")
+ scm_int2num ((start_type == "crescendo")
? BIGGER : SMALLER));
}
/*
FIXME: use get_markup () to check type.
*/
- if (gh_string_p (s) || gh_pair_p (s))
+ if (ly_string_p (s) || ly_pair_p (s))
{
cresc_->set_property ("edge-text",
- gh_cons (s, scm_makfrom0str ("")));
+ scm_cons (s, scm_makfrom0str ("")));
daddy_context_->set_property ((start_type + "Text").to_str0 (),
SCM_EOL);
}
if (script_ && !script_->get_parent (X_AXIS))
{
SCM head = scm_last_pair (i.grob_->get_property ("note-heads"));
- if (gh_pair_p (head))
- script_->set_parent (unsmob_grob (gh_car (head)), X_AXIS);
+ if (ly_pair_p (head))
+ script_->set_parent (unsmob_grob (ly_car (head)), X_AXIS);
}
}
DynamicText doesn't really have a script-priority field.
*/
- if (gh_number_p (p)
- && gh_scm2int (p) < gh_scm2int (script_->get_property ("script-priority")))
+ if (ly_number_p (p)
+ && ly_scm2int (p) < ly_scm2int (script_->get_property ("script-priority")))
{
Side_position_interface::add_support (line_spanner_, i.grob_);
SCM proc = get_property ("dynamicAbsoluteVolumeFunction");
SCM svolume = SCM_EOL;
- if (gh_procedure_p (proc))
+ if (ly_procedure_p (proc))
{
// urg
- svolume = gh_call1 (proc, script_req_->get_property ("text"));
+ svolume = scm_call_1 (proc, script_req_->get_property ("text"));
}
Real volume = robust_scm2double (svolume, 0.5);
*/
SCM min = get_property ("midiMinimumVolume");
SCM max = get_property ("midiMaximumVolume");
- if (gh_number_p (min) || gh_number_p (max))
+ if (ly_number_p (min) || ly_number_p (max))
{
Interval iv (0, 1);
- if (gh_number_p (min))
- iv[MIN] = gh_scm2double (min);
- if (gh_number_p (max))
- iv[MAX] = gh_scm2double (max);
+ if (ly_number_p (min))
+ iv[MIN] = ly_scm2double (min);
+ if (ly_number_p (max))
+ iv[MAX] = ly_scm2double (max);
volume = iv[MIN] + iv.length () * volume;
}
else
*/
SCM s = get_property ("midiInstrument");
- if (!gh_string_p (s))
+ if (!ly_string_p (s))
s = get_property ("instrument");
- if (!gh_string_p (s))
+ if (!ly_string_p (s))
s = scm_makfrom0str ("piano");
SCM eq = get_property ("instrumentEqualizer");
- if (gh_procedure_p (eq))
+ if (ly_procedure_p (eq))
{
- s = gh_call1 (eq, s);
+ s = scm_call_1 (eq, s);
}
if (is_number_pair (s))
SCM meta = info.grob_->internal_get_property (meta_sym);
SCM nm = scm_assoc (name_sym, meta);
- if (gh_pair_p (nm))
+ if (ly_pair_p (nm))
nm = ly_cdr (nm);
else
{
SCM acklist = scm_hashq_ref (tab, nm, SCM_UNDEFINED);
if (acklist == SCM_BOOL_F)
{
- acklist = find_acknowledge_engravers (gh_cons (self_scm (), get_simple_trans_list ()), meta);
+ acklist = find_acknowledge_engravers (scm_cons (self_scm (), get_simple_trans_list ()), meta);
scm_hashq_set_x (tab, nm, acklist);
}
- for (SCM p = acklist; gh_pair_p (p); p = ly_cdr (p))
+ for (SCM p = acklist; ly_pair_p (p); p = ly_cdr (p))
{
Translator * t = unsmob_translator (ly_car (p));
Engraver * eng = dynamic_cast<Engraver*> (t);
void
Engraver_group_engraver::initialize ()
{
- SCM tab = scm_make_vector (gh_int2scm (61), SCM_BOOL_F);
+ SCM tab = scm_make_vector (scm_int2num (61), SCM_BOOL_F);
daddy_context_->set_property ("acknowledgeHashTable", tab);
Translator_group::initialize ();
engraver_valid (Translator*tr, SCM ifaces)
{
SCM ack_ifs = scm_assoc (ly_symbol2scm ("interfaces-acked"), tr->translator_description ());
- ack_ifs = gh_cdr (ack_ifs);
+ ack_ifs = ly_cdr (ack_ifs);
for (SCM s = ifaces; ly_pair_p (s); s = ly_cdr (s))
if (scm_c_memq (ly_car (s), ack_ifs) != SCM_BOOL_F)
return true;
SCM
find_acknowledge_engravers (SCM gravlist, SCM meta_alist)
{
- SCM ifaces = gh_cdr (scm_assoc (ly_symbol2scm ("interfaces"), meta_alist));
+ SCM ifaces = ly_cdr (scm_assoc (ly_symbol2scm ("interfaces"), meta_alist));
SCM l = SCM_EOL;
for (SCM s = gravlist; ly_pair_p (s); s = ly_cdr (s))
(tg->*ptr) ();
}
- for (SCM s = c->context_list_ ; gh_pair_p (s);
- s =gh_cdr (s))
+ for (SCM s = c->context_list_ ; ly_pair_p (s);
+ s =ly_cdr (s))
{
- recurse_down_engravers (unsmob_context (gh_car (s)), ptr, context_first);
+ recurse_down_engravers (unsmob_context (ly_car (s)), ptr, context_first);
}
if (context_first)
void
engraver_each (SCM list, Engraver_method method)
{
- for (SCM p = list; gh_pair_p (p); p = ly_cdr (p))
+ for (SCM p = list; ly_pair_p (p); p = ly_cdr (p))
{
Engraver * e = dynamic_cast<Engraver*>(unsmob_translator (ly_car (p)));
if (e)
if (last_processed_mom_ < Moment (0))
{
for (SCM s = dynamic_cast<Music_sequence *> (get_music ())->music_list ();
- gh_pair_p (s); s = ly_cdr (s))
+ ly_pair_p (s); s = ly_cdr (s))
{
Music *mus = unsmob_music (ly_car (s));
new_pit = new_pit.to_relative_octave (last);
SCM check = get_property ("absolute-octave");
- if (gh_number_p (check) &&
- new_pit.get_octave () != gh_scm2int (check))
+ if (ly_number_p (check) &&
+ new_pit.get_octave () != ly_scm2int (check))
{
- Pitch expected_pit (gh_scm2int (check),
+ Pitch expected_pit (ly_scm2int (check),
new_pit.get_notename (),
new_pit.get_alteration ());
origin ()->warning (_f ("octave check failed; expected %s, found: %s",
SCM newlist = SCM_EOL;
Pitch *p = unsmob_pitch (pit);
- for (SCM s = l; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = l; ly_pair_p (s); s = ly_cdr (s))
{
SCM key = ly_caar (s);
SCM alter = ly_cdar (s);
- if (gh_pair_p (key))
+ if (ly_pair_p (key))
{
- Pitch orig (gh_scm2int (ly_car (key)),
- gh_scm2int (ly_cdr (key)),
- gh_scm2int (alter));
+ Pitch orig (ly_scm2int (ly_car (key)),
+ ly_scm2int (ly_cdr (key)),
+ ly_scm2int (alter));
orig =orig.transposed (*p);
- SCM key = gh_cons (scm_int2num (orig.get_octave ()),
+ SCM key = scm_cons (scm_int2num (orig.get_octave ()),
scm_int2num (orig.get_notename ()));
- newlist = gh_cons (gh_cons (key, scm_int2num (orig.get_alteration ())),
+ newlist = scm_cons (scm_cons (key, scm_int2num (orig.get_alteration ())),
newlist);
}
- else if (gh_number_p (key))
+ else if (ly_number_p (key))
{
- Pitch orig (0, gh_scm2int (key), gh_scm2int (alter));
+ Pitch orig (0, ly_scm2int (key), ly_scm2int (alter));
orig = orig.transposed (*p);
key =scm_int2num (orig.get_notename ());
alter = scm_int2num (orig.get_alteration ());
- newlist = gh_cons (gh_cons (key, alter), newlist);
+ newlist = scm_cons (scm_cons (key, alter), newlist);
}
}
return scm_reverse_x (newlist, SCM_EOL);
alist_equal_p (SCM a, SCM b)
{
for (SCM s = a;
- gh_pair_p (s); s = ly_cdr (s))
+ ly_pair_p (s); s = ly_cdr (s))
{
SCM key = ly_caar (s);
SCM val = ly_cdar (s);
SCM l = scm_assoc (key, b);
if (l == SCM_BOOL_F
- || !gh_equal_p ( ly_cdr (l), val))
+ || !ly_equal_p ( ly_cdr (l), val))
return false;
}
if (!sp->get_bound (RIGHT))
{
SCM heads = sp->get_property ("heads");
- if (gh_pair_p (heads))
+ if (ly_pair_p (heads))
{
- Item* it = dynamic_cast<Item*> (unsmob_grob (gh_car (heads)));
+ Item* it = dynamic_cast<Item*> (unsmob_grob (ly_car (heads)));
if (it)
sp->set_bound (RIGHT, it);
}
else if (figures_.size ())
{
SCM proc = get_property ("bassFigureFormatFunction");
- if (gh_procedure_p (proc))
+ if (ly_procedure_p (proc))
{
SCM l = SCM_EOL;
SCM * t = &l;
// Hmm
int priority = 200;
SCM s = fingering->get_property ("script-priority");
- if (gh_number_p (s))
- priority = gh_scm2int (s);
+ if (ly_number_p (s))
+ priority = ly_scm2int (s);
/* See script-engraver.cc */
priority += i;
- fingering->set_property ("script-priority", gh_int2scm (priority));
+ fingering->set_property ("script-priority", scm_int2num (priority));
if (!is_direction (fingering->get_property ("direction")))
{
if (d)
- fingering->set_property ("direction", gh_int2scm (d));
+ fingering->set_property ("direction", scm_int2num (d));
else
- fingering->set_property ("direction", gh_int2scm (RIGHT));
+ fingering->set_property ("direction", scm_int2num (RIGHT));
}
SCM dig = r->get_property ("digit");
- fingering->set_property ("text", scm_number_to_string (dig, gh_int2scm (10)));
+ fingering->set_property ("text", scm_number_to_string (dig, scm_int2num (10)));
announce_grob (fingering, r->self_scm ());
fingerings_.push (fingering);
{
expr = scm_list_3 (ly_symbol2scm ("char"),
self_scm (),
- gh_int2scm (index_to_ascii (idx)));
+ scm_int2num (index_to_ascii (idx)));
b = get_indexed_char (idx);
}
{
Font_metric *fm = unsmob_metrics (font);
SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
- SCM_ASSERT_TYPE (gh_string_p (name), name, SCM_ARG2, __FUNCTION__, "string");
+ SCM_ASSERT_TYPE (ly_string_p (name), name, SCM_ARG2, __FUNCTION__, "string");
Stencil m = fm->find_by_name (ly_scm2string (name));
{
Font_metric *fm = unsmob_metrics (font);
SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
- SCM_ASSERT_TYPE (gh_number_p (index), index, SCM_ARG2, __FUNCTION__, "number");
+ SCM_ASSERT_TYPE (ly_number_p (index), index, SCM_ARG2, __FUNCTION__, "number");
- return fm->get_ascii_char_stencil (gh_scm2int (index)).smobbed_copy ();
+ return fm->get_ascii_char_stencil (ly_scm2int (index)).smobbed_copy ();
}
LY_DEFINE (ly_text_dimension,"ly:text-dimension",
Modified_font_metric*fm = dynamic_cast<Modified_font_metric*>
(unsmob_metrics (font));
SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "modified font metric");
- SCM_ASSERT_TYPE (gh_string_p (text), text, SCM_ARG2, __FUNCTION__, "string");
+ SCM_ASSERT_TYPE (ly_string_p (text), text, SCM_ARG2, __FUNCTION__, "string");
b = fm->text_dimension (ly_scm2string (text));
- return gh_cons (ly_interval2scm (b[X_AXIS]), ly_interval2scm (b[Y_AXIS]));
+ return scm_cons (ly_interval2scm (b[X_AXIS]), ly_interval2scm (b[Y_AXIS]));
}
LY_DEFINE (ly_font_name,"ly:font-name",
{
Font_metric *fm = unsmob_metrics (font);
SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
- return gh_car (fm->description_);
+ return ly_car (fm->description_);
}
LY_DEFINE (ly_font_magnification,"ly:font-magnification", 1 , 0, 0,
{
Font_metric *fm = unsmob_metrics (font);
SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
- return gh_cdr (fm->description_);
+ return ly_cdr (fm->description_);
}
LY_DEFINE (ly_font_design_size,"ly:font-design-size", 1 , 0, 0,
{
Font_metric *fm = unsmob_metrics (font);
SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
- return gh_double2scm (fm->design_size ());
+ return scm_make_real (fm->design_size ());
}
Stencil
Font_metric::get_ascii_char_stencil (int code) const
{
- SCM at = scm_list_2 (ly_symbol2scm ("char"), gh_int2scm (code));
+ SCM at = scm_list_2 (ly_symbol2scm ("char"), scm_int2num (code));
at = fontify_atom (this, at);
Box b = get_ascii_char (code);
return Stencil (b, at);
Stencil
Font_metric::get_indexed_char_stencil (int code) const
{
- SCM at = scm_list_2 (ly_symbol2scm ("char"), gh_int2scm (code));
+ SCM at = scm_list_2 (ly_symbol2scm ("char"), scm_int2num (code));
at = fontify_atom (this, at);
Box b = get_indexed_char (code);
return Stencil (b, at);
scm_makfrom0str (input_coding.to_str0 ()),
scm_makfrom0str (font_coding.to_str0 ()),
scm_int2num (code));
- return gh_scm2int (s);
+ return ly_scm2int (s);
}
{
Paper_def *pap = unsmob_paper (paper);
SCM_ASSERT_TYPE (pap, paper, SCM_ARG1, __FUNCTION__, "paper definition");
- return gh_double2scm (pap->get_dimension (name));
+ return scm_make_real (pap->get_dimension (name));
}
bool
{
SCM name = ly_assoc_chain (ly_symbol2scm ("font-name"), chain);
- if (!gh_pair_p (name) || !gh_string_p (gh_cdr (name)))
+ if (!ly_pair_p (name) || !ly_string_p (ly_cdr (name)))
{
SCM fonts = paper->lookup_variable (ly_symbol2scm ("fonts"));
name = properties_to_font_size_family (fonts, chain);
}
else
- name = gh_cdr (name);
+ name = ly_cdr (name);
- if (gh_string_p (name))
+ if (ly_string_p (name))
{
SCM mag = ly_assoc_chain (ly_symbol2scm ("font-magnification"), chain);
- Real rmag = gh_pair_p (mag) ? robust_scm2double (gh_cdr (mag), 1.0) : 1;
+ Real rmag = ly_pair_p (mag) ? robust_scm2double (ly_cdr (mag), 1.0) : 1;
Font_metric * fm = all_fonts_global->find_font (ly_scm2string (name));
SCM font_size = ly_assoc_chain (ly_symbol2scm ("font-size"), chain);
Real req = 0.0;
- if (gh_pair_p (font_size))
- req = gh_scm2double (ly_cdr (font_size));
+ if (ly_pair_p (font_size))
+ req = ly_scm2double (ly_cdr (font_size));
return get_font_by_mag_step (paper, req,
- vec, gh_scm2double (base_size));
+ vec, ly_scm2double (base_size));
}
assert (0);
if (gi.origin_trans_->daddy_context_ != daddy_context_)
return ;
- if (gh_number_p (sz) && gh_scm2double (sz))
+ if (ly_number_p (sz) && ly_scm2double (sz))
{
- Real font_size = gh_scm2double (sz);
+ Real font_size = ly_scm2double (sz);
font_size += robust_scm2double (gi.grob_->get_property ("font-size"), 0);
- gi.grob_->set_property ("font-size", gh_double2scm (font_size));
+ gi.grob_->set_property ("font-size", scm_make_real (font_size));
}
}
SCM busy = get_property ("busyGrobs");
Moment now = now_mom ();
- while (gh_pair_p (busy) && unsmob_moment (gh_caar (busy))->main_part_ == now.main_part_)
- busy = gh_cdr (busy);
+ while (ly_pair_p (busy) && unsmob_moment (ly_caar (busy))->main_part_ == now.main_part_)
+ busy = ly_cdr (busy);
- while (gh_pair_p (busy))
+ while (ly_pair_p (busy))
{
- Grob *g = unsmob_grob (gh_cdar (busy));
+ Grob *g = unsmob_grob (ly_cdar (busy));
if (Rhythmic_head::has_interface (g))
{
get_score_engraver ()->forbid_breaks ();
}
- busy = gh_cdr (busy);
+ busy = ly_cdr (busy);
}
}
if (!strlen (doc))
return ;
- if (!gh_vector_p (doc_hash_table ))
- doc_hash_table = scm_make_vector (gh_int2scm (59), SCM_EOL);
+ if (!ly_vector_p (doc_hash_table ))
+ doc_hash_table = scm_make_vector (scm_int2num (59), SCM_EOL);
String s = String (" - ") + "LilyPond procedure: " + fname + " " + varlist
+ "\n" + doc ;
scm_set_procedure_property_x (func, ly_symbol2scm ("documentation"),
scm_makfrom0str (s.to_str0 ()));
- SCM entry = gh_cons (scm_makfrom0str (varlist), scm_makfrom0str (doc));
+ SCM entry = scm_cons (scm_makfrom0str (varlist), scm_makfrom0str (doc));
scm_hashq_set_x (doc_hash_table, ly_symbol2scm (fname), entry);
}
Score_context*
Global_context::get_score_context () const
{
- return (gh_pair_p (context_list_))
- ? dynamic_cast<Score_context*> (unsmob_context (gh_car (context_list_)))
+ return (ly_pair_p (context_list_))
+ ? dynamic_cast<Score_context*> (unsmob_context (ly_car (context_list_)))
: 0;
}
{
SCM lst = get_property ("finalizations");
set_property ("finalizations" , SCM_EOL);
- for (SCM s = lst ; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = lst ; ly_pair_p (s); s = ly_cdr (s))
{
- scm_primitive_eval (gh_car (s)); // TODO: make safe.
+ scm_primitive_eval (ly_car (s)); // TODO: make safe.
}
}
if (pc->original_)
{
SCM pen = pc->get_property ("penalty");
- if (gh_number_p (pen) && fabs (gh_scm2double (pen)) < 10000)
+ if (ly_number_p (pen) && fabs (ly_scm2double (pen)) < 10000)
{
- break_penalties += gh_scm2double (pen);
+ break_penalties += ly_scm2double (pen);
}
}
/* all other combinations should be valid (unless I made a
mistake) */
- primitive->set_property ("prefix-set", gh_int2scm (prefix_set));
+ primitive->set_property ("prefix-set", scm_int2num (prefix_set));
}
}
Music *music_cause = primitives[i].music_cause ();
int context_info = 0;
int pitch = unsmob_pitch (music_cause->get_property ("pitch"))->steps ();
- int prefix_set = gh_scm2int (primitive->get_property ("prefix-set"));
+ int prefix_set = ly_scm2int (primitive->get_property ("prefix-set"));
if (prefix_set & PES_OR_FLEXA)
if (!i) // ligature may not start with 2nd head of pes or flexa
if (prev_primitive)
prev_primitive->set_property ("context-info",
- gh_int2scm (prev_context_info));
+ scm_int2num (prev_context_info));
prev_primitive = primitive;
prev_prefix_set = prefix_set;
prev_context_info = context_info;
}
if (prev_primitive)
prev_primitive->set_property ("context-info",
- gh_int2scm (prev_context_info));
+ scm_int2num (prev_context_info));
}
void
{
String str;
int prefix_set =
- gh_scm2int (primitive->get_property ("prefix-set"));
+ ly_scm2int (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);
LY_DEFINE (ly_add_interface, "ly:add-interface", 3,0,0, (SCM a, SCM b, SCM c),
"Add an interface description.")
{
- SCM_ASSERT_TYPE (gh_symbol_p (a), a, SCM_ARG1, __FUNCTION__, "symbol");
- SCM_ASSERT_TYPE (gh_string_p (b), b, SCM_ARG2, __FUNCTION__, "string");
- SCM_ASSERT_TYPE (gh_list_p (c), c, SCM_ARG3, __FUNCTION__, "list of syms");
- if (!gh_vector_p (all_ifaces))
- all_ifaces = scm_make_vector (gh_int2scm (40), SCM_EOL);
+ SCM_ASSERT_TYPE (ly_symbol_p (a), a, SCM_ARG1, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_string_p (b), b, SCM_ARG2, __FUNCTION__, "string");
+ SCM_ASSERT_TYPE (ly_list_p (c), c, SCM_ARG3, __FUNCTION__, "list of syms");
+ if (!ly_vector_p (all_ifaces))
+ all_ifaces = scm_make_vector (scm_int2num (40), SCM_EOL);
SCM entry = scm_list_n (a, b, c, SCM_UNDEFINED);
SCM ifs = me->get_property ("interfaces");
bool found = false;
- for (; !found && gh_pair_p (ifs); ifs =gh_cdr (ifs))
+ for (; !found && ly_pair_p (ifs); ifs =ly_cdr (ifs))
{
- SCM iface = scm_hashq_ref (all_ifaces , gh_car (ifs), SCM_BOOL_F);
+ SCM iface = scm_hashq_ref (all_ifaces , ly_car (ifs), SCM_BOOL_F);
if (iface == SCM_BOOL_F)
{
String msg = to_string (_f ("Unknown interface `%s'",
- ly_symbol2string (gh_car (ifs)).to_str0 ()));
+ ly_symbol2string (ly_car (ifs)).to_str0 ()));
programming_error (msg);
continue;
}
- found= found || (scm_c_memq (sym, gh_caddr (iface)) != SCM_BOOL_F);
+ found= found || (scm_c_memq (sym, ly_caddr (iface)) != SCM_BOOL_F);
}
if (!found)
2, 0 ,0, (SCM a, SCM b),
"Compare 2 grob priority queue entries. Internal")
{
- if (Moment::compare (*unsmob_moment (gh_car (a)),
- *unsmob_moment (gh_car (b))) < 0)
+ if (Moment::compare (*unsmob_moment (ly_car (a)),
+ *unsmob_moment (ly_car (b))) < 0)
return SCM_BOOL_T;
else
return SCM_BOOL_F;
Moment now = now_mom ();
SCM start_busy = get_property ("busyGrobs");
SCM busy = start_busy;
- while (gh_pair_p (busy) && *unsmob_moment (gh_caar (busy)) == now)
+ while (ly_pair_p (busy) && *unsmob_moment (ly_caar (busy)) == now)
{
- busy = gh_cdr (busy);
+ busy = ly_cdr (busy);
}
if (start_busy != busy)
SCM start_busy = get_property ("busyGrobs");
SCM busy = start_busy;
- while (gh_pair_p (busy) && *unsmob_moment (gh_caar (busy)) < now)
+ while (ly_pair_p (busy) && *unsmob_moment (ly_caar (busy)) < now)
{
/*
The grob-pq-engraver is not water tight, and stuff like
tupletSpannerDuration confuses it.
*/
- busy = gh_cdr (busy);
+ busy = ly_cdr (busy);
}
if (start_busy != busy)
if (handle != SCM_BOOL_F)
{
- gh_set_cdr_x (handle, gh_cons (thing, gh_cdr (handle)));
+ scm_set_cdr_x (handle, scm_cons (thing, ly_cdr (handle)));
}
else
{
mutable prop list.
*/
handle = scm_sloppy_assq (sym, immutable_property_alist_);
- SCM tail = (handle != SCM_BOOL_F) ? gh_cdr (handle) : SCM_EOL;
- SCM val = gh_cons (thing, tail);
+ SCM tail = (handle != SCM_BOOL_F) ? ly_cdr (handle) : SCM_EOL;
+ SCM val = scm_cons (thing, tail);
- mutable_property_alist_ = gh_cons (gh_cons (sym, val),
+ mutable_property_alist_ = scm_cons (scm_cons (sym, val),
mutable_property_alist_);
}
}
s = scm_sloppy_assq (sym, immutable_property_alist_);
- if (internal_type_checking_global_b && gh_pair_p (s))
+ if (internal_type_checking_global_b && ly_pair_p (s))
{
- if (!type_check_assignment (sym, gh_cdr (s),
+ if (!type_check_assignment (sym, ly_cdr (s),
ly_symbol2scm ("backend-type?")))
abort ();
{
Grob * sc = unsmob_grob (grob);
SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
- SCM_ASSERT_TYPE (gh_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
if (!type_check_assignment (sym, val, ly_symbol2scm ("backend-type?")))
error ("typecheck failed");
{
Grob *sc = unsmob_grob (grob);
SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
- SCM_ASSERT_TYPE (gh_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
return sc->internal_get_property (sym);
}
SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
- return ly_interval2scm ( sc->extent (ref, Axis (gh_scm2int (axis))));
+ return ly_interval2scm ( sc->extent (ref, Axis (ly_scm2int (axis))));
}
LY_DEFINE (ly_get_parent, "ly:grob-parent", 2, 0, 0, (SCM grob, SCM axis),
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 (gh_scm2int (axis)));
+ Grob *par = sc->get_parent (Axis (ly_scm2int (axis)));
return par ? par->self_scm () : SCM_EOL;
}
SCM s = SCM_EOL;
for (int i = me->broken_intos_.size (); i--;)
- s = gh_cons (me->broken_intos_[i]->self_scm (), s);
+ s = scm_cons (me->broken_intos_[i]->self_scm (), s);
return s;
}
{
Grob *me = unsmob_grob (g);
SCM_ASSERT_TYPE (me, g, SCM_ARG1, __FUNCTION__, "grob");
- SCM_ASSERT_TYPE (gh_number_p (d), d, SCM_ARG2, __FUNCTION__, "dimension");
+ SCM_ASSERT_TYPE (ly_number_p (d), d, SCM_ARG2, __FUNCTION__, "dimension");
SCM_ASSERT_TYPE (is_axis (a), a, SCM_ARG3, __FUNCTION__, "axis");
- me->translate_axis (gh_scm2double (d), Axis (gh_scm2int (a)));
+ me->translate_axis (ly_scm2double (d), Axis (ly_scm2int (a)));
return SCM_UNDEFINED;
}
Grob *me = unsmob_grob (g);
bool b = dynamic_cast<Spanner*> (me);
- return gh_bool2scm (b);
+ return ly_bool2scm (b);
}
LY_DEFINE (ly_item_p, "ly:item?",
{
Grob *me = unsmob_grob (g);
bool b = dynamic_cast<Item*> (me);
- return gh_bool2scm (b);
+ return ly_bool2scm (b);
}
LY_DEFINE (ly_item_break_dir, "ly:item-break-dir",
{
Item *me = dynamic_cast<Item*> (unsmob_grob (it));
SCM_ASSERT_TYPE (me, it, SCM_ARG1, __FUNCTION__, "Item");
- return gh_int2scm (me->break_status_dir ());
+ return scm_int2num (me->break_status_dir ());
}
#endif
SCM meta = get_property ("meta");
- if (gh_pair_p (meta))
+ if (ly_pair_p (meta))
{
SCM ifs = scm_assoc (ly_symbol2scm ("interfaces"), meta);
*/
bool itc = internal_type_checking_global_b;
internal_type_checking_global_b = false;
- internal_set_property (ly_symbol2scm ("interfaces"), gh_cdr (ifs));
+ internal_set_property (ly_symbol2scm ("interfaces"), ly_cdr (ifs));
internal_type_checking_global_b = itc;
}
if (is_number_pair (xt))
cb = xt;
else if (cb != SCM_BOOL_F
- && !gh_procedure_p (cb) && !gh_pair_p (cb)
- && gh_procedure_p (get_property ("print-function")))
+ && !ly_procedure_p (cb) && !ly_pair_p (cb)
+ && ly_procedure_p (get_property ("print-function")))
cb = stencil_extent_proc;
dim_cache_[a].dimension_ = cb;
Grob::stencil_extent (SCM element_smob, SCM scm_axis)
{
Grob *s = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (scm_axis);
+ Axis a = (Axis) ly_scm2int (scm_axis);
Stencil *m = s->get_stencil ();
Interval e ;
status_= busy;
- for (SCM d = get_property ("dependencies"); gh_pair_p (d);
+ for (SCM d = get_property ("dependencies"); ly_pair_p (d);
d = ly_cdr (d))
{
unsmob_grob (ly_car (d))
SCM proc = internal_get_property (funcname);
- if (gh_procedure_p (proc))
- gh_call1 (proc, this->self_scm ());
+ if (ly_procedure_p (proc))
+ scm_call_1 (proc, this->self_scm ());
status_= final;
}
SCM proc = get_property ("print-function");
SCM mol = SCM_EOL;
- if (gh_procedure_p (proc))
- mol = gh_apply (proc, scm_list_n (this->self_scm (), SCM_UNDEFINED));
+ if (ly_procedure_p (proc))
+ mol = scm_apply_0 (proc, scm_list_n (this->self_scm (), SCM_UNDEFINED));
Stencil *m = unsmob_stencil (mol);
because some Spanners have enormously long lists in their
properties.
*/
- for (SCM s = mutable_property_alist_; gh_pair_p (s);
- s = gh_cdr (s))
+ for (SCM s = mutable_property_alist_; ly_pair_p (s);
+ s = ly_cdr (s))
{
- sp->substitute_one_mutable_property (gh_caar (s),
- gh_cdar (s));
+ sp->substitute_one_mutable_property (ly_caar (s),
+ ly_cdar (s));
}
}
if (original_)
{
Item * it = dynamic_cast<Item*> (this);
- substitute_mutable_properties (gh_int2scm (it->break_status_dir ()),
+ substitute_mutable_properties (scm_int2num (it->break_status_dir ()),
original_->mutable_property_alist_);
}
}
while (dim_cache_[a].offsets_left_)
{
int l = --me->dim_cache_[a].offsets_left_;
- SCM cb = scm_list_ref (dim_cache_[a].offset_callbacks_, gh_int2scm (l));
- SCM retval = gh_call2 (cb, self_scm (), gh_int2scm (a));
+ 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 = gh_scm2double (retval);
+ Real r = ly_scm2double (retval);
if (isinf (r) || isnan (r))
{
programming_error (INFINITY_MSG);
bool
Grob::is_empty (Axis a)const
{
- return ! (gh_pair_p (dim_cache_[a].dimension_) ||
- gh_procedure_p (dim_cache_[a].dimension_));
+ return ! (ly_pair_p (dim_cache_[a].dimension_) ||
+ ly_procedure_p (dim_cache_[a].dimension_));
}
Interval
Dimension_cache * d = (Dimension_cache *)&dim_cache_[a];
Interval ext ;
- if (gh_pair_p (d->dimension_))
+ if (ly_pair_p (d->dimension_))
;
- else if (gh_procedure_p (d->dimension_))
+ else if (ly_procedure_p (d->dimension_))
{
/*
FIXME: add doco on types, and should typecheck maybe?
*/
- d->dimension_= gh_call2 (d->dimension_, self_scm (), gh_int2scm (a));
+ d->dimension_= scm_call_2 (d->dimension_, self_scm (), scm_int2num (a));
}
else
return ext;
- if (!gh_pair_p (d->dimension_))
+ if (!ly_pair_p (d->dimension_))
return ext;
ext = ly_scm2interval (d->dimension_);
/*
signs ?
*/
- if (gh_pair_p (extra))
+ if (ly_pair_p (extra))
{
- ext[BIGGER] += gh_scm2double (ly_cdr (extra));
- ext[SMALLER] += gh_scm2double (ly_car (extra));
+ ext[BIGGER] += ly_scm2double (ly_cdr (extra));
+ ext[SMALLER] += ly_scm2double (ly_car (extra));
}
extra = get_property (a == X_AXIS
? "minimum-X-extent"
: "minimum-Y-extent");
- if (gh_pair_p (extra))
+ if (ly_pair_p (extra))
{
- ext.unite (Interval (gh_scm2double (ly_car (extra)),
- gh_scm2double (ly_cdr (extra))));
+ ext.unite (Interval (ly_scm2double (ly_car (extra)),
+ ly_scm2double (ly_cdr (extra))));
}
ext.translate (x);
Grob *
common_refpoint_of_list (SCM elist, Grob *common, Axis a)
{
- for (; gh_pair_p (elist); elist = ly_cdr (elist))
+ for (; ly_pair_p (elist); elist = ly_cdr (elist))
{
Grob * s = unsmob_grob (ly_car (elist));
if (!s)
{
SCM meta = get_property ("meta");
SCM nm = scm_assoc (ly_symbol2scm ("name"), meta);
- nm = (gh_pair_p (nm)) ? ly_cdr (nm) : SCM_EOL;
- return gh_symbol_p (nm) ? ly_symbol2string (nm) : classname (this);
+ nm = (ly_pair_p (nm)) ? ly_cdr (nm) : SCM_EOL;
+ return ly_symbol_p (nm) ? ly_symbol2string (nm) : classname (this);
}
void
{
if (!has_offset_callback (cb, a))
{
- dim_cache_[a].offset_callbacks_ = gh_cons (cb, dim_cache_[a].offset_callbacks_);
+ dim_cache_[a].offset_callbacks_ = scm_cons (cb, dim_cache_[a].offset_callbacks_);
dim_cache_[a].offsets_left_ ++;
}
}
{
Link_array<Grob> arr;
- for (SCM s = l; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = l; ly_pair_p (s); s = ly_cdr (s))
{
- SCM e = gh_car (s);
+ SCM e = ly_car (s);
arr.push (unsmob_grob (e));
}
{
SCM s = SCM_EOL;
for (int i = a.size (); i; i--)
- s = gh_cons (a[i-1]->self_scm (), s);
+ s = scm_cons (a[i-1]->self_scm (), s);
return s;
}
/*
Ugh. property name is not general.
*/
- Real padding = gh_scm2double (me->get_property ("if-text-padding"));
+ Real padding = ly_scm2double (me->get_property ("if-text-padding"));
Drul_array<bool> broken;
Drul_array<Item*> bounds ;
Hara_kiri_group_spanner::y_extent (SCM element_smob, SCM scm_axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (scm_axis);
+ Axis a = (Axis) ly_scm2int (scm_axis);
assert (a == Y_AXIS);
consider_suicide (me);
{
Spanner*sp = dynamic_cast<Spanner*> (me);
SCM worth = me->get_property ("items-worth-living");
- if (gh_pair_p (worth))
+ if (ly_pair_p (worth))
return ;
if (!to_boolean (me->get_property ("remove-first"))
Hara_kiri_group_spanner::force_hara_kiri_callback (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (axis);
+ Axis a = (Axis) ly_scm2int (axis);
assert (a == Y_AXIS);
consider_suicide (me);
- return gh_double2scm (0.0);
+ 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) gh_scm2int (axis);
+ Axis a = (Axis) ly_scm2int (axis);
assert (a == Y_AXIS);
force_hara_kiri_callback (daughter->get_parent (a)->self_scm (), axis);
- return gh_double2scm (0.0);
+ return scm_make_real (0.0);
}
void
if (!sp->get_bound (RIGHT))
{
SCM heads = sp->get_property ("heads");
- if (gh_pair_p (heads))
+ if (ly_pair_p (heads))
{
- Item* it = dynamic_cast<Item*> (unsmob_grob (gh_car (heads)));
+ Item* it = dynamic_cast<Item*> (unsmob_grob (ly_car (heads)));
if (it)
sp->set_bound (RIGHT, it);
}
{
Link_array<T> arr;
- for (SCM s = elt->get_property (name); gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = elt->get_property (name); ly_pair_p (s); s = ly_cdr (s))
{
- SCM e = gh_car (s);
+ SCM e = ly_car (s);
arr.push (dynamic_cast<T*> (unsmob_grob (e)));
}
#define LILY_GUILE_HH
-/*
- TODO: the GH interface is deprecated as of GUILE 1.6
-
- Remove all gh_XXX functions.
- */
-#include <guile/gh.h>
-
-
/* GUILE only includes version in headers (libguile/version.h) as of
1.5.x. For some strange reason, they call it SCM.*VERSION.
#define scm_t_bits scm_bits_t
-#define fix_guile_1_4_gh_scm2newstr(str, lenp) gh_scm2newstr (str, (int*)lenp)
-#define gh_scm2newstr(str, lenp) fix_guile_1_4_gh_scm2newstr (str, lenp)
-
#define fix_guile_1_4_scm_primitive_eval(form) scm_eval_3 (form, 1, SCM_EOL)
#define scm_primitive_eval(form) fix_guile_1_4_scm_primitive_eval (form)
return scm_make_vector (SCM_MAKINUM (k), val);
}
#define scm_c_define_gsubr scm_make_gsubr
-#define scm_c_eval_string(str) gh_eval_str ((char*)str)
#define scm_remember_upto_here_1(s) scm_remember (&s)
#define scm_gc_protect_object scm_protect_object
#define scm_gc_unprotect_object scm_unprotect_object
/*
- Using this trick we cache the value of gh_symbol2scm ("fooo") where
+ Using this trick we cache the value of scm_str2symbol ("fooo") where
"fooo" is a constant string. This is done at the cost of one static
variable per ly_symbol2scm() use, and one boolean evaluation for
every call.
SCM value = cached; /* We store this one locally, since G++ -O2 fucks up else */ \
if ( __builtin_constant_p ((x)))\
{ if (!cached)\
- value = cached = scm_gc_protect_object (gh_symbol2scm((x)));\
+ value = cached = scm_gc_protect_object (scm_str2symbol((x)));\
} else\
- value = gh_symbol2scm ((char*) (x)); \
+ value = scm_str2symbol ((char*) (x)); \
value; })
#else
-inline SCM ly_symbol2scm(char const* x) { return gh_symbol2scm((x)); }
+inline SCM ly_symbol2scm(char const* x) { return scm_str2symbol((x)); }
#endif
extern SCM global_lily_module;
SCM value = cached; /* We store this one locally, since G++ -O2 fucks up else */ \
if ( __builtin_constant_p ((x)))\
{ if (!cached)\
- value = cached = scm_gc_protect_object (scm_eval(gh_symbol2scm (x), global_lily_module));\
+ value = cached = scm_gc_protect_object (scm_eval(scm_str2symbol (x), global_lily_module));\
} else\
- value = scm_eval(gh_symbol2scm (x), global_lily_module);\
+ value = scm_eval(scm_str2symbol (x), global_lily_module);\
value; })
Drul_array<Real> ly_scm2realdrul (SCM);
Slice int_list_to_slice (SCM l);
SCM ly_interval2scm (Drul_array<Real>);
+char *ly_scm2newstr (SCM str, size_t *lenp);
Real robust_scm2double (SCM, double);
int robust_scm2int (SCM, int);
inline SCM ly_caddr (SCM x) { return SCM_CADDR (x); }
inline SCM ly_cdadr (SCM x) { return SCM_CDADR (x); }
inline SCM ly_caadr (SCM x) { return SCM_CAADR (x); }
+inline SCM ly_cadar (SCM x) { return SCM_CADAR (x); }
/* inserts at front, removing dublicates */
inline SCM ly_assoc_front_x(SCM alist, SCM key, SCM val)
{
return scm_acons(key, val, scm_assoc_remove_x (alist, key));
}
-#ifdef PARANOID
-#define gh_pair_p ly_pair_p
-bool ly_pair_p (SCM x);
-#else
inline bool ly_pair_p (SCM x) { return SCM_NFALSEP (scm_pair_p (x)); }
-#endif
inline bool ly_symbol_p (SCM x) { return SCM_SYMBOLP (x); }
+inline bool ly_boolean_p (SCM x) { return SCM_BOOLP (x); }
+inline bool ly_char_p (SCM x) { return SCM_CHARP (x); }
inline bool ly_number_p (SCM x) { return SCM_NUMBERP (x); }
+inline bool ly_string_p (SCM x) { return SCM_STRINGP (x); }
+inline bool ly_vector_p (SCM x) { return SCM_VECTORP (x); }
+inline bool ly_list_p (SCM x) { return SCM_NFALSEP (scm_list_p (x)); }
inline bool ly_procedure_p (SCM x) { return SCM_NFALSEP (scm_procedure_p (x)); }
+inline bool ly_eq_p (SCM x, SCM y) { return SCM_EQ_P (x, y); }
+inline bool ly_equal_p (SCM x, SCM y) {
+ return SCM_NFALSEP (scm_equal_p (x, y));
+}
+
+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");
+}
+inline unsigned long ly_vector_length (SCM x) { return SCM_VECTOR_LENGTH (x); }
+
+inline SCM ly_bool2scm (bool x) { return SCM_BOOL (x); }
+
+inline SCM ly_append2 (SCM x1, SCM x2) {
+ return scm_append (scm_listify (x1, x2, SCM_UNDEFINED));
+}
+inline SCM ly_append3 (SCM x1, SCM x2, SCM x3) {
+ return scm_append (scm_listify (x1, x2, x3, SCM_UNDEFINED));
+}
+inline SCM ly_append4 (SCM x1, SCM x2, SCM x3, SCM x4) {
+ return scm_append (scm_listify (x1, x2, x3, x4, SCM_UNDEFINED));
+}
/*
display and print newline.
void \
TYPE ## _ ## FUNC ## _init_functions () \
{ \
- TYPE :: FUNC ## _proc = gh_new_procedure ## ARGCOUNT ## _0 (#TYPE "::" #FUNC, \
- ((Scheme_function_ ## ARGCOUNT)TYPE :: FUNC)); \
+ TYPE :: FUNC ## _proc = scm_c_define_gsubr (#TYPE "::" #FUNC, \
+ (ARGCOUNT), 0, 0, \
+ (Scheme_function_unknown)TYPE :: FUNC); \
scm_c_export (#TYPE "::" #FUNC, NULL);\
} \
\
{ \
CL * ptr = new CL (*this);\
SCM s; \
- s = gh_cons (SCM_PACK (CL::smob_tag_), SCM_PACK (ptr)); \
+ s = scm_cons (SCM_PACK (CL::smob_tag_), SCM_PACK (ptr)); \
scm_gc_register_collectable_memory ((CL*)this, sizeof (CL), #CL " smob"); \
\
return s; \
*/
SCM val = SCM_BOOL_F;
if (ly_symbol2scm ("line-column") == what)
- val = gh_eval_str ("line-column-location");
+ val = scm_c_eval_string ("line-column-location");
else if (what == ly_symbol2scm ("line"))
- val = gh_eval_str ("line-location");
+ val = scm_c_eval_string ("line-location");
scm_module_define (global_lily_module, ly_symbol2scm ("point-and-click"), val);
- store_locations_global_b =gh_procedure_p (val);
+ store_locations_global_b =ly_procedure_p (val);
return SCM_UNSPECIFIED;
}
{
Input *ip = unsmob_input (sip);
SCM_ASSERT_TYPE (ip, sip, SCM_ARG1, __FUNCTION__, "input location");
- SCM_ASSERT_TYPE (gh_string_p (msg), msg, SCM_ARG2, __FUNCTION__, "string");
+ SCM_ASSERT_TYPE (ly_string_p (msg), msg, SCM_ARG2, __FUNCTION__, "string");
String m = ly_scm2string (msg);
ip->message (m);
&& Axis_group_interface::has_axis (i.grob_, Y_AXIS)))
&& !Align_interface::has_interface (i.grob_))
{
- SCM nl = gh_cons (i.grob_->self_scm (),
+ SCM nl = scm_cons (i.grob_->self_scm (),
get_property ("instrumentSupport"));
daddy_context_->set_property ("instrumentSupport", nl);
Also create text if barlines in other groups. This allows
a name to be attached to lyrics or chords.
*/
- if (gh_string_p (get_property ("whichBar")))
+ if (ly_string_p (get_property ("whichBar")))
create_text ();
}
more complicated things.
*/
SCM vis = get_property ("break-visibility");
- if (gh_procedure_p (vis))
+ if (ly_procedure_p (vis))
{
- SCM args = scm_list_n (gh_int2scm (break_status_dir ()), SCM_UNDEFINED);
- SCM result = gh_apply (vis, args);
- bool trans = gh_scm2bool (ly_car (result));
- bool empty = gh_scm2bool (ly_cdr (result));
+ SCM args = scm_list_n (scm_int2num (break_status_dir ()), SCM_UNDEFINED);
+ SCM result = scm_apply_0 (vis, args);
+ bool trans = ly_scm2bool (ly_car (result));
+ bool empty = ly_scm2bool (ly_cdr (result));
if (empty && trans)
suicide ();
if (!def)
{
SCM vis = get_property ("explicitKeySignatureVisibility");
- if (gh_procedure_p (vis))
+ if (ly_procedure_p (vis))
item_->set_property ("break-visibility",vis);
}
}
}
}
else if (Bar_line::has_interface (info.grob_)
- && gh_pair_p (get_property ("keySignature")))
+ && ly_pair_p (get_property ("keySignature")))
{
create_key (true);
}
Key_engraver::read_ev (Music const * r)
{
SCM p = r->get_property ("pitch-alist");
- if (!gh_pair_p (p))
+ if (!ly_pair_p (p))
return;
SCM n = scm_list_copy (p);
SCM accs = SCM_EOL;
for (SCM s = get_property ("keyAccidentalOrder");
- gh_pair_p (s); s = ly_cdr (s))
+ ly_pair_p (s); s = ly_cdr (s))
{
- if (gh_pair_p (scm_member (ly_car (s), n)))
+ if (ly_pair_p (scm_member (ly_car (s), n)))
{
- accs = gh_cons (ly_car (s), accs);
+ accs = scm_cons (ly_car (s), accs);
n = scm_delete_x (ly_car (s), n);
}
}
- for (SCM s = n ; gh_pair_p (s); s = ly_cdr (s))
- if (gh_scm2int (ly_cdar (s)))
- accs = gh_cons (ly_car (s), accs);
+ for (SCM s = n ; ly_pair_p (s); s = ly_cdr (s))
+ if (ly_scm2int (ly_cdar (s)))
+ accs = scm_cons (ly_car (s), accs);
daddy_context_->set_property ("keySignature", accs);
daddy_context_->set_property ("tonic" ,
SCM pitchlist = key_req_->get_property ("pitch-alist");
SCM proc = ly_scheme_function ("alterations-in-key");
- SCM acc = gh_call1 (proc, pitchlist);
+ SCM acc = scm_call_1 (proc, pitchlist);
Pitch key_do (0,
- gh_scm2int (ly_caar (pitchlist)),
- gh_scm2int (ly_cdar (pitchlist)));
+ ly_scm2int (ly_caar (pitchlist)),
+ ly_scm2int (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 (gh_scm2int (acc),
+ audio_ = new Audio_key (ly_scm2int (acc),
SCM_BOOL_T != scm_equal_p (minor, c_pitchlist));
Audio_element_info info (audio_, key_req_);
int
alteration_pos (SCM what, int alter, int c0p)
{
- if (gh_pair_p (what))
- return gh_scm2int (ly_car (what)) * 7 + gh_scm2int (ly_cdr (what)) + c0p;
+ if (ly_pair_p (what))
+ return ly_scm2int (ly_car (what)) * 7 + ly_scm2int (ly_cdr (what)) + c0p;
- int p = gh_scm2int (what);
+ int p = ly_scm2int (what);
// Find the c in the range -4 through 2
int from_bottom_pos = c0p + 4;
SCM scm_style = me->get_property ("style");
String style;
- if (gh_symbol_p (scm_style))
+ if (ly_symbol_p (scm_style))
{
style = ly_symbol2string (scm_style);
}
SCM c0s = me->get_property ("c0-position");
int c0p = 0;
- if (gh_number_p (c0s))
- c0p = gh_scm2int (c0s);
+ if (ly_number_p (c0s))
+ c0p = ly_scm2int (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; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = newas; ly_pair_p (s); s = ly_cdr (s))
{
- int alteration = gh_scm2int (ly_cdar (s));
+ int alteration = ly_scm2int (ly_cdar (s));
String font_char =
Accidental_interface::get_fontcharname (style, alteration);
Stencil acc (fm->find_by_name ("accidentals-" + font_char));
mol.add_at_edge (X_AXIS, LEFT, Lookup::blank (Box (x,y)), 0, 0);
Stencil natural;
- if (gh_pair_p (old))
+ if (ly_pair_p (old))
natural=Font_interface::get_default_font (me)->
find_by_name (String ("accidentals-") + style + String ("0"));
- for (; gh_pair_p (old); old = ly_cdr (old))
+ for (; ly_pair_p (old); old = ly_cdr (old))
{
SCM found = scm_assoc (ly_caar (old), newas);
if (found == SCM_BOOL_F
"Read the file @var{name}, and return its contents in a string. "
"The file is looked up using the search path and kpathsea.")
{
- SCM_ASSERT_TYPE (gh_string_p (name), name, SCM_ARG1, __FUNCTION__, "string");
+ SCM_ASSERT_TYPE (ly_string_p (name), name, SCM_ARG1, __FUNCTION__, "string");
return scm_makfrom0str
(kpathsea_gulp_file_to_string (ly_scm2string (name)).to_str0 ());
}
progress_indication ("\n");
progress_indication (_f ("input renamed to: `%s'", s.to_str0 ()));
progress_indication ("\n");
- scm_module_define (gh_car (scopes_),
+ scm_module_define (ly_car (scopes_),
ly_symbol2scm ("input-file-name"),
scm_makfrom0str (s.to_str0()));
s = s.left_string (s.length () - 1);
SCM sid = lookup_identifier (s);
- if (gh_string_p (sid)) {
+ if (ly_string_p (sid)) {
new_input (ly_scm2string (sid), &global_input_file->sources_);
yy_pop_state ();
} else {
String str (YYText () + 1);
SCM s = lookup_markup_command (str);
- if (gh_pair_p (s) && gh_symbol_p (gh_cdr (s)) ) {
- yylval.scm = gh_car(s);
- SCM tag = gh_cdr(s);
+ if (ly_pair_p (s) && ly_symbol_p (ly_cdr (s)) ) {
+ yylval.scm = ly_car(s);
+ SCM tag = ly_cdr(s);
if (tag == ly_symbol2scm("markup0"))
return MARKUP_HEAD_MARKUP0;
if (tag == ly_symbol2scm("empty"))
int cnv=sscanf (YYText (), "%lf", &r);
assert (cnv == 1);
- yylval.scm = gh_double2scm (r);
+ yylval.scm = scm_make_real (r);
return REAL;
}
void
My_lily_lexer::push_note_state (SCM tab)
{
- pitchname_tab_stack_ = gh_cons (tab, pitchname_tab_stack_);
+ pitchname_tab_stack_ = scm_cons (tab, pitchname_tab_stack_);
yy_push_state (notes);
}
void
My_lily_lexer::push_chord_state (SCM tab)
{
- pitchname_tab_stack_ = gh_cons (tab, pitchname_tab_stack_);
+ pitchname_tab_stack_ = scm_cons (tab, pitchname_tab_stack_);
yy_push_state (chords);
}
My_lily_lexer::pop_state ()
{
if (YYSTATE == notes || YYSTATE == chords)
- pitchname_tab_stack_ = gh_cdr (pitchname_tab_stack_);
+ pitchname_tab_stack_ = ly_cdr (pitchname_tab_stack_);
yy_pop_state ();
}
SCM sym = ly_symbol2scm (str.to_str0 ());
if ((YYSTATE == notes) || (YYSTATE == chords)) {
SCM handle = SCM_BOOL_F;
- if (gh_pair_p (pitchname_tab_stack_))
- handle = scm_hashq_get_handle (gh_car (pitchname_tab_stack_), sym);
+ if (ly_pair_p (pitchname_tab_stack_))
+ handle = scm_hashq_get_handle (ly_car (pitchname_tab_stack_), sym);
- if (gh_pair_p (handle)) {
+ if (ly_pair_p (handle)) {
yylval.scm = ly_cdr (handle);
if (unsmob_pitch (yylval.scm))
return (YYSTATE == notes) ? NOTENAME_PITCH : TONICNAME_PITCH;
- else if (gh_symbol_p (yylval.scm))
+ else if (ly_symbol_p (yylval.scm))
return DRUM_PITCH;
}
else if ((handle = scm_hashq_get_handle (chordmodifier_tab_, sym))!= SCM_BOOL_F)
int n = String_convert::dec2int (left);
int d = String_convert::dec2int (right);
- return gh_cons (gh_int2scm (n), gh_int2scm (d));
+ return scm_cons (scm_int2num (n), scm_int2num (d));
}
// Breaks for flex 2.5.31
SCM write = scm_primitive_eval (ly_symbol2scm ("write"));
// scm_apply (write, port, SCM_EOL);
- gh_call2 (write, s, port);
+ scm_call_2 (write, s, port);
return scm_strport_to_string (port);
}
String
ly_symbol2string (SCM s)
{
- assert (gh_symbol_p (s));
+ assert (ly_symbol_p (s));
return String ((Byte*)SCM_STRING_CHARS (s), (int) SCM_STRING_LENGTH (s));
}
"Read the file @var{name}, and return its contents in a string. "
"The file is looked up using the search path.")
{
- SCM_ASSERT_TYPE (gh_string_p (name), name, SCM_ARG1, __FUNCTION__, "string");
+ SCM_ASSERT_TYPE (ly_string_p (name), name, SCM_ARG1, __FUNCTION__, "string");
return scm_makfrom0str (gulp_file_to_string (ly_scm2string (name)).to_str0 ());
}
void
ly_display_scm (SCM s)
{
- gh_display (s);
- gh_newline ();
+ scm_display (s, scm_current_output_port ());
+ scm_newline (scm_current_output_port ());
}
};
String
ly_scm2string (SCM s)
{
- assert (gh_string_p (s));
+ assert (ly_string_p (s));
char *p = SCM_STRING_CHARS (s);
String r (p);
return r;
}
+char *
+ly_scm2newstr (SCM str, size_t *lenp)
+{
+ char *new_str;
+ size_t len;
+
+ SCM_ASSERT_TYPE (ly_string_p (str), str, SCM_ARG1, __FUNCTION__, "string");
+
+ len = SCM_STRING_LENGTH (str);
+ new_str = (char *) malloc ((len + 1) * sizeof (char));
+
+ if (new_str == NULL)
+ return NULL;
+
+ memcpy (new_str, SCM_STRING_CHARS (str), len);
+ new_str[len] = '\0';
+
+ if (lenp != NULL)
+ *lenp = len;
+
+ return new_str;
+}
+
SCM
index_get_cell (SCM s, Direction d)
{
index_set_cell (SCM s, Direction d, SCM v)
{
if (d == LEFT)
- gh_set_car_x (s, v);
+ scm_set_car_x (s, v);
else if (d == RIGHT)
- gh_set_cdr_x (s, v);
+ scm_set_cdr_x (s, v);
return s;
}
LY_DEFINE (ly_warning,"ly:warn", 1, 0, 0,
(SCM str), "Scheme callable function to issue the warning @code{msg}.")
{
- SCM_ASSERT_TYPE (gh_string_p (str), str, SCM_ARG1, __FUNCTION__, "string");
+ SCM_ASSERT_TYPE (ly_string_p (str), str, SCM_ARG1, __FUNCTION__, "string");
progress_indication ("\n");
warning ("lily-guile: " + ly_scm2string (str));
return SCM_BOOL_T;
"@code{1}, where @code{-1} represents "
"left or down and @code{1} represents right or up.")
{
- if (gh_number_p (s))
+ if (ly_number_p (s))
{
- int i = gh_scm2int (s);
+ int i = ly_scm2int (s);
return (i>= -1 && i <= 1) ? SCM_BOOL_T : SCM_BOOL_F;
}
return SCM_BOOL_F;
bool
is_number_pair (SCM p)
{
- return gh_pair_p (p) && gh_number_p (ly_car (p)) && gh_number_p (ly_cdr (p));
+ return ly_pair_p (p) && ly_number_p (ly_car (p)) && ly_number_p (ly_cdr (p));
}
typedef void (*Void_fptr) ();
bool
is_direction (SCM s)
{
- if (gh_number_p (s))
+ if (ly_number_p (s))
{
- int i = gh_scm2int (s);
+ int i = ly_scm2int (s);
return i>= -1 && i <= 1;
}
return false;
bool
is_axis (SCM s)
{
- if (gh_number_p (s))
+ if (ly_number_p (s))
{
- int i = gh_scm2int (s);
+ int i = ly_scm2int (s);
return i== 0 || i == 1;
}
return false;
Direction
to_dir (SCM s)
{
- return SCM_INUMP (s) ? (Direction) gh_scm2int (s) : CENTER;
+ return SCM_INUMP (s) ? (Direction) ly_scm2int (s) : CENTER;
}
Interval
ly_scm2interval (SCM p)
{
- return Interval (gh_scm2double (ly_car (p)), gh_scm2double (ly_cdr (p)));
+ return Interval (ly_scm2double (ly_car (p)), ly_scm2double (ly_cdr (p)));
}
Drul_array<Real>
ly_scm2realdrul (SCM p)
{
- return Drul_array<Real> (gh_scm2double (ly_car (p)),
- gh_scm2double (ly_cdr (p)));
+ return Drul_array<Real> (ly_scm2double (ly_car (p)),
+ ly_scm2double (ly_cdr (p)));
}
SCM
ly_interval2scm (Drul_array<Real> i)
{
- return gh_cons (gh_double2scm (i[LEFT]), gh_double2scm (i[RIGHT]));
+ return scm_cons (scm_make_real (i[LEFT]), scm_make_real (i[RIGHT]));
}
bool
to_boolean (SCM s)
{
- return gh_boolean_p (s) && gh_scm2bool (s);
+ return ly_boolean_p (s) && ly_scm2bool (s);
}
/* Appendable list L: the cdr contains the list, the car the last cons
SCM
appendable_list ()
{
- SCM s = gh_cons (SCM_EOL, SCM_EOL);
- gh_set_car_x (s, s);
+ SCM s = scm_cons (SCM_EOL, SCM_EOL);
+ scm_set_car_x (s, s);
return s;
}
void
appendable_list_append (SCM l, SCM elt)
{
- SCM newcons = gh_cons (elt, SCM_EOL);
+ SCM newcons = scm_cons (elt, SCM_EOL);
- gh_set_cdr_x (ly_car (l), newcons);
- gh_set_car_x (l, newcons);
+ scm_set_cdr_x (ly_car (l), newcons);
+ scm_set_car_x (l, newcons);
}
SCM
ly_offset2scm (Offset o)
{
- return gh_cons (gh_double2scm (o[X_AXIS]), gh_double2scm (o[Y_AXIS]));
+ return scm_cons (scm_make_real (o[X_AXIS]), scm_make_real (o[Y_AXIS]));
}
Offset
ly_scm2offset (SCM s)
{
- return Offset (gh_scm2double (ly_car (s)),
- gh_scm2double (ly_cdr (s)));
+ return Offset (ly_scm2double (ly_car (s)),
+ ly_scm2double (ly_cdr (s)));
}
1, 0, 0, (SCM s),
"Convert @var{num} to a string without generating many decimals.")
{
- SCM_ASSERT_TYPE (gh_number_p (s), s, SCM_ARG1, __FUNCTION__, "number");
+ SCM_ASSERT_TYPE (ly_number_p (s), s, SCM_ARG1, __FUNCTION__, "number");
char str[400]; // ugh.
if (scm_exact_p (s) == SCM_BOOL_F)
{
- Real r (gh_scm2double (s));
+ Real r (ly_scm2double (s));
if (my_isinf (r) || my_isnan (r))
{
sprintf (str, "%08.4f", r);
}
else
- sprintf (str, "%d", gh_scm2int (s));
+ sprintf (str, "%d", ly_scm2int (s));
return scm_makfrom0str (str);
}
{
char const* vs = "\'(" MAJOR_VERSION " " MINOR_VERSION " " PATCH_LEVEL " " MY_PATCH_LEVEL ")" ;
- return gh_eval_str ((char*)vs);
+ return scm_c_eval_string ((char*)vs);
}
LY_DEFINE (ly_unit, "ly:unit", 0, 0, 0, (),
SCM
ly_deep_copy (SCM src)
{
- if (gh_pair_p (src))
- return gh_cons (ly_deep_copy (ly_car (src)), ly_deep_copy (ly_cdr (src)));
- else if (gh_vector_p (src))
+ if (ly_pair_p (src))
+ return scm_cons (ly_deep_copy (ly_car (src)), ly_deep_copy (ly_cdr (src)));
+ else if (ly_vector_p (src))
{
int len = SCM_VECTOR_LENGTH (src);
SCM nv = scm_c_make_vector (len, SCM_UNDEFINED);
for (int i =0 ; i < len ; i++)
{
- SCM si = gh_int2scm (i);
+ SCM si = scm_int2num (i);
scm_vector_set_x (nv, si, ly_deep_copy (scm_vector_ref (src, si)));
}
}
SCM
ly_assoc_chain (SCM key, SCM achain)
{
- if (gh_pair_p (achain))
+ if (ly_pair_p (achain))
{
SCM handle = scm_assoc (key, ly_car (achain));
- if (gh_pair_p (handle))
+ if (ly_pair_p (handle))
return handle;
else
return ly_assoc_chain (key, ly_cdr (achain));
SCM
ly_assoc_cdr (SCM key, SCM alist)
{
- if (gh_pair_p (alist))
- {
- SCM trykey = ly_caar (alist);
- if (gh_pair_p (trykey) && to_boolean (scm_equal_p (key, ly_cdr (trykey))))
- return ly_car (alist);
- else
- return ly_assoc_cdr (key, ly_cdr (alist));
- }
+ if (ly_pair_p (alist))
+ {
+ SCM trykey = ly_caar (alist);
+ if (ly_pair_p (trykey) && to_boolean (scm_equal_p (key, ly_cdr (trykey))))
+ return ly_car (alist);
+ else
+ return ly_assoc_cdr (key, ly_cdr (alist));
+ }
return SCM_BOOL_F;
}
if (next)
*next++ = 0;
- create_list = gh_cons (ly_symbol2scm (s), create_list);
+ create_list = scm_cons (ly_symbol2scm (s), create_list);
s = next;
}
{
SCM s = lst;
k--;
- for (; gh_pair_p (s) && k--; s = ly_cdr (s))
+ for (; ly_pair_p (s) && k--; s = ly_cdr (s))
;
- if (gh_pair_p (s))
- gh_set_cdr_x (s, SCM_EOL);
+ if (ly_pair_p (s))
+ scm_set_cdr_x (s, SCM_EOL);
}
return lst;
}
if (val == SCM_EOL || val == SCM_BOOL_F)
return ok;
- if (!gh_symbol_p (sym))
+ if (!ly_symbol_p (sym))
#if 0
return false;
#else
SCM type = scm_object_property (sym, type_symbol);
- if (type != SCM_EOL && !gh_procedure_p (type))
+ if (type != SCM_EOL && !ly_procedure_p (type))
{
warning (_f ("Can't find property type-check for `%s' (%s).",
ly_symbol2string (sym).to_str0 (),
else
{
if (val != SCM_EOL
- && gh_procedure_p (type)
- && gh_call1 (type, val) == SCM_BOOL_F)
+ && ly_procedure_p (type)
+ && scm_call_1 (type, val) == SCM_BOOL_F)
{
SCM errport = scm_current_error_port ();
ok = false;
SCM typefunc = ly_scheme_function ("type-name");
- SCM type_name = gh_call1 (typefunc, type);
+ SCM type_name = scm_call_1 (typefunc, type);
scm_puts (_f ("Type check for `%s' failed; value `%s' must be of type `%s'",
ly_unique (SCM list)
{
SCM unique = SCM_EOL;
- for (SCM i = list; gh_pair_p (i); i = ly_cdr (i))
+ for (SCM i = list; ly_pair_p (i); i = ly_cdr (i))
{
- if (!gh_pair_p (ly_cdr (i))
- || !gh_equal_p (ly_car (i), ly_cadr (i)))
- unique = gh_cons (ly_car (i), unique);
+ if (!ly_pair_p (ly_cdr (i))
+ || !ly_equal_p (ly_car (i), ly_cadr (i)))
+ unique = scm_cons (ly_car (i), unique);
}
return scm_reverse_x (unique, SCM_EOL);
}
SCM
ly_snoc (SCM s, SCM list)
{
- return gh_append2 (list, scm_list_n (s, SCM_UNDEFINED));
+ return ly_append2 (list, scm_list_n (s, SCM_UNDEFINED));
}
/* Split list at member s, removing s.
{
SCM before = SCM_EOL;
SCM after = list;
- for (; gh_pair_p (after);)
+ for (; ly_pair_p (after);)
{
SCM i = ly_car (after);
after = ly_cdr (after);
- if (gh_equal_p (i, s))
+ if (ly_equal_p (i, s))
break;
- before = gh_cons (i, before);
+ before = scm_cons (i, before);
}
- return gh_cons ( scm_reverse_x (before, SCM_EOL), after);
+ return scm_cons ( scm_reverse_x (before, SCM_EOL), after);
}
SCM p = scm_current_output_port ();
scm_puts ("(", p);
- for (; gh_pair_p (s); s =gh_cdr (s))
+ for (; ly_pair_p (s); s =ly_cdr (s))
{
- scm_display (gh_car (s), p);
+ scm_display (ly_car (s), p);
scm_puts (" ", p);
}
scm_puts (")", p);
{
Slice s;
s.set_empty ();
- for (; gh_pair_p (l); l = gh_cdr (l))
- if (gh_number_p (gh_car (l)))
- s.add_point (gh_scm2int (gh_car (l)));
+ for (; ly_pair_p (l); l = ly_cdr (l))
+ if (ly_number_p (ly_car (l)))
+ s.add_point (ly_scm2int (ly_car (l)));
return s;
}
SCM
robust_list_ref (int i, SCM l)
{
- while (i-- > 0 && gh_pair_p (gh_cdr (l)))
- l = gh_cdr (l);
- return gh_car (l);
+ while (i-- > 0 && ly_pair_p (ly_cdr (l)))
+ l = ly_cdr (l);
+ return ly_car (l);
}
Real
robust_scm2double (SCM k, double x)
{
- if (gh_number_p (k))
- x = gh_scm2double (k);
+ if (ly_number_p (k))
+ x = ly_scm2double (k);
return x;
}
robust_scm2int (SCM k, int o)
{
if (scm_integer_p (k) == SCM_BOOL_T)
- o = gh_scm2int (k);
+ o = ly_scm2int (k);
return o;
}
{
int i = scm_ilength (alist);
if (i < 0)
- return scm_make_vector (gh_int2scm (0), SCM_EOL);
+ return scm_make_vector (scm_int2num (0), SCM_EOL);
- SCM tab = scm_make_vector (gh_int2scm (i), SCM_EOL);
- for (SCM s = alist; gh_pair_p (s); s = ly_cdr (s))
+ SCM tab = scm_make_vector (scm_int2num (i), SCM_EOL);
+ for (SCM s = alist; ly_pair_p (s); s = ly_cdr (s))
{
SCM pt = ly_cdar (s);
scm_hashq_set_x (tab, ly_caar (s), pt);
Real off = dash_period - on;
SCM at = scm_list_n (ly_symbol2scm ("dashed-line"),
- gh_double2scm (thick),
- gh_double2scm (on),
- gh_double2scm (off),
- gh_double2scm (to[X_AXIS] - from[X_AXIS]),
- gh_double2scm (to[Y_AXIS] - from[Y_AXIS]),
+ scm_make_real (thick),
+ scm_make_real (on),
+ scm_make_real (off),
+ scm_make_real (to[X_AXIS] - from[X_AXIS]),
+ scm_make_real (to[Y_AXIS] - from[Y_AXIS]),
SCM_UNDEFINED);
Box box;
Line_interface::make_line (Real th, Offset from, Offset to)
{
SCM at = scm_list_n (ly_symbol2scm ("draw-line"),
- gh_double2scm (th),
- gh_double2scm (from[X_AXIS]),
- gh_double2scm (from[Y_AXIS]),
- gh_double2scm (to[X_AXIS]),
- gh_double2scm (to[Y_AXIS]),
+ scm_make_real (th),
+ scm_make_real (from[X_AXIS]),
+ scm_make_real (from[Y_AXIS]),
+ scm_make_real (to[X_AXIS]),
+ scm_make_real (to[Y_AXIS]),
SCM_UNDEFINED);
Box box;
SCM type = me->get_property ("style");
SCM dash_fraction = me->get_property ("dash-fraction");
- if (gh_number_p (dash_fraction) || type == ly_symbol2scm ("dotted-line"))
+ if (ly_number_p (dash_fraction) || type == ly_symbol2scm ("dotted-line"))
{
Real fraction
double h = l>w/2 ? sqrt (l*l-w*w/4) : 0;
SCM list = scm_list_n (ly_symbol2scm ("zigzag-line"),
- gh_bool2scm (true),
- gh_double2scm (w),
- gh_double2scm (h),
- gh_double2scm (thick),
- gh_double2scm (dx),
- gh_double2scm (dy),
+ ly_bool2scm (true),
+ scm_make_real (w),
+ scm_make_real (h),
+ scm_make_real (thick),
+ scm_make_real (dx),
+ scm_make_real (dy),
SCM_UNDEFINED);
Box b;
b.add_point (Offset (0,0));
{
Offset dz = to -from ;
SCM type = me->get_property ("style");
- if (gh_symbol_p (type)
+ if (ly_symbol_p (type)
&& (type == ly_symbol2scm ("line")
|| type == ly_symbol2scm ("dashed-line")
|| type == ly_symbol2scm ("dotted-line")
? zigzag_stencil (me, from, to)
: Line_interface::line (me, from, to);
}
- else if (gh_symbol_p (type)
+ else if (ly_symbol_p (type)
&& type == ly_symbol2scm ("trill"))
{
SCM alist_chain = Font_interface::text_font_alist_chain (me);
- SCM style_alist = scm_list_n (gh_cons (ly_symbol2scm ("font-encoding"),
+ SCM style_alist = scm_list_n (scm_cons (ly_symbol2scm ("font-encoding"),
ly_symbol2scm ("music")),
SCM_UNDEFINED);
Font_metric *fm = select_font (me->get_paper (),
- gh_cons (style_alist,
+ scm_cons (style_alist,
alist_chain));
Stencil m = fm->find_by_name ("scripts-trill-element");
Stencil mol;
Lookup::dot (Offset p, Real radius)
{
SCM at = (scm_list_n (ly_symbol2scm ("dot"),
- gh_double2scm (p[X_AXIS]),
- gh_double2scm (p[Y_AXIS]),
- gh_double2scm (radius),
+ scm_make_real (p[X_AXIS]),
+ scm_make_real (p[Y_AXIS]),
+ scm_make_real (radius),
SCM_UNDEFINED));
Box box;
box.add_point (p - Offset (radius, radius));
Interval (min_y, max_y));
SCM at = scm_list_n (ly_symbol2scm ("beam"),
- gh_double2scm (width),
- gh_double2scm (slope),
- gh_double2scm (thick),
- gh_double2scm (blot),
+ scm_make_real (width),
+ scm_make_real (slope),
+ scm_make_real (thick),
+ scm_make_real (blot),
SCM_UNDEFINED);
return Stencil (b, at);
}
for (int i= 4; i -- ;)
{
- l = gh_cons (ly_offset2scm (b.control_[i]), l);
+ l = scm_cons (ly_offset2scm (b.control_[i]), l);
}
SCM at = (scm_list_n (ly_symbol2scm ("dashed-slur"),
- gh_double2scm (thick),
- gh_double2scm (dash),
+ scm_make_real (thick),
+ scm_make_real (dash),
ly_quote_scm (l),
SCM_UNDEFINED));
Lookup::horizontal_line (Interval w, Real th)
{
SCM at = scm_list_n (ly_symbol2scm ("horizontal-line"),
- gh_double2scm (w[LEFT]),
- gh_double2scm (w[RIGHT]),
- gh_double2scm (th),
+ scm_make_real (w[LEFT]),
+ scm_make_real (w[RIGHT]),
+ scm_make_real (th),
SCM_UNDEFINED);
Lookup::filled_box (Box b)
{
SCM at = (scm_list_n (ly_symbol2scm ("filledbox"),
- gh_double2scm (-b[X_AXIS][LEFT]),
- gh_double2scm (b[X_AXIS][RIGHT]),
- gh_double2scm (-b[Y_AXIS][DOWN]),
- gh_double2scm (b[Y_AXIS][UP]),
+ scm_make_real (-b[X_AXIS][LEFT]),
+ scm_make_real (b[X_AXIS][RIGHT]),
+ scm_make_real (-b[Y_AXIS][DOWN]),
+ scm_make_real (b[Y_AXIS][UP]),
SCM_UNDEFINED));
return Stencil (b,at);
}
SCM at = (scm_list_n (ly_symbol2scm ("round-filled-box"),
- gh_double2scm (-b[X_AXIS][LEFT]),
- gh_double2scm (b[X_AXIS][RIGHT]),
- gh_double2scm (-b[Y_AXIS][DOWN]),
- gh_double2scm (b[Y_AXIS][UP]),
- gh_double2scm (blotdiameter),
+ scm_make_real (-b[X_AXIS][LEFT]),
+ scm_make_real (b[X_AXIS][RIGHT]),
+ scm_make_real (-b[Y_AXIS][DOWN]),
+ scm_make_real (b[Y_AXIS][UP]),
+ scm_make_real (blotdiameter),
SCM_UNDEFINED));
return Stencil (b,at);
Box box;
for (int i = 0; i < shrinked_points.size (); i++)
{
- SCM x = gh_double2scm (shrinked_points[i][X_AXIS]);
- SCM y = gh_double2scm (shrinked_points[i][Y_AXIS]);
- shrinked_points_scm = gh_cons (x, gh_cons (y, shrinked_points_scm));
+ SCM x = scm_make_real (shrinked_points[i][X_AXIS]);
+ SCM y = scm_make_real (shrinked_points[i][Y_AXIS]);
+ shrinked_points_scm = scm_cons (x, scm_cons (y, shrinked_points_scm));
box.add_point (points[i]);
}
SCM polygon_scm = scm_list_n (ly_symbol2scm ("polygon"),
ly_quote_scm (shrinked_points_scm),
- gh_double2scm (blotdiameter),
+ scm_make_real (blotdiameter),
SCM_UNDEFINED);
Stencil polygon = Stencil (box, polygon_scm);
SCM list = SCM_EOL;
for (int i= 8; i--;)
{
- list = gh_cons (scontrols[indices[i]], list);
+ list = scm_cons (scontrols[indices[i]], list);
}
SCM at = (scm_list_n (ly_symbol2scm ("bezier-sandwich"),
ly_quote_scm (list),
- gh_double2scm (linethick),
+ scm_make_real (linethick),
SCM_UNDEFINED));
Box b (curve.extent (X_AXIS),
curve.extent (Y_AXIS));
Need the weird order b.o. the way PS want its arguments
*/
SCM list = SCM_EOL;
- list = gh_cons (ly_offset2scm (bottom_curve.control_[3]), list);
- list = gh_cons (ly_offset2scm (bottom_curve.control_[0]), list);
- list = gh_cons (ly_offset2scm (bottom_curve.control_[1]), list);
- list = gh_cons (ly_offset2scm (bottom_curve.control_[2]), list);
- list = gh_cons (ly_offset2scm (top_curve.control_[0]), list);
- list = gh_cons (ly_offset2scm (top_curve.control_[3]), list);
- list = gh_cons (ly_offset2scm (top_curve.control_[2]), list);
- list = gh_cons (ly_offset2scm (top_curve.control_[1]), list);
+ list = scm_cons (ly_offset2scm (bottom_curve.control_[3]), list);
+ list = scm_cons (ly_offset2scm (bottom_curve.control_[0]), list);
+ list = scm_cons (ly_offset2scm (bottom_curve.control_[1]), list);
+ list = scm_cons (ly_offset2scm (bottom_curve.control_[2]), list);
+ list = scm_cons (ly_offset2scm (top_curve.control_[0]), list);
+ list = scm_cons (ly_offset2scm (top_curve.control_[3]), list);
+ list = scm_cons (ly_offset2scm (top_curve.control_[2]), list);
+ list = scm_cons (ly_offset2scm (top_curve.control_[1]), list);
SCM horizontal_bend = scm_list_n (ly_symbol2scm ("bezier-sandwich"),
ly_quote_scm (list),
- gh_double2scm (0.0),
+ scm_make_real (0.0),
SCM_UNDEFINED);
Interval x_extent = top_curve.extent (X_AXIS);
Stencil
Lookup::repeat_slash (Real w, Real s, Real t)
{
- SCM wid = gh_double2scm (w);
- SCM sl = gh_double2scm (s);
- SCM thick = gh_double2scm (t);
+ SCM wid = scm_make_real (w);
+ SCM sl = scm_make_real (s);
+ SCM thick = scm_make_real (t);
SCM slashnodot = scm_list_n (ly_symbol2scm ("repeat-slash"),
wid, sl, thick, SCM_UNDEFINED);
b[Y_AXIS] = Interval (0 <? protude , 0 >? protude);
SCM s = scm_list_n (ly_symbol2scm ("symmetric-x-triangle"),
- gh_double2scm (thick),
- gh_double2scm (iv.length ()),
- gh_double2scm (protude), SCM_UNDEFINED);
+ scm_make_real (thick),
+ scm_make_real (iv.length ()),
+ scm_make_real (protude), SCM_UNDEFINED);
return Stencil (b, s);
}
{
SCM_ASSERT_TYPE (is_axis (a), a, SCM_ARG1, __FUNCTION__, "axis") ;
SCM_ASSERT_TYPE (is_number_pair (iv), iv, SCM_ARG2, __FUNCTION__, "number pair") ;
- SCM_ASSERT_TYPE (gh_number_p (t), a, SCM_ARG3, __FUNCTION__, "number") ;
- SCM_ASSERT_TYPE (gh_number_p (p), a, SCM_ARG4, __FUNCTION__, "number") ;
+ SCM_ASSERT_TYPE (ly_number_p (t), a, SCM_ARG3, __FUNCTION__, "number") ;
+ SCM_ASSERT_TYPE (ly_number_p (p), a, SCM_ARG4, __FUNCTION__, "number") ;
- return Lookup::bracket ((Axis)gh_scm2int (a), ly_scm2interval (iv),
- gh_scm2double (t),
- gh_scm2double (p),
- 0.95 * gh_scm2double (t)).smobbed_copy ();
+ return Lookup::bracket ((Axis)ly_scm2int (a), ly_scm2interval (iv),
+ ly_scm2double (t),
+ ly_scm2double (p),
+ 0.95 * ly_scm2double (t)).smobbed_copy ();
}
{
SCM_ASSERT_TYPE (is_number_pair (xext), xext, SCM_ARG1, __FUNCTION__, "number pair") ;
SCM_ASSERT_TYPE (is_number_pair (yext), yext, SCM_ARG2, __FUNCTION__, "number pair") ;
- SCM_ASSERT_TYPE (gh_number_p (blot), blot, SCM_ARG3, __FUNCTION__, "number") ;
+ SCM_ASSERT_TYPE (ly_number_p (blot), blot, SCM_ARG3, __FUNCTION__, "number") ;
return Lookup::round_filled_box (Box (ly_scm2interval (xext), ly_scm2interval (yext)),
- gh_scm2double (blot)).smobbed_copy ();
+ ly_scm2double (blot)).smobbed_copy ();
}
SCM s = anon_modules;
anon_modules = SCM_EOL;
- for (; gh_pair_p (s) ; s = gh_cdr (s))
+ for (; ly_pair_p (s) ; s = ly_cdr (s))
{
SCM tab= scm_c_make_hash_table (2);
/* UGH. */
- SCM_STRUCT_DATA (gh_car (s))[scm_module_index_obarray]
+ SCM_STRUCT_DATA (ly_car (s))[scm_module_index_obarray]
= (long unsigned int) tab;
}
}
SCM
ly_modules_lookup (SCM modules, SCM sym)
{
- for (SCM s = gh_car (modules); SCM_MODULEP (s); s = ly_cdr (s))
+ for (SCM s = ly_car (modules); SCM_MODULEP (s); s = ly_cdr (s))
{
SCM v = scm_sym2var (sym, scm_module_lookup_closure (s), SCM_UNDEFINED);
if (v != SCM_UNDEFINED)
SCM melisma_properties = tr->get_property ("melismaBusyProperties");
bool busy = false;
- for (; gh_pair_p (melisma_properties);
- melisma_properties = gh_cdr (melisma_properties))
- busy = busy || to_boolean (tr->internal_get_property (gh_car (melisma_properties)));
+ for (; ly_pair_p (melisma_properties);
+ melisma_properties = ly_cdr (melisma_properties))
+ busy = busy || to_boolean (tr->internal_get_property (ly_car (melisma_properties)));
return busy;
}
SCM grobs = tr->get_property ("busyGrobs");
Moment now = tr->now_mom ();
- for (; gh_pair_p (grobs); grobs = gh_cdr (grobs))
+ for (; ly_pair_p (grobs); grobs = ly_cdr (grobs))
{
- SCM grob = gh_cdar (grobs);
- Moment end =*unsmob_moment (gh_caar (grobs));
+ SCM grob = ly_cdar (grobs);
+ Moment end =*unsmob_moment (ly_caar (grobs));
/*
Lyric_combine_music::get_music () const
{
SCM l = get_property ("elements");
- if (!gh_pair_p (l))
+ if (!ly_pair_p (l))
return 0;
- return unsmob_music (gh_car (l));
+ return unsmob_music (ly_car (l));
}
Lyric_combine_music::get_lyrics () const
{
SCM l = get_property ("elements");
- if (!gh_pair_p (l))
+ if (!ly_pair_p (l))
return 0;
- l = gh_cdr (l);
- if (!gh_pair_p (l))
+ l = ly_cdr (l);
+ if (!ly_pair_p (l))
return 0;
- return unsmob_music (gh_car (l));
+ return unsmob_music (ly_car (l));
}
SCM voice = lyrics->get_property ("associatedVoice");
String nm = lyrics->id_string_;
- if (gh_string_p (voice))
+ if (ly_string_p (voice))
nm = ly_scm2string (voice);
else
{
get_current_note_head (Context * voice)
{
for (SCM s = voice->get_property ("busyGrobs");
- gh_pair_p (s); s = gh_cdr (s))
+ ly_pair_p (s); s = ly_cdr (s))
{
- Item*g = dynamic_cast<Item*> (unsmob_grob (gh_cdar (s)));
+ Item*g = dynamic_cast<Item*> (unsmob_grob (ly_cdar (s)));
if (g && !g->get_column ()
&& Note_head::has_interface (g))
{
text_->set_parent (head, X_AXIS);
if (melisma_busy (voice))
- text_->set_property ("self-alignment-X", gh_int2scm (LEFT));
+ text_->set_property ("self-alignment-X", scm_int2num (LEFT));
}
}
{
// FIXME: won't work with fancy lyrics
if (lreqs_.size ()
- && gh_string_p (lreqs_[0]->get_property ("text"))
+ && ly_string_p (lreqs_[0]->get_property ("text"))
&& ly_scm2string (lreqs_[0]->get_property ("text")).length ())
{
audio_ = new Audio_text (Audio_text::LYRIC,
all_fonts_global = new All_font_metrics (global_path.to_string ());
init_scheme_code_string += ")";
- gh_eval_str ((char*) init_scheme_code_string.to_str0 ());
+ scm_c_eval_string ((char*) init_scheme_code_string.to_str0 ());
/* We accept multiple independent music files on the command line to
reduce compile time when processing lots of small files.
SCM m = mark_ev_->get_property ("label");
SCM proc = get_property ("markFormatter");
if (!Text_item::markup_p (m) &&
- gh_procedure_p (proc))
+ ly_procedure_p (proc))
{
- if (!gh_number_p (m))
+ if (!ly_number_p (m))
m = get_property ("rehearsalMark");
if (scm_integer_p (m) == SCM_BOOL_T
&& scm_exact_p (m) == SCM_BOOL_T)
{
- int mark_count = gh_scm2int (m);
+ int mark_count = ly_scm2int (m);
mark_count ++;
daddy_context_->set_property ("rehearsalMark",
- gh_int2scm (mark_count));
+ scm_int2num (mark_count));
}
- if (gh_number_p (m))
+ if (ly_number_p (m))
m = scm_call_2 (proc, m, daddy_context_->self_scm ());
else
warning ("rehearsalMark does not have integer value.");
return;
SCM grouping = get_property ("beatGrouping");
- if (gh_pair_p (grouping))
+ if (ly_pair_p (grouping))
{
Moment *measpos = unsmob_moment (get_property ("measurePosition"));
Rational mp = measpos->main_part_;
Rational bl = beatlen->main_part_;
Rational where (0);
- for (SCM s = grouping; gh_pair_p (s);
- where += Rational (gh_scm2int (gh_car (s))) * bl,
- s = gh_cdr (s)
+ for (SCM s = grouping; ly_pair_p (s);
+ where += Rational (ly_scm2int (ly_car (s))) * bl,
+ s = ly_cdr (s)
)
{
- int grouplen = gh_scm2int (gh_car (s));
+ int grouplen = ly_scm2int (ly_car (s));
if (where == mp)
{
if (grouping_)
programming_error ("last_primitive undefined");
break;
}
- last_primitive->set_property ("primitive", gh_int2scm (output));
+ last_primitive->set_property ("primitive", scm_int2num (output));
break;
case MLP_BB:
case MLP_LB:
programming_error ("primitive undefined");
break;
}
- last_primitive->set_property ("primitive", gh_int2scm (output));
- primitive->set_property ("primitive", gh_int2scm (MLP_NONE));
+ last_primitive->set_property ("primitive", scm_int2num (output));
+ primitive->set_property ("primitive", scm_int2num (MLP_NONE));
break;
case MLP_SS:
// delayed primitive with two note heads
programming_error ("last_primitive undefined");
break;
}
- last_last_primitive->set_property ("primitive", gh_int2scm (output));
- last_primitive->set_property ("primitive", gh_int2scm (MLP_NONE));
+ last_last_primitive->set_property ("primitive", scm_int2num (output));
+ last_primitive->set_property ("primitive", scm_int2num (MLP_NONE));
break;
default:
programming_error (_f ("unexpected case fall-through"));
for (int i = 0; i < primitives.size (); i++)
{
Item *primitive = dynamic_cast<Item*> (primitives[i].grob_);
- int output = gh_scm2int (primitive->get_property ("primitive"));
+ int output = ly_scm2int (primitive->get_property ("primitive"));
primitive->set_property ("thickness",
- gh_double2scm (thickness));
+ scm_make_real (thickness));
switch (output) {
case MLP_NONE:
primitive->set_property ("head-width",
- gh_double2scm (half_flexa_width));
+ scm_make_real (half_flexa_width));
break;
case MLP_sc:
case MLP_ss:
case MLP_cs:
primitive->set_property ("head-width",
- gh_double2scm (head_width));
+ scm_make_real (head_width));
break;
case MLP_BB:
case MLP_LB:
case MLP_SS:
primitive->set_property ("head-width",
- gh_double2scm (half_flexa_width));
+ scm_make_real (half_flexa_width));
primitive->set_property ("flexa-width",
- gh_double2scm (flexa_width));
+ scm_make_real (flexa_width));
break;
default:
programming_error (_f ("unexpected case fall-through"));
}
distance +=
- gh_scm2double (current->get_property ("head-width")) -
- gh_scm2double (current->get_property ("thickness"));
+ ly_scm2double (current->get_property ("head-width")) -
+ ly_scm2double (current->get_property ("thickness"));
}
}
if (i > 0)
{
Item *primitive = dynamic_cast<Item*> (info.grob_);
- int output = gh_scm2int (primitive->get_property ("primitive"));
+ int output = ly_scm2int (primitive->get_property ("primitive"));
if (output & MLP_ANY)
{
int delta_pitch = (pitch.steps () - last_pitch.steps ());
primitive->set_property ("join-left-amount",
- gh_int2scm (delta_pitch));
+ scm_int2num (delta_pitch));
}
}
last_pitch = pitch;
}
Stencil out;
- int primitive = gh_scm2int (primitive_scm);
+ int primitive = ly_scm2int (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 = gh_scm2int (join_left_scm);
+ int join_left = ly_scm2int (join_left_scm);
if (!join_left)
programming_error (_f ("Mensural_ligature: (join_left == 0)"));
Real blotdiameter = (me->get_paper ()->get_dimension (ly_symbol2scm ("blotdiameter")));
UGH. don't use eval.
*/
SCM proc = ly_scheme_function ("midi-program");
- SCM program = gh_call1 (proc, ly_symbol2scm (audio_->str_.to_str0 ()));
+ SCM program = scm_call_1 (proc, ly_symbol2scm (audio_->str_.to_str0 ()));
found = (program != SCM_BOOL_F);
if (found)
- program_byte = gh_scm2int (program);
+ program_byte = ly_scm2int (program);
else
warning (_f ("no such MIDI instrument: `%s'", audio_->str_.to_str0 ()));
if (gn != SCM_UNDEFINED)
{
SCM_ASSERT_TYPE (SCM_INUMP (gn), gn, SCM_ARG3, __FUNCTION__, "integer");
- grace_num = gh_scm2int (gn);
+ grace_num = ly_scm2int (gn);
}
int grace_den = 1;
if (gd != SCM_UNDEFINED)
{
SCM_ASSERT_TYPE (SCM_INUMP (gd), gd, SCM_ARG4, __FUNCTION__, "integer");
- grace_den = gh_scm2int (gd);
+ grace_den = ly_scm2int (gd);
}
- return Moment (Rational (gh_scm2int (n), gh_scm2int (d)),
+ return Moment (Rational (ly_scm2int (n), ly_scm2int (d)),
Rational (grace_num, grace_den)).smobbed_copy ();
}
SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
- return gh_bool2scm (*ma < *mb);
+ return ly_bool2scm (*ma < *mb);
}
Grob *last =0;
for (int i=0; i <numbers_.size (); i++)
{
- if (gh_int2scm (d) == numbers_[i]->get_property ("direction"))
+ if (scm_int2num (d) == numbers_[i]->get_property ("direction"))
{
if (last)
Side_position_interface::add_support (numbers_[i], last);
announce_grob (mmrest_, rest_ev_->self_scm ());
start_measure_
- = gh_scm2int (get_property ("currentBarNumber"));
+ = ly_scm2int (get_property ("currentBarNumber"));
}
- bar_seen_ = gh_string_p (get_property ("whichBar"));
+ bar_seen_ = ly_string_p (get_property ("whichBar"));
}
void
last_rest_ = mmrest_;
last_numbers_ = numbers_;
- int cur = gh_scm2int (get_property ("currentBarNumber"));
+ int cur = ly_scm2int (get_property ("currentBarNumber"));
int num = cur - start_measure_;
/*
We can't plug a markup directly into the grob, since the
measure-count determines the formatting of the mmrest.
*/
- last_rest_->set_property ("measure-count", gh_int2scm (num));
+ last_rest_->set_property ("measure-count", scm_int2num (num));
SCM sml = get_property ("measureLength");
Rational ml = (unsmob_moment (sml)) ? unsmob_moment (sml)->main_part_ : Rational (1);
{
SCM thres = get_property ("restNumberThreshold");
int t = 1;
- if (gh_number_p (thres))
- t = gh_scm2int (thres);
+ if (ly_number_p (thres))
+ t = ly_scm2int (thres);
if (num <= t)
last->suicide ();
else
{
SCM text
- = scm_number_to_string (gh_int2scm (num), SCM_MAKINUM (10));
+ = scm_number_to_string (scm_int2num (num), SCM_MAKINUM (10));
last->set_property ("text", text);
}
}
int measures = 0;
SCM m (me->get_property ("measure-count"));
- if (gh_number_p (m))
+ if (ly_number_p (m))
{
- measures = gh_scm2int (m);
+ measures = ly_scm2int (m);
}
mol.translate_axis (x_off, X_AXIS);
{
int measures = 0;
SCM m (me->get_property ("measure-count"));
- if (gh_number_p (m))
+ if (ly_number_p (m))
{
- measures = gh_scm2int (m);
+ measures = ly_scm2int (m);
}
if (measures <= 0)
return Stencil ();
SCM limit = me->get_property ("expand-limit");
- if (measures > gh_scm2int (limit))
+ if (measures > ly_scm2int (limit))
{
Real padding = 0.15;
Stencil s = big_rest (me, (1.0 - 2*padding) * space);
Stencil r (musfont->find_by_name ("rests-" + to_string (k)));
symbols_width += r.extent (X_AXIS).length ();
- mols = gh_cons (r.smobbed_copy (), mols);
+ mols = scm_cons (r.smobbed_copy (), mols);
}
else
{
r.translate_axis (staff_space, Y_AXIS);
}
symbols_width += r.extent (X_AXIS).length ();
- mols = gh_cons (r.smobbed_copy (), mols);
+ mols = scm_cons (r.smobbed_copy (), mols);
}
count ++;
}
}
Stencil mol;
- for (SCM s = mols; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = mols; ly_pair_p (s); s = ly_cdr (s))
{
- mol.add_at_edge (X_AXIS, LEFT, *unsmob_stencil (gh_car (s)), inner_padding, 0);
+ mol.add_at_edge (X_AXIS, LEFT, *unsmob_stencil (ly_car (s)), inner_padding, 0);
}
mol.align_to (X_AXIS, LEFT);
mol.translate_axis (outer_padding_factor * inner_padding, X_AXIS);
SCM ctor = m->get_property ("iterator-ctor") ;
SCM iter = SCM_EOL;
- if (gh_procedure_p (ctor))
+ if (ly_procedure_p (ctor))
{
- iter = gh_call0 (ctor);
+ iter = scm_call_0 (ctor);
p = unsmob_iterator (iter);
}
else
{
Music_output_def *op = unsmob_music_output_def (pap);
SCM_ASSERT_TYPE (op, pap, SCM_ARG1, __FUNCTION__, "Paper");
- SCM_ASSERT_TYPE (gh_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
SCM var = ly_module_lookup (op->scope_, sym);
if (SCM_VARIABLEP (var))
Music_sequence::append_music (Music *m)
{
set_property ("elements",
- gh_append2 (music_list (), gh_cons (m->self_scm (), SCM_EOL)));
+ ly_append2 (music_list (), scm_cons (m->self_scm (), SCM_EOL)));
scm_gc_unprotect_object (m->self_scm ());
}
void
transpose_music_list (SCM l, Pitch rq)
{
- for (SCM s = l; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = l; ly_pair_p (s); s = ly_cdr (s))
unsmob_music (ly_car (s))->transpose (rq);
}
Moment cumulative;
Moment last_len;
- for (SCM s = l; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = l; ly_pair_p (s); s = ly_cdr (s))
{
Moment l = unsmob_music (ly_car (s))->get_length ();
if (last_len.grace_part_ && l.main_part_)
Music_sequence::maximum_length (SCM l)
{
Moment dur = 0;
- for (SCM s = l; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = l; ly_pair_p (s); s = ly_cdr (s))
{
Music * m = unsmob_music (ly_car (s));
Moment l = m->get_length ();
int count=0;
Pitch last = p;
- for (SCM s = l; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = l; ly_pair_p (s); s = ly_cdr (s))
{
if (Music *m = unsmob_music (ly_car (s)))
{
void
compress_music_list (SCM l, Moment m)
{
- for (SCM s = l; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = l; ly_pair_p (s); s = ly_cdr (s))
unsmob_music (ly_car (s))->compress (m);
}
{
Moment m;
- for (SCM s = l; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = l; ly_pair_p (s); s = ly_cdr (s))
{
m = m <? unsmob_music (ly_car (s))->start_mom ();
}
{
Moment m;
- for (SCM s = l; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = l; ly_pair_p (s); s = ly_cdr (s))
{
Music * mus = unsmob_music (ly_car (s));
Moment l = mus->get_length ();
Music::name () const
{
SCM nm = get_property ("name");
- if (gh_symbol_p (nm))
+ if (ly_symbol_p (nm))
{
return ly_symbol2string (nm);
}
SCM lst = get_property ("length");
if (unsmob_moment (lst))
return *unsmob_moment (lst);
- else if (gh_procedure_p (lst))
+ else if (ly_procedure_p (lst))
{
- SCM res = gh_call1 (lst, self_scm ());
+ SCM res = scm_call_1 (lst, self_scm ());
return *unsmob_moment (res);
}
Music::start_mom () const
{
SCM lst = get_property ("start-moment-function");
- if (gh_procedure_p (lst))
+ if (ly_procedure_p (lst))
{
- SCM res = gh_call1 (lst, self_scm ());
+ SCM res = scm_call_1 (lst, self_scm ());
return *unsmob_moment (res);
}
print_alist (SCM a, SCM port)
{
/* SCM_EOL -> catch malformed lists. */
- for (SCM s = a; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = a; ly_pair_p (s); s = ly_cdr (s))
{
scm_display (ly_caar (s), port);
scm_puts (" = ", port);
Music* m = unsmob_music (s);
SCM nm = m->get_property ("name");
- if (gh_symbol_p (nm) || gh_string_p (nm))
+ if (ly_symbol_p (nm) || ly_string_p (nm))
scm_display (nm, p);
else
scm_puts (classname (m),p);
{
Music * sc = unsmob_music (mus);
SCM_ASSERT_TYPE (sc, mus, SCM_ARG1, __FUNCTION__, "music");
- SCM_ASSERT_TYPE (gh_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
return sc->internal_get_property (sym);
}
{
Music * sc = unsmob_music (mus);
SCM_ASSERT_TYPE (sc, mus, SCM_ARG1, __FUNCTION__, "music");
- SCM_ASSERT_TYPE (gh_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
bool ok = type_check_assignment (sym, val, ly_symbol2scm ("music-type?"));
if (ok)
"for creating music objects. "
)
{
- SCM_ASSERT_TYPE (gh_string_p (type), type, SCM_ARG1, __FUNCTION__, "string");
+ SCM_ASSERT_TYPE (ly_string_p (type), type, SCM_ARG1, __FUNCTION__, "string");
SCM s = make_music (ly_scm2string (type))->self_scm ();
unsmob_music (s)->immutable_property_alist_ = props;
scm_gc_unprotect_object (s);
"of music objects.")
{
if (scm_list_p (lst) == SCM_BOOL_T)
- while (gh_pair_p (lst))
+ while (ly_pair_p (lst))
{
- if (!unsmob_music (gh_car (lst)))
+ if (!unsmob_music (ly_car (lst)))
return SCM_BOOL_F;
- lst = gh_cdr (lst);
+ lst = ly_cdr (lst);
}
return SCM_BOOL_T;
copy = unsmob_music (m)->clone ()->self_scm ();
scm_gc_unprotect_object (copy);
}
- else if (gh_pair_p (m))
- copy = gh_cons (ly_deep_mus_copy (ly_car (m)),
+ else if (ly_pair_p (m))
+ copy = scm_cons (ly_deep_mus_copy (ly_car (m)),
ly_deep_mus_copy (ly_cdr (m)));
return copy;
}
{
keytable_ = new Keyword_table (the_key_tab);
- chordmodifier_tab_ = scm_make_vector (gh_int2scm (1), SCM_EOL);
+ chordmodifier_tab_ = scm_make_vector (scm_int2num (1), SCM_EOL);
pitchname_tab_stack_ = SCM_EOL;
scopes_ = SCM_EOL;
{
ly_reexport_module (scm_current_module ());
scm_set_current_module (module);
- for (SCM s = scopes_; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = scopes_; ly_pair_p (s); s = ly_cdr (s))
{
/* UGH. how to do this more neatly? */
SCM expr
= scm_list_3 (ly_symbol2scm ("module-use!"),
module,
scm_list_2 (ly_symbol2scm ("module-public-interface"),
- gh_car (s)));
+ ly_car (s)));
scm_primitive_eval (expr);
}
scopes_ = scm_cons (module, scopes_);
SCM
My_lily_lexer::remove_scope ()
{
- SCM sc = gh_car (scopes_);
- scopes_ = gh_cdr (scopes_);
- scm_set_current_module (gh_car (scopes_));
+ SCM sc = ly_car (scopes_);
+ scopes_ = ly_cdr (scopes_);
+ scm_set_current_module (ly_car (scopes_));
return sc;
}
My_lily_lexer::lookup_identifier (String s)
{
SCM sym = ly_symbol2scm (s.to_str0());
- for (SCM s = scopes_; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = scopes_; ly_pair_p (s); s = ly_cdr (s))
{
- SCM var = ly_module_lookup (gh_car (s), sym);
+ SCM var = ly_module_lookup (ly_car (s), sym);
if (var != SCM_BOOL_F)
return scm_variable_ref (var);
}
/* Do not allow \include in --safe-mode */
allow_includes_b_ = allow_includes_b_ && ! safe_global_b;
- scm_module_define (gh_car (scopes_),
+ scm_module_define (ly_car (scopes_),
ly_symbol2scm ("input-file-name"),
scm_makfrom0str (main_input_name_.to_str0 ()));
}
SCM al = p->translator_tab_->to_alist ();
SCM l = SCM_EOL;
- for (SCM s = al ; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = al ; ly_pair_p (s); s = ly_cdr (s))
{
Context_def * td = unsmob_context_def (ly_cdar (s));
- l = gh_cons (gh_cons (ly_caar (s), td->to_alist ()), l);
+ l = scm_cons (scm_cons (ly_caar (s), td->to_alist ()), l);
}
return l;
}
SCM arts = note_ev->get_property ("articulations");
- for (SCM s = arts; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = arts; ly_pair_p (s); s = ly_cdr (s))
{
- Music * m = unsmob_music (gh_car (s));
+ Music * m = unsmob_music (ly_car (s));
if (!m)
continue;
Side_position_interface::add_support (ft.script_, head);
- int d = gh_scm2int (event->get_property ("digit"));
+ int d = ly_scm2int (event->get_property ("digit"));
/*
TODO:
*/
event->origin ()->warning (_("music for the martians."));
}
- SCM sstr = scm_number_to_string (gh_int2scm (d), gh_int2scm (10)) ;
+ SCM sstr = scm_number_to_string (scm_int2num (d), scm_int2num (10)) ;
ft.script_->set_property ("text", sstr);
ft.finger_event_ = event;
*/
for (int i = 0; i < fingerings_.size (); i++)
{
- fingerings_[i].position_ = gh_scm2int (fingerings_[i].head_ -> get_property ( "staff-position"));
+ fingerings_[i].position_ = ly_scm2int (fingerings_[i].head_ -> get_property ( "staff-position"));
}
for (int i = fingerings_.size (); i--;)
f->add_offset_callback (Self_alignment_interface::aligned_on_self_proc, Y_AXIS);
f->add_offset_callback (Side_position_interface::aligned_side_proc, X_AXIS);
- f->set_property ("direction", gh_int2scm (hordir));
+ f->set_property ("direction", scm_int2num (hordir));
typeset_grob (f);
}
Grob* f = ft.script_;
f->set_parent (ft.head_, X_AXIS);
f->set_property ("script-priority",
- gh_int2scm (finger_prio + i));
+ scm_int2num (finger_prio + i));
f->add_offset_callback (Side_position_interface::aligned_side_proc, Y_AXIS);
f->add_offset_callback (Self_alignment_interface::centered_on_parent_proc, X_AXIS);
f->add_offset_callback (Self_alignment_interface::aligned_on_self_proc, X_AXIS);
- f->set_property ("direction", gh_int2scm (UP));
+ f->set_property ("direction", scm_int2num (UP));
typeset_grob (f);
}
Grob* f = ft.script_;
f->set_parent (ft.head_, X_AXIS);
f->set_property ("script-priority",
- gh_int2scm (finger_prio + down.size () - i));
+ scm_int2num (finger_prio + down.size () - i));
f->add_offset_callback (Self_alignment_interface::centered_on_parent_proc, X_AXIS);
f->add_offset_callback (Self_alignment_interface::aligned_on_self_proc, X_AXIS);
f->add_offset_callback (Side_position_interface::aligned_side_proc, Y_AXIS);
- f->set_property ("direction", gh_int2scm (DOWN));
+ f->set_property ("direction", scm_int2num (DOWN));
typeset_grob (f);
}
}
sc->set_property ("direction-source", stem_->self_scm ());
SCM follow = scm_assoc (ly_symbol2scm ("follow-into-staff"), articulations_[i].description_);
- if (gh_pair_p (follow) && to_boolean (gh_cdr (follow)))
+ if (ly_pair_p (follow) && to_boolean (ly_cdr (follow)))
{
sc->add_offset_callback (Side_position_interface::quantised_position_proc, Y_AXIS);
sc->set_property ("staff-padding" , SCM_EOL);
{
SCM voice_name = get_music ()->get_property ("associated-context");
- if (gh_string_p (voice_name))
+ if (ly_string_p (voice_name))
{
Context *t = get_outlet ();
while (t && t->daddy_context_)
Note_collision_interface::force_shift_callback (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (axis);
+ Axis a = (Axis) ly_scm2int (axis);
assert (a == X_AXIS);
me = me->get_parent (a);
do_shifts (me);
}
- return gh_double2scm (0.0);
+ return scm_make_real (0.0);
}
/* Do not merge notes typeset in different style. */
- if ( !gh_equal_p (nu->get_property ("style"),
+ if ( !ly_equal_p (nu->get_property ("style"),
nd->get_property ("style") ) )
merge_possible = false;
while (flip (&d) != UP);
Link_array<Grob> done;
- for (; gh_pair_p (hand); hand =ly_cdr (hand))
+ for (; ly_pair_p (hand); hand =ly_cdr (hand))
{
Grob * s = unsmob_grob (ly_caar (hand));
- Real amount = gh_scm2double (ly_cdar (hand));
+ Real amount = ly_scm2double (ly_cdar (hand));
s->translate_axis (amount *wid, X_AXIS);
done.push (s);
}
- for (; gh_pair_p (autos); autos =ly_cdr (autos))
+ for (; ly_pair_p (autos); autos =ly_cdr (autos))
{
Grob * s = unsmob_grob (ly_caar (autos));
- Real amount = gh_scm2double (ly_cdar (autos));
+ Real amount = ly_scm2double (ly_cdar (autos));
if (!done.find (s))
s->translate_axis (amount * wid, X_AXIS);
Drul_array<Link_array<Grob> > clash_groups;
SCM s = me->get_property ("elements");
- for (; gh_pair_p (s); s = ly_cdr (s))
+ for (; ly_pair_p (s); s = ly_cdr (s))
{
SCM car = ly_car (s);
SCM sh
= clashes[i]->get_property ("horizontal-shift");
- if (gh_number_p (sh))
- shift.push (gh_scm2int (sh));
+ if (ly_number_p (sh))
+ shift.push (ly_scm2int (sh));
else
shift.push (0);
}
do
{
for (int i=0; i < clash_groups[d].size (); i++)
- tups = gh_cons (gh_cons (clash_groups[d][i]->self_scm (),
- gh_double2scm (offsets[d][i])),
+ tups = scm_cons (scm_cons (clash_groups[d][i]->self_scm (),
+ scm_make_real (offsets[d][i])),
tups);
}
while (flip (&d) != UP);
SCM tups = SCM_EOL;
SCM s = me->get_property ("elements");
- for (; gh_pair_p (s); s = ly_cdr (s))
+ for (; ly_pair_p (s); s = ly_cdr (s))
{
Grob * se = unsmob_grob (ly_car (s));
SCM force = se->get_property ("force-hshift");
- if (gh_number_p (force))
+ if (ly_number_p (force))
{
- tups = gh_cons (gh_cons (se->self_scm (), force),
+ tups = scm_cons (scm_cons (se->self_scm (), force),
tups);
}
}
SCM s1 = p1->get_property ("horizontal-shift");
SCM s2 = p2->get_property ("horizontal-shift");
- int h1 = (gh_number_p (s1))? gh_scm2int (s1) :0;
- int h2 = (gh_number_p (s2)) ? gh_scm2int (s2):0;
+ int h1 = (ly_number_p (s1))? ly_scm2int (s1) :0;
+ int h2 = (ly_number_p (s2)) ? ly_scm2int (s2):0;
return h1 - h2;
}
iv.set_empty ();
SCM h = me->get_property ("note-heads");
- for (; gh_pair_p (h); h = ly_cdr (h))
+ for (; ly_pair_p (h); h = ly_cdr (h))
{
Grob *se = unsmob_grob (ly_car (h));
Grob *stem = unsmob_grob (me->get_property ("stem"));
if (stem && Stem::has_interface (stem))
return Stem::get_direction (stem);
- else if (gh_pair_p (me->get_property ("note-heads")))
+ else if (ly_pair_p (me->get_property ("note-heads")))
return (Direction)sign (head_positions_interval (me).center ());
programming_error ("Note column without heads and stem!");
bool both = false;
if (Rest::has_interface (h))
{
- if (gh_pair_p (me->get_property ("note-heads")))
+ if (ly_pair_p (me->get_property ("note-heads")))
both = true;
else
me->set_property ("rest", h->self_scm ());
Note_column::translate_rests (Grob*me, int dy)
{
Grob * r = unsmob_grob (me->get_property ("rest"));
- if (r && !gh_number_p (r->get_property ("staff-position")))
+ if (r && !ly_number_p (r->get_property ("staff-position")))
{
r->translate_axis (dy * Staff_symbol_referencer::staff_space (r)/2.0, Y_AXIS);
}
{
SCM heads = me->get_property ("note-heads");
Grob * acc = 0;
- for (;gh_pair_p (heads); heads =gh_cdr (heads))
+ for (;ly_pair_p (heads); heads =ly_cdr (heads))
{
- Grob * h = unsmob_grob (gh_car (heads));
+ Grob * h = unsmob_grob (ly_car (heads));
acc = h ? unsmob_grob (h->get_property ("accidental-grob")) : 0;
if (acc)
break;
internal_print (Grob *me, bool with_ledgers)
{
SCM style = me->get_property ("style");
- if (!gh_symbol_p (style))
+ if (!ly_symbol_p (style))
{
return Stencil ();
}
- SCM log = gh_int2scm (Note_head::get_balltype (me));
+ SCM log = scm_int2num (Note_head::get_balltype (me));
SCM proc = me->get_property ("glyph-name-procedure");
SCM scm_font_char = scm_call_2 (proc, log, style);
String font_char = "noteheads-" + ly_scm2string (scm_font_char);
{
Grob *me = unsmob_grob (smob);
- return ly_interval2scm (head_extent (me, (Axis) gh_scm2int (axis)));
+ return ly_interval2scm (head_extent (me, (Axis) ly_scm2int (axis)));
}
MAKE_SCHEME_CALLBACK (Note_head,brew_ez_stencil,1);
SCM spitch = unsmob_music (cause)->get_property ("pitch");
Pitch* pit = unsmob_pitch (spitch);
- SCM idx = gh_int2scm (pit->get_notename ());
+ SCM idx = scm_int2num (pit->get_notename ());
SCM names = me->get_property ("note-names");
SCM charstr = SCM_EOL;
- if (gh_vector_p (names))
+ if (ly_vector_p (names))
charstr = scm_vector_ref (names, idx);
else
{
SCM at = scm_list_n (ly_symbol2scm ("ez-ball"),
charstr,
- gh_int2scm (b),
- gh_int2scm (1-b),
+ scm_int2num (b),
+ scm_int2num (1-b),
SCM_UNDEFINED);
Box bx (Interval (0, 1.0), Interval (-0.5, 0.5));
Stencil m (bx, at);
if (brewer == Note_head::print_proc)
{
SCM style = me->get_property ("style");
- if (!gh_symbol_p (style))
+ if (!ly_symbol_p (style))
{
return 0.0;
}
- SCM log = gh_int2scm (Note_head::get_balltype (me));
+ SCM log = scm_int2num (Note_head::get_balltype (me));
SCM proc = me->get_property ("glyph-name-procedure");
SCM scm_font_char = scm_call_2 (proc, log, style);
String font_char = "noteheads-" + ly_scm2string (scm_font_char);
Fallback
*/
SCM v = me->get_property ("stem-attachment-function");
- if (!gh_procedure_p (v))
+ if (!ly_procedure_p (v))
return 0.0;
- SCM result = scm_call_2 (v, me->self_scm (), gh_int2scm (a));
- if (!gh_pair_p (result))
+ SCM result = scm_call_2 (v, me->self_scm (), scm_int2num (a));
+ if (!ly_pair_p (result))
return 0.0;
result = (a == X_AXIS) ? ly_car (result) : ly_cdr (result);
Note_head::get_balltype (Grob*me)
{
SCM s = me->get_property ("duration-log");
- return gh_number_p (s) ? gh_scm2int (s) <? 2 : 0;
+ return ly_number_p (s) ? ly_scm2int (s) <? 2 : 0;
}
ADD_INTERFACE (Note_head,"note-head-interface",
Duration dur = *unsmob_duration (req->get_property ("duration"));
- note->set_property ("duration-log", gh_int2scm (dur.duration_log ()));
+ note->set_property ("duration-log", scm_int2num (dur.duration_log ()));
if (dur.dot_count ())
{
Item * d = make_item ("Dots");
if (dur.dot_count ()
!= robust_scm2int (d->get_property ("dot-count"), 0))
- d->set_property ("dot-count", gh_int2scm (dur.dot_count ()));
+ d->set_property ("dot-count", scm_int2num (dur.dot_count ()));
d->set_parent (note, Y_AXIS);
announce_grob (d, SCM_EOL);
int pos = pit ? pit->steps () : 0;
SCM c0 = get_property ("middleCPosition");
- if (gh_number_p (c0))
- pos += gh_scm2int (c0);
+ if (ly_number_p (c0))
+ pos += ly_scm2int (c0);
- note->set_property ("staff-position", gh_int2scm (pos));
+ note->set_property ("staff-position", scm_int2num (pos));
announce_grob (note,req->self_scm ());
notes_.push (note);
}
Interval left_head_wid;
do
{
- for (SCM s = props[d]; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = props[d]; ly_pair_p (s); s = ly_cdr (s))
{
- Item * it= dynamic_cast<Item*> (unsmob_grob (gh_car (s)));
+ Item * it= dynamic_cast<Item*> (unsmob_grob (ly_car (s)));
if (d == RIGHT && it->break_status_dir () != col_dir)
{
Item *mincol = 0;
int min_rank = INT_MAX;
bool prune = false;
- for (SCM s = right ; gh_pair_p (s) ; s = gh_cdr (s))
+ for (SCM s = right ; ly_pair_p (s) ; s = ly_cdr (s))
{
- Item * ri = unsmob_item (gh_car (s));
+ Item * ri = unsmob_item (ly_car (s));
Item * col = ri->get_column ();
int rank = Paper_column::get_rank (col);
{
// I'm a lazy bum. We could do this in-place.
SCM newright = SCM_EOL;
- for (SCM s = right ; gh_pair_p (s) ; s =gh_cdr (s))
+ for (SCM s = right ; ly_pair_p (s) ; s =ly_cdr (s))
{
- if (unsmob_item (gh_car (s))->get_column () == mincol)
- newright = gh_cons (gh_car (s), newright);
+ if (unsmob_item (ly_car (s))->get_column () == mincol)
+ newright = scm_cons (ly_car (s), newright);
}
me->set_property ("right-items", newright);
do
{
- for (SCM s = props[d]; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = props[d]; ly_pair_p (s); s = ly_cdr (s))
{
- Item * it= dynamic_cast<Item*> (unsmob_grob (gh_car (s)));
+ Item * it= dynamic_cast<Item*> (unsmob_grob (ly_car (s)));
if (d == RIGHT)
acc_right = acc_right || Note_column::accidentals (it);
Interval ext;
if (Note_column::has_interface (b))
{
- for (SCM s = b->get_property ("note-heads"); gh_pair_p (s); s =gh_cdr (s))
- ext.unite (unsmob_grob (gh_car (s))->extent (common, X_AXIS));
+ for (SCM s = b->get_property ("note-heads"); ly_pair_p (s); s =ly_cdr (s))
+ ext.unite (unsmob_grob (ly_car (s))->extent (common, X_AXIS));
}
if (ext.is_empty ())
{
finished_= span_;
span_ = 0;
- if (gh_string_p (ott))
+ if (ly_string_p (ott))
{
span_ = make_spanner ("OttavaBracket");
span_->set_property ("text", ott);
SCM c0 (get_property ("middleCPosition"));
SCM oc0 (get_property ("originalCentralCPosition"));
if (scm_less_p (oc0, c0) == SCM_BOOL_T)
- span_->set_property ("direction", gh_int2scm (DOWN));
+ span_->set_property ("direction", scm_int2num (DOWN));
}
}
last_ottavation_ = ott;
- if (gh_procedure_p (pred))
+ if (ly_procedure_p (pred))
{
/*
should typecheck pred.
if (get_footer ())
out->output_line (stencil2line (get_footer ()), &o, is_last);
out->output_scheme (scm_list_2 (ly_symbol2scm ("stop-page"),
- gh_bool2scm (is_last && !get_footer ())));
+ ly_bool2scm (is_last && !get_footer ())));
progress_indication ("]");
}
SCM all = lines ();
SCM proc = paper->get_scmvar ("page-breaking");
- SCM breaks = scm_apply_0 (proc, scm_list_n (all, gh_double2scm (height_),
- gh_double2scm (text_height),
- gh_double2scm (-copy_height),
- gh_double2scm (-tag_height),
+ SCM breaks = scm_apply_0 (proc, scm_list_n (all, scm_make_real (height_),
+ scm_make_real (text_height),
+ scm_make_real (-copy_height),
+ scm_make_real (-tag_height),
SCM_UNDEFINED));
/* Copyright on first page. */
if (i)
page = new Page (paper, i+1);
int next = i + 1 < page_count
- ? gh_scm2int (scm_vector_ref (breaks, gh_int2scm (i))) : 0;
+ ? ly_scm2int (scm_vector_ref (breaks, scm_int2num (i))) : 0;
while ((!next && all != SCM_EOL) || line <= next)
{
SCM s = ly_car (all);
h += pl->dim ()[Y_AXIS];
if (!pl->is_title () && h > page_height)
{
- breaks = ly_snoc (gh_int2scm (number), breaks);
+ breaks = ly_snoc (scm_int2num (number), breaks);
page_number++;
page_height = text_height + (page_number == page_count) * last;
h = 0;
}
if (ly_cdr (s) == SCM_EOL)
- breaks = ly_snoc (gh_int2scm (pl->number_), breaks);
+ breaks = ly_snoc (scm_int2num (pl->number_), breaks);
}
return scm_vector (breaks);
"Return a vector with line numbers of page breaks.")
{
SCM_ASSERT_TYPE (scm_pair_p (lines), lines, SCM_ARG1, __FUNCTION__, "list");
- SCM_ASSERT_TYPE (gh_number_p (book), book, SCM_ARG2, __FUNCTION__, "real");
- SCM_ASSERT_TYPE (gh_number_p (text), text, SCM_ARG2, __FUNCTION__, "real");
- SCM_ASSERT_TYPE (gh_number_p (first), first, SCM_ARG2, __FUNCTION__, "real");
- SCM_ASSERT_TYPE (gh_number_p (last), last, SCM_ARG2, __FUNCTION__, "real");
+ SCM_ASSERT_TYPE (ly_number_p (book), book, SCM_ARG2, __FUNCTION__, "real");
+ SCM_ASSERT_TYPE (ly_number_p (text), text, SCM_ARG2, __FUNCTION__, "real");
+ SCM_ASSERT_TYPE (ly_number_p (first), first, SCM_ARG2, __FUNCTION__, "real");
+ SCM_ASSERT_TYPE (ly_number_p (last), last, SCM_ARG2, __FUNCTION__, "real");
return c_ragged_page_breaks (lines,
- gh_scm2double (book), gh_scm2double (text),
- gh_scm2double (first), gh_scm2double (last));
+ ly_scm2double (book), ly_scm2double (text),
+ ly_scm2double (first), ly_scm2double (last));
}
bool
Paper_column::is_used (Grob*me)
{
- return gh_pair_p (me->get_property ("elements")) || Item::is_breakable (me)
- || gh_pair_p (me->get_property ("bounded-by-me"))
+ return ly_pair_p (me->get_property ("elements")) || Item::is_breakable (me)
+ || ly_pair_p (me->get_property ("bounded-by-me"))
;
}
SCM c = me->get_property ("bounded-by-me");
SCM *ptrptr = &c;
- while (gh_pair_p (*ptrptr))
+ while (ly_pair_p (*ptrptr))
{
- Grob * g = unsmob_grob (gh_car (*ptrptr));
+ Grob * g = unsmob_grob (ly_car (*ptrptr));
if (!g || !g->live ())
{
- *ptrptr = gh_cdr (*ptrptr);
+ *ptrptr = ly_cdr (*ptrptr);
}
else
{
SCM val = lookup_variable (s);
SCM scale = lookup_variable (ly_symbol2scm ("outputscale"));
- Real sc = gh_scm2double (scale);
- return gh_scm2double (val) / sc;
+ Real sc = ly_scm2double (scale);
+ return ly_scm2double (val) / sc;
}
/*
SCM sizes = scm_hashq_ref (scaled_fonts_, f->self_scm (), SCM_BOOL_F);
if (sizes != SCM_BOOL_F)
{
- SCM met = scm_assoc (gh_double2scm (m), sizes);
- if (gh_pair_p (met))
+ SCM met = scm_assoc (scm_make_real (m), sizes);
+ if (ly_pair_p (met))
return unsmob_metrics (ly_cdr (met));
}
else
*/
SCM l = SCM_EOL;
SCM *t = &l;
- for (SCM s = vf->get_font_list (); gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = vf->get_font_list (); ly_pair_p (s); s = ly_cdr (s))
{
Font_metric*scaled
- = find_scaled_font (unsmob_metrics (gh_car (s)), m);
+ = find_scaled_font (unsmob_metrics (ly_car (s)), m);
*t = scm_cons (scaled->self_scm (), SCM_EOL);
t = SCM_CDRLOC(*t);
}
SCM scale_var = ly_module_lookup (scope_, ly_symbol2scm ("outputscale"));
SCM coding_var = ly_module_lookup (scope_, ly_symbol2scm ("inputcoding"));
- m /= gh_scm2double (scm_variable_ref (scale_var));
+ m /= ly_scm2double (scm_variable_ref (scale_var));
val = Modified_font_metric::make_scaled_font_metric (scm_variable_ref (coding_var),
f, m);
}
- sizes = scm_acons (gh_double2scm (m), val, sizes);
+ sizes = scm_acons (scm_make_real (m), val, sizes);
scm_gc_unprotect_object (val);
scm_hashq_set_x (scaled_fonts_, f->self_scm (), sizes);
SCM func = ly_scheme_function ("hash-table->alist");
SCM l = SCM_EOL;
- for (SCM s = scm_call_1 (func, scaled_fonts_); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = scm_call_1 (func, scaled_fonts_); ly_pair_p (s); s = ly_cdr (s))
{
- SCM entry = gh_car (s);
- for (SCM t = gh_cdr (entry); gh_pair_p (t); t = gh_cdr (t))
+ SCM entry = ly_car (s);
+ for (SCM t = ly_cdr (entry); ly_pair_p (t); t = ly_cdr (t))
{
- Font_metric *fm= unsmob_metrics (gh_cdar (t));
+ Font_metric *fm= unsmob_metrics (ly_cdar (t));
if (dynamic_cast<Modified_font_metric*> (fm))
- l = gh_cons (fm->self_scm (), l);
+ l = scm_cons (fm->self_scm (), l);
}
}
return l;
Paper_def *op = dynamic_cast<Paper_def*> (unsmob_music_output_def (def));
bool pap = op;
- return gh_bool2scm (pap);
+ return ly_bool2scm (pap);
}
{
Paper_line *pl = unsmob_paper_line (line);
SCM_ASSERT_TYPE (pl, line, SCM_ARG1, __FUNCTION__, "paper-line");
- return gh_double2scm (pl->dim ()[Y_AXIS]);
+ return scm_make_real (pl->dim ()[Y_AXIS]);
}
LY_DEFINE (ly_paper_line_number, "ly:paper-line-number",
{
Paper_line *pl = unsmob_paper_line (line);
SCM_ASSERT_TYPE (pl, line, SCM_ARG1, __FUNCTION__, "paper-line");
- return gh_int2scm (pl->number_);
+ return scm_int2num (pl->number_);
}
LY_DEFINE (ly_paper_line_break_score, "ly:paper-line-break-score",
{
Paper_line *pl = unsmob_paper_line (line);
SCM_ASSERT_TYPE (pl, line, SCM_ARG1, __FUNCTION__, "paper-line");
- return gh_int2scm (int (pl->is_title ()) * TITLE_PENALTY);
+ return scm_int2num (int (pl->is_title ()) * TITLE_PENALTY);
}
if (output_format_global == PAGE_LAYOUT)
scm_display (scm_eval (scm, output_module_), file_);
else
- gh_call2 (output_func_, scm, file_);
+ scm_call_2 (output_func_, scm, file_);
}
void
SCM fields = SCM_EOL;
for (int i = dump_header_fieldnames_global.size (); i--; )
fields
- = gh_cons (ly_symbol2scm (dump_header_fieldnames_global[i].to_str0 ()),
+ = scm_cons (ly_symbol2scm (dump_header_fieldnames_global[i].to_str0 ()),
fields);
output_scheme (scm_list_n (ly_symbol2scm ("output-scopes"),
paper->self_scm (),
if (output_format_global != PAGE_LAYOUT)
output_scheme (scm_list_3 (ly_symbol2scm ("start-system"),
- gh_double2scm (dim[X_AXIS]),
- gh_double2scm (dim[Y_AXIS])));
+ scm_make_real (dim[X_AXIS]),
+ scm_make_real (dim[Y_AXIS])));
else
{
output_scheme (scm_list_3 (ly_symbol2scm ("new-start-system"),
}
SCM between = SCM_EOL;
- for (SCM s = pl->stencils (); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = pl->stencils (); ly_pair_p (s); s = ly_cdr (s))
{
Stencil *stil = unsmob_stencil (ly_car (s));
if (stil)
{
while (1)
{
- if (!gh_pair_p (expr))
+ if (!ly_pair_p (expr))
return;
SCM head =ly_car (expr);
output_scheme (scm_list_n (ly_symbol2scm ("define-origin"),
scm_makfrom0str (ip->file_string ().to_str0 ()),
- gh_int2scm (ip->line_number ()),
- gh_int2scm (ip->column_number ()),
+ scm_int2num (ip->line_number ()),
+ scm_int2num (ip->column_number ()),
SCM_UNDEFINED));
expr = ly_cadr (expr);
}
else
{
output_scheme (scm_list_n (ly_symbol2scm ("placebox"),
- gh_double2scm (o[X_AXIS]),
- gh_double2scm (o[Y_AXIS]),
+ scm_make_real (o[X_AXIS]),
+ scm_make_real (o[Y_AXIS]),
expr,
SCM_UNDEFINED));
return;
if (!system_)
system_ = system;
- systems_ = gh_cons (system->self_scm (), systems_);
+ systems_ = scm_cons (system->self_scm (), systems_);
system->pscore_ = this;
scm_gc_unprotect_object (system->self_scm ());
Shouldn't scm_read () do this for us? */
scm_fill_input (port);
SCM to = scm_ftell (port);
- ps->nchars = gh_scm2int (to) - gh_scm2int (from);
+ ps->nchars = ly_scm2int (to) - ly_scm2int (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.
ps->start_location_.error (_("GUILE signaled an error for the expression beginning here"));
if (scm_ilength (args) > 2)
- scm_display_error_message (gh_cadr (args), gh_caddr (args), scm_current_error_port ());
+ scm_display_error_message (ly_cadr (args), ly_caddr (args), scm_current_error_port ());
/*
The following is a kludge; we should probably search for
#define YYERROR_VERBOSE 1
-My_lily_parser* my_lily_parser;
#define YYPARSE_PARAM my_lily_parser
#define YYLEX_PARAM my_lily_parser
#define THIS\
tag_music (Music *m, SCM tag, Input ip)
{
SCM tags = m->get_property ("tags");
- if (gh_symbol_p (tag))
+ if (ly_symbol_p (tag))
tags = scm_cons (tag, tags);
- else if (gh_list_p (tag))
- tags = gh_append2 (tag, tags);
+ else if (ly_list_p (tag))
+ tags = ly_append2 (tag, tags);
else
ip.warning (_ ("Tag must be symbol or list of symbols."));
void
set_music_properties (Music *p, SCM a)
{
- for (SCM k = a; gh_pair_p (k); k = ly_cdr (k))
+ for (SCM k = a; ly_pair_p (k); k = ly_cdr (k))
p->internal_set_property (ly_caar (k), ly_cdar (k));
}
bool
ly_input_procedure_p (SCM x)
{
- return gh_procedure_p (x)
- || (gh_pair_p (x) && gh_procedure_p (gh_car (x)));
+ return ly_procedure_p (x)
+ || (ly_pair_p (x) && ly_procedure_p (ly_car (x)));
}
Music*
%pure_parser
-
%token ACCEPTS
%token ADDLYRICS
%token ADDQUOTE
| context_def_spec_body GROBDESCRIPTIONS embedded_scm {
Context_def*td = unsmob_context_def ($$);
- for (SCM p = $3; gh_pair_p (p); p = ly_cdr (p)) {
- SCM tag = gh_caar (p);
+ for (SCM p = $3; ly_pair_p (p); p = ly_cdr (p)) {
+ SCM tag = ly_caar (p);
/* TODO: should make new tag "grob-definition" ? */
td->add_context_mod (scm_list_3 (ly_symbol2scm ("assign"),
- tag, gh_cons (ly_cdar (p), SCM_EOL)));
+ tag, scm_cons (ly_cdar (p), SCM_EOL)));
}
}
| context_def_spec_body context_mod {
guh.
*/
SCM check_funcs = ly_scheme_function ("toplevel-music-functions");
- for (; gh_pair_p (check_funcs); check_funcs = gh_cdr (check_funcs))
- m = gh_call1 (gh_car (check_funcs), m);
+ for (; ly_pair_p (check_funcs); check_funcs = ly_cdr (check_funcs))
+ m = scm_call_1 (ly_car (check_funcs), m);
$$->music_ = m;
}
junk this ? there already is tempo stuff in
music.
*/
- int m = gh_scm2int ( $2->get_property ("metronome-count"));
+ int m = ly_scm2int ( $2->get_property ("metronome-count"));
Duration *d = unsmob_duration ($2->get_property ("tempo-unit"));
Midi_def *md = dynamic_cast<Midi_def*> ($$);
if (md)
TEMPO steno_duration '=' bare_unsigned {
$$ = MY_MAKE_MUSIC ("MetronomeChangeEvent");
$$->set_property ("tempo-unit", $2);
- $$->set_property ("metronome-count", gh_int2scm ( $4));
+ $$->set_property ("metronome-count", scm_int2num ( $4));
}
;
SCM s = $$;
SCM c = scm_cons ($2->self_scm (), SCM_EOL);
scm_gc_unprotect_object ($2->self_scm ()); /* UGH */
- if (gh_pair_p (ly_cdr (s)))
- gh_set_cdr_x (ly_cdr (s), c); /* append */
+ if (ly_pair_p (ly_cdr (s)))
+ scm_set_cdr_x (ly_cdr (s), c); /* append */
else
- gh_set_car_x (s, c); /* set first cons */
- gh_set_cdr_x (s, c); /* remember last cell */
+ scm_set_car_x (s, c); /* set first cons */
+ scm_set_cdr_x (s, c); /* remember last cell */
}
| Music_list error {
}
{
Music *beg = $4;
int times = $3;
- SCM alts = gh_pair_p ($5) ? gh_car ($5) : SCM_EOL;
+ SCM alts = ly_pair_p ($5) ? ly_car ($5) : SCM_EOL;
if (times < scm_ilength (alts)) {
- unsmob_music (gh_car (alts))
+ unsmob_music (ly_car (alts))
->origin ()->warning (
_ ("More alternatives than repeats. Junking excess alternatives."));
alts = ly_truncate_list (times, alts);
r-> set_property ("element", beg->self_scm ());
scm_gc_unprotect_object (beg->self_scm ());
}
- r->set_property ("repeat-count", gh_int2scm (times >? 1));
+ r->set_property ("repeat-count", scm_int2num (times >? 1));
r-> set_property ("elements",alts);
- if (gh_equal_p ($2, scm_makfrom0str ("tremolo"))) {
+ if (ly_equal_p ($2, scm_makfrom0str ("tremolo"))) {
/*
TODO: move this code to Scheme.
*/
shift -= 1;
r->compress (Moment (Rational (1, list_len)));
}
- gh_call3 (func, r->self_scm (), gh_int2scm (shift),gh_int2scm (dots));
+ scm_call_3 (func, r->self_scm (), scm_int2num (shift),scm_int2num (dots));
}
r->set_spot (*$4->origin ());
context_mod_list:
/* */ { $$ = SCM_EOL; }
| context_mod_list context_mod {
- $$ = gh_cons ($2, $1);
+ $$ = scm_cons ($2, $1);
}
;
| PARTCOMBINE Music Music {
SCM proc = ly_scheme_function ("make-part-combine-music");
- SCM res = scm_call_1 (proc, gh_list ($2->self_scm (),
+ SCM res = scm_call_1 (proc, scm_listify ($2->self_scm (),
$3->self_scm (), SCM_UNDEFINED));
scm_gc_unprotect_object ($3->self_scm ());
scm_gc_unprotect_object ($2->self_scm ());
fraction Music
{
- int n = gh_scm2int (ly_car ($3)); int d = gh_scm2int (ly_cdr ($3));
+ int n = ly_scm2int (ly_car ($3)); int d = ly_scm2int (ly_cdr ($3));
Music *mp = $4;
$$= MY_MAKE_MUSIC ("TimeScaledMusic");
$$->set_property ("element", mp->self_scm ());
scm_gc_unprotect_object (mp->self_scm ());
- $$->set_property ("numerator", gh_int2scm (n));
- $$->set_property ("denominator", gh_int2scm (d));
+ $$->set_property ("numerator", scm_int2num (n));
+ $$->set_property ("denominator", scm_int2num (d));
$$->compress (Moment (Rational (n,d)));
}
}
else
{
- SCM ret = gh_call1 ($2, $3->self_scm ());
+ SCM ret = scm_call_1 ($2, $3->self_scm ());
Music *m = unsmob_music (ret);
if (!m) {
THIS->parser_error ("\\apply must return a Music");
re_rhythmed_music:
ADDLYRICS Music Music {
Music *l = MY_MAKE_MUSIC ("LyricCombineMusic");
- l->set_property ("elements", gh_list ($2->self_scm (), $3->self_scm (), SCM_UNDEFINED));
+ l->set_property ("elements", scm_listify ($2->self_scm (), $3->self_scm (), SCM_UNDEFINED));
scm_gc_unprotect_object ($3->self_scm ());
scm_gc_unprotect_object ($2->self_scm ());
$$ = l;
OVERRIDE context_prop_spec embedded_scm '=' scalar {
$$ = property_op_to_music (scm_list_4 (
ly_symbol2scm ("poppush"),
- gh_cadr ($2),
+ ly_cadr ($2),
$3, $5));
- $$= context_spec_music (gh_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
+ $$= context_spec_music (ly_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
}
| REVERT context_prop_spec embedded_scm {
$$ = property_op_to_music (scm_list_3 (
ly_symbol2scm ("pop"),
- gh_cadr ($2),
+ ly_cadr ($2),
$3));
- $$= context_spec_music (gh_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
+ $$= context_spec_music (ly_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
}
| SET context_prop_spec '=' scalar {
$$ = property_op_to_music (scm_list_3 (
ly_symbol2scm ("assign"),
- gh_cadr ($2),
+ ly_cadr ($2),
$4));
- $$= context_spec_music (gh_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
+ $$= context_spec_music (ly_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
}
| UNSET context_prop_spec {
$$ = property_op_to_music (scm_list_2 (
ly_symbol2scm ("unset"),
- gh_cadr ($2)));
- $$= context_spec_music (gh_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
+ ly_cadr ($2)));
+ $$= context_spec_music (ly_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
}
| ONCE music_property_def {
SCM e = $2->get_property ("element");
scalar:
string { $$ = $1; }
- | bare_int { $$ = gh_int2scm ($1); }
+ | bare_int { $$ = scm_int2num ($1); }
| embedded_scm { $$ = $1; }
| full_markup { $$ = $1; }
- | DIGIT { $$ = gh_int2scm ($1); }
+ | DIGIT { $$ = scm_int2num ($1); }
;
/*
pre_events simple_element post_events {
SCM elts = $2-> get_property ("elements");
- elts = gh_append2 (elts, scm_reverse_x ($3, SCM_EOL));
+ elts = ly_append2 (elts, scm_reverse_x ($3, SCM_EOL));
$2->set_property ("elements", elts);
$$ = $2;
SCM es = $1->get_property ("elements");
SCM postevs = scm_reverse_x ($3, SCM_EOL);
- for (SCM s = es; gh_pair_p (s); s = gh_cdr (s))
- unsmob_music (gh_car (s))->set_property ("duration", dur);
- es = gh_append2 (es, postevs);
+ for (SCM s = es; ly_pair_p (s); s = ly_cdr (s))
+ unsmob_music (ly_car (s))->set_property ("duration", dur);
+ es = ly_append2 (es, postevs);
$1-> set_property ("elements", es);
$$ = $1;
chord_body_elements:
/* empty */ { $$ = SCM_EOL; }
| chord_body_elements chord_body_element {
- $$ = gh_cons ($2->self_scm (), $1);
+ $$ = scm_cons ($2->self_scm (), $1);
scm_gc_unprotect_object ($2->self_scm ());
}
;
if ($2 % 2 || $3 % 2)
n->set_property ("force-accidental", SCM_BOOL_T);
- if (gh_pair_p ($4)) {
+ if (ly_pair_p ($4)) {
SCM arts = scm_reverse_x ($4, SCM_EOL);
n->set_property ("articulations", arts);
}
n->set_property ("drum-type", $1);
n->set_spot (THIS->here_input ());
- if (gh_pair_p ($2)) {
+ if (ly_pair_p ($2)) {
SCM arts = scm_reverse_x ($2, SCM_EOL);
n->set_property ("articulations", arts);
}
evs = scm_hash_ref (tab, key, SCM_BOOL_F);
}
Music *quote = 0;
- if (gh_vector_p (evs))
+ if (ly_vector_p (evs))
{
quote = MY_MAKE_MUSIC ("QuoteMusic");
quote->set_property ("duration", $3);
}
| E_LEFTSQUARE {
Music *l = MY_MAKE_MUSIC ("LigatureEvent");
- l->set_property ("span-direction", gh_int2scm (START));
+ l->set_property ("span-direction", scm_int2num (START));
l->set_spot (THIS->here_input ());
$$ = MY_MAKE_MUSIC ("EventChord");
}
| E_RIGHTSQUARE {
Music *l = MY_MAKE_MUSIC ("LigatureEvent");
- l->set_property ("span-direction", gh_int2scm (STOP));
+ l->set_property ("span-direction", scm_int2num (STOP));
l->set_spot (THIS->here_input ());
$$ = MY_MAKE_MUSIC ("EventChord");
| TIME_T fraction {
SCM proc= ly_scheme_function ("make-time-signature-set");
- SCM result = scm_apply_2 (proc, gh_car ($2), gh_cdr ($2), SCM_EOL);
+ SCM result = scm_apply_2 (proc, ly_car ($2), ly_cdr ($2), SCM_EOL);
scm_gc_protect_object (result);
$$ = unsmob_music (result);
}
}
| post_events post_event {
$2->set_spot (THIS->here_input ());
- $$ = gh_cons ($2->self_scm (), $$);
+ $$ = scm_cons ($2->self_scm (), $$);
scm_gc_unprotect_object ($2->self_scm ());
}
| post_events tagged_post_event {
}
| script_dir direction_reqd_event {
if ($1)
- $2->set_property ("direction", gh_int2scm ($1));
+ $2->set_property ("direction", scm_int2num ($1));
$$ = $2;
}
| script_dir direction_less_event {
if ($1)
- $2->set_property ("direction", gh_int2scm ($1));
+ $2->set_property ("direction", scm_int2num ($1));
$$ = $2;
}
| string_number_event
string_number_event:
E_UNSIGNED {
Music *s = MY_MAKE_MUSIC ("StringNumberEvent");
- s->set_property ("string-number", gh_int2scm ($1));
+ s->set_property ("string-number", scm_int2num ($1));
s->set_spot (THIS->here_input ());
$$ = s;
}
*/
Music *m = MY_MAKE_MUSIC ("BeamEvent");
m->set_spot (THIS->here_input ());
- m->set_property ("span-direction", gh_int2scm (START));
+ m->set_property ("span-direction", scm_int2num (START));
$$ = m;
}
| ']' {
Music *m = MY_MAKE_MUSIC ("BeamEvent");
m->set_spot (THIS->here_input ());
- m->set_property ("span-direction", gh_int2scm (STOP));
+ m->set_property ("span-direction", scm_int2num (STOP));
$$ = m;
}
| '~' {
| close_event {
$$ = $1;
dynamic_cast<Music *> ($$)->set_property ("span-direction",
- gh_int2scm (START));
+ scm_int2num (START));
}
| open_event {
$$ = $1;
dynamic_cast<Music *> ($$)->set_property ("span-direction",
- gh_int2scm (STOP));
+ scm_int2num (STOP));
}
| EVENT_IDENTIFIER {
$$ = unsmob_music ($1);
| tremolo_type {
Music *a = MY_MAKE_MUSIC ("TremoloEvent");
a->set_spot (THIS->here_input ());
- a->set_property ("tremolo-type", gh_int2scm ($1));
+ a->set_property ("tremolo-type", scm_int2num ($1));
$$ = a;
}
;
| script_abbreviation {
SCM s = THIS->lexer_->lookup_identifier ("dash" + ly_scm2string ($1));
Music *a = MY_MAKE_MUSIC ("ArticulationEvent");
- if (gh_string_p (s))
+ if (ly_string_p (s))
a->set_property ("articulation-type", s);
else THIS->parser_error (_ ("Expecting string as script definition"));
$$ = a;
oct_check:
/**/ { $$ = SCM_EOL; }
- | '=' { $$ = gh_int2scm (0); }
- | '=' sub_quotes { $$ = gh_int2scm ($2); }
- | '=' sup_quotes { $$ = gh_int2scm ($2); }
+ | '=' { $$ = scm_int2num (0); }
+ | '=' sub_quotes { $$ = scm_int2num ($2); }
+ | '=' sup_quotes { $$ = scm_int2num ($2); }
;
sup_quotes:
}
| DIGIT {
Music *t = MY_MAKE_MUSIC ("FingerEvent");
- t->set_property ("digit", gh_int2scm ($1));
+ t->set_property ("digit", scm_int2num ($1));
t->set_spot (THIS->here_input ());
$$ = t;
}
$$ = unsmob_duration ($$)->compressed ( $3) .smobbed_copy ();
}
| multiplied_duration '*' FRACTION {
- Rational m (gh_scm2int (ly_car ($3)), gh_scm2int (ly_cdr ($3)));
+ Rational m (ly_scm2int (ly_car ($3)), ly_scm2int (ly_cdr ($3)));
$$ = unsmob_duration ($$)->compressed (m).smobbed_copy ();
}
fraction:
FRACTION { $$ = $1; }
| UNSIGNED '/' UNSIGNED {
- $$ = scm_cons (gh_int2scm ($1), gh_int2scm ($3));
+ $$ = scm_cons (scm_int2num ($1), scm_int2num ($3));
}
;
*****************************************************************/
bass_number:
DIGIT {
- $$ = scm_number_to_string (gh_int2scm ($1), gh_int2scm (10));
+ $$ = scm_number_to_string (scm_int2num ($1), scm_int2num (10));
}
| UNSIGNED {
- $$ = scm_number_to_string (gh_int2scm ($1), gh_int2scm (10));
+ $$ = scm_number_to_string (scm_int2num ($1), scm_int2num (10));
}
| STRING { $$ = $1; }
;
Music *m = unsmob_music ($1);
if ($2) {
SCM salter = m->get_property ("alteration");
- int alter = gh_number_p (salter) ? gh_scm2int (salter) : 0;
+ int alter = ly_number_p (salter) ? ly_scm2int (salter) : 0;
m->set_property ("alteration",
- gh_int2scm (alter + $2));
+ scm_int2num (alter + $2));
} else {
- m->set_property ("alteration", gh_int2scm (0));
+ m->set_property ("alteration", scm_int2num (0));
}
}
;
n->set_property ("pitch", $1);
n->set_property ("duration", $5);
- if (gh_number_p ($4))
+ if (ly_number_p ($4))
{
- int q = gh_scm2int ($4);
- n->set_property ("absolute-octave", gh_int2scm (q-1));
+ int q = ly_scm2int ($4);
+ n->set_property ("absolute-octave", scm_int2num (q-1));
}
if ($3 % 2)
Music *m = unsmob_music ($1);
Input i = THIS->pop_spot ();
m->set_spot (i);
- for (SCM s = m->get_property ("elements"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = m->get_property ("elements"); ly_pair_p (s); s = ly_cdr (s))
{
unsmob_music (ly_car (s))->set_property ("duration", $2);
}
}
| steno_tonic_pitch optional_notemode_duration chord_separator chord_items {
SCM its = scm_reverse_x ($4, SCM_EOL);
- $$ = make_chord ($1, $2, gh_cons ($3, its));
+ $$ = make_chord ($1, $2, scm_cons ($3, its));
}
;
$$ = SCM_EOL;
}
| chord_items chord_item {
- $$ = gh_cons ($2, $$);
+ $$ = scm_cons ($2, $$);
}
;
;
step_numbers:
- step_number { $$ = gh_cons ($1, SCM_EOL); }
+ step_number { $$ = scm_cons ($1, SCM_EOL); }
| step_numbers '.' step_number {
- $$ = gh_cons ($3, $$);
+ $$ = scm_cons ($3, $$);
}
;
bare_number:
UNSIGNED {
- $$ = gh_int2scm ($1);
+ $$ = scm_int2num ($1);
}
| REAL {
$$ = $1;
$$ = $1;
}
| REAL NUMBER_IDENTIFIER {
- $$ = gh_double2scm (gh_scm2double ($1) *gh_scm2double ($2));
+ $$ = scm_make_real (ly_scm2double ($1) *ly_scm2double ($2));
}
| UNSIGNED NUMBER_IDENTIFIER {
- $$ = gh_double2scm ($1 *gh_scm2double ($2));
+ $$ = scm_make_real ($1 *ly_scm2double ($2));
}
;
bare_number {
if (scm_integer_p ($1) == SCM_BOOL_T)
{
- int k = gh_scm2int ($1);
+ int k = ly_scm2int ($1);
$$ = k;
} else
{
markup_list_body:
/**/ { $$ = SCM_EOL; }
| markup_list_body markup {
- $$ = gh_cons ($2, $1);
+ $$ = scm_cons ($2, $1);
}
;
int
My_lily_lexer::try_special_identifiers (SCM *destination, SCM sid)
{
- if (gh_string_p (sid)) {
+ if (ly_string_p (sid)) {
*destination = sid;
return STRING_IDENTIFIER;
- } else if (gh_number_p (sid)) {
+ } else if (ly_number_p (sid)) {
*destination = sid;
return NUMBER_IDENTIFIER;
} else if (unsmob_context_def (sid)) {
property_op_to_music (SCM op)
{
Music *m = 0;
- SCM tag = gh_car (op);
- SCM symbol = gh_cadr (op);
- SCM args = gh_cddr (op);
+ SCM tag = ly_car (op);
+ SCM symbol = ly_cadr (op);
+ SCM args = ly_cddr (op);
SCM grob_val = SCM_UNDEFINED;
SCM grob_sym = SCM_UNDEFINED;
SCM val = SCM_UNDEFINED;
if (tag == ly_symbol2scm ("assign"))
{
m = MY_MAKE_MUSIC ("PropertySet");
- val = gh_car (args);
+ val = ly_car (args);
}
else if (tag == ly_symbol2scm ("unset"))
m = MY_MAKE_MUSIC ("PropertyUnset");
|| tag == ly_symbol2scm ("push"))
{
m = MY_MAKE_MUSIC ("OverrideProperty");
- grob_sym = gh_car (args);
- grob_val = gh_cadr (args);
+ grob_sym = ly_car (args);
+ grob_val = ly_cadr (args);
}
else if (tag == ly_symbol2scm ("pop")) {
m = MY_MAKE_MUSIC ("RevertProperty");
- grob_sym = gh_car (args);
+ grob_sym = ly_car (args);
}
m->set_property ("symbol", symbol);
bool itc = internal_type_checking_global_b;
/* UGH.
*/
- bool autobeam = gh_equal_p (symbol, ly_symbol2scm ("autoBeamSettings"));
+ bool autobeam = ly_equal_p (symbol, ly_symbol2scm ("autoBeamSettings"));
if (autobeam)
internal_type_checking_global_b = false;
m->set_property ("grob-property", grob_sym);
scm_gc_unprotect_object (m->self_scm ());
csm->set_property ("context-type",
- gh_symbol_p (type) ? type : scm_string_to_symbol (type));
+ ly_symbol_p (type) ? type : scm_string_to_symbol (type));
csm->set_property ("property-operations", ops);
- if (gh_string_p (id))
+ if (ly_string_p (id))
csm->set_property ("context-id", id);
return csm;
}
one_.set_translator (one);
set_translator (one);
- first_iter_ = unsmob_iterator (get_iterator (unsmob_music (gh_car (lst))));
+ first_iter_ = unsmob_iterator (get_iterator (unsmob_music (ly_car (lst))));
Context *two = tr->find_create_context (ly_symbol2scm ("Voice"),
"two", props);
two_.set_translator (two);
set_translator (two);
- second_iter_ = unsmob_iterator (get_iterator (unsmob_music (gh_cadr (lst))));
+ second_iter_ = unsmob_iterator (get_iterator (unsmob_music (ly_cadr (lst))));
set_translator (tr);
{
SCM sym = ly_symbol2scm (*p);
execute_pushpop_property (one, sym,
- ly_symbol2scm ("direction"), gh_int2scm (1));
+ ly_symbol2scm ("direction"), scm_int2num (1));
execute_pushpop_property (two, sym,
- ly_symbol2scm ("direction"), gh_int2scm (-1));
+ ly_symbol2scm ("direction"), scm_int2num (-1));
}
}
Moment now = get_outlet ()->now_mom ();
Moment *splitm = 0;
- for (; gh_pair_p (split_list_); split_list_ = gh_cdr (split_list_))
+ for (; ly_pair_p (split_list_); split_list_ = ly_cdr (split_list_))
{
- splitm = unsmob_moment (gh_caar (split_list_));
+ splitm = unsmob_moment (ly_caar (split_list_));
if (splitm && *splitm + start_moment_ > now)
break ;
- SCM tag = gh_cdar (split_list_);
+ SCM tag = ly_cdar (split_list_);
if (tag == ly_symbol2scm ("chords"))
chords_together ();
solo1 ();
else if (tag == ly_symbol2scm ("solo2"))
solo2 ();
- else if (gh_symbol_p (tag))
+ else if (ly_symbol_p (tag))
{
String s = "Unknown split directive: "
- + (gh_symbol_p (tag) ? ly_symbol2string (tag) : String ("not a symbol"));
+ + (ly_symbol_p (tag) ? ly_symbol2string (tag) : String ("not a symbol"));
programming_error (s);
}
}
{
Audio_element_info info = announce_infos_[j];
- for (SCM p = get_simple_trans_list (); gh_pair_p (p); p = ly_cdr (p))
+ for (SCM p = get_simple_trans_list (); ly_pair_p (p); p = ly_cdr (p))
{
Translator * t = unsmob_translator (ly_car (p));
Performer * eng = dynamic_cast<Performer*> (t);
void
performer_each (SCM list, Performer_method method)
{
- for (SCM p = list; gh_pair_p (p); p = ly_cdr (p))
+ for (SCM p = list; ly_pair_p (p); p = ly_cdr (p))
{
Performer * e = dynamic_cast<Performer*>(unsmob_translator (ly_car (p)));
if (e)
if (Direction updown = to_dir (phrasing_slur_ev->get_property ("direction")))
{
- phrasing_slur->set_property ("direction", gh_int2scm (updown));
+ phrasing_slur->set_property ("direction", scm_int2num (updown));
}
start_phrasing_slurs.push (phrasing_slur);
for (Pedal_info*p = info_list_; p->name_; p ++)
{
String nm = p->name_ + String ("Event");
- if (gh_equal_p (m->get_property ("name") ,
- scm_str2symbol (nm.to_str0())))
+ if (ly_equal_p (m->get_property ("name") ,
+ scm_str2symbol(nm.to_str0())))
{
Direction d = to_dir (m->get_property ("span-direction"));
p->event_drul_[d] = m;
}
}
- if (gh_string_p (s))
+ if (ly_string_p (s))
{
String propname = String (p->name_) + "Pedal";
if (!p->event_drul_[START])
{
SCM flare = p->bracket_->get_property ("bracket-flare");
- p->bracket_->set_property ("bracket-flare", scm_cons (gh_car (flare),
- gh_double2scm (0)));
+ p->bracket_->set_property ("bracket-flare", scm_cons (ly_car (flare),
+ scm_make_real (0)));
}
p->finished_bracket_ = p->bracket_;
if (!p->finished_bracket_)
{
SCM flare = p->bracket_->get_property ("bracket-flare");
- p->bracket_->set_property ("bracket-flare", scm_cons (gh_double2scm (0),gh_cdr (flare)));
+ p->bracket_->set_property ("bracket-flare", scm_cons (scm_make_real (0),ly_cdr (flare)));
}
for (Pedal_info*p = info_alist_; p->name_; p ++)
{
String nm = p->name_ + String ("Event");
- if (gh_equal_p (r->get_property ("name") ,
+ if (ly_equal_p (r->get_property ("name") ,
scm_str2symbol (nm.to_str0())))
{
Direction d = to_dir (r->get_property ("span-direction"));
Pitch_squash_engraver::acknowledge_grob (Grob_info i)
{
SCM newpos = get_property ("squashedPosition");
- if (gh_number_p (newpos)
+ if (ly_number_p (newpos)
&& Note_head::has_interface (i.grob_))
{
i.grob_->set_property ("staff-position", newpos);
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 (gh_scm2int (octave), gh_scm2int (note), gh_scm2int (alter));
+ Pitch p (ly_scm2int (octave), ly_scm2int (note), ly_scm2int (alter));
return p.smobbed_copy ();
}
{
Pitch *pp = unsmob_pitch (p);
SCM_ASSERT_TYPE (pp, p, SCM_ARG1, __FUNCTION__, "Pitch");
- return gh_int2scm (pp->steps ());
+ return scm_int2num (pp->steps ());
}
LY_DEFINE (pitch_octave, "ly:pitch-octave",
Pitch *p = unsmob_pitch (pp);
SCM_ASSERT_TYPE (p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
int q = p->get_octave ();
- return gh_int2scm (q);
+ return scm_int2num (q);
}
LY_DEFINE (pitch_alteration, "ly:pitch-alteration",
SCM_ASSERT_TYPE (p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
int q = p->get_alteration ();
- return gh_int2scm (q);
+ return scm_int2num (q);
}
LY_DEFINE (pitch_notename, "ly:pitch-notename",
Pitch *p = unsmob_pitch (pp);
SCM_ASSERT_TYPE (p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
int q = p->get_notename ();
- return gh_int2scm (q);
+ return scm_int2num (q);
}
LY_DEFINE (ly_pitch_quartertones, "ly:pitch-quartertones",
Pitch *p = unsmob_pitch (pp);
SCM_ASSERT_TYPE (p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
int q = p->quartertone_pitch ();
- return gh_int2scm (q);
+ return scm_int2num (q);
}
LY_DEFINE (ly_pitch_semitones, "ly:pitch-semitones",
Pitch *p = unsmob_pitch (pp);
SCM_ASSERT_TYPE (p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
int q = p->semitone_pitch ();
- return gh_int2scm (q);
+ return scm_int2num (q);
}
LY_DEFINE (pitch_less, "ly:pitch<?",
Property_iterator::process (Moment m)
{
SCM sym = get_music ()->get_property ("symbol");
- if (gh_symbol_p (sym))
+ if (ly_symbol_p (sym))
{
SCM val = get_music ()->get_property ("value");
bool ok= true;
{
if (!list_p)
{
- list_p = gh_eval_str ("list?");
+ list_p = scm_c_eval_string ("list?");
}
{
int cmp = (lo + hi) / 2;
- SCM when = gh_caar (SCM_VECTOR_REF (vec, cmp));
+ SCM when = ly_caar (SCM_VECTOR_REF (vec, cmp));
bool result = (*is_less) (key, when);
if (result)
hi = cmp;
start_moment_ = now;
event_vector_ = get_music ()->get_property ("quoted-events");
- if (gh_vector_p (event_vector_))
+ if (ly_vector_p (event_vector_))
{
event_idx_ = binsearch_scm_vector (event_vector_, now.smobbed_copy (), &moment_less);
end_idx_ = binsearch_scm_vector (event_vector_, stop.smobbed_copy (), &moment_less);
Quote_iterator::pending_moment () const
{
SCM entry = SCM_VECTOR_REF (event_vector_, event_idx_);
- return *unsmob_moment (gh_caar (entry)) - start_moment_;
+ return *unsmob_moment (ly_caar (entry)) - start_moment_;
}
{
entry = SCM_VECTOR_REF (event_vector_, event_idx_);
- Moment em = *unsmob_moment (gh_caar (entry));
+ Moment em = *unsmob_moment (ly_caar (entry));
if (em > m)
return ;
event_idx_++;
}
- if (gh_pair_p (entry))
+ if (ly_pair_p (entry))
{
- Pitch * quote_pitch = unsmob_pitch (gh_cdar (entry));
+ Pitch * quote_pitch = unsmob_pitch (ly_cdar (entry));
Pitch * me_pitch = unsmob_pitch (get_outlet ()->get_property ("instrumentTransposition"));
- for (SCM s = gh_cdr (entry); gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = ly_cdr (entry); ly_pair_p (s); s = ly_cdr (s))
{
- SCM ev_acc = gh_car (s);
+ SCM ev_acc = ly_car (s);
- Music * mus = unsmob_music (gh_car (ev_acc));
+ Music * mus = unsmob_music (ly_car (ev_acc));
if (mus)
{
if (quote_pitch || me_pitch)
SCM copy = ly_deep_mus_copy (mus->self_scm ());
mus = unsmob_music (copy);
- transposed_musics_ = gh_cons (copy, transposed_musics_);
+ transposed_musics_ = scm_cons (copy, transposed_musics_);
mus->transpose (diff);
}
void
Recording_group_engraver::start ()
{
- if (!gh_pair_p (accumulator_))
- accumulator_ = gh_cons (SCM_EOL, SCM_EOL);
- if (!gh_pair_p (gh_car (accumulator_)))
+ if (!ly_pair_p (accumulator_))
+ accumulator_ = scm_cons (SCM_EOL, SCM_EOL);
+ if (!ly_pair_p (ly_car (accumulator_)))
{
/*
Need to store transposition for every moment; transposition changes during pieces.
*/
- scm_set_car_x (accumulator_, gh_cons (gh_cons (now_mom ().smobbed_copy (),
+ scm_set_car_x (accumulator_, scm_cons (scm_cons (now_mom ().smobbed_copy (),
get_property ("instrumentTransposition")),
SCM_EOL));
}
Recording_group_engraver::stop_translation_timestep ()
{
Engraver_group_engraver::stop_translation_timestep ();
- scm_set_cdr_x (accumulator_, gh_cons (gh_car (accumulator_), gh_cdr (accumulator_)));
+ scm_set_cdr_x (accumulator_, scm_cons (ly_car (accumulator_), ly_cdr (accumulator_)));
scm_set_car_x (accumulator_, SCM_EOL);
}
Engraver_group_engraver::finalize ();
SCM proc = get_property ("recordEventSequence");
- if (gh_procedure_p (proc))
- scm_call_2 (proc, daddy_context_->self_scm (), gh_cdr (accumulator_));
+ if (ly_procedure_p (proc))
+ scm_call_2 (proc, daddy_context_->self_scm (), ly_cdr (accumulator_));
accumulator_ = SCM_EOL;
}
{
bool retval = Translator_group::try_music (m);
- SCM seq = gh_cdar (accumulator_);
- seq = gh_cons (gh_cons (m->self_scm (), gh_bool2scm (retval)),
+ SCM seq = ly_cdar (accumulator_);
+ seq = scm_cons (scm_cons (m->self_scm (), ly_bool2scm (retval)),
seq);
- scm_set_cdr_x (gh_car (accumulator_), seq);
+ scm_set_cdr_x (ly_car (accumulator_), seq);
return retval;
}
bool start = false;
bool end = false;
bool volta_found = false;
- while (gh_pair_p (cs))
+ while (ly_pair_p (cs))
{
SCM command = ly_car (cs);
if (command == ly_symbol2scm ("start-repeat"))
start = true;
else if (command == ly_symbol2scm ("end-repeat"))
end = true;
- else if (gh_pair_p (command) && ly_car (command) == ly_symbol2scm ("volta"))
+ else if (ly_pair_p (command) && ly_car (command) == ly_symbol2scm ("volta"))
volta_found = true;
cs = ly_cdr (cs);
}
*/
SCM wb = get_property ("whichBar");
SCM db = get_property ("defaultBarType");
- if (!gh_string_p (wb) || gh_equal_p (db, wb))
+ if (!ly_string_p (wb) || ly_equal_p (db, wb))
{
- if (s != "" || (volta_found && !gh_string_p (wb)))
+ if (s != "" || (volta_found && !ly_string_p (wb)))
{
daddy_context_->set_property ("whichBar", scm_makfrom0str (s.to_str0 ()));
}
{
lily_1_8_compatibility_used = true;
- for (SCM s = alternatives (); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = alternatives (); ly_pair_p (s); s = ly_cdr (s))
unsmob_music (ly_car (s))->to_relative_octave (p);
}
int done =0;
SCM p = alternatives ();
- while (gh_pair_p (p) && done < repeat_count ())
+ while (ly_pair_p (p) && done < repeat_count ())
{
m = m + unsmob_music (ly_car (p))->get_length ();
done ++;
Moment m;
SCM p = alternatives ();
- while (gh_pair_p (p))
+ while (ly_pair_p (p))
{
m = m + unsmob_music (ly_car (p))->get_length ();
p = ly_cdr (p);
int
Repeated_music::repeat_count () const
{
- return gh_scm2int (get_property ("repeat-count"));
+ return ly_scm2int (get_property ("repeat-count"));
}
Rest_collision::force_shift_callback (SCM element_smob, SCM axis)
{
Grob *them = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (axis);
+ Axis a = (Axis) ly_scm2int (axis);
assert (a == Y_AXIS);
Grob * rc = unsmob_grob (them->get_property ("rest-collision"));
do_shift (rc);
}
- return gh_double2scm (0.0);
+ return scm_make_real (0.0);
}
if (!s)
return SCM_BOOL_F;
else
- return gh_cons (s->get_property ("duration-log"),
- gh_int2scm (Rhythmic_head::dot_count (s)));
+ return scm_cons (s->get_property ("duration-log"),
+ scm_int2num (Rhythmic_head::dot_count (s)));
}
/*
Link_array<Grob> rests;
Link_array<Grob> notes;
- for (SCM s = elts; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = elts; ly_pair_p (s); s = ly_cdr (s))
{
Grob * e = unsmob_grob (ly_car (s));
if (unsmob_grob (e->get_property ("rest")))
int durlog = unsmob_duration (rest_req_->get_property ("duration"))-> duration_log ();
rest_->set_property ("duration-log",
- gh_int2scm (durlog));
+ scm_int2num (durlog));
int dots =unsmob_duration (rest_req_->get_property ("duration"))->dot_count ();
Rhythmic_head::set_dots (rest_, dot_);
dot_->set_parent (rest_, Y_AXIS);
- dot_->set_property ("dot-count", gh_int2scm (dots));
+ dot_->set_property ("dot-count", scm_int2num (dots));
announce_grob (dot_, SCM_EOL);
}
{
int pos= p->steps ();
SCM c0 = get_property ("middleCPosition");
- if (gh_number_p (c0))
- pos += gh_scm2int (c0);
+ if (ly_number_p (c0))
+ pos += ly_scm2int (c0);
- rest_->set_property ("staff-position", gh_int2scm (pos));
+ rest_->set_property ("staff-position", scm_int2num (pos));
}
announce_grob (rest_, rest_req_->self_scm ());
Rest::after_line_breaking (SCM smob)
{
Grob *me = unsmob_grob (smob);
- int bt = gh_scm2int (me->get_property ("duration-log"));
+ int bt = ly_scm2int (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 (d && bt > 4) // UGH.
{
d->set_property ("staff-position",
- gh_int2scm ((bt == 7) ? 4 : 3));
+ scm_int2num ((bt == 7) ? 4 : 3));
}
if (d && bt >= -1 && bt <= 1) // UGH again.
{
d->set_property ("staff-position",
- gh_int2scm ((bt == 0) ? -1 : 1));
+ scm_int2num ((bt == 0) ? -1 : 1));
}
return SCM_UNSPECIFIED;
}
Grob* me = unsmob_grob (smob);
SCM balltype_scm = me->get_property ("duration-log");
- if (!gh_number_p (balltype_scm))
+ if (!ly_number_p (balltype_scm))
return Stencil ().smobbed_copy ();
- int balltype = gh_scm2int (balltype_scm);
+ int balltype = ly_scm2int (balltype_scm);
String style;
SCM style_scm = me->get_property ("style");
- if (gh_symbol_p (style_scm))
+ if (ly_symbol_p (style_scm))
style = ly_scm2string (scm_symbol_to_string (style_scm));
Font_metric *fm = Font_interface::get_default_font (me);
SCM
Rest::extent_callback (SCM smob, SCM ax)
{
- Axis a = (Axis) gh_scm2int (ax);
+ Axis a = (Axis) ly_scm2int (ax);
SCM m = brew_internal_stencil (smob);
return ly_interval2scm (unsmob_stencil (m)->extent (a));
}
Rest::polyphonic_offset_callback (SCM smob, SCM)
{
Grob* me = unsmob_grob (smob);
- if (gh_number_p (me->get_property ("staff-position")))
- return gh_double2scm (0);
+ if (ly_number_p (me->get_property ("staff-position")))
+ return scm_make_real (0);
Direction d = get_grob_direction (me);
Real off = 2* d ;
if (off)
off *= Staff_symbol_referencer::staff_space (me);
- return gh_double2scm (off);
+ return scm_make_real (off);
}
ADD_INTERFACE (Rest,"rest-interface",
announce_grob (note_column_, rheads_[0]->self_scm ());
spacing_ = make_item ("NoteSpacing");
- spacing_->set_property ("left-items", gh_cons (note_column_->self_scm (), SCM_EOL));
+ spacing_->set_property ("left-items", scm_cons (note_column_->self_scm (), SCM_EOL));
announce_grob (spacing_, SCM_EOL);
Rhythmic_head::dot_count (Grob*me)
{
return get_dots (me)
- ? gh_scm2int (get_dots (me)->get_property ("dot-count")) : 0;
+ ? ly_scm2int (get_dots (me)->get_property ("dot-count")) : 0;
}
void
Rhythmic_head::duration_log (Grob*me)
{
SCM s = me->get_property ("duration-log");
- return gh_number_p (s) ? gh_scm2int (s) : 0;
+ return ly_number_p (s) ? ly_scm2int (s) : 0;
}
ADD_INTERFACE (Rhythmic_head,"rhythmic-head-interface",
SCM desc = m->description_;
- Real total_mag = magn * gh_scm2double (ly_cdr (desc));
+ Real total_mag = magn * ly_scm2double (ly_cdr (desc));
assert (total_mag);
- description_ = gh_cons (ly_car (desc), gh_double2scm (total_mag));
+ description_ = scm_cons (ly_car (desc), scm_make_real (total_mag));
orig_ = m;
if (coding_scheme_ != "TeX"
coding_vector_ = scm_call_1 (ly_scheme_function ("get-coding-vector"),
scm_makfrom0str (coding_scheme_.to_str0 ()));
- if (!gh_vector_p (coding_vector_))
+ if (!ly_vector_p (coding_vector_))
{
programming_error ("get-coding-vector should return vector");
coding_vector_ = scm_c_make_vector (256, ly_symbol2scm (".notdef"));
{
hash_tab_ = SCM_EOL;
smobify_self ();
- hash_tab_ = scm_make_vector (gh_int2scm (119), SCM_EOL);
+ hash_tab_ = scm_make_vector (scm_int2num (119), SCM_EOL);
elt_count_ = 0;
}
elt_count_ = 0;
smobify_self ();
- hash_tab_ = scm_make_vector (gh_int2scm (src.elt_count_ >? 11 ), SCM_EOL);
+ hash_tab_ = scm_make_vector (scm_int2num (src.elt_count_ >? 11 ), SCM_EOL);
elt_count_ = copy_scm_hashes (hash_tab_, src.hash_tab_);
}
if (&src == this)
return;
- hash_tab_ = scm_make_vector (gh_int2scm (src.elt_count_ >? 11), SCM_EOL);
+ hash_tab_ = scm_make_vector (scm_int2num (src.elt_count_ >? 11), SCM_EOL);
elt_count_ = copy_scm_hashes (hash_tab_, src.hash_tab_);
}
void
Scheme_hash_table::set (SCM k, SCM v)
{
- assert (gh_symbol_p (k));
+ assert (ly_symbol_p (k));
SCM handle = scm_hashq_create_handle_x (hash_tab_, k, SCM_UNDEFINED);
if (ly_cdr (handle) == SCM_UNDEFINED)
{
elt_count_++;
}
- gh_set_cdr_x (handle, v);
+ scm_set_cdr_x (handle, v);
/*
resize if getting too large.
*/
if (elt_count_ > 2 * SCM_VECTOR_LENGTH (hash_tab_))
{
- SCM nh = scm_make_vector (gh_int2scm (3* elt_count_+1), SCM_EOL);
+ SCM nh = scm_make_vector (scm_int2num (3* elt_count_+1), SCM_EOL);
elt_count_ = copy_scm_hashes (nh, hash_tab_);
hash_tab_ = nh;
}
{
SCM l = SCM_EOL;
for (int i = SCM_VECTOR_LENGTH (hash_tab_); i--;)
- for (SCM s = scm_vector_ref (hash_tab_, gh_int2scm (i)); ly_pair_p (s); s = ly_cdr (s))
+ for (SCM s = scm_vector_ref (hash_tab_, scm_int2num (i)); ly_pair_p (s); s = ly_cdr (s))
{
l = scm_acons (ly_caar (s), ly_cdar (s), l);
}
}
else if (var == ly_symbol2scm ("testing-level"))
{
- testing_level_global = gh_scm2int (val);
+ testing_level_global = ly_scm2int (val);
}
else if (var == ly_symbol2scm ("parse-protect" ))
{
{
if (var == ly_symbol2scm ("old-relative-used"))
{
- return gh_bool2scm (lily_1_8_compatibility_used);
+ return ly_bool2scm (lily_1_8_compatibility_used);
}
if (var == ly_symbol2scm ("old-relative"))
{
- return gh_bool2scm (lily_1_8_relative);
+ return ly_bool2scm (lily_1_8_relative);
}
if (var == ly_symbol2scm ("verbose"))
{
- return gh_bool2scm (verbose_global_b);
+ return ly_bool2scm (verbose_global_b);
}
else
{
gotcha = true;
SCM pen = command_column_->get_property ("penalty");
- Real total_penalty = gh_number_p (pen)
- ? gh_scm2double (pen)
+ Real total_penalty = ly_number_p (pen)
+ ? ly_scm2double (pen)
: 0.0;
SCM rpen = r->get_property ("penalty");
- if (gh_number_p (rpen))
- total_penalty += gh_scm2double (rpen);
+ if (ly_number_p (rpen))
+ total_penalty += ly_scm2double (rpen);
if (total_penalty > 10000.0) // ugh. arbitrary.
forbid_breaks ();
command_column_->set_property ("penalty",
- gh_double2scm (total_penalty));
+ scm_make_real (total_penalty));
}
return gotcha;
}
{
Global_context *g = dynamic_cast<Global_context*> (unsmob_context (context));
SCM_ASSERT_TYPE (g, context, SCM_ARG1, __FUNCTION__, "Global context");
- SCM_ASSERT_TYPE (gh_string_p (outname), outname, SCM_ARG2, __FUNCTION__, "output filename");
+ SCM_ASSERT_TYPE (ly_string_p (outname), outname, SCM_ARG2, __FUNCTION__, "output filename");
Music_output *output = g->get_output ();
progress_indication ("\n");
Script_column::add_staff_sided (Grob *me, Item *i)
{
SCM p = i->get_property ("script-priority");
- if (!gh_number_p (p))
+ if (!ly_number_p (p))
return;
Pointer_group_interface::add_grob (me, ly_symbol2scm ("scripts"),i);
SCM p1 = i1->get_property ("script-priority");
SCM p2 = i2->get_property ("script-priority");
- return gh_scm2int (p1) < gh_scm2int (p2) ? SCM_BOOL_T : SCM_BOOL_F;
+ return ly_scm2int (p1) < ly_scm2int (p2) ? SCM_BOOL_T : SCM_BOOL_F;
}
MAKE_SCHEME_CALLBACK (Script_column, before_line_breaking, 1);
Drul_array<SCM> scripts (SCM_EOL, SCM_EOL);
Link_array<Grob> staff_sided;
- for (SCM s = me->get_property ("scripts"); gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = me->get_property ("scripts"); ly_pair_p (s); s = ly_cdr (s))
{
- Grob *sc = unsmob_grob (gh_car (s));
+ Grob *sc = unsmob_grob (ly_car (s));
if (!sc->has_offset_callback (Side_position_interface::aligned_side_proc,
X_AXIS))
{
programming_error ( "No direction for script?");
d = DOWN;
- g->set_property ("direction", gh_int2scm (d));
+ g->set_property ("direction", scm_int2num (d));
}
scripts[d] = scm_cons (g->self_scm (), scripts[d]);
ss = scm_stable_sort_x (ss, grob_script_priority_less_proc);
Grob * last = 0;
- for (SCM s = ss; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = ss; ly_pair_p (s); s = ly_cdr (s))
{
- Grob *g = unsmob_grob (gh_car (s));
+ Grob *g = unsmob_grob (ly_car (s));
if (last)
Side_position_interface::add_support (g,last);
This is necessary for part-combining.
*/
for (int j = 0; j < scripts_.size (); j++)
- if (gh_equal_p (scripts_[j]. event_->get_property ("articulation-type"),
+ if (ly_equal_p (scripts_[j]. event_->get_property ("articulation-type"),
r->get_property ("articulation-type")
))
return true;
if (g->internal_get_property (sym) == SCM_EOL)
{
SCM entry = scm_assoc (sym,alist);
- if (gh_pair_p (entry))
+ if (ly_pair_p (entry))
{
- g->internal_set_property (sym, gh_cdr (entry));
+ g->internal_set_property (sym, ly_cdr (entry));
}
}
}
return ;
}
- art = gh_cdr (art);
+ art = ly_cdr (art);
*descr = art;
int prio =0;
SCM sprio = scm_assoc (ly_symbol2scm ("script-priority"), art);
- if (gh_pair_p (sprio))
- prio = gh_scm2int (gh_cdr (sprio));
+ if (ly_pair_p (sprio))
+ prio = ly_scm2int (ly_cdr (sprio));
/*
prio += index;
Side_position_interface::set_axis (p, Y_AXIS);
- p->set_property ("script-priority", gh_int2scm (prio));
+ p->set_property ("script-priority", scm_int2num (prio));
}
void
Grob * sc = scripts_[i].script_;
SCM follow = scm_assoc (ly_symbol2scm ("follow-into-staff"), scripts_[i].description_);
- if (gh_pair_p (follow) && to_boolean (gh_cdr (follow)))
+ if (ly_pair_p (follow) && to_boolean (ly_cdr (follow)))
{
sc->add_offset_callback (Side_position_interface::quantised_position_proc, Y_AXIS);
sc->set_property ("staff-padding", SCM_EOL);
Script_interface::get_stencil (Grob * me, Direction d)
{
SCM s = me->get_property ("script-stencil");
- assert (gh_pair_p (s));
+ assert (ly_pair_p (s));
SCM key = ly_car (s);
if (key == ly_symbol2scm ("feta"))
{
SCM name_entry = ly_cdr (s);
- SCM str = (gh_pair_p (name_entry)) ? index_get_cell (name_entry, d) : name_entry;
+ SCM str = (ly_pair_p (name_entry)) ? index_get_cell (name_entry, d) : name_entry;
return Font_interface::get_default_font (me)->find_by_name ("scripts-" +
ly_scm2string (str));
}
Self_alignment_interface::centered_on_parent (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (axis);
+ Axis a = (Axis) ly_scm2int (axis);
Grob *him = me->get_parent (a);
Interval he = him->extent (him,a);
- return gh_double2scm (he.is_empty () ? 0.0 : he.center ());
+ return scm_make_real (he.is_empty () ? 0.0 : he.center ());
}
MAKE_SCHEME_CALLBACK (Self_alignment_interface,aligned_on_parent,2);
Self_alignment_interface::aligned_on_parent (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (axis);
+ Axis a = (Axis) ly_scm2int (axis);
Grob *him = me->get_parent (a);
Interval he = him->extent (him,a);
SCM sym= (a == X_AXIS) ? ly_symbol2scm ("self-alignment-X"): ly_symbol2scm ("self-alignment-Y");
SCM align_prop (me->internal_get_property (sym));
- if (!gh_number_p (align_prop))
- return gh_int2scm (0);
+ if (!ly_number_p (align_prop))
+ return scm_int2num (0);
Real x = 0.0;
- Real align = gh_scm2double (align_prop);
+ Real align = ly_scm2double (align_prop);
Interval ext (me->extent (me,a));
if (ext.is_empty ())
x += he.linear_combination (align);
}
- return gh_double2scm (x);
+ return scm_make_real (x);
}
/*
SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (axis);
+ Axis a = (Axis) ly_scm2int (axis);
Grob *him = me->get_parent (other_axis (a));
Interval he = him->extent (him,a);
- return gh_double2scm (he.is_empty () ? 0.0 : he.center ());
+ return scm_make_real (he.is_empty () ? 0.0 : he.center ());
}
Self_alignment_interface::aligned_on_self (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (axis);
+ Axis a = (Axis) ly_scm2int (axis);
SCM sym= (a == X_AXIS) ? ly_symbol2scm ("self-alignment-X"): ly_symbol2scm ("self-alignment-Y");
SCM align (me->internal_get_property (sym));
- if (gh_number_p (align))
+ if (ly_number_p (align))
{
Interval ext (me->extent (me,a));
if (ext.is_empty ())
{
programming_error ("I'm empty. Can't align on self");
- return gh_double2scm (0.0);
+ return scm_make_real (0.0);
}
else
{
- return gh_double2scm (- ext.linear_combination (gh_scm2double (align)));
+ return scm_make_real (- ext.linear_combination (ly_scm2double (align)));
}
}
- return gh_double2scm (0.0);
+ return scm_make_real (0.0);
}
return;
- for (; gh_pair_p (next); next = ly_cdr (next))
+ for (; ly_pair_p (next); next = ly_cdr (next))
{
Item *l = dynamic_cast<Item*> (unsmob_grob (ly_car ( next)));
Item *lb = l->find_prebroken_piece (RIGHT);
*/
Real padding = robust_scm2double (me->get_property ("padding"), 0.1);
- for (SCM s = me->get_property ("elements"); gh_pair_p (s) && gh_pair_p (ly_cdr (s)); s = ly_cdr (s))
+ for (SCM s = me->get_property ("elements"); ly_pair_p (s) && ly_pair_p (ly_cdr (s)); s = ly_cdr (s))
{
/*
Order of elements is reversed!
{
Item *it = make_item ("StaffSpacing");
current_spacings_.staff_spacing_ = it;
- it->set_property ("left-items", gh_cons (break_item_->self_scm (), SCM_EOL));
+ it->set_property ("left-items", scm_cons (break_item_->self_scm (), SCM_EOL));
announce_grob (it, SCM_EOL);
else if (last_spacings_.staff_spacing_)
{
last_spacings_.staff_spacing_->set_property ("right-items",
- gh_cons (break_item_->self_scm (), SCM_EOL));
+ scm_cons (break_item_->self_scm (), SCM_EOL));
}
}
}
Paper_column * pc = item->get_column ();
- for (SCM s = me->get_property ("conditional-elements"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("conditional-elements"); ly_pair_p (s); s = ly_cdr (s))
{
SCM elt = ly_car (s);
if (!unsmob_grob (elt))
Paper_column * pc = item->get_column ();
Interval w;
- for (SCM s = me->get_property ("elements"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("elements"); ly_pair_p (s); s = ly_cdr (s))
{
SCM elt = ly_car (s);
if (!unsmob_grob (elt))
last_ext->set_empty ();
Grob *last_grob = 0;
for (SCM s = separation_item->get_property ("elements");
- gh_pair_p (s); s = gh_cdr (s))
+ ly_pair_p (s); s = ly_cdr (s))
{
- Grob * break_item = unsmob_grob (gh_car (s));
+ Grob * break_item = unsmob_grob (ly_car (s));
- if (!gh_symbol_p (break_item->get_property ("break-align-symbol")))
+ if (!ly_symbol_p (break_item->get_property ("break-align-symbol")))
continue;
Interval ext = break_item->extent (col, X_AXIS);
Invariant for the data structure.
- if (gh_pair_p (cursor_))
+ if (ly_pair_p (cursor_))
iter_->music_ == unsmob_music (ly_car (cursor_))
else
iter_ == 0;
Grace_fixup *head = 0;
Grace_fixup **tail = &head;
- for (; gh_pair_p (cursor); cursor = ly_cdr (cursor))
+ for (; ly_pair_p (cursor); cursor = ly_cdr (cursor))
{
Music *mus = unsmob_music (ly_car (cursor));
Moment s = mus->start_mom ();
cursor_ = get_music_list ();
iter_ = 0;
- if (gh_pair_p (cursor_))
+ if (ly_pair_p (cursor_))
{
Music *m = unsmob_music (ly_car (cursor_));
iter_ = unsmob_iterator (get_iterator (m));
cursor_ = ly_cdr (cursor_);
iter_->quit ();
- if (gh_pair_p (cursor_))
+ if (ly_pair_p (cursor_))
iter_ = unsmob_iterator (get_iterator (unsmob_music (ly_car (cursor_))));
else
iter_ = 0;
Side_position_interface::aligned_on_support_extents (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (axis);
+ Axis a = (Axis) ly_scm2int (axis);
return general_side_position (me, a, true);
}
Grob * st = Staff_symbol_referencer::get_staff_symbol (me);
bool include_staff = (st
&& a == Y_AXIS
- && gh_number_p (me->get_property ("staff-padding")));
+ && ly_number_p (me->get_property ("staff-padding")));
Interval dim;
if (include_staff)
- return gh_double2scm (total_off);
+ return scm_make_real (total_off);
}
/*
Side_position_interface::aligned_on_support_refpoints (SCM smob, SCM axis)
{
Grob *me = unsmob_grob (smob);
- Axis a = (Axis) gh_scm2int (axis);
+ Axis a = (Axis) ly_scm2int (axis);
return general_side_position (me, a, false);
}
rp += d;
}
- return gh_double2scm ((rp - p) * Staff_symbol_referencer::staff_space (me) / 2.0);
+ return scm_make_real ((rp - p) * Staff_symbol_referencer::staff_space (me) / 2.0);
}
- return gh_double2scm (0.0);
+ return scm_make_real (0.0);
}
/*
Side_position_interface::aligned_side (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (axis);
+ Axis a = (Axis) ly_scm2int (axis);
Direction d = Side_position_interface::get_direction (me);
- Real o = gh_scm2double (aligned_on_support_extents (element_smob,axis));
+ Real o = ly_scm2double (aligned_on_support_extents (element_smob,axis));
Interval iv = me->extent (me, a);
*/
Grob * st = Staff_symbol_referencer::get_staff_symbol (me);
if (st && a == Y_AXIS
- && gh_number_p (me->get_property ("staff-padding")))
+ && ly_number_p (me->get_property ("staff-padding")))
{
Real padding=
Staff_symbol_referencer::staff_space (me)
- * gh_scm2double (me->get_property ("staff-padding"));
+ * ly_scm2double (me->get_property ("staff-padding"));
Grob *common = me->common_refpoint (st, Y_AXIS);
o += (d* (diff >? 0));
}
- return gh_double2scm (o);
+ return scm_make_real (o);
}
Link_array<Grob> cols (icols);
for (int i = cols.size (); i--;)
- if (gh_pair_p (cols[i]->get_property ("between-cols")))
+ if (ly_pair_p (cols[i]->get_property ("between-cols")))
{
loose_cols_.push (cols[i]);
cols.del (i);
Spring_smob *spring = 0;
for (SCM s = cols[i]->get_property ("ideal-distances");
- !spring && gh_pair_p (s);
+ !spring && ly_pair_p (s);
s = ly_cdr (s))
{
Spring_smob *sp = unsmob_spring (ly_car (s));
for (int i=0; i < cols.size () - 1; i++)
{
for (SCM s = Spaceable_grob::get_minimum_distances (cols[i]);
- gh_pair_p (s); s = ly_cdr (s))
+ ly_pair_p (s); s = ly_cdr (s))
{
Grob * other = unsmob_grob (ly_caar (s));
int oi = cols.find_index (other);
if (oi >= 0)
{
- add_rod (i, oi, gh_scm2double (ly_cdar (s)));
+ add_rod (i, oi, ly_scm2double (ly_cdar (s)));
}
}
}
for (int i = sz; i--; )
{
SCM p = positions->cols_[i]->get_property ( "penalty");
- if (gh_number_p (p))
+ if (ly_number_p (p))
{
- if (gh_scm2double (p) < -9999)
+ if (ly_scm2double (p) < -9999)
break_satisfy = break_satisfy && (i == 0 || i == sz -1);
- if (gh_scm2double (p) > 9999)
+ if (ly_scm2double (p) > 9999)
break_satisfy = break_satisfy && !(i == 0 || i == sz -1);
}
void
Simultaneous_music_iterator::derived_substitute (Context *f,Context *t)
{
- for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr (s))
- unsmob_iterator (gh_car (s))-> substitute_outlet (f,t);
+ for (SCM s = children_list_; ly_pair_p (s); s = ly_cdr (s))
+ unsmob_iterator (ly_car (s))-> substitute_outlet (f,t);
}
void
children_list_ = SCM_EOL;
SCM * tail = &children_list_;
- for (; gh_pair_p (i); i = ly_cdr (i), j++)
+ for (; ly_pair_p (i); i = ly_cdr (i), j++)
{
Music *mus = unsmob_music (ly_car (i));
Simultaneous_music_iterator::process (Moment until)
{
SCM *proc = &children_list_;
- while (gh_pair_p (*proc))
+ while (ly_pair_p (*proc))
{
- Music_iterator * i = unsmob_iterator (gh_car (*proc));
+ Music_iterator * i = unsmob_iterator (ly_car (*proc));
if (i->run_always ()
|| i->pending_moment () == until)
{
if (!i->ok ())
{
i->quit ();
- *proc = gh_cdr (*proc);
+ *proc = ly_cdr (*proc);
}
else
{
Moment next;
next.set_infinite (1);
- for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = children_list_; ly_pair_p (s); s = ly_cdr (s))
{
- Music_iterator * it = unsmob_iterator (gh_car (s));
+ Music_iterator * it = unsmob_iterator (ly_car (s));
next = next <? it->pending_moment ();
}
Simultaneous_music_iterator::ok () const
{
bool run_always_ok = false;
- for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = children_list_; ly_pair_p (s); s = ly_cdr (s))
{
- Music_iterator * it = unsmob_iterator (gh_car (s));
+ Music_iterator * it = unsmob_iterator (ly_car (s));
if (!it->run_always ())
return true;
else
bool
Simultaneous_music_iterator::run_always () const
{
- for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = children_list_; ly_pair_p (s); s = ly_cdr (s))
{
- Music_iterator * it = unsmob_iterator (gh_car (s));
+ Music_iterator * it = unsmob_iterator (ly_car (s));
if (it->run_always ())
return true;
}
Simultaneous_music_iterator::try_music_in_children (Music *m) const
{
Music_iterator * b=0;
- for (SCM s = children_list_; !b && gh_pair_p (s); s = gh_cdr (s))
- b =unsmob_iterator (gh_car (s))->try_music (m);
+ for (SCM s = children_list_; !b && ly_pair_p (s); s = ly_cdr (s))
+ b =unsmob_iterator (ly_car (s))->try_music (m);
return b;
}
void
Simultaneous_music_iterator::do_quit ()
{
- for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr (s))
- unsmob_iterator (gh_car (s))->quit ();
+ for (SCM s = children_list_; ly_pair_p (s); s = ly_cdr (s))
+ unsmob_iterator (ly_car (s))->quit ();
}
IMPLEMENT_CTOR_CALLBACK (Simultaneous_music_iterator);
if (fit_factor () > 1.0)
blow_fit ();
- Real pct_c0 = gh_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-c0"), bezier_props)));
- Real pct_c3 = gh_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-c3"), bezier_props)));
- Real pct_in_max = gh_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-in-max"), bezier_props)));
- Real pct_out_max = gh_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-out-max"), bezier_props)));
- Real steps = gh_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-area-steps"),bezier_props)));
+ Real pct_c0 = ly_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-c0"), bezier_props)));
+ Real pct_c3 = ly_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-c3"), bezier_props)));
+ Real pct_in_max = ly_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-in-max"), bezier_props)));
+ Real pct_out_max = ly_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-out-max"), bezier_props)));
+ Real steps = ly_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-area-steps"),bezier_props)));
for (int i=0; i < steps; i++)
{
if (Direction updown = to_dir (slur_ev->get_property ("direction")))
{
- slur->set_property ("direction", gh_int2scm (updown));
+ slur->set_property ("direction", scm_int2num (updown));
}
start_slurs.push (slur);
Real f = default_height / length;
SCM up = me->get_property ("de-uglify-parameters");
- Real c1 = gh_scm2double (ly_car (up));
- Real c2 = gh_scm2double (ly_cadr (up));
- Real c3 = gh_scm2double (ly_caddr (up));
+ Real c1 = ly_scm2double (ly_car (up));
+ Real c2 = ly_scm2double (ly_cadr (up));
+ Real c3 = ly_scm2double (ly_caddr (up));
if (h > c1 * f)
{
return SCM_UNSPECIFIED;
}
set_extremities (me);
- if (!gh_pair_p (me->get_property ("control-points")))
+ if (!ly_pair_p (me->get_property ("control-points")))
set_control_points (me);
return SCM_UNSPECIFIED;
}
Avoid too steep slurs.
*/
SCM s = me->get_property ("slope-limit");
- if (gh_number_p (s))
+ if (ly_number_p (s))
{
Array<Offset> encompass = get_encompass_offsets (me);
Drul_array<Offset> attachment;
Real slope = slope = abs (dy / dx);
- Real limit = gh_scm2double (s);
+ Real limit = ly_scm2double (s);
if (slope > limit)
{
Real staff_space = Staff_symbol_referencer::staff_space ((Grob*)me);
- Direction dir = (Direction)gh_scm2int (me->get_property ("direction"));
+ Direction dir = (Direction)ly_scm2int (me->get_property ("direction"));
Direction d = (Direction) (- dir * (sign (dy)));
SCM a = me->get_property ("attachment-offset");
Drul_array<Offset> o;
o[d][Y_AXIS] *= get_grob_direction (me);
me->set_property ("attachment-offset",
- gh_cons (ly_offset2scm (o[LEFT]),
+ scm_cons (ly_offset2scm (o[LEFT]),
ly_offset2scm (o[RIGHT])));
}
}
SCM att = me->get_property ("attachment");
/*
*/
- if (!gh_pair_p (att))
+ if (!ly_pair_p (att))
{
programming_error ("attachment is not a cons?!");
- att = gh_cons (SCM_EOL, SCM_EOL);
+ att = scm_cons (SCM_EOL, SCM_EOL);
me->set_property ("attachment", att);
}
do
{
- if (!gh_symbol_p (index_get_cell (att, dir)))
+ if (!ly_symbol_p (index_get_cell (att, dir)))
{
SCM p = me->get_property ("extremity-function");
SCM res = ly_symbol2scm ("head");
- if (gh_procedure_p (p))
- res = gh_call2 (p, me->self_scm (), gh_int2scm (dir));
+ if (ly_procedure_p (p))
+ res = scm_call_2 (p, me->self_scm (), scm_int2num (dir));
- if (gh_symbol_p (res))
+ if (ly_symbol_p (res))
index_set_cell (att, dir, res);
}
}
{
SCM cols = me->get_property ("note-columns");
- if (!gh_pair_p (cols))
+ if (!ly_pair_p (cols))
{
programming_error ("No note-columns in slur?");
me->suicide ();
Grob **common)
{
SCM s = me->get_property ("attachment");
- if (!gh_pair_p (s) || !gh_symbol_p (index_get_cell (s, dir)))
+ if (!ly_pair_p (s) || !ly_symbol_p (index_get_cell (s, dir)))
{
s = set_extremities (me);
}
int stemdir = stem ? Stem::get_direction (stem) : 1;
SCM l = scm_assoc
(scm_list_n (a,
- gh_int2scm (stemdir * dir),
- gh_int2scm (slurdir * dir),
+ scm_int2num (stemdir * dir),
+ scm_int2num (slurdir * dir),
SCM_UNDEFINED), alist);
if (l != SCM_BOOL_F)
SCM
Slur::height (SCM smob, SCM ax)
{
- Axis a = (Axis)gh_scm2int (ax);
+ Axis a = (Axis)ly_scm2int (ax);
Grob * me = unsmob_grob (smob);
assert (a == Y_AXIS);
TODO: replace dashed with generic property.
*/
SCM d = me->get_property ("dashed");
- if (gh_number_p (d))
+ if (ly_number_p (d))
a = Lookup::dashed_slur (one, thick, thick * robust_scm2double (d, 0));
else
a = Lookup::slur (one, get_grob_direction (me) * base_thick * ss / 10.0,
SCM r_0_scm = me->get_property ("ratio");
Real r_0 = robust_scm2double (r_0_scm, 1);
- Real h_inf = staff_space * gh_scm2double (h_inf_scm);
+ Real h_inf = staff_space * ly_scm2double (h_inf_scm);
Slur_bezier_bow bb (get_encompass_offsets (me),
get_grob_direction (me),
SCM ssb = me->get_property ("beautiful");
Real sb = 0;
- if (gh_number_p (ssb))
- sb = gh_scm2double (ssb);
+ if (ly_number_p (ssb))
+ sb = ly_scm2double (ssb);
bb.minimise_enclosed_area (sb, details);
SCM sbf = scm_assq (ly_symbol2scm ("force-blowfit"), details);
Real bff = 1.0;
- if (gh_pair_p (sbf) && gh_number_p (ly_cdr (sbf)))
- bff = gh_scm2double (ly_cdr (sbf));
+ if (ly_pair_p (sbf) && ly_number_p (ly_cdr (sbf)))
+ bff = ly_scm2double (ly_cdr (sbf));
bb.curve_.control_[1][Y_AXIS] *= bff;
bb.curve_.control_[2][Y_AXIS] *= bff;
SCM controls = SCM_EOL;
for (int i= 4; i--;)
{
- controls = gh_cons (ly_offset2scm (b.control_[i]), controls);
+ controls = scm_cons (ly_offset2scm (b.control_[i]), controls);
/*
BRRR WHURG.
All these null control-points, where do they all come from?
int i = 0;
SCM attach = me->get_property ("attachment");
- if (!gh_pair_p (attach))
+ if (!ly_pair_p (attach))
attach = set_extremities (me);
if (!get_grob_direction (me)
- || ! gh_symbol_p (index_get_cell (attach, LEFT))
- || ! gh_symbol_p (index_get_cell (attach, RIGHT)))
+ || ! ly_symbol_p (index_get_cell (attach, LEFT))
+ || ! ly_symbol_p (index_get_cell (attach, RIGHT)))
set_extremities (me);
- if (!gh_pair_p (me->get_property ("control-points")))
+ if (!ly_pair_p (me->get_property ("control-points")))
set_control_points (me);
// set_control_points may suicide
SCM mins = get_minimum_distances (me);
- SCM newdist = gh_double2scm (d);
- for (SCM s = mins; gh_pair_p (s); s = ly_cdr (s))
+ SCM newdist = scm_make_real (d);
+ for (SCM s = mins; ly_pair_p (s); s = ly_cdr (s))
{
SCM dist = ly_car (s);
if (ly_car (dist) == p->self_scm ())
{
- gh_set_cdr_x (dist, scm_max (ly_cdr (dist),
+ scm_set_cdr_x (dist, scm_max (ly_cdr (dist),
newdist));
return ;
}
}
- mins = gh_cons (gh_cons (p->self_scm (), newdist), mins);
+ mins = scm_cons (scm_cons (p->self_scm (), newdist), mins);
me->set_property ("minimum-distances", mins);
}
#ifndef NDEBUG
SCM mins = me->get_property ("ideal-distances");
- for (SCM s = mins; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = mins; ly_pair_p (s); s = ly_cdr (s))
{
Spring_smob * sp = unsmob_spring(ly_car (s));
if (sp->other_ == p)
such a borderline case.)
*/
- if (!gh_pair_p (lns) || !gh_pair_p (rns))
+ if (!ly_pair_p (lns) || !ly_pair_p (rns))
return false;
- Item * l_neighbor = dynamic_cast<Item*> (unsmob_grob (gh_car (lns)));
- Item * r_neighbor = dynamic_cast<Item*> (unsmob_grob (gh_car (rns)));
+ Item * l_neighbor = dynamic_cast<Item*> (unsmob_grob (ly_car (lns)));
+ Item * r_neighbor = dynamic_cast<Item*> (unsmob_grob (ly_car (rns)));
if (!l_neighbor || !r_neighbor)
return false;
in any case, we don't want to move bar lines.
*/
- for (SCM e = c->get_property ("elements"); gh_pair_p (e); e = gh_cdr (e))
+ for (SCM e = c->get_property ("elements"); ly_pair_p (e); e = ly_cdr (e))
{
- Grob * g = unsmob_grob (gh_car (e));
+ Grob * g = unsmob_grob (ly_car (e));
if (g && Break_align_interface::has_interface (g))
{
- for (SCM s = g->get_property ("elements"); gh_pair_p (s);
- s = gh_cdr (s))
+ for (SCM s = g->get_property ("elements"); ly_pair_p (s);
+ s = ly_cdr (s))
{
- Grob *h = unsmob_grob (gh_car (s));
+ Grob *h = unsmob_grob (ly_car (s));
/*
ugh. -- fix staff-bar name?
if (loose_column (cols->elem (i-1), c, cols->elem (i+1)))
{
SCM lns = c->get_property ("left-neighbors");
- lns = gh_pair_p (lns) ? gh_car (lns) : SCM_BOOL_F;
+ lns = ly_pair_p (lns) ? ly_car (lns) : SCM_BOOL_F;
SCM rns = c->get_property ("right-neighbors");
- rns = gh_pair_p (rns) ? gh_car (rns) : SCM_BOOL_F;
+ rns = ly_pair_p (rns) ? ly_car (rns) : SCM_BOOL_F;
/*
Either object can be non existent, if the score ends
prematurely.
*/
- rns = gh_car (unsmob_grob (rns)->get_property ("right-items"));
- c->set_property ("between-cols", gh_cons (lns,
+ rns = ly_car (unsmob_grob (rns)->get_property ("right-items"));
+ c->set_property ("between-cols", scm_cons (lns,
rns));
/*
Item *rc = dynamic_cast<Item*> (d == LEFT ? c : next_door[RIGHT]);
for (SCM s = lc->get_property ("spacing-wishes");
- gh_pair_p (s); s = gh_cdr (s))
+ ly_pair_p (s); s = ly_cdr (s))
{
- Grob *sp = unsmob_grob (gh_car (s));
+ Grob *sp = unsmob_grob (ly_car (s));
if (Note_spacing::left_column (sp) != lc
|| Note_spacing::right_column (sp) != rc)
continue;
SCM wishes= cols[i]->get_property ("spacing-wishes");
- for (SCM s =wishes; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s =wishes; ly_pair_p (s); s = ly_cdr (s))
{
- Item * wish = dynamic_cast<Item*> (unsmob_grob (gh_car (s)));
+ Item * wish = dynamic_cast<Item*> (unsmob_grob (ly_car (s)));
Item * lc = wish->get_column ();
Grob * right = Note_spacing::right_column (wish);
right_neighbors =SCM_EOL;
min_rank = right_rank;
- right_neighbors = gh_cons (wish->self_scm (), right_neighbors);
+ right_neighbors = scm_cons (wish->self_scm (), right_neighbors);
}
/*
*/
int maxrank = 0;
SCM left_neighs = rc->get_property ("left-neighbors");
- if (gh_pair_p (left_neighs)
- && unsmob_grob (gh_car (left_neighs)))
+ if (ly_pair_p (left_neighs)
+ && unsmob_grob (ly_car (left_neighs)))
{
- Item * it = dynamic_cast<Item*> (unsmob_grob (gh_car (left_neighs)));
+ Item * it = dynamic_cast<Item*> (unsmob_grob (ly_car (left_neighs)));
maxrank = Paper_column::get_rank (it->get_column ());
}
if (left_rank > maxrank)
left_neighs = SCM_EOL;
- left_neighs = gh_cons (wish->self_scm (), left_neighs);
+ left_neighs = scm_cons (wish->self_scm (), left_neighs);
rc->set_property ("left-neighbors", right_neighbors);
}
}
- if (gh_pair_p (right_neighbors))
+ if (ly_pair_p (right_neighbors))
{
cols[i]->set_property ("right-neighbors", right_neighbors);
}
sloppy with typnig left/right-neighbors should take list, but paper-column found instead.
*/
SCM ln = cols[i] ->get_property ("left-neighbors");
- if (!gh_pair_p (ln) && i )
+ if (!ly_pair_p (ln) && i )
{
- cols[i]->set_property ("left-neighbors", gh_cons (cols[i-1]->self_scm (), SCM_EOL));
+ cols[i]->set_property ("left-neighbors", scm_cons (cols[i-1]->self_scm (), SCM_EOL));
}
SCM rn = cols[i] ->get_property ("right-neighbors");
- if (!gh_pair_p (rn) && i < cols.size () - 1)
+ if (!ly_pair_p (rn) && i < cols.size () - 1)
{
- cols[i]->set_property ("right-neighbors", gh_cons (cols[i + 1]->self_scm (), SCM_EOL));
+ cols[i]->set_property ("right-neighbors", scm_cons (cols[i + 1]->self_scm (), SCM_EOL));
}
}
}
happens after the current note (this is set in the grob
property SPACING-SEQUENCE.
*/
- for (SCM s = seq; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = seq; ly_pair_p (s); s = ly_cdr (s))
{
- Grob * wish = unsmob_grob (gh_car (s));
+ Grob * wish = unsmob_grob (ly_car (s));
Item *wish_rcol = Note_spacing::right_column (wish);
if (Note_spacing::left_column (wish) != lc
if (dt == Moment (0,0))
{
for (SCM s = l->get_property ("spacing-wishes");
- gh_pair_p (s); s = gh_cdr (s))
+ ly_pair_p (s); s = ly_cdr (s))
{
- Item * spacing_grob = dynamic_cast<Item*> (unsmob_grob (gh_car (s)));
+ Item * spacing_grob = dynamic_cast<Item*> (unsmob_grob (ly_car (s)));
if (!spacing_grob || !Staff_spacing::has_interface (spacing_grob))
continue;
for (int i=0; i < arpeggios_.size (); i ++)
{
for (SCM s = arpeggios_[i]->get_property ("stems");
- gh_pair_p (s); s = ly_cdr (s))
+ ly_pair_p (s); s = ly_cdr (s))
Group_interface::add_thing (span_arpeggio_, ly_symbol2scm ("stems"), ly_car (s));
for (SCM s = arpeggios_[i]->get_property ("side-support-elements");
- gh_pair_p (s); s = ly_cdr (s))
+ ly_pair_p (s); s = ly_cdr (s))
Group_interface::add_thing (span_arpeggio_, ly_symbol2scm ("side-support-elements"), ly_car (s));
/*
SCM vissym =ly_symbol2scm ("break-visibility");
SCM vis = bars_[0]->internal_get_property (vissym);
- if (gh_equal_p (spanbar_->internal_get_property (vissym), vis))
+ if (ly_equal_p (spanbar_->internal_get_property (vissym), vis))
spanbar_->internal_set_property (vissym, vis);
typeset_grob (spanbar_);
/* compute common refpoint of elements */
Grob *refp = me;
- for (SCM elts = first_elt; gh_pair_p (elts); elts = ly_cdr (elts))
+ for (SCM elts = first_elt; ly_pair_p (elts); elts = ly_cdr (elts))
{
SCM smobbed_staff_bar = ly_car (elts);
Grob *staff_bar = unsmob_grob (smobbed_staff_bar);
/* glyph may not be a string, when ME is killed by Hara Kiri in
between. */
- if (!gh_string_p (glyph))
+ if (!ly_string_p (glyph))
return SCM_EOL;
String glyph_string = ly_scm2string (glyph);
Stencil span_bar_mol;
Interval prev_extent;
- for (SCM elts = first_elt; gh_pair_p (elts); elts = ly_cdr (elts))
+ for (SCM elts = first_elt; ly_pair_p (elts); elts = ly_cdr (elts))
{
SCM smobbed_staff_bar = ly_car (elts);
Grob *staff_bar = unsmob_grob (smobbed_staff_bar);
Span_bar::width_callback (SCM element_smob, SCM scm_axis)
{
Grob *se = unsmob_grob (element_smob);
- Axis a = (Axis) gh_scm2int (scm_axis);
+ Axis a = (Axis) ly_scm2int (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) gh_scm2int (axis);
+ Axis a = (Axis) ly_scm2int (axis);
assert (a == Y_AXIS);
Interval i (get_spanned_interval (me));
if (i.is_empty ())
{
me->suicide ();
- return gh_double2scm (0.0);
+ return scm_make_real (0.0);
}
- return gh_double2scm (i.center ());
+ return scm_make_real (i.center ());
}
void
/* TODO: filter all hara-kiried out of ELEMENS list, and then
optionally do suicide. Call this cleanage function from
center_on_spanned_callback () as well. */
- if (!gh_pair_p (me->get_property ("elements")))
+ if (!ly_pair_p (me->get_property ("elements")))
{
me->suicide ();
}
{
SCM gl = me->get_property ("glyph");
- if (gh_string_p (gl))
+ if (ly_string_p (gl))
return ;
for (SCM s = me->get_property ("elements");
- !gh_string_p (gl) && gh_pair_p (s); s = gh_cdr (s))
+ !ly_string_p (gl) && ly_pair_p (s); s = ly_cdr (s))
{
- gl = unsmob_grob (gh_car (s))
+ gl = unsmob_grob (ly_car (s))
->get_property ("glyph");
}
- if (!gh_string_p (gl))
+ if (!ly_string_p (gl))
{
me->suicide ();
return;
Span_bar::get_spanned_interval (Grob*me)
{
return ly_scm2interval (Axis_group_interface::group_extent_callback
- (me->self_scm (), gh_int2scm (Y_AXIS)));
+ (me->self_scm (), scm_int2num (Y_AXIS)));
}
{
/* This happens if the bars are hara-kiried from under us. */
me->suicide ();
- return gh_double2scm (-1);
+ return scm_make_real (-1);
}
- return gh_double2scm (iv.length ());
+ return scm_make_real (iv.length ());
}
if (Staff_symbol::has_interface (gi.grob_))
{
SCM staffs = get_property ("stavesFound");
- staffs = gh_cons (gi.grob_->self_scm (), staffs);
+ staffs = scm_cons (gi.grob_->self_scm (), staffs);
daddy_context_->set_property ("stavesFound", staffs);
}
{
SCM proc = ly_scheme_function ("percussion?");
- SCM drums = gh_call1 (proc, ly_symbol2scm (instrument_string_.to_str0 ()));
+ SCM drums = scm_call_1 (proc, ly_symbol2scm (instrument_string_.to_str0 ()));
audio_staff_->channel_ = (drums == SCM_BOOL_T ? 9 : -1 );
if (name_)
{
// mustn't ask Score for instrument: it will return piano!
SCM minstr = get_property ("midiInstrument");
- if (!gh_string_p (minstr)
+ if (!ly_string_p (minstr)
|| ly_scm2string (minstr) == instrument_string_)
return "";
{
SCM glyph = bar_grob->get_property ("glyph");
- String glyph_string = gh_string_p (glyph) ? ly_scm2string (glyph) : "";
+ String glyph_string = ly_string_p (glyph) ? ly_scm2string (glyph) : "";
if (glyph_string.left_string (1) == "|" || glyph_string.left_string (1) == ".")
{
SCM sz = Bar_line::get_staff_bar_size (bar_grob->self_scm ());
Real max_corr =0.0;
for (SCM s = me->get_property ("right-items");
- gh_pair_p (s); s = gh_cdr (s))
+ ly_pair_p (s); s = ly_cdr (s))
{
- Grob * g = unsmob_grob (gh_car (s));
+ Grob * g = unsmob_grob (ly_car (s));
max_corr = max_corr >? next_note_correction (me, g, bar_size);
for (SCM t = g->get_property ("elements");
- gh_pair_p (t); t = gh_cdr (t))
- max_corr = max_corr >? next_note_correction (me, unsmob_grob (gh_car (t)), bar_size);
+ ly_pair_p (t); t = ly_cdr (t))
+ max_corr = max_corr >? next_note_correction (me, unsmob_grob (ly_car (t)), bar_size);
}
Item * me_item = dynamic_cast<Item*> (me);
for (SCM s = me->get_property ("left-items");
- gh_pair_p (s); s = gh_cdr (s))
+ ly_pair_p (s); s = ly_cdr (s))
{
- Grob * cand = unsmob_grob (gh_car (s));
+ Grob * cand = unsmob_grob (ly_car (s));
if (cand && Separation_item::has_interface (cand))
separation_item = cand ;
}
if (me_item->break_status_dir () == CENTER)
{
SCM nndef = scm_sloppy_assq (ly_symbol2scm ("next-note"), alist);
- if (gh_pair_p (nndef))
+ if (ly_pair_p (nndef))
space_def = nndef;
}
- if (!gh_pair_p (space_def))
+ if (!ly_pair_p (space_def))
{
programming_error ("Unknown prefatory spacing. ");
return;
}
- space_def = gh_cdr (space_def);
- Real distance = gh_scm2double (gh_cdr (space_def));
- SCM type = gh_car (space_def) ;
+ space_def = ly_cdr (space_def);
+ Real distance = ly_scm2double (ly_cdr (space_def));
+ SCM type = ly_car (space_def) ;
*fixed = last_ext[RIGHT];
if (type == ly_symbol2scm ("fixed-space"))
{
int k = scm_ilength (get_property ("stringTunings"));
if (k>=0)
- span_->set_property ("line-count", gh_int2scm (k));
+ span_->set_property ("line-count", scm_int2num (k));
}
}
Real pos = Staff_symbol_referencer::get_position (g);
if (fabs (rint (pos) -pos) < 1e-6) // ugh.
- return gh_int2scm ((int) my_round (pos));
+ return scm_int2num ((int) my_round (pos));
else
- return gh_double2scm (pos);
+ return scm_make_real (pos);
}
SCM pos = me->get_property ("staff-position");
Real off = 0.0;
- if (gh_number_p (pos))
+ if (ly_number_p (pos))
{
Real space = Staff_symbol_referencer::staff_space (me);
- off = gh_scm2double (pos) * space / 2.0;
- me->set_property ("staff-position", gh_int2scm (0));
+ off = ly_scm2double (pos) * space / 2.0;
+ me->set_property ("staff-position", scm_int2num (0));
}
- return gh_double2scm (off);
+ return scm_make_real (off);
}
/* This sets the position relative to the center of the staff symbol.
if (st && me->common_refpoint (st, Y_AXIS))
{
Real oldpos = get_position (me);
- me->set_property ("staff-position", gh_double2scm (p - oldpos));
+ me->set_property ("staff-position", scm_make_real (p - oldpos));
}
else
- me->set_property ("staff-position", gh_double2scm (p));
+ me->set_property ("staff-position", scm_make_real (p));
if (!me->has_offset_callback (Staff_symbol_referencer::callback_proc,
Y_AXIS))
do
{
SCM width_scm = me->get_property ("width");
- if (d == RIGHT && gh_number_p (width_scm))
+ if (d == RIGHT && ly_number_p (width_scm))
{
/*
don't multiply by Staff_symbol_referencer::staff_space (me),
since that would make aligning staff symbols of different sizes to
one right margin hell.
*/
- span_points[RIGHT] = gh_scm2double (width_scm);
+ span_points[RIGHT] = ly_scm2double (width_scm);
}
else
{
Staff_symbol::line_count (Grob*me)
{
SCM c = me->get_property ("line-count");
- if (gh_number_p (c))
- return gh_scm2int (c);
+ if (ly_number_p (c))
+ return ly_scm2int (c);
else
return 0;
}
{
SCM stanza = get_property ("stanza");
- if (gh_string_p (stanza) && stanza != last_stanza_)
+ if (ly_string_p (stanza) && stanza != last_stanza_)
{
last_stanza_ = stanza;
{
stem_ = make_item ("Stem");
- stem_->set_property ("duration-log", gh_int2scm (duration_log));
+ stem_->set_property ("duration-log", scm_int2num (duration_log));
if (tremolo_ev_)
{
the first and last (quarter) note bothe get one tremolo flag.
*/
- int requested_type = gh_scm2int (tremolo_ev_->get_property ("tremolo-type"));
+ int requested_type = ly_scm2int (tremolo_ev_->get_property ("tremolo-type"));
SCM f = get_property ("tremoloFlags");
if (!requested_type)
- if (gh_number_p (f))
- requested_type = gh_scm2int (f);
+ if (ly_number_p (f))
+ requested_type = ly_scm2int (f);
else
requested_type = 8;
else
- daddy_context_->set_property ("tremoloFlags", gh_int2scm (requested_type));
+ daddy_context_->set_property ("tremoloFlags", scm_int2num (requested_type));
int tremolo_flags = intlog2 (requested_type) - 2
- (duration_log > 2 ? duration_log - 2 : 0);
itself.
*/
tremolo_->set_property ("flag-count",
- gh_int2scm (tremolo_flags));
+ scm_int2num (tremolo_flags));
tremolo_->set_parent (stem_, X_AXIS);
stem_->set_property ("tremolo-flag", tremolo_->self_scm ());
tremolo_->set_property ("stem",
toDO: junk these properties.
*/
SCM prop = get_property ("stemLeftBeamCount");
- if (gh_number_p (prop))
+ if (ly_number_p (prop))
{
- Stem::set_beaming (stem_,gh_scm2int (prop),LEFT);
+ Stem::set_beaming (stem_,ly_scm2int (prop),LEFT);
daddy_context_->unset_property (ly_symbol2scm ("stemLeftBeamCount"));
}
prop = get_property ("stemRightBeamCount");
- if (gh_number_p (prop))
+ if (ly_number_p (prop))
{
- Stem::set_beaming (stem_,gh_scm2int (prop), RIGHT);
+ Stem::set_beaming (stem_,ly_scm2int (prop), RIGHT);
daddy_context_->unset_property (ly_symbol2scm ("stemRightBeamCount"));
}
SCM
Stem_tremolo::height (SCM smob, SCM ax)
{
- Axis a = (Axis)gh_scm2int (ax);
+ Axis a = (Axis)ly_scm2int (ax);
Grob * me = unsmob_grob (smob);
assert (a == Y_AXIS);
SCM s = beam->get_property ("positions");
if (is_number_pair (s))
{
- dy = -gh_scm2double (gh_car (s)) +gh_scm2double (gh_cdr (s));
+ dy = -ly_scm2double (ly_car (s)) +ly_scm2double (ly_cdr (s));
}
Real dx = Beam::last_visible_stem (beam)->relative_coordinate (0, X_AXIS)
int tremolo_flags = 0;
SCM s = me->get_property ("flag-count");
- if (gh_number_p (s))
- tremolo_flags = gh_scm2int (s);
+ if (ly_number_p (s))
+ tremolo_flags = ly_scm2int (s);
if (!tremolo_flags)
{
Real beamthickness = 0.0;
SCM sbt = (beam) ? beam->get_property ("thickness") : SCM_EOL ;
- if (gh_number_p (sbt))
+ if (ly_number_p (sbt))
{
- beamthickness = gh_scm2double (sbt) * ss;
+ beamthickness = ly_scm2double (sbt) * ss;
}
Real end_y
{
SCM pair = me->get_property ("beaming");
- if (!gh_pair_p (pair))
+ if (!ly_pair_p (pair))
{
- pair = gh_cons (SCM_EOL, SCM_EOL);
+ pair = scm_cons (SCM_EOL, SCM_EOL);
me->set_property ("beaming", pair);
}
SCM l = index_get_cell (pair, d);
for (int i = 0; i< beam_count; i++)
{
- l = gh_cons (gh_int2scm (i), l);
+ l = scm_cons (scm_int2num (i), l);
}
index_set_cell (pair, d, l);
}
{
SCM p =me->get_property ("stem-end-position");
Real pos;
- if (!gh_number_p (p))
+ if (!ly_number_p (p))
{
pos = get_default_stem_end_position (me);
- me->set_property ("stem-end-position", gh_double2scm (pos));
+ me->set_property ("stem-end-position", scm_make_real (pos));
}
else
- pos = gh_scm2double (p);
+ pos = ly_scm2double (p);
return pos;
}
if (d && d * head_positions (me)[get_direction (me)] >= se*d)
me->warning (_ ("Weird stem size; check for narrow beams"));
- me->set_property ("stem-end-position", gh_double2scm (se));
+ me->set_property ("stem-end-position", scm_make_real (se));
}
Drul_array<Grob *> exthead;
exthead[LEFT] = exthead[RIGHT] =0;
- for (SCM s = me->get_property ("note-heads"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("note-heads"); ly_pair_p (s); s = ly_cdr (s))
{
Grob * n = unsmob_grob (ly_car (s));
Stem::note_head_positions (Grob *me)
{
Array<int> ps ;
- for (SCM s = me->get_property ("note-heads"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("note-heads"); ly_pair_p (s); s = ly_cdr (s))
{
Grob * n = unsmob_grob (ly_car (s));
int p = Staff_symbol_referencer::get_rounded_position (n);
Stem::is_invisible (Grob*me)
{
return ! (head_count (me)
- && gh_scm2int (me->get_property ("duration-log")) >= 1);
+ && ly_scm2int (me->get_property ("duration-log")) >= 1);
}
Direction
Real length = 7; // WARNING: IN HALF SPACES
SCM scm_len = me->get_property ("length");
- if (gh_number_p (scm_len))
+ if (ly_number_p (scm_len))
{
- length = gh_scm2double (scm_len);
+ length = ly_scm2double (scm_len);
}
else
{
s = me->get_property ("lengths");
- if (gh_pair_p (s))
+ if (ly_pair_p (s))
{
- length = 2* gh_scm2double (robust_list_ref (durlog -2, s));
+ length = 2* ly_scm2double (robust_list_ref (durlog -2, s));
}
}
if (dir * head_positions (me)[dir] >= 0)
{
SCM sshorten = me->get_property ("stem-shorten");
- SCM scm_shorten = gh_pair_p (sshorten) ?
+ SCM scm_shorten = ly_pair_p (sshorten) ?
robust_list_ref ((duration_log (me) - 2) >? 0, sshorten): SCM_EOL;
Real shorten = 2* robust_scm2double (scm_shorten,0);
Stem::duration_log (Grob*me)
{
SCM s = me->get_property ("duration-log");
- return (gh_number_p (s)) ? gh_scm2int (s) : 2;
+ return (ly_number_p (s)) ? ly_scm2int (s) : 2;
}
void
SCM
Stem::height (SCM smob, SCM ax)
{
- Axis a = (Axis)gh_scm2int (ax);
+ Axis a = (Axis)ly_scm2int (ax);
Grob * me = unsmob_grob (smob);
assert (a == Y_AXIS);
String flag_style;
SCM flag_style_scm = me->get_property ("flag-style");
- if (gh_symbol_p (flag_style_scm))
+ if (ly_symbol_p (flag_style_scm))
{
flag_style = ly_symbol2string (flag_style_scm);
}
}
SCM stroke_style_scm = me->get_property ("stroke-style");
- if (gh_string_p (stroke_style_scm))
+ if (ly_string_p (stroke_style_scm))
{
String stroke_style = ly_scm2string (stroke_style_scm);
if (!stroke_style.is_empty ())
SCM
Stem::dim_callback (SCM e, SCM ax)
{
- Axis a = (Axis) gh_scm2int (ax);
+ Axis a = (Axis) ly_scm2int (ax);
assert (a == X_AXIS);
Grob *me = unsmob_grob (e);
Interval r (0, 0);
Real
Stem::thickness (Grob* me)
{
- return gh_scm2double (me->get_property ("thickness"))
+ return ly_scm2double (me->get_property ("thickness"))
* Staff_symbol_referencer::line_thickness (me);
}
if (head_count (me) == 0)
{
- return gh_double2scm (0.0);
+ return scm_make_real (0.0);
}
if (Grob * f = first_head (me))
r += - d * rule_thick * 0.5;
}
}
- return gh_double2scm (r);
+ return scm_make_real (r);
}
{
/* Return cached info if available */
SCM scm_info = me->get_property ("stem-info");
- if (!gh_pair_p (scm_info))
+ if (!ly_pair_p (scm_info))
{
calc_stem_info (me);
scm_info = me->get_property ("stem-info");
Stem_info si;
si.dir_ = get_grob_direction (me);
- si.ideal_y_ = gh_scm2double (gh_car (scm_info));
- si.shortest_y_ = gh_scm2double (gh_cadr (scm_info));
+ si.ideal_y_ = ly_scm2double (ly_car (scm_info));
+ si.shortest_y_ = ly_scm2double (ly_cadr (scm_info));
return si;
}
/* Simple standard stem length */
SCM lengths = me->get_property ("beamed-lengths");
Real ideal_length =
- gh_scm2double (robust_list_ref (beam_count - 1,lengths))
+ ly_scm2double (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 =
- gh_scm2double (robust_list_ref (beam_count - 1, lengths))
+ ly_scm2double (robust_list_ref (beam_count - 1, lengths))
* staff_space;
ideal_y -= robust_scm2double (beam->get_property ("shorten"), 0);
Real minimum_free =
- gh_scm2double (robust_list_ref
+ ly_scm2double (robust_list_ref
(beam_count - 1,
me->get_property
("beamed-extreme-minimum-free-lengths")))
Real shortest_y = minimum_y * my_dir;
me->set_property ("stem-info",
- scm_list_n (gh_double2scm (ideal_y),
- gh_double2scm (shortest_y),
+ scm_list_n (scm_make_real (ideal_y),
+ scm_make_real (shortest_y),
SCM_UNDEFINED));
}
Stem::beam_multiplicity (Grob *stem)
{
SCM beaming= stem->get_property ("beaming");
- Slice l = int_list_to_slice (gh_car (beaming));
- Slice r = int_list_to_slice (gh_cdr (beaming));
+ Slice l = int_list_to_slice (ly_car (beaming));
+ Slice r = int_list_to_slice (ly_cdr (beaming));
l.unite (r);
return l;
"number pair");
Interval iv = ly_scm2interval (np);
- s->dim_[Axis (gh_scm2int (axis))] = iv;
+ s->dim_[Axis (ly_scm2int (axis))] = iv;
return SCM_UNDEFINED;
}
{
Stencil *s = unsmob_stencil (stil);
SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil");
- SCM_ASSERT_TYPE (gh_number_p (amount), amount, SCM_ARG2, __FUNCTION__, "number pair");
+ SCM_ASSERT_TYPE (ly_number_p (amount), amount, SCM_ARG2, __FUNCTION__, "number pair");
SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
SCM new_s = s->smobbed_copy ();
Stencil *q = unsmob_stencil (new_s);
- q->translate_axis (gh_scm2double (amount), Axis (gh_scm2int (axis)));
+ q->translate_axis (ly_scm2double (amount), Axis (ly_scm2int (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 (gh_scm2int (axis))));
+ return ly_interval2scm (s->extent (Axis (ly_scm2int (axis))));
}
LY_DEFINE (ly_stencil_moved_to_edge, "ly:stencil-moved-to-edge",
Real p = 0.0;
if (padding != SCM_UNDEFINED)
{
- SCM_ASSERT_TYPE (gh_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number");
- p = gh_scm2double (padding);
+ SCM_ASSERT_TYPE (ly_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number");
+ p = ly_scm2double (padding);
}
Real m = 0.0;
if (minimum != SCM_UNDEFINED)
{
- SCM_ASSERT_TYPE (gh_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
- m = gh_scm2double (minimum);
+ SCM_ASSERT_TYPE (ly_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
+ m = ly_scm2double (minimum);
}
if (s1)
first_stencil = *s1;
if (s2)
- return first_stencil.moved_to_edge (Axis (gh_scm2int (axis)),
- Direction (gh_scm2int (direction)),
+ return first_stencil.moved_to_edge (Axis (ly_scm2int (axis)),
+ Direction (ly_scm2int (direction)),
*s2, p, m).smobbed_copy ();
else
return Stencil().smobbed_copy ();
Real p = 0.0;
if (padding != SCM_UNDEFINED)
{
- SCM_ASSERT_TYPE (gh_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number");
- p = gh_scm2double (padding);
+ SCM_ASSERT_TYPE (ly_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number");
+ p = ly_scm2double (padding);
}
Real m = 0.0;
if (minimum != SCM_UNDEFINED)
{
- SCM_ASSERT_TYPE (gh_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
- m = gh_scm2double (minimum);
+ SCM_ASSERT_TYPE (ly_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
+ m = ly_scm2double (minimum);
}
if (s1)
result = *s1;
if (s2)
- result.add_at_edge (Axis (gh_scm2int (axis)),
- Direction (gh_scm2int (direction)), *s2, p, m);
+ result.add_at_edge (Axis (ly_scm2int (axis)),
+ Direction (ly_scm2int (direction)), *s2, p, m);
return result.smobbed_copy ();
}
while (!SCM_NULLP (args))
{
- Stencil *s = unsmob_stencil (gh_car (args));
+ Stencil *s = unsmob_stencil (ly_car (args));
if (!s)
- SCM_ASSERT_TYPE (s, gh_car (args), SCM_ARGn, __FUNCTION__, "Stencil");
+ SCM_ASSERT_TYPE (s, ly_car (args), SCM_ARGn, __FUNCTION__, "Stencil");
result.add_stencil (*s);
- args = gh_cdr (args);
+ args = ly_cdr (args);
}
return result.smobbed_copy ();
{
SCM_ASSERT_TYPE (unsmob_stencil (stil), stil, SCM_ARG1, __FUNCTION__, "stencil");
SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
- SCM_ASSERT_TYPE (gh_number_p (dir), dir, SCM_ARG3, __FUNCTION__, "number");
+ SCM_ASSERT_TYPE (ly_number_p (dir), dir, SCM_ARG3, __FUNCTION__, "number");
- unsmob_stencil (stil)->align_to ((Axis)gh_scm2int (axis),
- gh_scm2double (dir));
+ unsmob_stencil (stil)->align_to ((Axis)ly_scm2int (axis),
+ ly_scm2double (dir));
return SCM_UNDEFINED;
}
Stencil mol;
SCM glyph = e->get_property ("text");
- if (!gh_string_p (glyph))
+ if (!ly_string_p (glyph))
return mol.smobbed_copy ();
String text = ly_scm2string (glyph);
/*
UGH UGH
*/
- if (gh_string_p (gl) && gh_equal_p (gl, scm_makfrom0str ("brace"))
- && gh_string_p (my_gl) && gh_equal_p (my_gl, scm_makfrom0str ("bracket")))
+ if (ly_string_p (gl) && ly_equal_p (gl, scm_makfrom0str ("brace"))
+ && ly_string_p (my_gl) && ly_equal_p (my_gl, scm_makfrom0str ("bracket")))
inf.grob_->translate_axis (-0.8, X_AXIS); // ugh
- else if (gh_string_p (gl) && gh_equal_p (gl, scm_makfrom0str ("bracket"))
- && gh_string_p (my_gl) && gh_equal_p (my_gl, scm_makfrom0str ("bracket")))
+ else if (ly_string_p (gl) && ly_equal_p (gl, scm_makfrom0str ("bracket"))
+ && ly_string_p (my_gl) && ly_equal_p (my_gl, scm_makfrom0str ("bracket")))
{
inf.grob_->translate_axis ( -0.8, X_AXIS); // ugh
inf.grob_->set_property ("arch-height",
- gh_double2scm (gh_scm2double (inf.grob_->get_property
+ scm_make_real (ly_scm2double (inf.grob_->get_property
("arch-height"))+0.5));
}
}
Stencil
System_start_delimiter::staff_bracket (Grob*me,Real height)
{
- Real arc_height = gh_scm2double (me->get_property ("arch-height")) ;
+ Real arc_height = ly_scm2double (me->get_property ("arch-height")) ;
SCM at = scm_list_n (ly_symbol2scm ("bracket"),
me->get_property ("arch-angle"),
me->get_property ("arch-width"),
- gh_double2scm (arc_height),
- gh_double2scm (height),
+ scm_make_real (arc_height),
+ scm_make_real (height),
me->get_property ("arch-thick"),
me->get_property ("thickness"),
SCM_UNDEFINED);
{
Grob * me = unsmob_grob (smob);
SCM gl = me->get_property ("glyph");
- if (gh_equal_p (gl,scm_makfrom0str ("bar-line")))
+ if (ly_equal_p (gl,scm_makfrom0str ("bar-line")))
{
int count = 0;
*/
SCM elts = me->get_property ("elements");
Grob *common = common_refpoint_of_list (elts, me, Y_AXIS);
- for (SCM s = elts; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = elts; ly_pair_p (s); s = ly_cdr (s))
{
- Interval v = unsmob_grob (gh_car (s))->extent (common, Y_AXIS);
+ Interval v = unsmob_grob (ly_car (s))->extent (common, Y_AXIS);
if (!v.is_empty ())
count ++;
Grob * me = unsmob_grob (smob);
SCM s = me->get_property ("glyph");
- if (!gh_string_p (s))
+ if (!ly_string_p (s))
return SCM_EOL;
SCM gsym = scm_string_to_symbol (s) ;
Real staff_space = Staff_symbol_referencer::staff_space (me);
Interval ext = ly_scm2interval (Axis_group_interface::group_extent_callback
- (me->self_scm (), gh_int2scm (Y_AXIS)));
+ (me->self_scm (), scm_int2num (Y_AXIS)));
Real l = ext.length () / staff_space;
if (ext.is_empty ()
name. This is better than using find_font directly,
esp. because that triggers mktextfm for non-existent
fonts. */
- SCM fam = gh_cons (ly_symbol2scm ("font-encoding"), ly_symbol2scm ("braces"));
+ SCM fam = scm_cons (ly_symbol2scm ("font-encoding"), ly_symbol2scm ("braces"));
SCM alist = scm_list_n (fam, SCM_UNDEFINED);
fm = select_font (me->get_paper (), scm_list_n (alist, SCM_UNDEFINED));
{
int k =0;
for (SCM s = get_property ("all-elements");
- gh_pair_p (s); s = ly_cdr (s))
+ ly_pair_p (s); s = ly_cdr (s))
{
- if (dynamic_cast<Spanner*> (unsmob_grob (gh_car (s))))
+ if (dynamic_cast<Spanner*> (unsmob_grob (ly_car (s))))
k++;
}
static void
fixup_refpoints (SCM s)
{
- for (; gh_pair_p (s); s = ly_cdr (s))
+ for (; ly_pair_p (s); s = ly_cdr (s))
{
Grob::fixup_refpoint (ly_car (s));
}
SCM
System::get_lines ()
{
- for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = get_property ("all-elements"); ly_pair_p (s); s = ly_cdr (s))
{
Grob *g = unsmob_grob (ly_car (s));
if (g->internal_has_interface (ly_symbol2scm ("only-prebreak-interface")))
{
Grob *se = broken_intos_[i];
SCM all = se->get_property ("all-elements");
- for (SCM s = all; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = all; ly_pair_p (s); s = ly_cdr (s))
fixup_refpoint (ly_car (s));
count += scm_ilength (all);
}
*/
fixup_refpoints (get_property ("all-elements"));
- for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = get_property ("all-elements"); ly_pair_p (s); s = ly_cdr (s))
unsmob_grob (ly_car (s))->handle_broken_dependencies ();
handle_broken_dependencies ();
do
{
SCM between = loose->get_property ("between-cols");
- if (!gh_pair_p (between))
+ if (!ly_pair_p (between))
break;
{
Grob *me = this;
SCM cs = me->get_property ("columns");
- Grob * prev = gh_pair_p (cs) ? unsmob_grob (ly_car (cs)) : 0;
+ Grob * prev = ly_pair_p (cs) ? unsmob_grob (ly_car (cs)) : 0;
p->rank_ = prev ? Paper_column::get_rank (prev) + 1 : 0;
- me->set_property ("columns", gh_cons (p->self_scm (), cs));
+ me->set_property ("columns", scm_cons (p->self_scm (), cs));
Axis_group_interface::add_element (me, p);
}
void
System::pre_processing ()
{
- for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = get_property ("all-elements"); ly_pair_p (s); s = ly_cdr (s))
unsmob_grob (ly_car (s))->discretionary_processing ();
if (verbose_global_b)
progress_indication (_f ("Grob count %d", element_count ()));
- for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = get_property ("all-elements"); ly_pair_p (s); s = ly_cdr (s))
unsmob_grob (ly_car (s))->handle_prebroken_dependencies ();
fixup_refpoints (get_property ("all-elements"));
- for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = get_property ("all-elements"); ly_pair_p (s); s = ly_cdr (s))
{
Grob* sc = unsmob_grob (ly_car (s));
sc->calculate_dependencies (PRECALCED, PRECALCING, ly_symbol2scm ("before-line-breaking-callback"));
}
progress_indication ("\n" + _ ("Calculating line breaks...") + " ");
- for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = get_property ("all-elements"); ly_pair_p (s); s = ly_cdr (s))
{
Grob * e = unsmob_grob (ly_car (s));
SCM proc = e->get_property ("spacing-procedure");
- if (gh_procedure_p (proc))
- gh_call1 (proc, e->self_scm ());
+ if (ly_procedure_p (proc))
+ scm_call_1 (proc, e->self_scm ());
}
}
void
System::post_processing ()
{
- for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = get_property ("all-elements"); ly_pair_p (s); s = ly_cdr (s))
{
Grob *g = unsmob_grob (ly_car (s));
g->calculate_dependencies (POSTCALCED, POSTCALCING,
all = uniquify_list (all);
this->get_stencil ();
- for (SCM s = all; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = all; ly_pair_p (s); s = ly_cdr (s))
{
Grob *g = unsmob_grob (ly_car (s));
g->get_stencil ();
SCM all = get_property ("all-elements");
for (int i = LAYER_COUNT; i--;)
- for (SCM s = all; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = all; ly_pair_p (s); s = ly_cdr (s))
{
Grob *g = unsmob_grob (ly_car (s));
Stencil *stil = g->get_stencil ();
SCM between = ly_symbol2scm ("between-system-string");
SCM inter = g->internal_get_property (between);
- if (gh_string_p (inter))
+ if (ly_string_p (inter))
stencils = scm_cons (scm_cons (between, inter), stencils);
}
r = r->get_column ();
SCM s = get_property ("columns");
- while (gh_pair_p (s) && ly_car (s) != r->self_scm ())
+ while (ly_pair_p (s) && ly_car (s) != r->self_scm ())
s = ly_cdr (s);
- if (gh_pair_p (s))
+ if (ly_pair_p (s))
s = ly_cdr (s);
- while (gh_pair_p (s) && ly_car (s) != l->self_scm ())
+ while (ly_pair_p (s) && ly_car (s) != l->self_scm ())
{
Paper_column*c = dynamic_cast<Paper_column*> (unsmob_grob (ly_car (s)));
if (Item::is_breakable (c) && !c->system_)
for (int i=0; i < note_events_.size (); i++)
{
SCM stringTunings = get_property ("stringTunings");
- int number_of_strings = ((int) gh_length (stringTunings));
+ int number_of_strings = ((int) ly_length (stringTunings));
bool high_string_one = to_boolean (get_property ("highStringOne"));
Item * note = make_item ("TabNoteHead");
Music * tabstring_event=0;
for (SCM s =event->get_property ("articulations");
- !tabstring_event && gh_pair_p (s); s = gh_cdr (s))
+ !tabstring_event && ly_pair_p (s); s = ly_cdr (s))
{
- Music * art = unsmob_music (gh_car (s));
+ Music * art = unsmob_music (ly_car (s));
if (art->is_mus_type ("string-number-event"))
tabstring_event = art;
bool string_found;
if (tabstring_event)
{
- tab_string = gh_scm2int (tabstring_event->get_property ("string-number"));
+ tab_string = ly_scm2int (tabstring_event->get_property ("string-number"));
string_found = true;
}
else
Duration dur = *unsmob_duration (event->get_property ("duration"));
note->set_property ("duration-log",
- gh_int2scm (dur.duration_log ()));
+ scm_int2num (dur.duration_log ()));
if (dur.dot_count ())
{
Rhythmic_head::set_dots (note, d);
if (dur.dot_count ()
- != gh_scm2int (d->get_property ("dot-count")))
- d->set_property ("dot-count", gh_int2scm (dur.dot_count ()));
+ != ly_scm2int (d->get_property ("dot-count")))
+ d->set_property ("dot-count", scm_int2num (dur.dot_count ()));
d->set_parent (note, Y_AXIS);
announce_grob (d, SCM_EOL);
SCM scm_pitch = event->get_property ("pitch");
SCM proc = get_property ("tablatureFormat");
SCM min_fret_scm = get_property ("minimumFret");
- int min_fret = gh_number_p (min_fret_scm) ? gh_scm2int (min_fret_scm) : 0;
+ int min_fret = ly_number_p (min_fret_scm) ? ly_scm2int (min_fret_scm) : 0;
while (!string_found)
{
int fret = unsmob_pitch (scm_pitch)->semitone_pitch ()
- - gh_scm2int (gh_list_ref (stringTunings,gh_int2scm (tab_string-1)));
+ - ly_scm2int (scm_list_ref (stringTunings,scm_int2num (tab_string-1)));
if (fret<min_fret)
tab_string += high_string_one ? 1 : -1;
else
string_found = true;
}
- SCM text = gh_call3 (proc, gh_int2scm (tab_string), stringTunings, scm_pitch);
+ SCM text = scm_call_3 (proc, scm_int2num (tab_string), stringTunings, scm_pitch);
int pos = 2 * tab_string - number_of_strings - 1; // No tab-note between the string !!!
if (to_boolean (get_property ("stringOneTopmost")))
note->set_property ("text", text);
- note->set_property ("staff-position", gh_int2scm (pos));
+ note->set_property ("staff-position", scm_int2num (pos));
announce_grob (note, event->self_scm ());
notes_.push (note);
}
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 (gh_scm2int (met))).main_part_;
+ Rational r = (d->get_length () / Moment (Rational (1, 4)) * Moment (ly_scm2int (met))).main_part_;
audio_ = new Audio_tempo (int (r));
// Hmm
int priority = 200;
SCM s = text->get_property ("script-priority");
- if (gh_number_p (s))
- priority = gh_scm2int (s);
+ if (ly_number_p (s))
+ priority = ly_scm2int (s);
/* see script-engraver.cc */
priority += i;
- text->set_property ("script-priority", gh_int2scm (priority));
+ text->set_property ("script-priority", scm_int2num (priority));
Direction dir = to_dir (r->get_property ("direction"));
if (dir)
SCM
Text_item::interpret_markup (SCM paper, SCM props, SCM markup)
{
- if (gh_string_p (markup))
+ if (ly_string_p (markup))
{
String str = ly_scm2string (markup);
return Stencil (b, lst).smobbed_copy ();
}
- else if (gh_pair_p (markup))
+ else if (ly_pair_p (markup))
{
- SCM func = gh_car (markup);
- SCM args = gh_cdr (markup);
+ SCM func = ly_car (markup);
+ SCM args = ly_cdr (markup);
if (!markup_p (markup))
programming_error ("Markup head has no markup signature.");
Text_item::markup_p (SCM x)
{
return
- gh_string_p (x) ||
- (gh_pair_p (x)
- && SCM_BOOL_F != scm_object_property (gh_car (x), ly_symbol2scm ("markup-signature")));
+ ly_string_p (x) ||
+ (ly_pair_p (x)
+ && SCM_BOOL_F != scm_object_property (ly_car (x), ly_symbol2scm ("markup-signature")));
}
ADD_INTERFACE (Text_item,"text-interface",
span_points[d] = b->extent (common, X_AXIS).linear_combination (d * encl);
if (is_number_pair (shorten))
- span_points -= d * gh_scm2double (index_get_cell (shorten, d));
+ span_points -= d * ly_scm2double (index_get_cell (shorten, d));
}
if (is_number_pair (flare))
- span_points -= d * gh_scm2double (index_get_cell (flare, d));
+ span_points -= d * ly_scm2double (index_get_cell (flare, d));
}
while (flip (&d) != LEFT);
SCM properties = Font_interface::text_font_alist_chain (me);
SCM edge_text = me->get_property ("edge-text");
Drul_array<Stencil> edge;
- if (gh_pair_p (edge_text))
+ if (ly_pair_p (edge_text))
{
Direction d = LEFT;
do
Real dx = 0.0;
if (is_number_pair (flare))
- dx = gh_scm2double (index_get_cell (flare, d)) * d;
+ dx = ly_scm2double (index_get_cell (flare, d)) * d;
Real dy = - dir * edge_height[d] ;
if (dy)
SCM sym = ly_symbol2scm (s.to_str0 ());
SCM idx = scm_hash_ref (encoding_table_, sym, SCM_BOOL_F);
- if (gh_char_p (idx))
+ if (ly_char_p (idx))
{
- return (unsigned char) gh_scm2char (idx);
+ return (unsigned char) ly_scm2char (idx);
}
else
return -1;
maybe should check positions too.
*/
if (right_mus && left_mus
- && gh_equal_p (right_mus->get_property ("pitch"),
+ && ly_equal_p (right_mus->get_property ("pitch"),
left_mus->get_property ("pitch")))
{
Grob * p = make_spanner ("Tie");
Tie_engraver::start_translation_timestep ()
{
daddy_context_->set_property ("tieMelismaBusy",
- gh_bool2scm (heads_to_tie_.size ()));
+ ly_bool2scm (heads_to_tie_.size ()));
}
Music * left_mus = heads_to_tie_[i].event_;
if (right_mus && left_mus
- && gh_equal_p (right_mus->get_property ("pitch"),
+ && ly_equal_p (right_mus->get_property ("pitch"),
left_mus->get_property ("pitch")))
{
an->tie_to (th);
Tie_performer::start_translation_timestep ()
{
daddy_context_->set_property ("tieMelismaBusy",
- gh_bool2scm (heads_to_tie_.size ()));
+ ly_bool2scm (heads_to_tie_.size ()));
}
void
Tie::set_interface (Grob*me)
{
- me->set_property ("head-pair", gh_cons (SCM_EOL, SCM_EOL));
+ me->set_property ("head-pair", scm_cons (SCM_EOL, SCM_EOL));
}
{
SCM c = me->get_property ("head-pair");
- if (gh_pair_p (c))
+ if (ly_pair_p (c))
return unsmob_grob (index_get_cell (c, d));
else
return 0;
SCM lim // groetjes aan de chirurgendochter.
= scm_assq (ly_symbol2scm ("height-limit"),details);
- Real h_inf = gh_scm2double (ly_cdr (lim)) * staff_space;
- Real r_0 = gh_scm2double (ly_cdr (scm_assq (ly_symbol2scm ("ratio"),details)));
+ Real h_inf = ly_scm2double (ly_cdr (lim)) * staff_space;
+ Real r_0 = ly_scm2double (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 * gh_scm2double (me->get_property ("y-offset"));;
+ + dir * ly_scm2double (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 * gh_scm2double (me->get_property ("staffline-clearance"));
+ Real clear = staff_space * ly_scm2double (me->get_property ("staffline-clearance"));
if (fabs (y) <=
Staff_symbol_referencer::staff_radius (me) * staff_space + clear
SCM controls = SCM_EOL;
for (int i= 4; i--;)
- controls = gh_cons (ly_offset2scm (b.control_[i]), controls);
+ controls = scm_cons (ly_offset2scm (b.control_[i]), controls);
return controls;
}
Grob*me = unsmob_grob (smob);
SCM cp = me->get_property ("control-points");
- if (!gh_pair_p (cp)) // list is more accurate
+ if (!ly_pair_p (cp)) // list is more accurate
{
cp = get_control_points (smob);
me->set_property ("control-points", cp);
}
- if (!gh_pair_p (cp))
+ if (!ly_pair_p (cp))
return Stencil ().smobbed_copy ();
Real thick
SCM fr= get_property ("timeSignatureFraction");
if (!time_signature_
&& last_time_fraction_ != fr
- && gh_pair_p (fr))
+ && ly_pair_p (fr))
{
- int den = gh_scm2int (gh_cdr (fr));
+ int den = ly_scm2int (ly_cdr (fr));
if (den != (1 << intlog2 (den)))
{
/*
*/
warning (_f ("Found strange time signature %d/%d.",
den,
- gh_scm2int (gh_car (fr))
+ ly_scm2int (ly_car (fr))
));
}
Time_signature_performer::create_audio_elements ()
{
SCM fr = get_property ("timeSignatureFraction");
- if (gh_pair_p (fr) && !gh_equal_p (fr, prev_fraction_))
+ if (ly_pair_p (fr) && !ly_equal_p (fr, prev_fraction_))
{
prev_fraction_ = fr;
- int b = gh_scm2int (ly_car (fr));
- int o = gh_scm2int (ly_cdr (fr));
+ int b = ly_scm2int (ly_car (fr));
+ int o = ly_scm2int (ly_cdr (fr));
audio_ = new Audio_time_signature (b,o);
Audio_element_info info (audio_, 0);
SCM frac = me->get_property ("fraction");
int n = 4;
int d = 4;
- if (gh_pair_p (frac))
+ if (ly_pair_p (frac))
{
- n = gh_scm2int (ly_car (frac));
- d = gh_scm2int (ly_cdr (frac));
+ n = ly_scm2int (ly_car (frac));
+ d = ly_scm2int (ly_cdr (frac));
}
Stencil m;
- if (gh_symbol_p (st))
+ if (ly_symbol_p (st))
{
String style (ly_scm2string (scm_symbol_to_string (st)));
if (style[0]=='1')
Time_signature::numbered_time_signature (Grob*me,int num, int den)
{
SCM chain = me->get_property_alist_chain (Font_interface::text_font_alist_chain (me));
- chain = scm_cons (scm_list_1 (gh_cons (ly_symbol2scm ("font-encoding"),
+ chain = scm_cons (scm_list_1 (scm_cons (ly_symbol2scm ("font-encoding"),
ly_symbol2scm ("number"))),
chain);
Moment now = now_mom ();
/* Set the first bar of the score? */
- if (!gh_string_p (which))
+ if (!ly_string_p (which))
which = (now.main_part_ || now.main_part_ == last_moment_.main_part_)
? SCM_EOL : scm_makfrom0str ("|");
SCM which = get_property ("whichBar");
/* Set the first bar of the score? */
- if (!gh_string_p (which))
+ if (!ly_string_p (which))
which = SCM_EOL;
Moment mp = measure_position ();
->set_property ("measure-length", mlen.smobbed_copy ());
}
- if (!gh_string_p (which) && to_boolean (automatic_bars))
+ if (!ly_string_p (which) && to_boolean (automatic_bars))
{
SCM always = get_property ("barAlways");
*/
daddy_context_->add_alias (ly_symbol2scm ("Timing"));
daddy_context_->set_property ("timing" , SCM_BOOL_T);
- daddy_context_->set_property ("currentBarNumber" , gh_int2scm (1));
+ daddy_context_->set_property ("currentBarNumber" , scm_int2num (1));
daddy_context_->set_property ("timeSignatureFraction",
- gh_cons (gh_int2scm (4), gh_int2scm (4)));
+ scm_cons (scm_int2num (4), scm_int2num (4)));
/*
Do not init measurePosition; this should be done from global
context.
SCM barn = get_property ("currentBarNumber");
int b = 0;
- if (gh_number_p (barn))
+ if (ly_number_p (barn))
{
- b = gh_scm2int (barn);
+ b = ly_scm2int (barn);
}
SCM cad = get_property ("timing");
b ++;
}
- daddy_context_->set_property ("currentBarNumber", gh_int2scm (b));
+ daddy_context_->set_property ("currentBarNumber", scm_int2num (b));
daddy_context_->set_property ("measurePosition", measposp.smobbed_copy ());
}
{
SCM l = global_translator_dict ? global_translator_dict->to_alist () : SCM_EOL;
- for (SCM s =l; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s =l; ly_pair_p (s); s = ly_cdr (s))
{
- gh_set_car_x (s, gh_cdar (s));
+ scm_set_car_x (s, ly_cdar (s));
}
return l;
void
translator_each (SCM list, Translator_method method)
{
- for (SCM p = list; gh_pair_p (p); p = ly_cdr (p))
+ for (SCM p = list; ly_pair_p (p); p = ly_cdr (p))
(unsmob_translator (ly_car (p))->*method) ();
}
void
Translator_group::initialize ()
{
- SCM tab = scm_make_vector (gh_int2scm (19), SCM_BOOL_F);
+ SCM tab = scm_make_vector (scm_int2num (19), SCM_BOOL_F);
daddy_context_->set_property ("acceptHashTable", tab);
}
{
SCM ack_ifs = scm_assoc (ly_symbol2scm ("events-accepted"),
tr->translator_description ());
- ack_ifs = gh_cdr (ack_ifs);
+ ack_ifs = ly_cdr (ack_ifs);
for (SCM s = ifaces; ly_pair_p (s); s = ly_cdr (s))
if (scm_c_memq (ly_car (s), ack_ifs) != SCM_BOOL_F)
return true;
SCM name = scm_sloppy_assq (ly_symbol2scm ("name"),
m->get_property_alist (false));
- if (!gh_pair_p (name))
+ if (!ly_pair_p (name))
return false;
- name = gh_cdr (name);
+ name = ly_cdr (name);
SCM accept_list = scm_hashq_ref (tab, name, SCM_UNDEFINED);
if (accept_list == SCM_BOOL_F)
{
scm_hashq_set_x (tab, name, accept_list);
}
- for (SCM p = accept_list; gh_pair_p (p); p = ly_cdr (p))
+ for (SCM p = accept_list; ly_pair_p (p); p = ly_cdr (p))
{
Translator * t = unsmob_translator (ly_car (p));
if (t && t->try_music (m))
names_to_translators (SCM namelist, Context*tg)
{
SCM l = SCM_EOL;
- for (SCM s = namelist; gh_pair_p (s) ; s = ly_cdr (s))
+ for (SCM s = namelist; ly_pair_p (s) ; s = ly_cdr (s))
{
Translator * t = get_translator (ly_car (s));
if (!t)
{
Translator * tr = t->clone ();
SCM str = tr->self_scm ();
- l = gh_cons (str, l);
+ l = scm_cons (str, l);
tr->daddy_context_ = tg;
scm_gc_unprotect_object (str);
(tg->*ptr) ();
}
- for (SCM s = c->context_list_ ; gh_pair_p (s);
- s =gh_cdr (s))
+ for (SCM s = c->context_list_ ; ly_pair_p (s);
+ s =ly_cdr (s))
{
- recurse_over_translators (unsmob_context (gh_car (s)), ptr, dir);
+ recurse_over_translators (unsmob_context (ly_car (s)), ptr, dir);
}
if (dir == UP)
execute_pushpop_property (Context * trg,
SCM prop, SCM eltprop, SCM val)
{
- if (gh_symbol_p (prop) && gh_symbol_p (eltprop))
+ if (ly_symbol_p (prop) && ly_symbol_p (eltprop))
{
if (val != SCM_UNDEFINED)
{
if (where != trg)
{
SCM base = updated_grob_properties (trg, prop);
- prev = gh_cons (base, base);
+ prev = scm_cons (base, base);
trg->internal_set_property (prop, prev);
}
else
prev = trg->internal_get_property (prop);
- if (!gh_pair_p (prev))
+ if (!ly_pair_p (prev))
{
programming_error ("Grob definition should be cons.");
return ;
}
- SCM prev_alist = gh_car (prev);
+ SCM prev_alist = ly_car (prev);
- if (gh_pair_p (prev_alist) || prev_alist == SCM_EOL)
+ if (ly_pair_p (prev_alist) || prev_alist == SCM_EOL)
{
bool ok = type_check_assignment (eltprop, val, ly_symbol2scm ("backend-type?"));
tack onto alist:
*/
if (ok)
- gh_set_car_x (prev, scm_acons (eltprop, val, prev_alist));
+ scm_set_car_x (prev, scm_acons (eltprop, val, prev_alist));
}
else
{
else if (trg->where_defined (prop) == trg)
{
SCM prev = trg->internal_get_property (prop);
- SCM prev_alist = gh_car (prev);
- SCM daddy = gh_cdr (prev);
+ SCM prev_alist = ly_car (prev);
+ SCM daddy = ly_cdr (prev);
SCM new_alist = SCM_EOL;
SCM *tail = &new_alist;
while (prev_alist != daddy)
{
- if (gh_equal_p (gh_caar (prev_alist), eltprop))
+ if (ly_equal_p (ly_caar (prev_alist), eltprop))
{
- prev_alist = gh_cdr (prev_alist);
+ prev_alist = ly_cdr (prev_alist);
break ;
}
- *tail = gh_cons (gh_car (prev_alist), SCM_EOL);
+ *tail = scm_cons (ly_car (prev_alist), SCM_EOL);
tail = SCM_CDRLOC (*tail);
- prev_alist = gh_cdr (prev_alist);
+ prev_alist = ly_cdr (prev_alist);
}
if (new_alist == SCM_EOL && prev_alist == daddy)
else
{
*tail = prev_alist;
- trg->internal_set_property (prop, gh_cons (new_alist, daddy));
+ trg->internal_set_property (prop, scm_cons (new_alist, daddy));
}
}
}
apply_property_operations (Context *tg, SCM pre_init_ops)
{
SCM correct_order = scm_reverse (pre_init_ops);
- for (SCM s = correct_order; gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = correct_order; ly_pair_p (s); s = ly_cdr (s))
{
SCM entry = ly_car (s);
SCM type = ly_car (entry);
if (type == ly_symbol2scm ("push") || type == ly_symbol2scm ("poppush"))
{
SCM val = ly_cddr (entry);
- val = gh_pair_p (val) ? ly_car (val) : SCM_UNDEFINED;
+ val = ly_pair_p (val) ? ly_car (val) : SCM_UNDEFINED;
execute_pushpop_property (tg, ly_car (entry), ly_cadr (entry), val);
}
SCM
updated_grob_properties (Context * tg, SCM sym)
{
- assert (gh_symbol_p (sym));
+ assert (ly_symbol_p (sym));
tg = tg->where_defined (sym);
if (!tg)
SCM props = tg->internal_get_property (sym);
- if (!gh_pair_p (props))
+ if (!ly_pair_p (props))
{
programming_error ("grob props not a pair?");
return SCM_EOL;
}
- SCM based_on = gh_cdr (props);
+ SCM based_on = ly_cdr (props);
if (based_on == daddy_props)
{
- return gh_car (props);
+ return ly_car (props);
}
else
{
SCM copy = daddy_props;
SCM * tail = ©
- SCM p = gh_car (props);
+ SCM p = ly_car (props);
while (p != based_on)
{
- *tail = gh_cons (gh_car (p), daddy_props);
+ *tail = scm_cons (ly_car (p), daddy_props);
tail = SCM_CDRLOC (*tail);
p = SCM_CDR (p);
}
SCM lp = me->get_property ("left-position");
SCM rp = me->get_property ("right-position");
- if (!gh_number_p (rp) || !gh_number_p (lp))
+ if (!ly_number_p (rp) || !ly_number_p (lp))
after_line_breaking (smob);
}
Fixme: the type of this prop is sucky.
*/
SCM bracket = me->get_property ("bracket-visibility");
- if (gh_boolean_p (bracket))
+ if (ly_boolean_p (bracket))
{
- bracket_visibility = gh_scm2bool (bracket);
+ bracket_visibility = ly_scm2bool (bracket);
}
else if (bracket == ly_symbol2scm ("if-no-beam"))
bracket_visibility = !par_beam;
SCM numb = me->get_property ("number-visibility");
- if (gh_boolean_p (numb))
+ if (ly_boolean_p (numb))
{
- number_visibility = gh_scm2bool (numb);
+ number_visibility = ly_scm2bool (numb);
}
else if (numb == ly_symbol2scm ("if-no-beam"))
number_visibility = !par_beam;
Paper_def *pap = me->get_paper ();
Stencil num;
- if (gh_string_p (number) && number_visibility)
+ if (ly_string_p (number) && number_visibility)
{
SCM properties = Font_interface::text_font_alist_chain (me);
SCM snum = Text_item::interpret_markup (pap->self_scm (), properties, number);
do {
flare[d] = height[d] = shorten[d] = 0.0;
if (is_number_pair (fl))
- flare[d] += ss * gh_scm2double (index_get_cell (fl, d));
+ flare[d] += ss * ly_scm2double (index_get_cell (fl, d));
if (is_number_pair (eh))
- height[d] += - dir * ss *gh_scm2double (index_get_cell (eh, d));
+ height[d] += - dir * ss *ly_scm2double (index_get_cell (eh, d));
if (is_number_pair (sp))
- shorten[d] += ss *gh_scm2double (index_get_cell (sp, d));
+ shorten[d] += ss *ly_scm2double (index_get_cell (sp, d));
}
while (flip (&d) != LEFT);
}
// padding
- *offset += gh_scm2double (me->get_property ("padding")) *dir;
+ *offset += ly_scm2double (me->get_property ("padding")) *dir;
/*
{
SCM ps = par_beam->get_property ("positions");
- Real lp = gh_scm2double (gh_car (ps));
- Real rp = gh_scm2double (gh_cdr (ps));
+ Real lp = ly_scm2double (ly_car (ps));
+ Real rp = ly_scm2double (ly_cdr (ps));
/*
duh. magic.
*/
- offset = lp + dir * (0.5 + gh_scm2double (me->get_property ("padding")));
+ offset = lp + dir * (0.5 + ly_scm2double (me->get_property ("padding")));
dy = rp- lp;
}
SCM lp = me->get_property ("left-position");
SCM rp = me->get_property ("right-position");
- if (gh_number_p (lp) && !gh_number_p (rp))
+ if (ly_number_p (lp) && !ly_number_p (rp))
{
- rp = gh_double2scm (gh_scm2double (lp) + dy);
+ rp = scm_make_real (ly_scm2double (lp) + dy);
}
- else if (gh_number_p (rp) && !gh_number_p (lp))
+ else if (ly_number_p (rp) && !ly_number_p (lp))
{
- lp = gh_double2scm (gh_scm2double (rp) - dy);
+ lp = scm_make_real (ly_scm2double (rp) - dy);
}
- else if (!gh_number_p (rp) && !gh_number_p (lp))
+ else if (!ly_number_p (rp) && !ly_number_p (lp))
{
- lp = gh_double2scm (offset);
- rp = gh_double2scm (offset +dy);
+ lp = scm_make_real (offset);
+ rp = scm_make_real (offset +dy);
}
me->set_property ("left-position", lp);
Tuplet_bracket::get_default_dir (Grob*me)
{
Drul_array<int> dirs (0,0);
- for (SCM s = me->get_property ("note-columns"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("note-columns"); ly_pair_p (s); s = ly_cdr (s))
{
Grob * nc = unsmob_grob (ly_car (s));
Direction d = Note_column::dir (nc);
SCM proc = get_property ("tupletNumberFormatFunction");
- if (gh_procedure_p (proc))
+ if (ly_procedure_p (proc))
{
- SCM t = gh_apply (proc, scm_list_n (time_scaled_musics_[i]->self_scm (), SCM_UNDEFINED));
+ SCM t = scm_apply_0 (proc, scm_list_n (time_scaled_musics_[i]->self_scm (), SCM_UNDEFINED));
glep->set_property ("text", t);
}
SCM body = get_music ()->get_property ("element");
SCM alts = get_music ()->get_property ("elements");
int alt_count = scm_ilength (alts);
- int rep_count = gh_scm2int (get_music ()->get_property ("repeat-count"));
+ int rep_count = ly_scm2int (get_music ()->get_property ("repeat-count"));
for (int i = 0; i < rep_count; i++)
{
if (unsmob_music (body))
- *tail = gh_cons (body, SCM_EOL) ;
+ *tail = scm_cons (body, SCM_EOL) ;
tail = SCM_CDRLOC (*tail);
if (alt_count)
{
- *tail = gh_cons (gh_car (alts), SCM_EOL);
+ *tail = scm_cons (ly_car (alts), SCM_EOL);
tail = SCM_CDRLOC (*tail);
if (i >= rep_count - alt_count)
- alts = gh_cdr (alts);
+ alts = ly_cdr (alts);
}
}
SCM
Volta_repeat_iterator::get_music_list ()const
{
- return gh_cons (get_music ()->get_property ("element"),
+ return scm_cons (get_music ()->get_property ("element"),
get_music ()->get_property ("elements"));
}
SCM alts = get_music ()->get_property ("elements");
alt_count_ = scm_ilength (alts);
- rep_count_ = gh_scm2int (get_music ()->get_property ("repeat-count"));
+ rep_count_ = ly_scm2int (get_music ()->get_property ("repeat-count"));
done_count_ = 0;
}
Context * where = get_outlet ()->where_defined (reps);
if (where
- && current_reps == SCM_EOL || gh_pair_p (current_reps))
+ && current_reps == SCM_EOL || ly_pair_p (current_reps))
{
- current_reps = gh_cons (what, current_reps);
+ current_reps = scm_cons (what, current_reps);
where->internal_set_property (reps, current_reps);
}
}
{
Item *primitive = dynamic_cast<Item*> (primitives[i].grob_);
int prefix_set =
- gh_scm2int (primitive->get_property ("prefix-set"));
+ ly_scm2int (primitive->get_property ("prefix-set"));
int context_info =
- gh_scm2int (primitive->get_property ("context-info"));
+ ly_scm2int (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 = gh_scm2int (delta_pitch_scm);
+ delta_pitch = ly_scm2int (delta_pitch_scm);
}
else
{
* Save the head's final x-offset.
*/
primitive->set_property ("x-offset",
- gh_double2scm (x_offset));
+ scm_make_real (x_offset));
/*
* If the head is the 2nd head of a pes or flexa (but not a
else
{
prev_primitive->set_property ("add-join",
- gh_bool2scm (true));
+ ly_bool2scm (true));
/*
* Create a small overlap of adjacent heads so that the join
check_for_prefix_loss (Item *primitive)
{
int prefix_set =
- gh_scm2int (primitive->get_property ("prefix-set"));
+ ly_scm2int (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 = gh_scm2int (delta_pitch_scm);
+ delta_pitch = ly_scm2int (delta_pitch_scm);
}
else
{
/* retrieve & complete prefix_set and context_info */
int prefix_set =
- gh_scm2int (primitive->get_property ("prefix-set"));
+ ly_scm2int (primitive->get_property ("prefix-set"));
int context_info =
- gh_scm2int (primitive->get_property ("context-info"));
+ ly_scm2int (primitive->get_property ("context-info"));
if (is_stacked_head (prefix_set, context_info))
{
context_info |= STACKED_HEAD;
primitive->set_property ("context-info",
- gh_int2scm (context_info));
+ scm_int2num (context_info));
}
/*
if (prefix_set & VIRGA)
{
glyph_name = "vaticana_punctum";
- primitive->set_property ("add-stem", gh_bool2scm (true));
+ primitive->set_property ("add-stem", ly_bool2scm (true));
}
else if (prefix_set & QUILISMA)
glyph_name = "vaticana_quilisma";
* placed somewhere else.
*/
prev_primitive->set_property ("add-cauda",
- gh_bool2scm (false));
+ ly_bool2scm (false));
}
glyph_name = "vaticana_reverse_plica";
}
*/
if ((context_info & FLEXA_LEFT) && !(context_info & PES_UPPER))
if (!String::compare (glyph_name, "vaticana_punctum"))
- primitive->set_property ("add-cauda", gh_bool2scm (true));
+ primitive->set_property ("add-cauda", ly_bool2scm (true));
/*
* Execptional rule for porrectus:
check_for_prefix_loss (prev_primitive);
prev_glyph_name = "flexa";
prev_primitive->set_property ("flexa-height",
- gh_int2scm (prev_delta_pitch));
+ scm_int2num (prev_delta_pitch));
prev_primitive->set_property ("flexa-width",
- gh_double2scm (flexa_width));
+ scm_make_real (flexa_width));
bool add_cauda = !(prev_prefix_set && PES_OR_FLEXA);
prev_primitive->set_property ("add-cauda",
- gh_bool2scm (add_cauda));
+ ly_bool2scm (add_cauda));
check_for_prefix_loss (primitive);
glyph_name = "";
primitive->set_property ("flexa-width",
- gh_double2scm (flexa_width));
+ scm_make_real (flexa_width));
}
/*
* ligature grob's value for thickness to each ligature head (even
* if not all of them need to know).
*/
- primitive->set_property ("thickness", gh_double2scm (thickness));
+ primitive->set_property ("thickness", scm_make_real (thickness));
prev_primitive = primitive;
prev_prefix_set = prefix_set;
"setting `spacing-increment = %f': ptr=%ul",
ligature_width, paper_column));
paper_column->
- set_property ("forced-spacing", gh_double2scm (ligature_width));
+ set_property ("forced-spacing", scm_make_real (ligature_width));
#endif
}
SCM flexa_height_scm = me->get_property ("flexa-height");
if (flexa_height_scm != SCM_EOL)
{
- interval = gh_scm2int (flexa_height_scm);
+ interval = ly_scm2int (flexa_height_scm);
}
else
{
SCM delta_pitch_scm = me->get_property ("delta-pitch");
int delta_pitch;
if (delta_pitch_scm != SCM_EOL)
- delta_pitch = gh_scm2int (delta_pitch_scm);
+ delta_pitch = ly_scm2int (delta_pitch_scm);
else
delta_pitch = 0;
SCM name_list = SCM_EOL;
SCM *name_tail = &name_list;
- for (SCM s = font_list; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = font_list; ly_pair_p (s); s = ly_cdr (s))
{
- if (Font_metric *fm = unsmob_metrics (gh_car (s)))
+ if (Font_metric *fm = unsmob_metrics (ly_car (s)))
{
- *tail = scm_cons (gh_car (s),SCM_EOL);
+ *tail = scm_cons (ly_car (s),SCM_EOL);
tail = SCM_CDRLOC (*tail);
- if (!gh_number_p (mag))
+ if (!ly_number_p (mag))
/* Ugh. */
- mag = gh_cdr (fm->description_);
+ mag = ly_cdr (fm->description_);
- *name_tail = scm_cons (gh_car (fm->description_), SCM_EOL);
+ *name_tail = scm_cons (ly_car (fm->description_), SCM_EOL);
name_tail = SCM_CDRLOC (*name_tail);
}
}
Real
Virtual_font_metric::design_size () const
{
- return unsmob_metrics (gh_car (font_list_))-> design_size ();
+ return unsmob_metrics (ly_car (font_list_))-> design_size ();
}
void
Virtual_font_metric::count () const
{
int k = 0;
- for (SCM s = font_list_; gh_pair_p (s); s = gh_cdr (s))
- k += unsmob_metrics (gh_car (s))->count ();
+ for (SCM s = font_list_; ly_pair_p (s); s = ly_cdr (s))
+ k += unsmob_metrics (ly_car (s))->count ();
return k;
}
Virtual_font_metric::find_by_name (String glyph) const
{
Stencil m;
- for (SCM s = font_list_; m.is_empty () && gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = font_list_; m.is_empty () && ly_pair_p (s); s = ly_cdr (s))
{
- m = unsmob_metrics (gh_car (s))->find_by_name (glyph);
+ m = unsmob_metrics (ly_car (s))->find_by_name (glyph);
}
return m;
Virtual_font_metric::get_indexed_wxwy (int code) const
{
int total = 0;
- for (SCM s = font_list_; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = font_list_; ly_pair_p (s); s = ly_cdr (s))
{
- Font_metric *fm = unsmob_metrics (gh_car (s));
+ Font_metric *fm = unsmob_metrics (ly_car (s));
if (code < total + fm->count ())
return fm->get_indexed_wxwy (code - total);
total += fm->count ();
Virtual_font_metric::get_indexed_char (int code) const
{
int total = 0;
- for (SCM s = font_list_; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = font_list_; ly_pair_p (s); s = ly_cdr (s))
{
- Font_metric *fm = unsmob_metrics (gh_car (s));
+ Font_metric *fm = unsmob_metrics (ly_car (s));
if (code < total + fm->count ())
return fm->get_indexed_char (code - total);
total += fm->count ();
{
Stencil m;
int total = 0;
- for (SCM s = font_list_; m.is_empty () && gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = font_list_; m.is_empty () && ly_pair_p (s); s = ly_cdr (s))
{
- Font_metric *m =unsmob_metrics (gh_car (s));
+ Font_metric *m =unsmob_metrics (ly_car (s));
int k = m->name_to_index (glyph);
if (k >= 0)
return total + k;
Stencil m ;
int total = 0;
- for (SCM s = font_list_; gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = font_list_; ly_pair_p (s); s = ly_cdr (s))
{
- Font_metric *fm = unsmob_metrics (gh_car (s));
+ Font_metric *fm = unsmob_metrics (ly_car (s));
if (code < total + fm->count ())
{
/* Ugh. */
String
Virtual_font_metric::coding_scheme () const
{
- Font_metric *fm = unsmob_metrics (gh_car (font_list_));
+ Font_metric *fm = unsmob_metrics (ly_car (font_list_));
return fm->coding_scheme ();
}
SCM glyph = endbar->get_property ("glyph");
String str;
- if (gh_string_p (glyph))
+ if (ly_string_p (glyph))
str = ly_scm2string (glyph);
else
return SCM_EOL;
volta engraver in score context or somesuch.
*/
- if (!gh_pair_p (staffs))
+ if (!ly_pair_p (staffs))
{
programming_error ("Huh? Volta engraver can't find staffs?");
return false;
bool end = false;
start_string_ = SCM_EOL;
- while (gh_pair_p (cs))
+ while (ly_pair_p (cs))
{
SCM c = ly_car (cs);
- if (gh_pair_p (c)
+ if (ly_pair_p (c)
&& ly_car (c) == ly_symbol2scm ("volta")
- && gh_pair_p (ly_cdr (c)))
+ && ly_pair_p (ly_cdr (c)))
{
if (ly_cadr (c) == SCM_BOOL_F)
end = true;
}
if (volta_span_ &&
- (gh_string_p (start_string_) || gh_pair_p (start_string_)))
+ (ly_string_p (start_string_) || ly_pair_p (start_string_)))
{
warning (_ ("Already have a volta spanner. Stopping that one prematurely."));
}
if (!volta_span_ &&
- (gh_string_p (start_string_) || gh_pair_p (start_string_)))
+ (ly_string_p (start_string_) || ly_pair_p (start_string_)))
{
started_mom_ = now_mom () ;