]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/beam.cc
* input/regression/key-signature-cancellation.ly (Module): new file.
[lilypond.git] / lily / beam.cc
index 7539ce8907ae55b531c500a1d2ba1170f6006b74..65e1aafe382165e15c0cec292d5718b7d97e1a03 100644 (file)
@@ -80,7 +80,7 @@ Beam::get_beam_translation (Grob *me)
   if (ly_c_procedure_p (func))
     {
       SCM s = scm_call_2 (func, me->self_scm (), scm_int2num (get_beam_count (me)));
-      return ly_scm2double (s);
+      return scm_to_double (s);
     }
   else
     {
@@ -115,7 +115,7 @@ Beam::space_function (SCM smob, SCM beam_count)
   Real line = Staff_symbol_referencer::line_thickness (me);
   Real thickness = get_thickness (me);
   
-  Real beam_translation = ly_scm2int (beam_count) < 4
+  Real beam_translation = scm_to_int (beam_count) < 4
     ? (2*staff_space + line - thickness) / 2.0
     : (3*staff_space + line - thickness) / 3.0;
   
@@ -209,7 +209,7 @@ position_with_maximal_common_beams (SCM left_beaming, SCM right_beaming,
       int count =0;
       for ( SCM s = ly_car (right_beaming); ly_c_pair_p (s); s = ly_cdr (s))
        {
-         int k = - right_dir * ly_scm2int (ly_car (s)) + i;
+         int k = - right_dir * scm_to_int (ly_car (s)) + i;
          if (scm_c_memq (scm_int2num (k), left_beaming) != SCM_BOOL_F)
            count ++;
        }
@@ -258,7 +258,7 @@ Beam::connect_beams (Grob *me)
              for (; ly_c_pair_p (s); s = ly_cdr (s))
                {
                  int new_beam_pos =
-                   start_point - this_dir * ly_scm2int (ly_car (s));
+                   start_point - this_dir * scm_to_int (ly_car (s));
 
                  new_slice.add_point (new_beam_pos);
                  scm_set_car_x (s, scm_int2num (new_beam_pos));
@@ -277,7 +277,7 @@ Beam::connect_beams (Grob *me)
          SCM s = ly_cdr (this_beaming);
          for (; ly_c_pair_p (s); s = ly_cdr (s))
            {
-             int np = - this_dir * ly_scm2int (ly_car (s));
+             int np = - this_dir * scm_to_int (ly_car (s));
              scm_set_car_x (s, scm_int2num (np));
              last_int.add_point (np);
            }
@@ -377,7 +377,7 @@ Beam::print (SCM grob)
       for (SCM s = left;
           ly_c_pair_p (s); s =ly_cdr (s))
        {
-         int b = ly_scm2int (ly_car (s));
+         int b = scm_to_int (ly_car (s));
          if (scm_c_memq (ly_car (s), right) != SCM_BOOL_F)
            {
              full_beams.push (b);
@@ -390,7 +390,7 @@ Beam::print (SCM grob)
       for (SCM s = right;
           ly_c_pair_p (s); s =ly_cdr (s))
        {
-         int b = ly_scm2int (ly_car (s));
+         int b = scm_to_int (ly_car (s));
          if (scm_c_memq (ly_car (s), left) == SCM_BOOL_F)
            {
              rfliebertjes.push (b);
@@ -419,9 +419,9 @@ 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 = ly_scm2int (me->get_property ("gap-count"));
+         gap_count = scm_to_int (me->get_property ("gap-count"));
          gapped = Lookup::beam (dydx, w - 2 * gap_length, thick, blot);
 
          full_beams.sort (default_compare);
@@ -455,7 +455,7 @@ Beam::print (SCM grob)
 
              SCM proc = me->get_property ("flag-width-function");
              SCM result = scm_call_1 (proc, scm_int2num (t));
-             nw_f = ly_scm2double (result);
+             nw_f = scm_to_double (result);
            }
          else
            nw_f = break_overshoot / 2;
@@ -509,7 +509,7 @@ Beam::print (SCM grob)
 #if (DEBUG_QUANTING)
   SCM quant_score = me->get_property ("quant-score");
   if (to_boolean (me->get_paper ()->lookup_variable (ly_symbol2scm ("debug-beam-quanting")))
-      && ly_c_string_p (quant_score))
+      && scm_is_string (quant_score))
     {
       
       /*
@@ -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) && ly_scm2int (s))
+  if (scm_is_number (s) && scm_to_int (s))
     return to_dir (s);
   
   /* If dir is not determined: get default */
@@ -664,10 +664,10 @@ 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 = ly_scm2double (scm);
+  Real threshold = scm_to_double (scm);
   
   Int_set gaps;
 
@@ -789,7 +789,7 @@ Beam::set_stem_shorten (Grob *me)
   
   SCM shorten_elt =
     robust_list_ref (beam_count -1, shorten_list);
-  Real shorten_f = ly_scm2double (shorten_elt) * staff_space;
+  Real shorten_f = scm_to_double (shorten_elt) * staff_space;
 
   /* your similar cute comment here */
   shorten_f *= forced_fraction;
@@ -1099,9 +1099,9 @@ 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 = ly_scm2double (gap);
+      Real r1 = scm_to_double (gap);
       Real dy = Stem::chord_start_y (stems.top ())
        - Stem::chord_start_y (stems[0]);
 
@@ -1136,9 +1136,9 @@ 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 = ly_scm2double (thresh);
+      r2 = scm_to_double (thresh);
       
       Interval iv;
       iv.add_point (Stem::chord_start_y (stems[0]));
@@ -1181,7 +1181,7 @@ Beam::slope_damping (SCM smob)
     return SCM_UNSPECIFIED;
 
   SCM s = me->get_property ("damping"); 
-  int damping = ly_scm2int (s);
+  int damping = scm_to_int (s);
 
   if (damping)
     {
@@ -1225,7 +1225,7 @@ where_are_the_whole_beams (SCM beaming)
     {
       if (scm_c_memq (ly_car (s), ly_cdr (beaming)) != SCM_BOOL_F)
        
-       l.add_point (ly_scm2int (ly_car (s)));
+       l.add_point (scm_to_int (ly_car (s)));
     }
 
   return l;
@@ -1295,8 +1295,8 @@ Beam::set_stem_lengths (Grob *me)
 
   bool gap = false;
   Real thick =0.0;
-  if (ly_c_number_p (me->get_property ("gap-count"))
-      &&ly_scm2int (me->get_property ("gap-count")))
+  if (scm_is_number (me->get_property ("gap-count"))
+      &&scm_to_int (me->get_property ("gap-count")))
     {
       gap = true;
       thick = get_thickness (me);
@@ -1451,9 +1451,9 @@ SCM
 Beam::rest_collision_callback (SCM element_smob, SCM axis)
 {
   Grob *rest = unsmob_grob (element_smob);
-  Axis a = (Axis) ly_scm2int (axis);
+  Axis a = (Axis) scm_to_int (axis);
 
-  if (ly_c_number_p (rest->get_property ("staff-position")))
+  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;