]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.59
authorfred <fred>
Tue, 26 Mar 2002 23:22:49 +0000 (23:22 +0000)
committerfred <fred>
Tue, 26 Mar 2002 23:22:49 +0000 (23:22 +0000)
lily/auto-beam-engraver.cc
lily/break-align-item.cc
lily/include/group-interface.hh
lily/include/lily-guile.hh

index 5a8661ae9cb9d2fa1e87c7674e9ee9f7e18e28c5..c906fc6ac1012bb06735b4330036fb5f1d35810a 100644 (file)
@@ -113,19 +113,19 @@ Auto_beam_engraver::consider_end_and_begin (Moment test_mom)
   SCM one (get_property ("beatLength"));
 
   Moment end_mom;
-  if (SMOB_IS_TYPE_B(Moment, one))
-    end_mom = *SMOB_TO_TYPE (Moment, one);
+  if (unsmob_moment (one))
+    end_mom = *unsmob_moment (one);
 
   /*
     second guess: property generic time exception
   */
   SCM begin = get_property (time_str + "beamAutoBegin");
-  if (SMOB_IS_TYPE_B(Moment, begin))
-    begin_mom = * SMOB_TO_TYPE(Moment, begin);
+  if (unsmob_moment (begin))
+    begin_mom = * unsmob_moment (begin);
 
   SCM end = get_property (time_str + "beamAutoEnd");
-  if (SMOB_IS_TYPE_B (Moment, end))
-    end_mom = * SMOB_TO_TYPE(Moment,end);
+  if (unsmob_moment (end))
+    end_mom = * unsmob_moment (end);
 
   /*
     third guess: property time exception, specific for duration type
@@ -133,26 +133,26 @@ Auto_beam_engraver::consider_end_and_begin (Moment test_mom)
   if (type_str.length_i ())
     {
       SCM end_mult = get_property ( time_str + "beamAutoEnd" + type_str);
-      if (SMOB_IS_TYPE_B (Moment, end_mult))
-       end_mom = * SMOB_TO_TYPE (Moment,end_mult);
+      if (unsmob_moment (end_mult))
+       end_mom = * unsmob_moment (end_mult);
 
       SCM begin_mult = get_property (time_str + "beamAutoBegin" + type_str);
-      if (SMOB_IS_TYPE_B (Moment, begin_mult))
-       begin_mom = * SMOB_TO_TYPE (Moment,begin_mult);
+      if (unsmob_moment (begin_mult))
+       begin_mom = * unsmob_moment (begin_mult);
     }
 
   /*
     fourth guess [user override]: property plain generic
   */
   begin = get_property ("beamAutoBegin");
-  if (SMOB_IS_TYPE_B(Moment, begin))
-    begin_mom = * SMOB_TO_TYPE(Moment, begin);
+  if (unsmob_moment (begin))
+    begin_mom = * unsmob_moment (begin);
 
 
   
   end = get_property ("beamAutoEnd");
-  if (SMOB_IS_TYPE_B (Moment, end))
-    end_mom = * SMOB_TO_TYPE (Moment,end);
+  if (unsmob_moment (end))
+    end_mom = * unsmob_moment (end);
 
   /*
     fifth guess [user override]: property plain, specific for duration type
@@ -160,12 +160,12 @@ Auto_beam_engraver::consider_end_and_begin (Moment test_mom)
   if (type_str.length_i ())
     {
       SCM end_mult = get_property (String ("beamAutoEnd") + type_str);
-      if (SMOB_IS_TYPE_B (Moment, end_mult))
-       end_mom = * SMOB_TO_TYPE (Moment,end_mult);
+      if (unsmob_moment (end_mult))
+       end_mom = * unsmob_moment (end_mult);
 
       SCM begin_mult = get_property (String ("beamAutoBegin") + type_str);
-      if (SMOB_IS_TYPE_B (Moment, begin_mult))
-       begin_mom = * SMOB_TO_TYPE (Moment,begin_mult);
+      if (unsmob_moment (begin_mult))
+       begin_mom = * unsmob_moment (begin_mult);
     }
 
   Rational r;
index 7705d94e2698c823a4b98cd861d78889277f3195..6e5722ca1282658e9bf4bb6c39ae18758fd02c5a 100644 (file)
@@ -72,13 +72,26 @@ Break_align_item::before_line_breaking ()
       else
        next_origin = ly_symbol2scm ("begin-of-note");
       
-      SCM extra_space
-       = scm_eval (scm_listify (ly_symbol2scm ("break-align-spacer"),
-                                ly_quote_scm (current_origin),
-                                ly_quote_scm (next_origin),
-                                SCM_UNDEFINED));
+      SCM e = scm_assoc (scm_listify (current_origin,
+                                     next_origin,
+                                     SCM_UNDEFINED),
+                        scm_eval (ly_symbol2scm ("space-alist")));
+      
+      SCM extra_space;
+      if (e != SCM_BOOL_F)
+       {
+         extra_space = gh_cdr (e);
+       }
+      else
+       {
+         warning (_f ("unknown spacing pair `%s', `%s'",
+                      ly_symbol2string (current_origin),
+                      ly_symbol2string (next_origin)));
+         extra_space = scm_listify (ly_symbol2scm ("minimum-space"), gh_double2scm (0.0), SCM_UNDEFINED);
+       }
+
       SCM symbol = gh_car  (extra_space);
-      Real spc = gh_scm2double (SCM_CADR(extra_space));
+      Real spc = gh_scm2double (gh_cadr(extra_space));
       spc *= interline;
 
       dists.push(spc);
index e2eafc6de41e7913efad9192da77ebe065f8ad1d..43b2ba66dbbb97e9c6504e880dd830523f2a1cae 100644 (file)
@@ -59,9 +59,7 @@ Pointer_group_interface__extract_elements (Score_element const *elt, T *, const
   for (SCM s = elt->get_elt_pointer (name); gh_pair_p (s); s = gh_cdr (s))
     {
       SCM e = gh_car (s);
-      assert (SMOB_IS_TYPE_B(Score_element,e));
-      Score_element* se = SMOB_TO_TYPE(Score_element, e);
-      arr.push (dynamic_cast<T*> (se));
+      arr.push (dynamic_cast<T*> (unsmob_element (e)));
     }
 
   arr.reverse ();
index 0aa2b0287a589afdeca5c594aea96f2fc1afb707..ba9751c4b50f903e4e41409733b675ea5a061cb1 100644 (file)
 
 #ifndef SCM_PACK
 #define SCM_PACK(x) ((SCM) x)
-#endif
 
+#endif
+#ifndef SCM_UNPACK
+#define SCM_UNPACK(x) ( x)
+#endif
 
 /*
   conversion functions follow the GUILE naming convention, i.e.