]> git.donarmstrong.com Git - lilypond.git/commitdiff
* input/regression/key-signature-cancellation.ly (Module): new file.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 5 Sep 2004 11:19:14 +0000 (11:19 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 5 Sep 2004 11:19:14 +0000 (11:19 +0000)
* lily/key-signature-interface.cc (print): take position
difference into account when spacing naturals.

* lily/key-engraver.cc (create_key): create KeyCancellation grob
separately, so the cancellation can be put before the staff-bar

* scm/define-grobs.scm (all-grob-descriptions): add a
KeyCancellation grob.

* lily/tuplet-engraver.cc (struct Tuplet_description): new
struct. Use to clean-up Tuplet_engraver

90 files changed:
ChangeLog
Documentation/topdocs/NEWS.texi
input/regression/key-signature-cancellation.ly [new file with mode: 0644]
lily/accidental-engraver.cc
lily/accidental.cc
lily/align-interface.cc
lily/bar-line.cc
lily/bar-number-engraver.cc
lily/beam-quanting.cc
lily/beam.cc
lily/break-align-engraver.cc
lily/break-align-interface.cc
lily/chord-name-engraver.cc
lily/clef-engraver.cc
lily/cluster-engraver.cc
lily/cluster.cc
lily/completion-note-heads-engraver.cc
lily/context-def.cc
lily/context-scheme.cc
lily/context.cc
lily/custos-engraver.cc
lily/custos.cc
lily/dots.cc
lily/drum-note-engraver.cc
lily/drum-note-performer.cc
lily/duration.cc
lily/dynamic-engraver.cc
lily/dynamic-performer.cc
lily/event.cc
lily/fingering-engraver.cc
lily/font-metric.cc
lily/font-size-engraver.cc
lily/gourlay-breaking.cc
lily/grob-interface.cc
lily/grob-scheme.cc
lily/grob.cc
lily/include/lily-guile.hh
lily/key-engraver.cc
lily/key-signature-interface.cc
lily/lexer.ll
lily/lily-guile.cc
lily/lily-lexer.cc
lily/lily-parser.cc
lily/line-interface.cc
lily/line-spanner.cc
lily/lookup.cc
lily/mark-engraver.cc
lily/modified-font-metric.cc
lily/multi-measure-rest-engraver.cc
lily/multi-measure-rest.cc
lily/music.cc
lily/note-collision.cc
lily/note-column.cc
lily/note-head.cc
lily/note-heads-engraver.cc
lily/output-def.cc
lily/parser.yy
lily/part-combine-iterator.cc
lily/pitch-squash-engraver.cc
lily/property-iterator.cc
lily/rest-engraver.cc
lily/rest.cc
lily/rhythmic-head.cc
lily/scm-hash.cc
lily/scm-option.cc
lily/score-engraver.cc
lily/script-column.cc
lily/self-aligment-interface.cc
lily/separation-item.cc
lily/side-position-interface.cc
lily/simple-spacer.cc
lily/slur-scoring.cc
lily/slur.cc
lily/staff-symbol-referencer.cc
lily/staff-symbol.cc
lily/stem-engraver.cc
lily/stem-tremolo.cc
lily/stem.cc
lily/stencil-scheme.cc
lily/tab-note-heads-engraver.cc
lily/text-engraver.cc
lily/text-item.cc
lily/time-signature.cc
lily/timing-translator.cc
lily/translator-property.cc
lily/tuplet-bracket.cc
lily/tuplet-engraver.cc
lily/virtual-font-metric.cc
lily/volta-engraver.cc
scm/define-grobs.scm

index c0b9e1376ec7719d295cb40ef843645ca6bb1d50..69102fd611350e73978fade16ef3222de2ecaf9a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,25 @@
+2004-09-05  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * input/regression/key-signature-cancellation.ly (Module): new file.
+
+       * lily/*.cc: more ly_scm2 -> scm_to converions.
+
+       * lily/key-signature-interface.cc (print): take position
+       difference into account when spacing naturals.
+
+       * lily/key-engraver.cc (create_key): create KeyCancellation grob
+       separately, so the cancellation can be put before the staff-bar
+
+       * scm/define-grobs.scm (all-grob-descriptions): add a
+       KeyCancellation grob.
+
+       * lily/tuplet-engraver.cc (struct Tuplet_description): new
+       struct. Use to clean-up Tuplet_engraver
+
 2004-09-04  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
        * lily/*: ly_scm2int -> scm_to_int
+       ly_scm2double -> scm_to_double
 
        * lily/include/lily-guile.hh (scm_from_double): more compat glue.
 
index 388f8d43895df2a390e0359b1edb48d9ed46d7bb..133d2f6f59646bbad3b995985c98f6198c5ccfd6 100644 (file)
@@ -8,6 +8,10 @@
 
 @itemize @bullet
 
+@item Key signature cancellations are now printed before the bar line,
+and their appearance has been improved.
+
+
 @item The automatic staff changer, which is invoked with
 @code{\autochange}, now creates the @code{up} and @code{down} staff
 automatically, and uses bass clef for the bottom staff.
diff --git a/input/regression/key-signature-cancellation.ly b/input/regression/key-signature-cancellation.ly
new file mode 100644 (file)
index 0000000..3bd0539
--- /dev/null
@@ -0,0 +1,18 @@
+\header { texidoc = "Cancellation are printed before the barline. The
+   spacing of the natural signs depends on their vertical
+   positions. The stems should not clash graphically."
+
+
+}
+
+\paper {
+    raggedright = ##T
+}
+
+{
+
+    \key a \major
+    g'1
+    \key f \minor
+    g'1
+}
index b54366a066475535dbf06bd7a7a9fe01142910ae..d74ac87635e00aa501e3fc56f68994655a703e66 100644 (file)
@@ -151,7 +151,7 @@ number_accidentals_from_sig (bool *different, SCM sig, Pitch *pitch,
       if (ly_c_pair_p (prev_local))
        {
          if (ly_c_pair_p (ly_cdr (prev_local))
-             && ly_c_number_p (laziness))
+             && scm_is_number (laziness))
            {
              int barnum = scm_to_int (ly_cddr (prev_local));
 
@@ -168,10 +168,10 @@ number_accidentals_from_sig (bool *different, SCM sig, Pitch *pitch,
   prev_alt =  (prev_alt == SCM_BOOL_F) ? scm_int2num (0) : ly_cdr (prev_alt); 
     
   /* UGH. prev_acc can be #t in case of ties. What is this for?  */
-  int p = ly_c_number_p (prev_alt) ? scm_to_int (prev_alt) : 0;
+  int p = scm_is_number (prev_alt) ? scm_to_int (prev_alt) : 0;
 
   int num;
-  if (a == p && ly_c_number_p (prev_alt))
+  if (a == p && scm_is_number (prev_alt))
     num = 0;
   else if ( (abs (a)<abs (p) || p*a<0) && a != 0 )
     num = 2;
@@ -190,7 +190,7 @@ number_accidentals (bool *different,
   int number = 0;
 
   *different = false;
-  if (ly_c_pair_p (accidentals) && !ly_c_symbol_p (ly_car (accidentals)))
+  if (ly_c_pair_p (accidentals) && !scm_is_symbol (ly_car (accidentals)))
     warning (_f ("Accidental typesetting list must begin with context-name: %s", 
                 ly_scm2string (ly_car (accidentals)).to_str0 ()));
   
@@ -206,9 +206,9 @@ number_accidentals (bool *different,
          SCM localsig = origin->get_property ("localKeySignature");
          
          bool same_octave_b = 
-           ly_c_eq_p (ly_symbol2scm ("same-octave"), type);
+           scm_is_eq (ly_symbol2scm ("same-octave"), type);
          bool any_octave_b = 
-           ly_c_eq_p (ly_symbol2scm ("any-octave"), type);
+           scm_is_eq (ly_symbol2scm ("any-octave"), type);
 
          if (same_octave_b || any_octave_b)
            {
@@ -227,7 +227,7 @@ number_accidentals (bool *different,
       /*
        if symbol then it is a context name. Scan parent contexts to find it.
       */
-      else if (ly_c_symbol_p (rule))
+      else if (scm_is_symbol (rule))
        {
          Context *dad = origin;
          while (dad && !dad->is_alias (rule))
index 79260eed7b45ef3a0390bddcac4039203410cf5b..2844973503097b77f92a0bc812d5c0ad4a627f96 100644 (file)
@@ -48,7 +48,7 @@ Accidental_interface::after_line_breaking (SCM smob)
 }
 
 Array<Box>
-Accidental_interface::accurate_boxes (Grob *a,Grob**common)
+Accidental_interface::accurate_boxes (Grob *a, Grob**common)
 {
   Box b;
   b[X_AXIS] = a->extent (a, X_AXIS);
@@ -65,7 +65,7 @@ Accidental_interface::accurate_boxes (Grob *a,Grob**common)
 
   SCM accs = a->get_property ("accidentals");
   SCM scm_style = a->get_property ("style");
-  if (!ly_c_symbol_p (scm_style)
+  if (!scm_is_symbol (scm_style)
       && !parens
       && scm_ilength (accs) == 1)
     {
@@ -180,7 +180,7 @@ Accidental_interface::print (SCM smob)
 
   SCM scm_style = me->get_property ("style");
   String style;
-  if (ly_c_symbol_p (scm_style))
+  if (scm_is_symbol (scm_style))
     {
       style = ly_symbol2string (scm_style);
     }
index e11671ca51e9a6e2aa4c7c23643fa1be2960ee28..7cfea27c2a90e00f09e3baeb2162a6f52445beff 100644 (file)
@@ -52,7 +52,7 @@ Align_interface::align_to_fixed_distance (Grob *me , Axis a)
   
   SCM d =   me->get_property ("stacking-dir");
   
-  Direction stacking_dir = ly_c_number_p (d) ? to_dir (d) : CENTER;
+  Direction stacking_dir = scm_is_number (d) ? to_dir (d) : CENTER;
   if (!stacking_dir)
     stacking_dir = DOWN;
 
@@ -124,7 +124,7 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a)
   
   SCM d =   me->get_property ("stacking-dir");
   
-  Direction stacking_dir = ly_c_number_p (d) ? to_dir (d) : CENTER;
+  Direction stacking_dir = scm_is_number (d) ? to_dir (d) : CENTER;
   if (!stacking_dir)
     stacking_dir = DOWN;
   
@@ -217,7 +217,7 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a)
        FIXME: uncommenting freaks out the Y-alignment of
        line-of-score.
        */
-      if (ly_c_number_p (align))
+      if (scm_is_number (align))
        center_offset = total.linear_combination (scm_to_double (align));
 
       for (int j = 0 ;  j < all_grobs.size (); j++)
@@ -254,7 +254,7 @@ find_fixed_alignment_parent  (Grob *g)
 {
   while (g)
     {
-      if (ly_c_number_p (g->get_property ("forced-distance")))
+      if (scm_is_number (g->get_property ("forced-distance")))
        return g;
 
       g = g->get_parent (Y_AXIS);
index 56609b231f9e7b940d5aa27310c3d1d1fb3e2766..4a4a4513b572a42dc3c92c06eeb1a718e863b1d6 100644 (file)
@@ -195,7 +195,7 @@ Bar_line::get_staff_bar_size (SCM smob)
   Grob*me = unsmob_grob (smob);
   Real ss = Staff_symbol_referencer::staff_space (me);
   SCM size = me->get_property ("bar-size");
-  if (ly_c_number_p (size))
+  if (scm_is_number (size))
     return scm_make_real (scm_to_double (size)*ss);
   else if (Staff_symbol_referencer::get_staff_symbol (me))
     {
index cadf996c9a7248bc4b1ba9547d1d9e6c5fe80d31..e0a6917648ce27e6d6bc55de887b7c12d551dd04 100644 (file)
@@ -54,7 +54,7 @@ Bar_number_engraver::process_music ()
        {
          SCM bn = get_property ("currentBarNumber");
          SCM proc = get_property ("barNumberVisibility");
-         if (ly_c_number_p (bn) && ly_c_procedure_p (proc)
+         if (scm_is_number (bn) && ly_c_procedure_p (proc)
              && to_boolean (scm_call_1(proc, bn)))
            {
              create_items ();
index c329bafcc505eb03dee17434b59f0383439cd000..5dd9da6e7575a92289e1c349320fb682eb000901 100644 (file)
@@ -108,7 +108,7 @@ Beam::quanting (SCM smob)
   Real slt = Staff_symbol_referencer::line_thickness (me) / ss;
 
   SCM sdy = me->get_property ("least-squares-dy");
-  Real dy_mus = ly_c_number_p (sdy) ? scm_to_double (sdy) : 0.0;
+  Real dy_mus = scm_is_number (sdy) ? scm_to_double (sdy) : 0.0;
   
   Real straddle = 0.0;
   Real sit = (thickness - slt) / 2;
index 03f5206e04d5e3a9ab228672ef11bbbb3b44d746..65e1aafe382165e15c0cec292d5718b7d97e1a03 100644 (file)
@@ -419,7 +419,7 @@ Beam::print (SCM grob)
       Stencil gapped;
 
       int gap_count = 0;
-      if (ly_c_number_p (me->get_property ("gap-count")))
+      if (scm_is_number (me->get_property ("gap-count")))
        {
          gap_count = scm_to_int (me->get_property ("gap-count"));
          gapped = Lookup::beam (dydx, w - 2 * gap_length, thick, blot);
@@ -568,7 +568,7 @@ Beam::get_default_dir (Grob *me)
                    scm_cons (scm_int2num (total[UP]),
                             scm_int2num (total[DOWN])));
 
-  if (ly_c_number_p (s) && scm_to_int (s))
+  if (scm_is_number (s) && scm_to_int (s))
     return to_dir (s);
   
   /* If dir is not determined: get default */
@@ -664,7 +664,7 @@ void
 Beam::consider_auto_knees (Grob* me)
 {
   SCM scm = me->get_property ("auto-knee-gap");
-  if (!ly_c_number_p (scm))
+  if (!scm_is_number (scm))
     return ;
 
   Real threshold = scm_to_double (scm);
@@ -1099,7 +1099,7 @@ Beam::check_concave (SCM smob)
   */
   bool is_concave1 = false;
   SCM gap = me->get_property ("concaveness-gap");
-  if (ly_c_number_p (gap))
+  if (scm_is_number (gap))
     {
       Real r1 = scm_to_double (gap);
       Real dy = Stem::chord_start_y (stems.top ())
@@ -1136,7 +1136,7 @@ Beam::check_concave (SCM smob)
   Real concaveness2 = 0;
   SCM thresh = me->get_property ("concaveness-threshold");
   Real r2 = infinity_f;
-  if (!is_concave1 && ly_c_number_p (thresh))
+  if (!is_concave1 && scm_is_number (thresh))
     {
       r2 = scm_to_double (thresh);
       
@@ -1295,7 +1295,7 @@ Beam::set_stem_lengths (Grob *me)
 
   bool gap = false;
   Real thick =0.0;
-  if (ly_c_number_p (me->get_property ("gap-count"))
+  if (scm_is_number (me->get_property ("gap-count"))
       &&scm_to_int (me->get_property ("gap-count")))
     {
       gap = true;
@@ -1453,7 +1453,7 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis)
   Grob *rest = unsmob_grob (element_smob);
   Axis a = (Axis) scm_to_int (axis);
 
-  if (ly_c_number_p (rest->get_property ("staff-position")))
+  if (scm_is_number (rest->get_property ("staff-position")))
     return scm_int2num (0);
   
   assert (a == Y_AXIS);
@@ -1470,7 +1470,7 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis)
 
   Drul_array<Real> pos (0, 0);
   SCM s = beam->get_property ("positions");
-  if (ly_c_pair_p (s) && ly_c_number_p (ly_car (s)))
+  if (ly_c_pair_p (s) && scm_is_number (ly_car (s)))
     pos = ly_scm2interval (s);
   Real staff_space = Staff_symbol_referencer::staff_space (rest);
 
@@ -1523,7 +1523,7 @@ bool
 Beam::is_knee (Grob* me)
 {
   SCM k = me->get_property ("knee");
-  if (ly_c_boolean_p (k))
+  if (scm_is_bool (k))
     return ly_scm2bool (k);
 
   bool knee = false;
index 9c830d3fcedc53a2fab1d55c4804339cba41adec..da8a22e0af3756b3fb550d9fcec4e5367a4ca06a 100644 (file)
@@ -85,7 +85,7 @@ Break_align_engraver::acknowledge_grob (Grob_info inf)
        return ;
 
       SCM align_name = item->get_property ("break-align-symbol");
-      if (!ly_c_symbol_p (align_name))
+      if (!scm_is_symbol (align_name))
        return ;
 
       if (!align_)
index c7ec2daabba69ba7cdbf595e4dc5ab7c9290fb1d..ae9b7779c5a9e219e5f40e7c57fad5b1c70f3a02 100644 (file)
@@ -186,7 +186,7 @@ Break_align_interface::do_alignment (Grob *grob)
        reason.
       */
       for (SCM s = r ? r->get_property ("elements") : SCM_EOL;
-          !ly_c_symbol_p (rsym) && ly_c_pair_p (s); s = ly_cdr (s))
+          !scm_is_symbol (rsym) && ly_c_pair_p (s); s = ly_cdr (s))
        {
          Grob * elt =unsmob_grob (ly_car (s));
 
@@ -197,14 +197,14 @@ Break_align_interface::do_alignment (Grob *grob)
        edge_idx = next_idx;
 
       SCM entry = SCM_EOL;
-      if (ly_c_symbol_p (rsym))
+      if (scm_is_symbol (rsym))
        entry = scm_assq (rsym, alist);
 
       bool entry_found = ly_c_pair_p (entry);
       if (!entry_found)
        {
          String sym_string;
-         if (ly_c_symbol_p (rsym))
+         if (scm_is_symbol (rsym))
            sym_string = ly_symbol2string (rsym);
 
          String orig_string ;
index ac5b14d4cbf1d62711ee508e5a334596271721ab..a5603207c501259fd92b3bbf17a3b8b3651fd028 100644 (file)
@@ -86,7 +86,7 @@ Chord_name_engraver::process_music ()
   if (inversion_event)
     {
       SCM oct = inversion_event->get_property ("octavation");
-      if (ly_c_number_p (oct))
+      if (scm_is_number (oct))
        {
          Pitch *p = unsmob_pitch (inversion_event->get_property ("pitch"));
          int octavation =  scm_to_int (oct);
index 176f03692666cb7e2b81b1902138bd3ce457bc4a..53074e6e274a6197a9b442181e6c5636246b6603 100644 (file)
@@ -92,11 +92,11 @@ Clef_engraver::create_clef ()
       clef_ = c;
       SCM cpos = get_property ("clefPosition");
 
-      if (ly_c_number_p (cpos))
+      if (scm_is_number (cpos))
        clef_->set_property ("staff-position", cpos);
 
       SCM oct =  get_property ("clefOctavation");
-      if (ly_c_number_p (oct) && scm_to_int (oct))
+      if (scm_is_number (oct) && scm_to_int (oct))
        {
          Item * g = make_item ("OctavateEight", SCM_EOL);
 
index 9e10915541eeed205ac8fea5eb8ea6cbd12b3660..0e99a2a8f2286ebcffbf2631bd06ff41035cca53 100644 (file)
@@ -73,7 +73,7 @@ Cluster_spanner_engraver::process_music ()
     {
       SCM c0scm = get_property ("middleCPosition");
 
-      int c0 =  ly_c_number_p (c0scm) ? scm_to_int (c0scm) : 0;
+      int c0 =  scm_is_number (c0scm) ? scm_to_int (c0scm) : 0;
       int pmax = INT_MIN;
       int pmin = INT_MAX;
       
index 794c42640b358a4eef97229158cf7f215f41f401..d585735ac7bb8de8fae139515ab00f2972d2858f 100644 (file)
@@ -41,7 +41,7 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi
   SCM shape_scm = me->get_property ("style");
   String shape;
 
-  if (ly_c_symbol_p (shape_scm))
+  if (scm_is_symbol (shape_scm))
     {
       shape = ly_symbol2string (shape_scm);
     }
index cea76ecafac0398f91139c90bca1677358158b96..71d2abdf4da9c2722b600aaf3cbdc0440c32da71 100644 (file)
@@ -244,7 +244,7 @@ Completion_heads_engraver::process_music ()
 
       int pos = pit->steps ();
       SCM c0 = get_property ("middleCPosition");
-      if (ly_c_number_p (c0))
+      if (scm_is_number (c0))
        pos += scm_to_int (c0);
 
       note->set_property ("staff-position",   scm_int2num (pos));
index 5ad09112291d9bf817402794e69a153be5408234..a438341286e1b7a5b16edf95786a8d80e0fb1c41 100644 (file)
@@ -158,7 +158,7 @@ Context_def::get_accepted (SCM user_mod) const
 Link_array<Context_def>
 Context_def::path_to_acceptable_context (SCM type_sym, Output_def *odef) const
 {
-  assert (ly_c_symbol_p (type_sym));
+  assert (scm_is_symbol (type_sym));
   
   SCM accepted = get_accepted (SCM_EOL);
 
@@ -364,7 +364,7 @@ Context_def::to_alist () const
   ell = scm_cons (scm_cons (ly_symbol2scm ("context-name"), context_name_),
                  ell);
 
-  if (ly_c_symbol_p (translator_group_type_))
+  if (scm_is_symbol (translator_group_type_))
     ell = scm_cons (scm_cons (ly_symbol2scm ("group-type"),
                              translator_group_type_), ell);    
   return ell;  
index fb83375e06b512b58f71547faeb613e97331082d..594a7c19a1ac1fa8e417412d829c4a908a93318a 100644 (file)
@@ -40,7 +40,7 @@ LY_DEFINE (ly_context_grob_definition, "ly:context-grob-definition",
 {
   Context *tr = unsmob_context (context);
   SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
-  SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+  SCM_ASSERT_TYPE (scm_is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol");
 
     
   return updated_grob_properties (tr, name);
@@ -56,8 +56,8 @@ LY_DEFINE (ly_context_pushpop_property, "ly:context-pushpop-property",
 {
   Context *tg = unsmob_context (context);
   SCM_ASSERT_TYPE (tg, context, SCM_ARG1, __FUNCTION__, "context");
-  SCM_ASSERT_TYPE (ly_c_symbol_p (grob), grob, SCM_ARG2, __FUNCTION__, "symbol");
-  SCM_ASSERT_TYPE (ly_c_symbol_p (eltprop), eltprop, SCM_ARG3, __FUNCTION__, "symbol");
+  SCM_ASSERT_TYPE (scm_is_symbol (grob), grob, SCM_ARG2, __FUNCTION__, "symbol");
+  SCM_ASSERT_TYPE (scm_is_symbol (eltprop), eltprop, SCM_ARG3, __FUNCTION__, "symbol");
 
   execute_pushpop_property (tg, grob, eltprop, val);
 
@@ -71,7 +71,7 @@ LY_DEFINE (ly_context_property, "ly:context-property",
   Context *t = unsmob_context (c);
   Context * tr= (t);
   SCM_ASSERT_TYPE (tr, c, SCM_ARG1, __FUNCTION__, "Translator group");
-  SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+  SCM_ASSERT_TYPE (scm_is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol");
 
   return tr->internal_get_property (name);
 }
@@ -83,7 +83,7 @@ LY_DEFINE (ly_context_set_property, "ly:context-set-property!",
 {
   Context *tr = unsmob_context (context);
   SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
-  SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+  SCM_ASSERT_TYPE (scm_is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol");
 
   tr->internal_set_property (name, val);
 
@@ -97,7 +97,7 @@ LY_DEFINE (ly_context_property_where_defined, "ly:context-property-where-defined
 {
   Context *tr = unsmob_context (context);
   SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
-  SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+  SCM_ASSERT_TYPE (scm_is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol");
 
   tr = tr->where_defined (name);
   if (tr)
@@ -112,7 +112,7 @@ LY_DEFINE (ly_unset_context_property, "ly:context-unset-property", 2, 0, 0,
 {
   Context *tr = unsmob_context (context);
   SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
-  SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+  SCM_ASSERT_TYPE (scm_is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol");
 
   tr->unset_property (name);
   return SCM_UNSPECIFIED;
@@ -140,7 +140,7 @@ LY_DEFINE (ly_context_find, "ly:context-find",
 {
   Context *tr = unsmob_context (context);
   SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "context");
-  SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+  SCM_ASSERT_TYPE (scm_is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol");
   
   while (tr)
     {
index 3a4a875ec1f05cde55eaced15f517b577fdbd4db..14abd62adf1c16cbc936c7f52b234cafaf33e7d6 100644 (file)
@@ -184,7 +184,7 @@ Context::default_child_context_name () const
 bool
 Context::is_bottom_context () const
 {
-  return !ly_c_symbol_p (default_child_context_name ());
+  return !scm_is_symbol (default_child_context_name ());
 }
 
 Context*
index 080121da8b8bacf16f2c74d6aae1ffce40b0b2a5..928fde107eb70d5e065067ad9095cbb42a3e7435 100644 (file)
@@ -104,7 +104,7 @@ Custos_engraver::process_acknowledged_grobs ()
 
          int p = pitches_[i].steps ();
          SCM c0 = get_property ("middleCPosition");
-         if (ly_c_number_p (c0))
+         if (scm_is_number (c0))
            p += scm_to_int (c0);
 
          
index 0fb9f115a2a971564074a63b17de033d0c592ff3..9a41fb20c6c7a2e981f8aac5e97eb512cd4bd90b 100644 (file)
@@ -34,7 +34,7 @@ Custos::print (SCM smob)
 
   SCM scm_style = me->get_property ("style");
   String style;
-  if (ly_c_symbol_p (scm_style))
+  if (scm_is_symbol (scm_style))
     {
       style = ly_symbol2string (scm_style);
     }
index 6814800a37ccb4d525fb82f1308ec78d3e9bfe5b..ba33b5ff537be97439fbdd5fb4ec5e969926586b 100644 (file)
@@ -24,7 +24,7 @@ Dots::print (SCM d)
   
   SCM c = sc->get_property ("dot-count");
 
-  if (ly_c_number_p (c))
+  if (scm_is_number (c))
     {
       Stencil d = Font_interface::get_default_font (sc)->find_by_name (String ("dots-dot"));
       Real dw = d.extent (X_AXIS).length ();
index 884f6c4de6ba648dd44dd2acd3be6944b941d9f3..d084944ef05bae976fd9590e72a32f111750497b 100644 (file)
@@ -98,7 +98,7 @@ Drum_notes_engraver::process_music ()
          
          if (scm_integer_p (pos) == SCM_BOOL_T)
            note->set_property ("staff-position", pos);
-         if (ly_c_symbol_p (style))
+         if (scm_is_symbol (style))
            note->set_property ("style", style);
 
          if (scm_is_string (script))
index 03ff0bf48d2faf9524d77383de4657ebd5cec835..e20d1da05d77851d655054acf6e2eff53e113b40 100644 (file)
@@ -39,7 +39,7 @@ Drum_note_performer::create_audio_elements ()
       SCM sym = n->get_property ("drum-type");
       SCM defn = SCM_EOL;
 
-      if (ly_c_symbol_p (sym)
+      if (scm_is_symbol (sym)
          &&  (scm_hash_table_p (tab) == SCM_BOOL_T))
        defn = scm_hashq_ref (tab, sym, SCM_EOL);
       
index ff0181140b3adec56612945eda6f967083deb12a..fc52de448163daf0af269f886d71811ea3f8e085 100644 (file)
@@ -172,7 +172,7 @@ LY_DEFINE (ly_make_duration, "ly:make-duration",
   bool compress = false;
   if (num != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (ly_c_number_p (num), length, SCM_ARG3, __FUNCTION__, "integer");
+      SCM_ASSERT_TYPE (scm_is_number (num), length, SCM_ARG3, __FUNCTION__, "integer");
       compress = true;
     }
   else
@@ -180,7 +180,7 @@ LY_DEFINE (ly_make_duration, "ly:make-duration",
 
   if (den != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (ly_c_number_p (den), length, SCM_ARG4, __FUNCTION__, "integer");
+      SCM_ASSERT_TYPE (scm_is_number (den), length, SCM_ARG4, __FUNCTION__, "integer");
       compress = true;
     }
   else
@@ -213,7 +213,7 @@ LY_DEFINE (ly_intlog2, "ly:intlog2",
           1, 0, 0, (SCM d),
          "The 2-logarithm of 1/@var{d}.")
 {
-  SCM_ASSERT_TYPE (ly_c_number_p (d), d, SCM_ARG1, __FUNCTION__, "integer");
+  SCM_ASSERT_TYPE (scm_is_number (d), d, SCM_ARG1, __FUNCTION__, "integer");
   int log = intlog2 (scm_to_int (d));
   return scm_int2num (log);
 }
index 00439ca00ed669a9a03cdd5a9f20d28180f35761..7e0557a1e8a7d576b827f136d5c3e4105fc1889a 100644 (file)
@@ -223,7 +223,7 @@ Dynamic_engraver::process_music ()
            start_type = "crescendo";
          
          SCM s = get_property ((start_type + "Spanner").to_str0 ());
-         if (!ly_c_symbol_p (s) || s == ly_symbol2scm ("hairpin"))
+         if (!scm_is_symbol (s) || s == ly_symbol2scm ("hairpin"))
            {
              cresc_  = make_spanner ("Hairpin", accepted_spanreqs_drul_[START]->self_scm ());
              cresc_->set_property ("grow-direction",
@@ -396,7 +396,7 @@ Dynamic_engraver::acknowledge_grob (Grob_info info)
 
        DynamicText doesn't really have a script-priority field.
        */
-      if (ly_c_number_p (p)
+      if (scm_is_number (p)
          && scm_to_int (p)
          < scm_to_int (script_->get_property ("script-priority")))
        Side_position_interface::add_support (line_spanner_, info.grob_);
index 7f6008cb798ce54a4390fc7b8fbb48541493093a..cc6936a475b0759030d8301065fe87df9783d955 100644 (file)
@@ -59,12 +59,12 @@ Dynamic_performer::create_audio_elements ()
        */
       SCM min = get_property ("midiMinimumVolume");
       SCM max = get_property ("midiMaximumVolume");
-      if (ly_c_number_p (min) || ly_c_number_p (max))
+      if (scm_is_number (min) || scm_is_number (max))
        {
          Interval iv (0, 1);
-         if (ly_c_number_p (min))
+         if (scm_is_number (min))
            iv[MIN] = scm_to_double (min);
-         if (ly_c_number_p (max))
+         if (scm_is_number (max))
            iv[MAX] = scm_to_double (max);
          volume = iv[MIN] + iv.length () * volume;
        }
index 0c60b35f0f441bc754bef5cd3eca73f98e285622..69125b035d3a8f3c0bb757748bced5d8da6b509d 100644 (file)
@@ -63,7 +63,7 @@ Event::to_relative_octave (Pitch last)
       new_pit = new_pit.to_relative_octave (last);
 
       SCM check = get_property ("absolute-octave");
-      if (ly_c_number_p (check) &&
+      if (scm_is_number (check) &&
          new_pit.get_octave () != scm_to_int (check))
        {
          Pitch expected_pit (scm_to_int (check),
@@ -160,7 +160,7 @@ LY_DEFINE (ly_transpose_key_alist, "ly:transpose-key-alist",
          newlist = scm_cons (scm_cons (key, scm_int2num (orig.get_alteration ())),
                             newlist);
        }
-      else if (ly_c_number_p (key))
+      else if (scm_is_number (key))
        {
          Pitch orig (0, scm_to_int (key), scm_to_int (alter));
          orig = orig.transposed (*p);
index 0f5628e0f4c320443ff874ae37aa9112eec52ac6..48776e2f645d10b55b408e3ba05598ea4c02412b 100644 (file)
@@ -105,7 +105,7 @@ Fingering_engraver::make_script (Direction d, Music *r, int i)
   // Hmm
   int priority = 200;
   SCM s = fingering->get_property ("script-priority");
-  if (ly_c_number_p (s))
+  if (scm_is_number (s))
     priority = scm_to_int (s);
   
   /* See script-engraver.cc */
index cb90680601e51a0c24a98ab494b3768104dc7d5c..3b7563af17f61fe3fb3bfb7c779e5b4b5521aa51 100644 (file)
@@ -155,7 +155,7 @@ LY_DEFINE (ly_get_glyph, "ly:get-glyph",
 {
   Font_metric *fm = unsmob_metrics (font);
   SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
-  SCM_ASSERT_TYPE (ly_c_number_p (index), index, SCM_ARG2, __FUNCTION__, "number");
+  SCM_ASSERT_TYPE (scm_is_number (index), index, SCM_ARG2, __FUNCTION__, "number");
 
   return fm->get_ascii_char_stencil (scm_to_int (index)).smobbed_copy ();
 }
index edb728a5c5f448c3e7b79bff887de2de30614664..3efa0fee379e170f0585baeffce8fdaa9fffbd57 100644 (file)
@@ -36,7 +36,7 @@ Font_size_engraver::acknowledge_grob (Grob_info gi)
   if (gi.origin_trans_->context () != context ())
     return ;
   
-  if (ly_c_number_p (sz) && scm_to_double (sz))
+  if (scm_is_number (sz) && scm_to_double (sz))
     {
       Real font_size = scm_to_double (sz);
       
index 14b65f7fc98c3c03ed15ddb192475ed304a4476a..cd971e6e5e000040c971d34d698c1255ae31ec0c 100644 (file)
@@ -237,7 +237,7 @@ Gourlay_breaking::combine_demerits (Column_x_positions const &prev,
   if (pc->original_)
     {
       SCM pen = pc->get_property ("penalty");
-      if (ly_c_number_p (pen) && fabs (scm_to_double (pen)) < 10000)
+      if (scm_is_number (pen) && fabs (scm_to_double (pen)) < 10000)
        {
          break_penalties += scm_to_double (pen);
        }
index aaa22f5fb5681fbe347fd3ff6a407384d57800d2..2da145220e4faf9ae277dc70e84993115720b162 100644 (file)
@@ -29,7 +29,7 @@ void add_interface (const char * symbol,
 LY_DEFINE (ly_add_interface, "ly:add-interface", 3,0,0, (SCM a, SCM b, SCM c),
          "Add an interface description.")
 {
-  SCM_ASSERT_TYPE (ly_c_symbol_p (a), a, SCM_ARG1, __FUNCTION__, "symbol");
+  SCM_ASSERT_TYPE (scm_is_symbol (a), a, SCM_ARG1, __FUNCTION__, "symbol");
   SCM_ASSERT_TYPE (scm_is_string (b), b, SCM_ARG2, __FUNCTION__, "string");  
   SCM_ASSERT_TYPE (ly_c_list_p (c), c, SCM_ARG3, __FUNCTION__, "list of syms");    
   if (!ly_c_vector_p (all_ifaces))
index d1fd9c38f18612ab4abfb2345e73edb6a51dea55..75c9c7bc1e7b6182cbfa1ad3a6b1c33379c1222d 100644 (file)
@@ -21,7 +21,7 @@ LY_DEFINE (ly_grob_set_property_x, "ly:grob-set-property!",
 {
   Grob *sc = unsmob_grob (grob);
   SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
-  SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+  SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
 
   if (!type_check_assignment (sym, val, ly_symbol2scm ("backend-type?")))
     error ("typecheck failed");
@@ -40,7 +40,7 @@ LY_DEFINE (ly_grob_property, "ly:grob-property",
 {
   Grob *sc = unsmob_grob (grob);
   SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
-  SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+  SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
 
   return sc->internal_get_property (sym);
 }
@@ -187,7 +187,7 @@ LY_DEFINE (ly_grob_translate_axis_x, "ly:grob-translate-axis!",
 {
   Grob *me = unsmob_grob (g);
   SCM_ASSERT_TYPE (me, g, SCM_ARG1, __FUNCTION__, "grob");
-  SCM_ASSERT_TYPE (ly_c_number_p (d), d, SCM_ARG2, __FUNCTION__, "dimension");
+  SCM_ASSERT_TYPE (scm_is_number (d), d, SCM_ARG2, __FUNCTION__, "dimension");
   SCM_ASSERT_TYPE (is_axis (a), a, SCM_ARG3, __FUNCTION__, "axis");
 
   me->translate_axis (scm_to_double (d), Axis (scm_to_int (a)));
index d66dccb9607a3269fb8b6fdc7865f3f9260bc6c4..0406636264729f2c91de8c7e5f0eef72b8ce125d 100644 (file)
@@ -485,7 +485,7 @@ Grob::name () const
   SCM meta = get_property ("meta");
   SCM nm = scm_assoc (ly_symbol2scm ("name"), meta);
   nm = (ly_c_pair_p (nm)) ? ly_cdr (nm) : SCM_EOL;
-  return ly_c_symbol_p (nm) ? ly_symbol2string (nm) : classname (this);
+  return scm_is_symbol (nm) ? ly_symbol2string (nm) : classname (this);
 }
 
 void
index 5c3594aa6ffac148079823363732cf06e4211941..c8185778f7984e436ed12226b2a9803c12acfed9 100644 (file)
 #define scm_hash_table_p scm_vector_p
 #define scm_i_string_chars(x) SCM_STRING_CHARS(x)
 #define scm_i_string_length(x) SCM_STRING_LENGTH(x)
+inline bool ly_c_number_p (SCM x) { return SCM_NUMBERP (x); }
 #define scm_is_number(x) (scm_number_p(x)==SCM_BOOL_T)
 inline int ly_scm2int (SCM x) { return scm_num2int (x, 0, "ly_scm2int"); }
 #define scm_to_int(x) (ly_scm2int(x))
+inline bool ly_c_symbol_p (SCM x) { return SCM_SYMBOLP (x); }
+#define scm_is_symbol(x) ly_c_symbol_p(x)
+inline bool ly_c_boolean_p (SCM x) { return SCM_BOOLP (x); }
+#define scm_is_bool(x) ly_c_boolean_p(
+inline bool ly_c_eq_p (SCM x, SCM y) { return SCM_EQ_P (x, y); }
+#define scm_is_eq(x,y)  (SCM_EQ_P (x, y));
 
 inline double ly_scm2double (SCM x) { return scm_num2dbl (x, "ly_scm2double"); }
 #define scm_to_double(x) (ly_scm2double(x))
 #define scm_from_double(x) (scm_make_real(x))
+
+
 #endif /* SCM_MINOR_VERSION < 7 */
 
 #ifndef SMOB_FREE_RETURN_VAL
@@ -152,15 +161,10 @@ inline SCM ly_assoc_front_x(SCM alist, SCM key, SCM val)
   return scm_acons(key, val, scm_assoc_remove_x (alist, key));
 }
 inline bool ly_c_pair_p (SCM x) { return SCM_NFALSEP (scm_pair_p (x)); }
-inline bool ly_c_symbol_p (SCM x) { return SCM_SYMBOLP (x); }
-inline bool ly_c_boolean_p (SCM x) { return SCM_BOOLP (x); }
 inline bool ly_c_char_p (SCM x) { return SCM_CHARP (x); }
-inline bool ly_c_number_p (SCM x) { return SCM_NUMBERP (x); }
-inline bool ly_c_string_p (SCM x) { return scm_is_string (x); }
 inline bool ly_c_vector_p (SCM x) { return SCM_VECTORP (x); }
 inline bool ly_c_list_p (SCM x) { return SCM_NFALSEP (scm_list_p (x)); }
 inline bool ly_c_procedure_p (SCM x) { return SCM_NFALSEP (scm_procedure_p (x)); }
-inline bool ly_c_eq_p (SCM x, SCM y) { return SCM_EQ_P (x, y); }
 inline bool ly_c_equal_p (SCM x, SCM y) {
   return SCM_NFALSEP (scm_equal_p (x, y));
 }
index 2b1142fa9ba1011075b98fce9172c5b822071ad0..3c9283b887b539066a0ac65c4ef4a93e96e6cea4 100644 (file)
@@ -29,9 +29,10 @@ class Key_engraver : public Engraver
 {
   void create_key (bool);
   void read_ev (Music const * r);
-  Music * key_ev_;
-  Item * item_;
 
+  Music *key_ev_;
+  Item *item_;
+  Item *cancellation_;
 public:
   TRANSLATOR_DECLARATIONS (Key_engraver);
 
@@ -56,6 +57,7 @@ Key_engraver::Key_engraver ()
 {
   key_ev_ = 0;
   item_ = 0;
+  cancellation_ = 0;
 }
 
 
@@ -68,10 +70,19 @@ Key_engraver::create_key (bool def)
 
       item_->set_property ("c0-position",
                           get_property ("middleCPosition"));
+
+      SCM last = get_property ("lastKeySignature");
+      SCM key = get_property ("keySignature");
+      if (to_boolean (get_property ("printKeyCancellation"))
+         && !scm_is_eq (last, key))
+       {
+         cancellation_ = make_item ("KeyCancellation", key_ev_ ? key_ev_->self_scm () : SCM_EOL);
+         cancellation_->set_property ("old-accidentals",last);
+         cancellation_->set_property ("c0-position",
+                          get_property ("middleCPosition"));
       
-      if (to_boolean (get_property ("printKeyCancellation")))
-       item_->set_property ("old-accidentals", get_property ("lastKeySignature"));
-      item_->set_property ("new-accidentals", get_property ("keySignature"));
+       }
+      item_->set_property ("new-accidentals", key);
     }
 
   if (!def)
@@ -133,6 +144,7 @@ Key_engraver::stop_translation_timestep ()
 {
   item_ = 0;
   context ()->set_property ("lastKeySignature", get_property ("keySignature"));
+  cancellation_ = 0; 
 }
 
 
index f69348d9a53b3c0a2c6a429e3c884ed081724bd4..4bf6651dde54bee289e184e68fdd24e8cbdcbd48 100644 (file)
@@ -102,7 +102,7 @@ Key_signature_interface::print (SCM smob)
 
   SCM scm_style = me->get_property ("style");
   String style;
-  if (ly_c_symbol_p (scm_style))
+  if (scm_is_symbol (scm_style))
     {
       style = ly_symbol2string (scm_style);
     }
@@ -116,7 +116,7 @@ Key_signature_interface::print (SCM smob)
 
   SCM c0s = me->get_property ("c0-position");
   int c0p = 0;
-  if (ly_c_number_p (c0s))
+  if (scm_is_number (c0s))
     c0p = scm_to_int (c0s);
 
   /*
@@ -150,21 +150,13 @@ Key_signature_interface::print (SCM smob)
     {
       SCM old = me->get_property ("old-accidentals");
       
-      /*
-       Add half a space between  cancellation and key sig.
-
-       As suggested by [Ross], p.148.
-       */
-      Interval x (0, inter);
-      Interval y (0,0);
-
-      mol.add_at_edge (X_AXIS, LEFT, Lookup::blank (Box (x,y)), 0, 0);
-
       Stencil natural;
       if (ly_c_pair_p (old))
        natural=Font_interface::get_default_font (me)->
            find_by_name (String ("accidentals-") + style + String ("0"));
       
+
+      int last_pos = -100;
       for (; ly_c_pair_p (old); old = ly_cdr (old))
         {
          SCM found = scm_assoc (ly_caar (old), newas);
@@ -183,8 +175,13 @@ Key_signature_interface::print (SCM smob)
                has vertical edges on both sides. A little padding is
                needed to prevent collisions.
               */
-             Real padding = 0.1 ;
+             Real padding = 0.0;
+             if (last_pos < pos + 2
+                 &&  last_pos> pos - 6)
+               padding = 0.3;
+             
              mol.add_at_edge (X_AXIS, LEFT, m, padding, 0);
+             last_pos = pos;
             }
         }
     }
index 43b10a51de0755f053cb03c954581f9bd70799b2..d79c0c9a69959981a7311d42fe60eb9fc8a455f0 100644 (file)
@@ -499,7 +499,7 @@ HYPHEN              --
                String str (YYText () + 1);
                SCM s = lookup_markup_command (str);
 
-               if (ly_c_pair_p (s) && ly_c_symbol_p (ly_cdr (s)) ) {
+               if (ly_c_pair_p (s) && scm_is_symbol (ly_cdr (s)) ) {
                        yylval.scm = ly_car(s);
                        SCM tag = ly_cdr(s);
                        if (tag == ly_symbol2scm("markup0"))
@@ -734,7 +734,7 @@ Lily_lexer::scan_bare_word (String str)
                        yylval.scm = ly_cdr (handle);
                        if (unsmob_pitch (yylval.scm)) 
                            return (YYSTATE == notes) ? NOTENAME_PITCH : TONICNAME_PITCH;
-                       else if (ly_c_symbol_p (yylval.scm))
+                       else if (scm_is_symbol (yylval.scm))
                            return DRUM_PITCH;
                }
                else if ((handle = scm_hashq_get_handle (chordmodifier_tab_, sym))!= SCM_BOOL_F)
index 67ab65e028e1090accebf5dedbdcdcd69d4ea1df..2bc7c4e2e13ecaa3d8092a8576d01ee1e19c004e 100644 (file)
@@ -201,7 +201,7 @@ LY_DEFINE (ly_dir_p, "ly:dir?",
           "@code{1}, where @code{-1} represents "
          "left or down and @code{1} represents right or up.")
 {
-  if (ly_c_number_p (s))
+  if (scm_is_number (s))
     {
       int i = scm_to_int (s);
       return (i>= -1 && i <= 1)  ? SCM_BOOL_T : SCM_BOOL_F; 
@@ -213,7 +213,7 @@ bool
 is_number_pair (SCM p)
 {
   return ly_c_pair_p (p)
-    && ly_c_number_p (ly_car (p)) && ly_c_number_p (ly_cdr (p));
+    && scm_is_number (ly_car (p)) && scm_is_number (ly_cdr (p));
 }
 
 typedef void (*Void_fptr) ();
@@ -257,7 +257,7 @@ ly_scm_hash (SCM s)
 bool
 is_direction (SCM s)
 {
-  if (ly_c_number_p (s))
+  if (scm_is_number (s))
     {
       int i = scm_to_int (s);
       return i>= -1 && i <= 1; 
@@ -268,7 +268,7 @@ is_direction (SCM s)
 bool
 is_axis (SCM s)
 {
-  if (ly_c_number_p (s))
+  if (scm_is_number (s))
     {
       int i = scm_to_int (s);
       return i== 0 || i == 1;
@@ -304,7 +304,7 @@ ly_interval2scm (Drul_array<Real> i)
 bool
 to_boolean (SCM s)
 {
-  return ly_c_boolean_p (s) && ly_scm2bool (s);
+  return scm_is_bool (s) && ly_scm2bool (s);
 }
 
 /* Appendable list L: the cdr contains the list, the car the last cons
@@ -344,7 +344,7 @@ LY_DEFINE (ly_number2string, "ly:number->string",
           1, 0, 0, (SCM s),
           "Convert @var{num} to a string without generating many decimals.")
 {
-  SCM_ASSERT_TYPE (ly_c_number_p (s), s, SCM_ARG1, __FUNCTION__, "number");
+  SCM_ASSERT_TYPE (scm_is_number (s), s, SCM_ARG1, __FUNCTION__, "number");
 
   char str[400];                       // ugh.
 
@@ -537,7 +537,7 @@ type_check_assignment (SCM sym, SCM val,  SCM type_symbol)
   if (val == SCM_EOL || val == SCM_BOOL_F)
     return ok;
 
-  if (!ly_c_symbol_p (sym))
+  if (!scm_is_symbol (sym))
 #if 0
     return false;
 #else
@@ -709,7 +709,7 @@ int_list_to_slice (SCM l)
   Slice s;
   s.set_empty ();
   for (; ly_c_pair_p (l); l = ly_cdr (l))
-    if (ly_c_number_p (ly_car (l)))
+    if (scm_is_number (ly_car (l)))
       s.add_point (scm_to_int (ly_car (l))); 
   return s;
 }
@@ -729,7 +729,7 @@ robust_list_ref (int i, SCM l)
 Real
 robust_scm2double (SCM k, double x)
 {
-  if (ly_c_number_p (k))
+  if (scm_is_number (k))
     x = scm_to_double (k);
   return x;
 }
index 3bb157d5fdfe95170ceef12a70022f3fa559d8f4..07831cd264a86a01dcc2122842e0a4b7983ad70f 100644 (file)
@@ -212,7 +212,7 @@ Lily_lexer::set_identifier (SCM name, SCM s)
   if (scm_is_string (name))
     sym =  scm_string_to_symbol (name);
   
-  if (ly_c_symbol_p (sym))
+  if (scm_is_symbol (sym))
     {
       if (lookup_keyword (ly_symbol2string (sym)) >= 0)
        {
index 3183421f39e6278b3171b57f58a4895073486dd9..9d46014696a4e0b23afa44e70890d841eee6c439 100644 (file)
@@ -356,7 +356,7 @@ LY_DEFINE (ly_parser_define, "ly:parser-define",
           "Bind SYMBOL to VAL in PARSER_SMOB's module.")
 {
   Lily_parser *parser = unsmob_my_lily_parser (parser_smob);
-  SCM_ASSERT_TYPE (ly_c_symbol_p (symbol), symbol, SCM_ARG2, __FUNCTION__, "symbol");
+  SCM_ASSERT_TYPE (scm_is_symbol (symbol), symbol, SCM_ARG2, __FUNCTION__, "symbol");
   SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG2, __FUNCTION__, "parser");  
 
   parser->lexer_->set_identifier (scm_symbol_to_string (symbol), val);
@@ -370,7 +370,7 @@ LY_DEFINE (ly_parser_lookup, "ly:parser-lookup",
 {
   Lily_parser *parser = unsmob_my_lily_parser (parser_smob);
 
-  SCM_ASSERT_TYPE (ly_c_symbol_p (symbol), symbol, SCM_ARG2, __FUNCTION__, "symbol");
+  SCM_ASSERT_TYPE (scm_is_symbol (symbol), symbol, SCM_ARG2, __FUNCTION__, "symbol");
   SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG2, __FUNCTION__, "parser");  
 
   SCM val= parser->lexer_->lookup_identifier (ly_scm2string (scm_symbol_to_string (symbol)));
index 33c0f3820915485e9f06f8330aab3eb1490386d6..d57b5cac0c2d060551d04f145b9dd6d84ff1dec0 100644 (file)
@@ -73,7 +73,7 @@ Line_interface::line (Grob *me, Offset from, Offset to)
   SCM type = me->get_property ("style");
 
   SCM dash_fraction = me->get_property ("dash-fraction");
-  if (ly_c_number_p (dash_fraction) || type == ly_symbol2scm ("dotted-line"))
+  if (scm_is_number (dash_fraction) || type == ly_symbol2scm ("dotted-line"))
     {
       
       Real fraction
index 80d47beb5ffe1681afa5a3aabfc47a4247ebe238..36e35ef6eb6159a5690ea623387b73655fde0617 100644 (file)
@@ -98,7 +98,7 @@ Line_spanner::line_stencil (Grob *me,
 {
   Offset dz = to -from ; 
   SCM type = me->get_property ("style");
-  if (ly_c_symbol_p (type)
+  if (scm_is_symbol (type)
       && (type == ly_symbol2scm ("line")
          || type == ly_symbol2scm ("dashed-line")
          || type == ly_symbol2scm ("dotted-line")
@@ -109,7 +109,7 @@ Line_spanner::line_stencil (Grob *me,
        ? zigzag_stencil (me, from, to)
        : Line_interface::line (me, from, to);
     }
-  else if (ly_c_symbol_p (type)
+  else if (scm_is_symbol (type)
           && type == ly_symbol2scm ("trill"))
     {
       SCM alist_chain = Font_interface::text_font_alist_chain (me);
index 8d5c22acffee92734563396b669400a3f3356862..242260d676f68160d1ac20619617d8c524c43fe7 100644 (file)
@@ -708,8 +708,8 @@ LY_DEFINE (ly_bracket ,"ly:bracket",
 {
   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 (ly_c_number_p (t), a, SCM_ARG3, __FUNCTION__, "number") ;
-  SCM_ASSERT_TYPE (ly_c_number_p (p), a, SCM_ARG4, __FUNCTION__, "number") ;
+  SCM_ASSERT_TYPE (scm_is_number (t), a, SCM_ARG3, __FUNCTION__, "number") ;
+  SCM_ASSERT_TYPE (scm_is_number (p), a, SCM_ARG4, __FUNCTION__, "number") ;
 
 
   return Lookup::bracket ((Axis)scm_to_int (a), ly_scm2interval (iv),
@@ -730,7 +730,7 @@ LY_DEFINE (ly_filled_box ,"ly:round-filled-box",
 {
   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 (ly_c_number_p (blot), blot, SCM_ARG3, __FUNCTION__, "number") ;
+  SCM_ASSERT_TYPE (scm_is_number (blot), blot, SCM_ARG3, __FUNCTION__, "number") ;
 
   return Lookup::round_filled_box (Box (ly_scm2interval (xext), ly_scm2interval (yext)),
                                   scm_to_double (blot)).smobbed_copy ();
index 7adf61f5ea29d63a0b7116b4bf98829b01c6b36b..b43212a08dd9a62f85b41c400cd3dd91c18ab45a 100644 (file)
@@ -113,7 +113,7 @@ Mark_engraver::process_music ()
       if (!Text_item::markup_p (m) &&
          ly_c_procedure_p (proc))
        {
-         if (!ly_c_number_p (m)) 
+         if (!scm_is_number (m)) 
            m =  get_property ("rehearsalMark");
 
          if (scm_integer_p (m) == SCM_BOOL_T
@@ -125,7 +125,7 @@ Mark_engraver::process_music ()
                                            scm_int2num (mark_count));
            }
 
-         if (ly_c_number_p (m))
+         if (scm_is_number (m))
            m = scm_call_2 (proc, m, context ()->self_scm ());
          else
            warning ("rehearsalMark does not have integer value.");
index a28c1bd37231f0333e3644016cb1b71e23b1a627..b3e56980a7a725c83a908be44757464294430f3d 100644 (file)
@@ -110,7 +110,7 @@ Modified_font_metric::make_scaled_font_metric (SCM coding,
   /*
     UGH.
    */
-  if (ly_c_symbol_p (coding))
+  if (scm_is_symbol (coding))
     coding = scm_symbol_to_string (coding);
   
   String scheme = scm_is_string (coding) ? ly_scm2string (coding) : ""; 
@@ -277,7 +277,7 @@ Modified_font_metric::text_dimension (String text)
 
          Box char_box;
 
-         if (!ly_c_symbol_p (sym))
+         if (!scm_is_symbol (sym))
            continue;
 
          char const * chars =  scm_i_string_chars (scm_symbol_to_string(sym));
index 7a3d1b06aeabcd44af5222a65c32f5f95ce62621..d19f92299791afc4a6598dd73b393a30a8f05a11 100644 (file)
@@ -233,7 +233,7 @@ Multi_measure_rest_engraver::start_translation_timestep ()
        {
          SCM thres = get_property ("restNumberThreshold");
          int t = 1;
-         if (ly_c_number_p (thres))
+         if (scm_is_number (thres))
            t = scm_to_int (thres);
       
          if (num <= t)
index 3de81b361eed25f797485f936ba3731dd24d8c0f..61974f9deb7617f21f08aeb518dcfafb3a995d26 100644 (file)
@@ -102,7 +102,7 @@ Multi_measure_rest::print (SCM smob)
 
   int measures = 0;
   SCM m (me->get_property ("measure-count"));
-  if (ly_c_number_p (m))
+  if (scm_is_number (m))
     {
       measures = scm_to_int (m);
     }
@@ -118,7 +118,7 @@ Multi_measure_rest::symbol_stencil (Grob *me, Real space)
 {
   int measures = 0;
   SCM m (me->get_property ("measure-count"));
-  if (ly_c_number_p (m))
+  if (scm_is_number (m))
     {
       measures = scm_to_int (m);
     }
index ea81bb0df67cef0561bbc48f3342006367ce18d6..7ed8aacc9065cef914ad08ea295af01f31932f1f 100644 (file)
@@ -28,7 +28,7 @@ String
 Music::name () const
 {
   SCM nm = get_property ("name");
-  if (ly_c_symbol_p (nm))
+  if (scm_is_symbol (nm))
     {
       return ly_symbol2string (nm);
     }
@@ -130,7 +130,7 @@ Music::print_smob (SCM s, SCM p, scm_print_state*)
   Music* m = unsmob_music (s);
 
   SCM nm = m->get_property ("name");
-  if (ly_c_symbol_p (nm) || scm_is_string (nm))
+  if (scm_is_symbol (nm) || scm_is_string (nm))
     scm_display (nm, p);
   else
     scm_puts (classname (m),p);
@@ -250,7 +250,7 @@ LY_DEFINE (ly_music_property,
 {
   Music * sc = unsmob_music (mus);
   SCM_ASSERT_TYPE (sc, mus, SCM_ARG1, __FUNCTION__, "music");
-  SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+  SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
 
   return sc->internal_get_property (sym);
 }
@@ -261,7 +261,7 @@ LY_DEFINE (ly_music_set_property, "ly:music-set-property!",
 {
   Music * sc = unsmob_music (mus);
   SCM_ASSERT_TYPE (sc, mus, SCM_ARG1, __FUNCTION__, "music");
-  SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+  SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
 
   bool ok = type_check_assignment (sym, val, ly_symbol2scm ("music-type?"));
   if (ok)
index ae6f74cd9c3dfdc655849ebbd3bdf243cec82600..c633aafdd2c004a4f9e32921632ea43d08cb9218 100644 (file)
@@ -400,7 +400,7 @@ Note_collision_interface::automatic_shift (Grob *me,
          SCM sh
            = clashes[i]->get_property ("horizontal-shift");
 
-         if (ly_c_number_p (sh))
+         if (scm_is_number (sh))
            shift.push (scm_to_int (sh));
          else
            shift.push (0);
@@ -486,7 +486,7 @@ Note_collision_interface::forced_shift (Grob *me)
       Grob * se = unsmob_grob (ly_car (s));
 
       SCM force =  se->get_property ("force-hshift");
-      if (ly_c_number_p (force))
+      if (scm_is_number (force))
        {
          tups = scm_cons (scm_cons (se->self_scm (), force),
                          tups);
index a6b95da47cd255bd162bd2980bde8bc955aed437..230bf38000e49b690136322108de943db060f15b 100644 (file)
@@ -35,8 +35,8 @@ Note_column::shift_compare (Grob *const &p1, Grob *const&p2)
   SCM s1 = p1->get_property ("horizontal-shift");
   SCM s2 = p2->get_property ("horizontal-shift");
 
-  int h1 = (ly_c_number_p (s1))?  scm_to_int (s1) :0;
-  int h2 = (ly_c_number_p (s2)) ? scm_to_int (s2):0;
+  int h1 = (scm_is_number (s1))?  scm_to_int (s1) :0;
+  int h2 = (scm_is_number (s2)) ? scm_to_int (s2):0;
   return h1 - h2;
 }
 
@@ -126,7 +126,7 @@ void
 Note_column::translate_rests (Grob*me, int dy)
 {
   Grob * r = unsmob_grob (me->get_property ("rest"));
-  if (r && !ly_c_number_p (r->get_property ("staff-position")))
+  if (r && !scm_is_number (r->get_property ("staff-position")))
     {
       r->translate_axis (dy * Staff_symbol_referencer::staff_space (r)/2.0, Y_AXIS);
     }
index ad57f9f1d86b5248a718e671f349a86f1cbe34ad..74ee76e7321d8939672413ea157f57dcbcf1e74e 100644 (file)
@@ -28,7 +28,7 @@ static Stencil
 internal_print (Grob *me)
 {
   SCM style  = me->get_property ("style");
-  if (!ly_c_symbol_p (style))
+  if (!scm_is_symbol (style))
     {
       return Stencil ();
     }
@@ -147,7 +147,7 @@ Note_head::stem_attachment_coordinate (Grob *me, Axis a)
   if (brewer == Note_head::print_proc)
     {
       SCM style  = me->get_property ("style");
-      if (!ly_c_symbol_p (style))
+      if (!scm_is_symbol (style))
        {
          return 0.0;
        }
@@ -189,7 +189,7 @@ int
 Note_head::get_balltype (Grob*me) 
 {
   SCM s = me->get_property ("duration-log");
-  return ly_c_number_p (s) ? scm_to_int (s) <? 2 : 0;
+  return scm_is_number (s) ? scm_to_int (s) <? 2 : 0;
 }
 
 ADD_INTERFACE (Note_head,"note-head-interface",
index 0ecf80fd88f5dd2078a01c53ac2244b2bfdbf21b..6ab0e99a15533bc69afbd9e8c13568cea2044435 100644 (file)
@@ -82,7 +82,7 @@ Note_heads_engraver::process_music ()
 
       int pos = pit ? pit->steps () : 0;
       SCM c0 = get_property ("middleCPosition");
-      if (ly_c_number_p (c0))
+      if (scm_is_number (c0))
        pos += scm_to_int (c0);
 
       note->set_property ("staff-position",   scm_int2num (pos));
index 2bf1ea1d2b02a763b645cc6250bedd23f423ae4a..4a1e4963631553c4ac52a314d8fb482755566dca 100644 (file)
@@ -138,7 +138,7 @@ LY_DEFINE (ly_paper_lookup, "ly:output-def-lookup",
 {
   Output_def *op = unsmob_output_def (pap);
   SCM_ASSERT_TYPE (op, pap, SCM_ARG1, __FUNCTION__, "Output_def");
-  SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+  SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
 
   return op->lookup_variable (sym);
 }
index 7d2db4160521d47be15f1e4a288c7e113fcc802c..2dedb25e29363c9b8a67242a07c86de93b7c73dc 100644 (file)
@@ -71,7 +71,7 @@ void
 tag_music (Music *m, SCM tag, Input ip)
 {
        SCM tags = m->get_property ("tags");
-       if (ly_c_symbol_p (tag))
+       if (scm_is_symbol (tag))
                tags = scm_cons (tag, tags);
        else if (ly_c_list_p (tag))
                tags = ly_append2 (tag, tags);
@@ -104,7 +104,7 @@ SCM
 make_simple_markup (SCM encoding, SCM a)
 {
        SCM simple = ly_scheme_function ("simple-markup");
-       if (ly_c_symbol_p (encoding))
+       if (scm_is_symbol (encoding))
                return scm_list_3 (ly_scheme_function ("encoded-simple-markup"),
                           encoding, a);
        return scm_list_2 (simple, a);
@@ -1479,7 +1479,7 @@ chord_body_element:
                        SCM arts = scm_reverse_x (post, SCM_EOL);
                        n->set_property ("articulations", arts);
                }
-               if (ly_c_number_p (check))
+               if (scm_is_number (check))
                {
                        int q = scm_to_int (check);
                        n->set_property ("absolute-octave", scm_int2num (q-1));
@@ -2090,7 +2090,7 @@ bass_figure:
                Music *m = unsmob_music ($1);
                if ($2) {
                        SCM salter = m->get_property ("alteration");
-                       int alter = ly_c_number_p (salter) ? scm_to_int (salter) : 0;
+                       int alter = scm_is_number (salter) ? scm_to_int (salter) : 0;
                        m->set_property ("alteration",
                                scm_int2num (alter + $2));
                } else {
@@ -2153,7 +2153,7 @@ simple_element:
                n->set_property ("pitch", $1);
                n->set_property ("duration", $5);
 
-               if (ly_c_number_p ($4))
+               if (scm_is_number ($4))
                {
                        int q = scm_to_int ($4);
                        n->set_property ("absolute-octave", scm_int2num (q-1));
@@ -2562,7 +2562,7 @@ Lily_lexer::try_special_identifiers (SCM *destination, SCM sid)
        if (scm_is_string (sid)) {
                *destination = sid;
                return STRING_IDENTIFIER;
-       } else if (ly_c_number_p (sid)) {
+       } else if (scm_is_number (sid)) {
                *destination = sid;
                return NUMBER_IDENTIFIER;
        } else if (unsmob_context_def (sid)) {
@@ -2662,7 +2662,7 @@ context_spec_music (SCM type, SCM id, Music *m, SCM ops)
        scm_gc_unprotect_object (m->self_scm ());
 
        csm->set_property ("context-type",
-               ly_c_symbol_p (type) ? type : scm_string_to_symbol (type));
+               scm_is_symbol (type) ? type : scm_string_to_symbol (type));
        csm->set_property ("property-operations", ops);
 
        if (scm_is_string (id))
index 0afb18d819d0b1f0f52b813754a760cba1d5b4b5..59475df5cd9b99cfdf780a7177197070c8282b54 100644 (file)
@@ -392,10 +392,10 @@ Part_combine_iterator::process (Moment m)
        solo1 ();
       else if (tag == ly_symbol2scm ("solo2"))
        solo2 ();
-      else if (ly_c_symbol_p (tag))
+      else if (scm_is_symbol (tag))
        {
          String s =  "Unknown split directive: "
-           + (ly_c_symbol_p (tag) ? ly_symbol2string (tag) : String ("not a symbol")); 
+           + (scm_is_symbol (tag) ? ly_symbol2string (tag) : String ("not a symbol")); 
          programming_error (s);
        }
     }
index 3acff5c995f39144c26e5590d6c38855580af403..73211dfd984d241021a0d2edc0b13a1d54101eab 100644 (file)
@@ -22,7 +22,7 @@ void
 Pitch_squash_engraver::acknowledge_grob (Grob_info i)
 {
   SCM newpos = get_property ("squashedPosition");
-  if (ly_c_number_p (newpos)
+  if (scm_is_number (newpos)
       && Note_head::has_interface (i.grob_))
     {
       i.grob_->set_property ("staff-position", newpos);
index 20f9dc68e8aba9b8e3ad24a82b56b288b0a5aaa1..78c2b3ec714612d5c10b3ab63ed0c8555010bfd6 100644 (file)
@@ -21,7 +21,7 @@ void
 Property_iterator::process (Moment m)
 {
   SCM sym = get_music ()->get_property ("symbol");
-  if (ly_c_symbol_p (sym))
+  if (scm_is_symbol (sym))
     {
       SCM val = get_music ()->get_property ("value");
       bool ok= true;
index 72e5020bbeab49d137e646ba3bf28f3629465aff..4d9809b8f8ee0b3eead0bca1abb615182c6a9ffb 100644 (file)
@@ -86,7 +86,7 @@ Rest_engraver::process_music ()
        {
          int pos= p->steps ();
          SCM c0 = get_property ("middleCPosition");
-         if (ly_c_number_p (c0))
+         if (scm_is_number (c0))
            pos += scm_to_int (c0);
          
          rest_->set_property ("staff-position", scm_int2num (pos));
index e1e7313dab2823a033ba8f201051c55e6f462a01..b41babd3653dc0acbd7ba488ad1c1cea1fa59bea 100644 (file)
@@ -119,14 +119,14 @@ Rest::brew_internal_stencil (SCM smob, bool ledgered)
   Grob* me = unsmob_grob (smob);
 
   SCM balltype_scm = me->get_property ("duration-log");
-  if (!ly_c_number_p (balltype_scm))
+  if (!scm_is_number (balltype_scm))
     return Stencil ().smobbed_copy ();
 
   int balltype = scm_to_int (balltype_scm);
   
   String style; 
   SCM style_scm = me->get_property ("style");
-  if (ly_c_symbol_p (style_scm))
+  if (scm_is_symbol (style_scm))
     style = ly_scm2string (scm_symbol_to_string (style_scm));
 
   Font_metric *fm = Font_interface::get_default_font (me);
@@ -169,7 +169,7 @@ SCM
 Rest::polyphonic_offset_callback (SCM smob, SCM)
 {
   Grob* me = unsmob_grob (smob);
-  if (ly_c_number_p (me->get_property ("staff-position")))
+  if (scm_is_number (me->get_property ("staff-position")))
     return scm_make_real (0);
 
   Direction d = get_grob_direction (me);
index 9fbe521e3b8c9399ce3fdac2ebb6c4c158d635b0..40983ead13f0585bde3c3755568c7704ef2db7f2 100644 (file)
@@ -45,7 +45,7 @@ int
 Rhythmic_head::duration_log (Grob*me) 
 {
   SCM s = me->get_property ("duration-log");
-  return ly_c_number_p (s) ? scm_to_int (s) : 0;
+  return scm_is_number (s) ? scm_to_int (s) : 0;
 }
 
 ADD_INTERFACE (Rhythmic_head,"rhythmic-head-interface",
index dd3873d3b073aa22f2c44fff7430eb0f6cb1dc26..a0f66d0d7d0d7afe71c88a29205717a1cc1ad979 100644 (file)
@@ -101,7 +101,7 @@ Scheme_hash_table::contains (SCM k) const
 void
 Scheme_hash_table::set (SCM k, SCM v)
 {
-  assert (ly_c_symbol_p (k));
+  assert (scm_is_symbol (k));
   SCM handle = scm_hashq_create_handle_x (hash_tab_, k, SCM_UNDEFINED);
   if (ly_cdr (handle) == SCM_UNDEFINED)
     {
index fe9653ef1b4a2a5a48dd8959d30b66e95d185cc8..5da31ef2408e826859cccde458196c454a4ddbb0 100644 (file)
@@ -126,7 +126,7 @@ LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val),
     lily_1_8_relative = false;
   else
     {
-      if (ly_c_symbol_p (var))
+      if (scm_is_symbol (var))
        var = scm_symbol_to_string (var);
       
       warning (_f ("No such internal option: %s", ly_scm2string (var)));
index 2227ee00ac0b17d014e7fc11940169ec54bfe6d0..a1b1a755761227a3b4d284e278256635f1b3cf9b 100644 (file)
@@ -245,10 +245,10 @@ Score_engraver::try_music (Music *m)
   if (m->is_mus_type ("break-event"))
     {
       SCM pen = command_column_->get_property ("penalty");
-      Real total_penalty = ly_c_number_p (pen) ? scm_to_double (pen) : 0.0;
+      Real total_penalty = scm_is_number (pen) ? scm_to_double (pen) : 0.0;
 
       SCM mpen = m->get_property ("penalty");
-      if (ly_c_number_p (mpen))
+      if (scm_is_number (mpen))
        total_penalty += scm_to_double (mpen);
 
       command_column_->set_property ("penalty", scm_make_real (total_penalty));
@@ -258,9 +258,9 @@ Score_engraver::try_music (Music *m)
        forbid_breaks ();
 
       SCM page_pen = command_column_->get_property ("page-penalty");
-      Real total_pp = ly_c_number_p (page_pen) ? scm_to_double (page_pen) : 0.0;
+      Real total_pp = scm_is_number (page_pen) ? scm_to_double (page_pen) : 0.0;
       SCM mpage_pen = m->get_property ("page-penalty");
-      if (ly_c_number_p (mpage_pen))
+      if (scm_is_number (mpage_pen))
        total_pp += scm_to_double (mpage_pen);
       
       command_column_->set_property ("page-penalty", scm_make_real (total_pp));
index bc30636663d5927b72a7298fe98038e514a3fa82..697cf5ac7dbc303b36c5cb07d709a92c738928a3 100644 (file)
@@ -15,7 +15,7 @@ void
 Script_column::add_staff_sided (Grob *me, Item *i)
 {
   SCM p = i->get_property ("script-priority");
-  if (!ly_c_number_p (p))
+  if (!scm_is_number (p))
     return;
 
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("scripts"),i);
index 17e53b9b6306565714aa49418a1899a42368dd9a..e1db1ded12d752bfd2263892f50627596559a791 100644 (file)
@@ -35,7 +35,7 @@ Self_alignment_interface::aligned_on_parent (SCM element_smob, SCM axis)
     : ly_symbol2scm ("self-alignment-Y");
   SCM align_prop (me->internal_get_property (sym));
 
-  if (!ly_c_number_p (align_prop))
+  if (!scm_is_number (align_prop))
     return scm_int2num (0);
 
   Real x = 0.0;
@@ -80,7 +80,7 @@ Self_alignment_interface::aligned_on_self (SCM element_smob, SCM axis)
     : ly_symbol2scm ("self-alignment-Y");
   
   SCM align (me->internal_get_property (sym));
-  if (ly_c_number_p (align))
+  if (scm_is_number (align))
     {
       Interval ext (me->extent (me, a));
       if (ext.is_empty ())
index 4a308146e1c98ae6aff83b53283c847cab508475..b528ae7c51d596acd9509475ebe59201cba5762f 100644 (file)
@@ -144,7 +144,7 @@ Separation_item::extremal_break_aligned_grob (Grob *separation_item, Direction d
     {
       Grob * break_item = unsmob_grob (ly_car (s));
       
-      if (!ly_c_symbol_p (break_item->get_property ("break-align-symbol")))
+      if (!scm_is_symbol (break_item->get_property ("break-align-symbol")))
        continue;
 
       Interval ext = break_item->extent (col, X_AXIS);
index a65d8f25fa37ec70ff11a30e548c875747bc84c6..54ff667d6ebc9dccdd1ebd80c02deadd2d9f4d31 100644 (file)
@@ -73,7 +73,7 @@ Side_position_interface::general_side_position (Grob * me, Axis a, bool use_exte
   Grob * st = Staff_symbol_referencer::get_staff_symbol (me);
   bool include_staff = (st
                        && a == Y_AXIS
-                       && ly_c_number_p (me->get_property ("staff-padding")));
+                       && scm_is_number (me->get_property ("staff-padding")));
 
   Interval dim;
   if (include_staff)
@@ -222,7 +222,7 @@ Side_position_interface::aligned_side (SCM element_smob, SCM axis)
  */
   Grob * st = Staff_symbol_referencer::get_staff_symbol (me);
   if (st && a == Y_AXIS
-      && ly_c_number_p (me->get_property ("staff-padding")))
+      && scm_is_number (me->get_property ("staff-padding")))
     {
       Real padding=
       Staff_symbol_referencer::staff_space (me)
index 8261f702fa12d12bc286740f186f362d5909a14e..2915219c8f9ee1fce476873490e92322250227eb 100644 (file)
@@ -412,7 +412,7 @@ Simple_spacer_wrapper::solve (Column_x_positions *positions, bool ragged)
   for (int i = sz; i--; )
     {
       SCM p = positions->cols_[i]->get_property ( "penalty");
-      if (ly_c_number_p (p))
+      if (scm_is_number (p))
        {
          if (scm_to_double (p) < -9999)
            break_satisfy = break_satisfy && (i == 0 || i == sz -1);
index 0db9b834a3b60b893efa402a95cfc41afb9fe108..0d7852950f2dab8d6e3984b5bb35490fcdd3d029 100644 (file)
@@ -952,7 +952,7 @@ score_extra_encompass (Grob *me, Grob *common[],
        
              SCM accs = g->get_property ("accidentals");
              SCM scm_style = g->get_property ("style");
-             if (!ly_c_symbol_p (scm_style)
+             if (!scm_is_symbol (scm_style)
                  && !parens
                  && scm_ilength (accs) == 1)
                {
index af479083e9cf5765c2ce9a1e832e7a6e1b384c22..d8bb8401bf2764fc45d0704d494bd5eb81c3b7b4 100644 (file)
@@ -71,7 +71,7 @@ Slur::print (SCM smob)
     TODO: replace dashed with generic property.
   */
   SCM d =  me->get_property ("dashed");
-  if (ly_c_number_p (d))
+  if (scm_is_number (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,
index b7a42e1aaee719adfd5f48aad15a53201a984957..cb53c0af52f5438549ae3f220570d2b11d42e58b 100644 (file)
@@ -118,7 +118,7 @@ Staff_symbol_referencer::callback (SCM element_smob, SCM)
 
   SCM pos = me->get_property ("staff-position");
   Real off = 0.0;
-  if (ly_c_number_p (pos))
+  if (scm_is_number (pos))
     {
       Real space = Staff_symbol_referencer::staff_space (me);
       off = scm_to_double (pos) * space / 2.0;
index 9526e36dd88eca9c1ddadcfac44e91ad9e7b500b..9a5db7c46b79b0ae554aa0436d34d078f61f4215 100644 (file)
@@ -45,7 +45,7 @@ Staff_symbol::print (SCM smob)
   do
     {
       SCM width_scm = me->get_property ("width");
-      if (d == RIGHT && ly_c_number_p (width_scm))
+      if (d == RIGHT && scm_is_number (width_scm))
        {
          /*
            don't multiply by Staff_symbol_referencer::staff_space (me),
@@ -97,7 +97,7 @@ int
 Staff_symbol::line_count (Grob*me) 
 {
   SCM c = me->get_property ("line-count");
-  if (ly_c_number_p (c))
+  if (scm_is_number (c))
     return scm_to_int (c);
   else
     return 0;
index a8d7773f11ca336b41f9c1c7123c1200462da4f9..710d993f965d7859e3dd4a0bdd05fa91b5afa6be 100644 (file)
@@ -73,7 +73,7 @@ Stem_engraver::make_stem (Grob_info gi)
       SCM f = get_property ("tremoloFlags");
       if (!requested_type)
        {
-         if (ly_c_number_p (f))
+         if (scm_is_number (f))
            requested_type = scm_to_int (f);
          else
            requested_type = 8;
@@ -139,13 +139,13 @@ Stem_engraver::stop_translation_timestep ()
     {
       /* FIXME: junk these properties.  */
       SCM prop = get_property ("stemLeftBeamCount");
-      if (ly_c_number_p (prop))
+      if (scm_is_number (prop))
        {
          Stem::set_beaming (stem_,scm_to_int (prop),LEFT);
          context ()->unset_property (ly_symbol2scm ("stemLeftBeamCount"));
        }
       prop = get_property ("stemRightBeamCount");
-      if (ly_c_number_p (prop))
+      if (scm_is_number (prop))
        {
          Stem::set_beaming (stem_,scm_to_int (prop), RIGHT);
          context ()->unset_property (ly_symbol2scm ("stemRightBeamCount"));
index 508a37f8f5bfaf4acb16cadce788565664a6c82a..b4bb45f6949997be0e57a69c05b50c3f8ed4c7ba 100644 (file)
@@ -82,7 +82,7 @@ Stem_tremolo::raw_stencil (Grob *me)
   
   int tremolo_flags = 0;
   SCM s = me->get_property ("flag-count");
-  if (ly_c_number_p (s))
+  if (scm_is_number (s))
     tremolo_flags = scm_to_int (s);
 
   if (!tremolo_flags)
@@ -137,7 +137,7 @@ Stem_tremolo::print (SCM grob)
 
   Real beamthickness = 0.0;
   SCM sbt = (beam) ? beam->get_property ("thickness") : SCM_EOL ;
-  if (ly_c_number_p (sbt))
+  if (scm_is_number (sbt))
     beamthickness = scm_to_double (sbt) * ss;
 
   Real end_y
index c83c7a7b370c1a80d8eaaade74d4b79112bbed8f..4f364607ca28f9dbd0a76b3f73a87b32407dd6ea 100644 (file)
@@ -91,7 +91,7 @@ Stem::stem_end_position (Grob *me)
 {
   SCM p = me->get_property ("stem-end-position");
   Real pos;
-  if (!ly_c_number_p (p))
+  if (!scm_is_number (p))
     {
       pos = get_default_stem_end_position (me);
       me->set_property ("stem-end-position", scm_make_real (pos));
@@ -271,7 +271,7 @@ Stem::get_default_stem_end_position (Grob *me)
   /* WARNING: IN HALF SPACES */
   Real length = 7;
   SCM scm_len = me->get_property ("length");
-  if (ly_c_number_p (scm_len))
+  if (scm_is_number (scm_len))
     length = scm_to_double (scm_len);
   else
     {
@@ -380,7 +380,7 @@ int
 Stem::duration_log (Grob *me)
 {
   SCM s = me->get_property ("duration-log");
-  return (ly_c_number_p (s)) ? scm_to_int (s) : 2;
+  return (scm_is_number (s)) ? scm_to_int (s) : 2;
 }
 
 void
@@ -532,7 +532,7 @@ Stem::flag (Grob *me)
   String flag_style;
 
   SCM flag_style_scm = me->get_property ("flag-style");
-  if (ly_c_symbol_p (flag_style_scm))
+  if (scm_is_symbol (flag_style_scm))
     flag_style = ly_symbol2string (flag_style_scm);
   
   if (flag_style == "no-flag")
index 09f317fd0885a1cdfaa11e438ce24566c78ad601..1577f52758538726f8f3e232bac71e9d1bc2ec42 100644 (file)
@@ -39,7 +39,7 @@ LY_DEFINE (ly_translate_stencil_axis, "ly:stencil-translate-axis",
 {
   Stencil *s = unsmob_stencil (stil);
   SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil");
-  SCM_ASSERT_TYPE (ly_c_number_p (amount), amount, SCM_ARG2, __FUNCTION__, "number pair");
+  SCM_ASSERT_TYPE (scm_is_number (amount), amount, SCM_ARG2, __FUNCTION__, "number pair");
   SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
 
   SCM new_s = s->smobbed_copy ();
@@ -105,13 +105,13 @@ LY_DEFINE (ly_stencil_moved_to_edge, "ly:stencil-moved-to-edge",
   Real p = 0.0;
   if (padding != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (ly_c_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number");
+      SCM_ASSERT_TYPE (scm_is_number (padding), padding, SCM_ARG5, __FUNCTION__, "number");
       p = scm_to_double (padding);
     }
   Real m = 0.0;
   if (minimum != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (ly_c_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
+      SCM_ASSERT_TYPE (scm_is_number (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
       m = scm_to_double (minimum);
     }
 
@@ -155,13 +155,13 @@ LY_DEFINE (ly_stencil_combine_at_edge, "ly:stencil-combine-at-edge",
   Real p = 0.0;
   if (padding != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (ly_c_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number");
+      SCM_ASSERT_TYPE (scm_is_number (padding), padding, SCM_ARG5, __FUNCTION__, "number");
       p = scm_to_double (padding);
     }
   Real m = 0.0;
   if (minimum != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (ly_c_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
+      SCM_ASSERT_TYPE (scm_is_number (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
       m = scm_to_double (minimum);
     }
 
@@ -224,7 +224,7 @@ LY_DEFINE (ly_stencil_align_to_x, "ly:stencil-align-to!",
 {
   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 (ly_c_number_p (dir), dir, SCM_ARG3, __FUNCTION__, "number");
+  SCM_ASSERT_TYPE (scm_is_number (dir), dir, SCM_ARG3, __FUNCTION__, "number");
 
   unsmob_stencil (stil)->align_to ((Axis)scm_to_int (axis),
                                   scm_to_double (dir));
index 3ca95596181adcdf88e4a552b65184df0c79f8bc..883108f8c815b55ecb756cdad75494a072c13386 100644 (file)
@@ -131,7 +131,7 @@ Tab_note_heads_engraver::process_music ()
       SCM scm_pitch = event->get_property ("pitch");
       SCM proc      = get_property ("tablatureFormat");
       SCM min_fret_scm = get_property ("minimumFret");
-      int min_fret = ly_c_number_p (min_fret_scm) ? scm_to_int (min_fret_scm) : 0;
+      int min_fret = scm_is_number (min_fret_scm) ? scm_to_int (min_fret_scm) : 0;
 
       while (!string_found)
        {
index 05c8c0ff2477d0840037e3e99e180b582e555a48..0030340172199e10f545b22e21f50dfa40d2f689 100644 (file)
@@ -93,7 +93,7 @@ Text_engraver::process_acknowledged_grobs ()
       // Hmm
       int priority = 200;
       SCM s = text->get_property ("script-priority");
-      if (ly_c_number_p (s))
+      if (scm_is_number (s))
        priority = scm_to_int (s);
       
       /* see script-engraver.cc */
index 66c1b6d83a26ef3f7755a6a946aefd24b1c2d4b2..b3c14fd3e41c31b399ce1e263f271101a794d358 100644 (file)
@@ -29,16 +29,16 @@ Text_item::interpret_string (SCM paper_smob,
                   __FUNCTION__, "Paper definition");
   SCM_ASSERT_TYPE (scm_is_string (markup), markup, SCM_ARG3,
                   __FUNCTION__, "string");
-  SCM_ASSERT_TYPE (input_encoding == SCM_EOL || ly_c_symbol_p (input_encoding),
+  SCM_ASSERT_TYPE (input_encoding == SCM_EOL || scm_is_symbol (input_encoding),
                   input_encoding, SCM_ARG2, __FUNCTION__, "symbol");
   
   String str = ly_scm2string (markup);
-  if (!ly_c_symbol_p (input_encoding))
+  if (!scm_is_symbol (input_encoding))
     {
       SCM enc = paper->lookup_variable (ly_symbol2scm ("inputencoding"));
       if (scm_is_string (enc))
        input_encoding = scm_string_to_symbol (enc);
-      else if (ly_c_symbol_p (enc))
+      else if (scm_is_symbol (enc))
        input_encoding = enc;
     }
   
index f4324653fe67f008415e017775dff01ab883010d..ea1993a15560fb38dd2b8ae0f3d2b1bebef65f6e 100644 (file)
@@ -45,7 +45,7 @@ Time_signature::print (SCM smob)
     {
       m = numbered_time_signature (me, n, 0);
     }
-  else if (ly_c_symbol_p (st))
+  else if (scm_is_symbol (st))
     {
       m = special_time_signature (me, st, n, d);
     }
index 965885bd255b21bde74be31834cebf28cc9c9bfb..69257cffb9bdb391f6cd98468e5939dec07a3b38 100644 (file)
@@ -133,7 +133,7 @@ Timing_translator::start_translation_timestep ()
   
   SCM barn = get_property ("currentBarNumber");
   int b = 0;
-  if (ly_c_number_p (barn))
+  if (scm_is_number (barn))
     {
       b = scm_to_int (barn);
     }
index 2c433a008619eda8e823908dfb2b76dd61b23422..735c22b2abf403c1021f883ccd709361c27e152d 100644 (file)
@@ -33,7 +33,7 @@ void
 execute_pushpop_property (Context * trg,
                          SCM prop, SCM eltprop, SCM val)
 {
-  if (ly_c_symbol_p (prop) && ly_c_symbol_p (eltprop))
+  if (scm_is_symbol (prop) && scm_is_symbol (eltprop))
     {
       if (val != SCM_UNDEFINED)
        {
@@ -152,7 +152,7 @@ apply_property_operations (Context *tg, SCM pre_init_ops)
 SCM
 updated_grob_properties (Context * tg, SCM sym)
 {
-  assert (ly_c_symbol_p (sym));
+  assert (scm_is_symbol (sym));
   
   tg = tg->where_defined (sym);
   if (!tg)
index ecf3c725984915df366af5b5c4fee2de95554d93..f96551bc6f7b4942bf1def8706929fe684bab0d2 100644 (file)
@@ -114,7 +114,7 @@ Tuplet_bracket::print (SCM smob)
     SCM lp = me->get_property ("left-position");
     SCM rp = me->get_property ("right-position");  
 
-    if (!ly_c_number_p (rp) || !ly_c_number_p (lp))
+    if (!scm_is_number (rp) || !scm_is_number (lp))
       after_line_breaking (smob);
   }
   
@@ -133,7 +133,7 @@ Tuplet_bracket::print (SCM smob)
     Fixme: the type of this prop is sucky.
    */
   SCM bracket = me->get_property ("bracket-visibility");
-  if (ly_c_boolean_p (bracket))
+  if (scm_is_bool (bracket))
     {
       bracket_visibility = ly_scm2bool (bracket);
     }
@@ -141,7 +141,7 @@ Tuplet_bracket::print (SCM smob)
     bracket_visibility = !par_beam;
 
   SCM numb = me->get_property ("number-visibility");  
-  if (ly_c_boolean_p (numb))
+  if (scm_is_bool (numb))
     {
       number_visibility = ly_scm2bool (numb);
     }
@@ -487,15 +487,15 @@ Tuplet_bracket::after_line_breaking (SCM smob)
   SCM lp =  me->get_property ("left-position");
   SCM rp = me->get_property ("right-position");  
   
-  if (ly_c_number_p (lp) && !ly_c_number_p (rp))
+  if (scm_is_number (lp) && !scm_is_number (rp))
     {
       rp = scm_make_real (scm_to_double (lp) + dy);
     }
-  else if (ly_c_number_p (rp) && !ly_c_number_p (lp))
+  else if (scm_is_number (rp) && !scm_is_number (lp))
     {
       lp = scm_make_real (scm_to_double (rp) - dy);
     }
-  else if (!ly_c_number_p (rp) && !ly_c_number_p (lp))
+  else if (!scm_is_number (rp) && !scm_is_number (lp))
     {
       lp = scm_make_real (offset);
       rp = scm_make_real (offset +dy);
index 70378670ebc28cf85e08c359e2dfdf5053e0b377..54c3eb18634768d8ebc8f2d075b75d9e0ca41671 100644 (file)
@@ -1,5 +1,5 @@
 /*   
-  plet-engraver.cc --  implement Tuplet_engraver
+  tuplet-engraver.cc --  implement Tuplet_engraver
   
   source file of the GNU LilyPond music typesetter
   
@@ -7,8 +7,6 @@
   
  */
 
-
-
 #include "tuplet-bracket.hh"
 #include "note-column.hh"
 #include "time-scaled-music.hh"
 #include "engraver.hh"
 #include "spanner.hh"
 
+struct Tuplet_description
+{
+  Music *music_;
+  Rational stop_;
+  Rational span_stop_;
+  Spanner *spanner_;
+  Tuplet_description()
+  {
+    music_ = 0;
+    spanner_ = 0;
+  }
+};
+
 class Tuplet_engraver : public Engraver
 {
 public:
   TRANSLATOR_DECLARATIONS (Tuplet_engraver);
 
 protected:
-  Link_array<Music> time_scaled_musics_;
-  /// when does the scaled music stop? Array order is synced with time_scaled_musics_
-  Array<Rational> stop_moments_;
-  /// when does the current spanner stop? Array order is synced with time_scaled_musics_
-  Array<Rational> span_stop_moments_;
-  
-  /// The spanners. Array order is synced with time_scaled_musics_
-  Link_array<Spanner> started_spanners_;
+  Array<Tuplet_description> tuplets_;
 
   virtual void acknowledge_grob (Grob_info);
   virtual bool try_music (Music*r);
   virtual void start_translation_timestep ();
-  virtual void process_acknowledged_grobs ();
+  virtual void process_music ();
 };
 
 bool
-Tuplet_engraver::try_music (Music *c)
+Tuplet_engraver::try_music (Music *music)
 {
-  if (c->is_mus_type ("time-scaled-music"))
+  if (music->is_mus_type ("time-scaled-music"))
     {
-      Music *el = unsmob_music (c->get_property ("element"));
+      Music *el = unsmob_music (music->get_property ("element"));
       if (el && !el->is_mus_type ("event-chord"))
        {
-         time_scaled_musics_.push (c);
-         Rational m = now_mom ().main_part_ + c->get_length ().main_part_;
-         stop_moments_.push (m);
-
+         Tuplet_description d;
+         d.music_ = music;
+         d.stop_  = now_mom ().main_part_ + music->get_length ().main_part_;
+         d.span_stop_ = d.stop_;
+         
          SCM s = get_property ("tupletSpannerDuration");
          if (unsmob_moment (s))
-           m = m <? (now_mom () + *unsmob_moment (s)).main_part_;
+           d.span_stop_ = d.span_stop_ <? (now_mom () + *unsmob_moment (s)).main_part_;
          
-         span_stop_moments_.push (m);
+         tuplets_.push (d);
        }
       return true;
     }
@@ -62,28 +67,23 @@ Tuplet_engraver::try_music (Music *c)
 }
 
 void
-Tuplet_engraver::process_acknowledged_grobs ()
+Tuplet_engraver::process_music ()
 {
-  for (int i= 0; i < time_scaled_musics_.size (); i++)
+  for (int i= 0; i < tuplets_.size (); i++)
     {
-      if (i < started_spanners_.size () && started_spanners_[i])
+      if (tuplets_[i].spanner_)
        continue;
 
-      Spanner* glep = make_spanner ("TupletBracket", time_scaled_musics_ [i]->self_scm ());
-
-      if (i >= started_spanners_.size ())
-       started_spanners_.push (glep);
-      else
-       started_spanners_[i] = glep;
-      
+      Spanner* spanner = make_spanner ("TupletBracket",
+                                      tuplets_[i].music_->self_scm ());
+      tuplets_[i].spanner_ = spanner;
 
       SCM proc = get_property ("tupletNumberFormatFunction");
       if (ly_c_procedure_p (proc))
        {
-         SCM t = scm_apply_0 (proc, scm_list_n (time_scaled_musics_[i]->self_scm (), SCM_UNDEFINED));
-         glep->set_property ("text", t);
+         SCM t = scm_apply_0 (proc, scm_list_1 (tuplets_[i].music_->self_scm ()));
+         spanner->set_property ("text", t);
        }
-      
     }
 }
 
@@ -92,9 +92,10 @@ Tuplet_engraver::acknowledge_grob (Grob_info i)
 {
   if (Note_column::has_interface (i.grob_))
     {
-      for (int j =0; j < started_spanners_.size (); j++)
-       if (started_spanners_[j]) 
-         Tuplet_bracket::add_column (started_spanners_[j], dynamic_cast<Item*> (i.grob_));
+      for (int j =0; j < tuplets_.size (); j++)
+       if (tuplets_[j].spanner_) 
+         Tuplet_bracket::add_column (tuplets_[j].spanner_,
+                                     dynamic_cast<Item*> (i.grob_));
     }
 }
 
@@ -108,28 +109,25 @@ Tuplet_engraver::start_translation_timestep ()
   if (unsmob_moment (s))
     tsd = unsmob_moment (s)->main_part_;
 
-  for (int i= started_spanners_.size (); i--;)
+  for (int i = tuplets_.size (); i--;)
     {
-      if (now.main_part_ >= span_stop_moments_[i])
+      if (now.main_part_ >= tuplets_[i].span_stop_)
        {
-         if (Spanner *sp = started_spanners_[i])
+         if (Spanner *sp = tuplets_[i].spanner_)
            {
              if (!sp->get_bound (RIGHT))
                sp->set_bound (RIGHT, sp->get_bound (LEFT));
              
-             started_spanners_[i] =0;
+             tuplets_[i].spanner_ = 0;
            }
          
          if (tsd.to_bool ())
-           span_stop_moments_[i] += tsd.main_part_;
+           tuplets_[i].span_stop_ += tsd.main_part_;
        }
 
-      if (now.main_part_ >= stop_moments_[i])
+      if (now.main_part_ >= tuplets_[i].span_stop_)
        {
-         started_spanners_.del (i);
-         stop_moments_.del (i);
-         span_stop_moments_.del (i);
-         time_scaled_musics_.del (i);
+         tuplets_.del (i);
        }
     }
 }
index d63d8b74a00ec9e7540497ac60433bfe9741d065..ab8015b7c705e370809bf4d7f77ea017882677e1 100644 (file)
@@ -33,7 +33,7 @@ Virtual_font_metric::Virtual_font_metric (SCM font_list)
          *tail =  scm_cons (ly_car (s),SCM_EOL);
          tail = SCM_CDRLOC (*tail);
 
-         if (!ly_c_number_p (mag))
+         if (!scm_is_number (mag))
            /* Ugh.  */
            mag = ly_cdr (fm->description_);
 
index f9443a2fb72ae364d8bf9d446d661657797a5736..5f6dcf1b6ffd4547f72781423b35e97d1992444a 100644 (file)
@@ -61,7 +61,7 @@ bool
 Volta_engraver::staff_eligible ()
 {
   SCM doit =get_property ("voltaOnThisStaff");
-  if (ly_c_boolean_p (doit))
+  if (scm_is_bool (doit))
     {
       return to_boolean (doit);
     }
index 8c6e8d1a12cc281787a05ce64e42cd60b4de6202..c976dbcf46ae7d1f3df57b6f862df848648aea28 100644 (file)
        (breakable . #t)
        (stacking-dir . 1)
        (break-align-orders . #(; end-of-line:
-                               (instrument-name left-edge ambitus breathing-sign
-                                                clef  staff-bar key-signature
-                                                time-signature custos)
+                               (instrument-name
+                                left-edge ambitus breathing-sign
+                                clef key-cancellation staff-bar key-signature
+                                time-signature custos)
 
                                ; unbroken
                                (instrument-name left-edge ambitus breathing-sign
-                                                clef  staff-bar key-signature
+                                                clef key-cancellation staff-bar key-signature
                                                 staff
                                                 time-signature custos)
                                ; begin of line
                                (instrument-name left-edge ambitus breathing-sign
-                                                clef key-signature staff-bar
+                                                clef key-cancellation key-signature staff-bar
                                                 time-signature custos)
 
                                ))
        (break-visibility . ,begin-of-line-visible)
        (space-alist . ((ambitus . (extra-space . 2.0))
                        (staff-bar . (extra-space . 0.7))
+                       (key-cancellation . (minimum-space . 4.0))
                        (key-signature . (minimum-space . 4.0))
                        (time-signature . (minimum-space . 4.2))
                        (first-note . (minimum-fixed-space . 5.0))
                        (first-note . (fixed-space . 1.0))
                        (right-edge . (extra-space . 0.0))
                        (key-signature . (extra-space . 0.0))
+                       (key-cancellation . (extra-space . 0.0))
+                       
                        ))
        (meta . ((interfaces . (break-aligned-interface item-interface ))))
        ))
                                side-position-interface text-interface
                                break-aligned-interface item-interface ))))
        ))
-
+    (KeyCancellation
+     . (
+       (print-function . ,Key_signature_interface::print)
+       (space-alist . (
+                       (time-signature . (extra-space . 1.25))
+                       (staff-bar .  (extra-space . 0.6))
+                       (right-edge . (extra-space . 0.5))
+                       (first-note . (fixed-space . 2.5))
+                       ))
+       (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
+       (break-align-symbol . key-cancellation)
+       (break-visibility . ,begin-of-line-invisible)
+       (breakable . #t)
+       
+       (meta . ((interfaces . (key-signature-interface font-interface
+                                                       break-aligned-interface item-interface ))))
+       ))
     (KeySignature
      . (
        (print-function . ,Key_signature_interface::print)