]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/tuplet-bracket.cc
* Documentation/user/notation.itely (Bar lines): Added a note that
[lilypond.git] / lily / tuplet-bracket.cc
index 15cc8534ec89522ce3d5da4fbee797dddfc95836..52550d2b7e6fb56cb4c1fb209a885b27b3243493 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);
     }
@@ -160,20 +160,20 @@ Tuplet_bracket::print (SCM smob)
   Direction dir = get_grob_direction (me);
 
   Grob * lgr = get_x_bound_grob (columns[0], dir);
-  Grob * rgr = get_x_bound_grob (columns.top (), dir);  
-  Real x0 = lgr->extent (commonx,X_AXIS)[LEFT];
-  Real x1 = rgr->extent (commonx,X_AXIS)[RIGHT];
-
+  Grob * rgr = get_x_bound_grob (columns.top (), dir);
+  
+  Real x0 = robust_relative_extent (lgr, commonx, X_AXIS)[LEFT];
+  Real x1 = robust_relative_extent (rgr, commonx, X_AXIS)[RIGHT];
   Real w = x1 -x0;
   
   SCM number = me->get_property ("text");
 
   Output_def *pap = me->get_paper ();
   Stencil num;
- if (ly_c_string_p (number) && number_visibility)
+ if (scm_is_string (number) && number_visibility)
     {
       SCM properties = Font_interface::text_font_alist_chain (me);
-      SCM snum = Text_item::interpret_markup (pap->self_scm (), properties, number);
+      SCM snum = Text_interface::interpret_markup (pap->self_scm (), properties, number);
       num = *unsmob_stencil (snum);
       num.align_to (X_AXIS, CENTER);
       num.translate_axis (w/2, X_AXIS);
@@ -213,11 +213,11 @@ Tuplet_bracket::print (SCM smob)
       do {
        flare[d] =  height[d] = shorten[d] = 0.0;
        if (is_number_pair (fl))
-         flare[d] +=  ss * ly_scm2double (index_get_cell (fl, d));
+         flare[d] +=  ss * scm_to_double (index_get_cell (fl, d));
        if (is_number_pair (eh))
-         height[d] +=  - dir * ss *ly_scm2double (index_get_cell (eh, d));
+         height[d] +=  - dir * ss *scm_to_double (index_get_cell (eh, d));
        if (is_number_pair (sp))
-         shorten[d] +=  ss *ly_scm2double (index_get_cell (sp, d));
+         shorten[d] +=  ss *scm_to_double (index_get_cell (sp, d));
       }
       while (flip (&d) != LEFT);
       
@@ -360,9 +360,8 @@ Tuplet_bracket::calc_position_and_height (Grob*me,Real *offset, Real * dy)
   
   Grob * lgr = get_x_bound_grob (columns[0], dir);
   Grob * rgr = get_x_bound_grob (columns.top (), dir);  
-  Real x0 = lgr->extent (commonx,X_AXIS)[LEFT];
-  Real x1 = rgr->extent (commonx,X_AXIS)[RIGHT];
-
+  Real x0 = robust_relative_extent (lgr, commonx, X_AXIS)[LEFT];
+  Real x1 = robust_relative_extent (rgr, commonx, X_AXIS)[RIGHT];
 
   /*
     Slope.
@@ -383,7 +382,7 @@ Tuplet_bracket::calc_position_and_height (Grob*me,Real *offset, Real * dy)
     }
 
   // padding
-  *offset +=  ly_scm2double (me->get_property ("padding")) *dir;
+  *offset +=  scm_to_double (me->get_property ("padding")) *dir;
 
   
   /*
@@ -473,13 +472,13 @@ Tuplet_bracket::after_line_breaking (SCM smob)
     {
       SCM ps =  par_beam->get_property ("positions"); 
 
-      Real lp = ly_scm2double (ly_car (ps));
-      Real rp = ly_scm2double (ly_cdr (ps));
+      Real lp = scm_to_double (scm_car (ps));
+      Real rp = scm_to_double (scm_cdr (ps));
 
       /*
        duh. magic.
-<       */
-      offset = lp + dir * (0.5 + ly_scm2double (me->get_property ("padding")));
+       */
+      offset = lp + dir * (0.5 + scm_to_double (me->get_property ("padding")));
       dy = rp- lp;
     }
   
@@ -487,15 +486,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 (ly_scm2double (lp) + dy);
+      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 (ly_scm2double (rp) - dy);
+      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);
@@ -515,9 +514,9 @@ Direction
 Tuplet_bracket::get_default_dir (Grob*me)
 {
   Drul_array<int> dirs (0,0);  
-  for (SCM s = me->get_property ("note-columns"); ly_c_pair_p (s); s = ly_cdr (s))
+  for (SCM s = me->get_property ("note-columns"); scm_is_pair (s); s = scm_cdr (s))
     {
-      Grob * nc = unsmob_grob (ly_car (s));
+      Grob * nc = unsmob_grob (scm_car (s));
       Direction d = Note_column::dir (nc);
       if (d)
        dirs[d]++;