]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/event.cc
* lily/beam.cc (set_minimum_dy): new function. Round non-zero
[lilypond.git] / lily / event.cc
index 004f0eb32eab1ebeb3764c27fe9bf0278754cffc..69125b035d3a8f3c0bb757748bced5d8da6b509d 100644 (file)
@@ -63,18 +63,16 @@ Event::to_relative_octave (Pitch last)
       new_pit = new_pit.to_relative_octave (last);
 
       SCM check = get_property ("absolute-octave");
-      if (gh_number_p (check) &&
-         new_pit.get_octave () != gh_scm2int (check))
+      if (scm_is_number (check) &&
+         new_pit.get_octave () != scm_to_int (check))
        {
-         String s =_("Failed octave check, got: ");
-         s += new_pit.to_string ();
-         new_pit = Pitch (gh_scm2int (check),
-                          new_pit.get_notename (),
-                          new_pit.get_alteration ());
-
-         s += " expected ";
-         s += new_pit.to_string ();
-         origin ()->warning (s);
+         Pitch expected_pit (scm_to_int (check),
+                             new_pit.get_notename (),
+                             new_pit.get_alteration ());
+         origin ()->warning (_f ("octave check failed; expected %s, found: %s",
+                                 expected_pit.to_string (),
+                                 new_pit.to_string ()));
+         new_pit = expected_pit;
        }
       
       set_property ("pitch", new_pit.smobbed_copy ());
@@ -144,32 +142,32 @@ LY_DEFINE (ly_transpose_key_alist, "ly:transpose-key-alist",
   SCM newlist = SCM_EOL;
   Pitch *p = unsmob_pitch (pit);
   
-  for (SCM s = l; gh_pair_p (s); s = ly_cdr (s))
+  for (SCM s = l; ly_c_pair_p (s); s = ly_cdr (s))
     {
       SCM key = ly_caar (s);
       SCM alter = ly_cdar (s);
-      if (gh_pair_p (key))
+      if (ly_c_pair_p (key))
        {
-         Pitch orig (gh_scm2int (ly_car (key)),
-                     gh_scm2int (ly_cdr (key)),
-                     gh_scm2int (alter));
+         Pitch orig (scm_to_int (ly_car (key)),
+                     scm_to_int (ly_cdr (key)),
+                     scm_to_int (alter));
 
          orig =orig.transposed (*p);
 
-         SCM key = gh_cons (scm_int2num (orig.get_octave ()),
+         SCM key = scm_cons (scm_int2num (orig.get_octave ()),
                             scm_int2num (orig.get_notename ()));
 
-         newlist = gh_cons (gh_cons (key, scm_int2num (orig.get_alteration ())),
+         newlist = scm_cons (scm_cons (key, scm_int2num (orig.get_alteration ())),
                             newlist);
        }
-      else if (gh_number_p (key))
+      else if (scm_is_number (key))
        {
-         Pitch orig (0, gh_scm2int (key), gh_scm2int (alter));
+         Pitch orig (0, scm_to_int (key), scm_to_int (alter));
          orig = orig.transposed (*p);
 
          key =scm_int2num (orig.get_notename ());
          alter = scm_int2num (orig.get_alteration ());
-         newlist = gh_cons (gh_cons (key, alter), newlist);
+         newlist = scm_cons (scm_cons (key, alter), newlist);
        }
     }
   return scm_reverse_x (newlist, SCM_EOL);
@@ -190,14 +188,14 @@ bool
 alist_equal_p (SCM a, SCM b)
 {
   for (SCM s = a;
-       gh_pair_p (s); s = ly_cdr (s))
+       ly_c_pair_p (s); s = ly_cdr (s))
     {
       SCM key = ly_caar (s);
       SCM val = ly_cdar (s);
       SCM l = scm_assoc (key, b);
 
       if (l == SCM_BOOL_F
-         || !gh_equal_p ( ly_cdr (l), val))
+         || !ly_c_equal_p ( ly_cdr (l), val))
 
        return false;
     }