From b3098b8cf6a0b05bd27bbc8840196fded8edc7ca Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2002 23:22:49 +0000 Subject: [PATCH] lilypond-1.3.59 --- lily/auto-beam-engraver.cc | 36 ++++++++++++++++----------------- lily/break-align-item.cc | 25 +++++++++++++++++------ lily/include/group-interface.hh | 4 +--- lily/include/lily-guile.hh | 5 ++++- 4 files changed, 42 insertions(+), 28 deletions(-) diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 5a8661ae9c..c906fc6ac1 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -113,19 +113,19 @@ Auto_beam_engraver::consider_end_and_begin (Moment test_mom) SCM one (get_property ("beatLength")); Moment end_mom; - if (SMOB_IS_TYPE_B(Moment, one)) - end_mom = *SMOB_TO_TYPE (Moment, one); + if (unsmob_moment (one)) + end_mom = *unsmob_moment (one); /* second guess: property generic time exception */ SCM begin = get_property (time_str + "beamAutoBegin"); - if (SMOB_IS_TYPE_B(Moment, begin)) - begin_mom = * SMOB_TO_TYPE(Moment, begin); + if (unsmob_moment (begin)) + begin_mom = * unsmob_moment (begin); SCM end = get_property (time_str + "beamAutoEnd"); - if (SMOB_IS_TYPE_B (Moment, end)) - end_mom = * SMOB_TO_TYPE(Moment,end); + if (unsmob_moment (end)) + end_mom = * unsmob_moment (end); /* third guess: property time exception, specific for duration type @@ -133,26 +133,26 @@ Auto_beam_engraver::consider_end_and_begin (Moment test_mom) if (type_str.length_i ()) { SCM end_mult = get_property ( time_str + "beamAutoEnd" + type_str); - if (SMOB_IS_TYPE_B (Moment, end_mult)) - end_mom = * SMOB_TO_TYPE (Moment,end_mult); + if (unsmob_moment (end_mult)) + end_mom = * unsmob_moment (end_mult); SCM begin_mult = get_property (time_str + "beamAutoBegin" + type_str); - if (SMOB_IS_TYPE_B (Moment, begin_mult)) - begin_mom = * SMOB_TO_TYPE (Moment,begin_mult); + if (unsmob_moment (begin_mult)) + begin_mom = * unsmob_moment (begin_mult); } /* fourth guess [user override]: property plain generic */ begin = get_property ("beamAutoBegin"); - if (SMOB_IS_TYPE_B(Moment, begin)) - begin_mom = * SMOB_TO_TYPE(Moment, begin); + if (unsmob_moment (begin)) + begin_mom = * unsmob_moment (begin); end = get_property ("beamAutoEnd"); - if (SMOB_IS_TYPE_B (Moment, end)) - end_mom = * SMOB_TO_TYPE (Moment,end); + if (unsmob_moment (end)) + end_mom = * unsmob_moment (end); /* fifth guess [user override]: property plain, specific for duration type @@ -160,12 +160,12 @@ Auto_beam_engraver::consider_end_and_begin (Moment test_mom) if (type_str.length_i ()) { SCM end_mult = get_property (String ("beamAutoEnd") + type_str); - if (SMOB_IS_TYPE_B (Moment, end_mult)) - end_mom = * SMOB_TO_TYPE (Moment,end_mult); + if (unsmob_moment (end_mult)) + end_mom = * unsmob_moment (end_mult); SCM begin_mult = get_property (String ("beamAutoBegin") + type_str); - if (SMOB_IS_TYPE_B (Moment, begin_mult)) - begin_mom = * SMOB_TO_TYPE (Moment,begin_mult); + if (unsmob_moment (begin_mult)) + begin_mom = * unsmob_moment (begin_mult); } Rational r; diff --git a/lily/break-align-item.cc b/lily/break-align-item.cc index 7705d94e26..6e5722ca12 100644 --- a/lily/break-align-item.cc +++ b/lily/break-align-item.cc @@ -72,13 +72,26 @@ Break_align_item::before_line_breaking () else next_origin = ly_symbol2scm ("begin-of-note"); - SCM extra_space - = scm_eval (scm_listify (ly_symbol2scm ("break-align-spacer"), - ly_quote_scm (current_origin), - ly_quote_scm (next_origin), - SCM_UNDEFINED)); + SCM e = scm_assoc (scm_listify (current_origin, + next_origin, + SCM_UNDEFINED), + scm_eval (ly_symbol2scm ("space-alist"))); + + SCM extra_space; + if (e != SCM_BOOL_F) + { + extra_space = gh_cdr (e); + } + else + { + warning (_f ("unknown spacing pair `%s', `%s'", + ly_symbol2string (current_origin), + ly_symbol2string (next_origin))); + extra_space = scm_listify (ly_symbol2scm ("minimum-space"), gh_double2scm (0.0), SCM_UNDEFINED); + } + SCM symbol = gh_car (extra_space); - Real spc = gh_scm2double (SCM_CADR(extra_space)); + Real spc = gh_scm2double (gh_cadr(extra_space)); spc *= interline; dists.push(spc); diff --git a/lily/include/group-interface.hh b/lily/include/group-interface.hh index e2eafc6de4..43b2ba66db 100644 --- a/lily/include/group-interface.hh +++ b/lily/include/group-interface.hh @@ -59,9 +59,7 @@ Pointer_group_interface__extract_elements (Score_element const *elt, T *, const for (SCM s = elt->get_elt_pointer (name); gh_pair_p (s); s = gh_cdr (s)) { SCM e = gh_car (s); - assert (SMOB_IS_TYPE_B(Score_element,e)); - Score_element* se = SMOB_TO_TYPE(Score_element, e); - arr.push (dynamic_cast (se)); + arr.push (dynamic_cast (unsmob_element (e))); } arr.reverse (); diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 0aa2b0287a..ba9751c4b5 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -17,8 +17,11 @@ #ifndef SCM_PACK #define SCM_PACK(x) ((SCM) x) -#endif +#endif +#ifndef SCM_UNPACK +#define SCM_UNPACK(x) ( x) +#endif /* conversion functions follow the GUILE naming convention, i.e. -- 2.39.5