]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/hairpin.cc (print): check columns of bounds, not bounds themselves.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 24 Sep 2004 18:12:44 +0000 (18:12 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 24 Sep 2004 18:12:44 +0000 (18:12 +0000)
(print): robustify bound-padding lookup.

* scripts/lilypond-book.py (Compile_error.process_include): catch
Compile_error exception, and remove output .texi.

* lily/parser.yy (Music_list): add error-found to music with errors.

ChangeLog
lily/hairpin.cc
lily/lexer.ll
lily/parser.yy
lily/slur-scoring.cc
ly/book-paper-defaults.ly
scripts/lilypond-book.py

index 31fb69a09a64d33feff5b5db58b40e760dfdceef..0181fd1eeff8867ec00e13e01b6f5bf0872291c0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-09-24  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/hairpin.cc (print): check columns of bounds, not bounds themselves.
+       (print): robustify bound-padding lookup.
+
        * lily/*: ly_c[ad]+r -> scm_XXX , ly_c_pair_p -> scm_is_pair.
 
        * scripts/lilypond-book.py (Compile_error.process_include): catch
index ac4144e59757849fdb6296793bf9035560bb8fbc..9fcf79df88766483c13af02bd553ba2e4d28dfe6 100644 (file)
@@ -35,9 +35,8 @@ Hairpin::print (SCM smob)
     }
   
   Direction grow_dir = to_dir (s);
+  Real padding = robust_scm2double (me->get_property ("bound-padding"), 0.5);
 
-  Real padding = scm_to_double (me->get_property ("bound-padding"));
   Drul_array<bool> broken;
   Drul_array<Item*> bounds ;
   Direction d = LEFT;
@@ -82,8 +81,8 @@ Hairpin::print (SCM smob)
                  
                  Spanner *pin = unsmob_spanner (scm_car (adj));
                  if (pin
-                     && (pin->get_bound (LEFT)->get_column() == b
-                         || pin->get_bound (RIGHT)->get_column() == b))
+                     && (pin->get_bound (LEFT)->get_column() == b->get_column ()
+                         || pin->get_bound (RIGHT)->get_column() == b->get_column() ))
                    neighbor_found = true; 
                }
              
@@ -96,18 +95,16 @@ Hairpin::print (SCM smob)
              x_points[d] =
                neighbor_found ? e.center() - d * padding / 3 : e[d];
            }
-         
        }
     }
   while (flip (&d) != LEFT);
 
 
   Real width = x_points[RIGHT] - x_points[LEFT];
-
   if (width < 0)
     {
       me->warning (_ ((grow_dir < 0) ? "decrescendo too small"
-                 : "crescendo too small"));
+                     : "crescendo too small"));
       width = 0;
     }
 
index 975b336fd725d3c37ec7ed72d17ef577b85ce13f..f89f7fa5af599abf250aa1a4a458ff1ea2751ef8 100644 (file)
@@ -499,7 +499,7 @@ HYPHEN              --
                String str (YYText () + 1);
                SCM s = lookup_markup_command (str);
 
-               if (ly_c_pair_p (s) && scm_is_symbol (scm_cdr (s)) ) {
+               if (scm_is_pair (s) && scm_is_symbol (scm_cdr (s)) ) {
                        yylval.scm = scm_car(s);
                        SCM tag = scm_cdr(s);
                        if (tag == ly_symbol2scm("markup0"))
@@ -727,10 +727,10 @@ Lily_lexer::scan_bare_word (String str)
        SCM sym = ly_symbol2scm (str.to_str0 ());
        if ((YYSTATE == notes) || (YYSTATE == chords)) {
                SCM handle = SCM_BOOL_F;
-               if (ly_c_pair_p (pitchname_tab_stack_))
+               if (scm_is_pair (pitchname_tab_stack_))
                        handle = scm_hashq_get_handle (scm_car (pitchname_tab_stack_), sym);
                
-               if (ly_c_pair_p (handle)) {
+               if (scm_is_pair (handle)) {
                        yylval.scm = scm_cdr (handle);
                        if (unsmob_pitch (yylval.scm)) 
                            return (YYSTATE == notes) ? NOTENAME_PITCH : TONICNAME_PITCH;
index f7885478b84ea722b547525a029c12cbf29e7753..2ed5effb92f26134883f37c8af59cbf7d086272e 100644 (file)
@@ -119,7 +119,7 @@ is_duration (int t)
 void
 set_music_properties (Music *p, SCM a)
 {
-  for (SCM k = a; ly_c_pair_p (k); k = scm_cdr (k))
+  for (SCM k = a; scm_is_pair (k); k = scm_cdr (k))
        p->internal_set_property (scm_caar (k), scm_cdar (k));
 }
 
@@ -150,7 +150,7 @@ bool
 ly_input_procedure_p (SCM x)
 {
        return ly_c_procedure_p (x)
-               || (ly_c_pair_p (x) && ly_c_procedure_p (scm_car (x)));
+               || (scm_is_pair (x) && ly_c_procedure_p (scm_car (x)));
 }
 
 Music*
@@ -611,7 +611,7 @@ context_def_spec_body:
        | context_def_spec_body GROBDESCRIPTIONS embedded_scm {
                Context_def*td = unsmob_context_def ($$);
 
-               for (SCM p = $3; ly_c_pair_p (p); p = scm_cdr (p)) {
+               for (SCM p = $3; scm_is_pair (p); p = scm_cdr (p)) {
                        SCM tag = scm_caar (p);
 
                        /* TODO: should make new tag "grob-definition" ? */
@@ -816,7 +816,7 @@ Music_list:
                SCM c = scm_cons ($2->self_scm (), SCM_EOL);
                scm_gc_unprotect_object ($2->self_scm ()); /* UGH */
 
-               if (ly_c_pair_p (scm_cdr (s)))
+               if (scm_is_pair (scm_cdr (s)))
                        scm_set_cdr_x (scm_cdr (s), c); /* append */
                else
                        scm_set_car_x (s, c); /* set first cons */
@@ -833,7 +833,7 @@ Music_list:
                SCM c = scm_cons (m->self_scm (), SCM_EOL);
                scm_gc_unprotect_object (m->self_scm ()); /* UGH */
 
-               if (ly_c_pair_p (scm_cdr (s)))
+               if (scm_is_pair (scm_cdr (s)))
                        scm_set_cdr_x (scm_cdr (s), c); /* append */
                else
                        scm_set_car_x (s, c); /* set first cons */
@@ -861,7 +861,7 @@ Repeated_music:
        {
                Music *beg = $4;
                int times = $3;
-               SCM alts = ly_c_pair_p ($5) ? scm_car ($5) : SCM_EOL;
+               SCM alts = scm_is_pair ($5) ? scm_car ($5) : SCM_EOL;
                if (times < scm_ilength (alts)) {
                  unsmob_music (scm_car (alts))
                    ->origin ()->warning (
@@ -1032,7 +1032,7 @@ Generic_prefix_music:
                int k = 0;
                bool ok  = true; 
                for (SCM s = sig, t = args;
-                       ok && ly_c_pair_p (s) && ly_c_pair_p (t);
+                       ok && scm_is_pair (s) && scm_is_pair (t);
                        s = scm_cdr (s), t = scm_cdr (t)) {
                        k++;
                        if (scm_call_1 (scm_car (s), scm_car (t)) != SCM_BOOL_T)
@@ -1247,7 +1247,7 @@ re_rhythmed_music:
                Music *all = MY_MAKE_MUSIC ("SimultaneousMusic");
 
                SCM lst = SCM_EOL;
-               for (SCM s = $2; ly_c_pair_p (s); s = scm_cdr (s))
+               for (SCM s = $2; scm_is_pair (s); s = scm_cdr (s))
                {
                        Music *music = unsmob_music (scm_car (s));
                        Music *com = make_lyric_combine_music (name, music);
@@ -1462,7 +1462,7 @@ note_chord_element:
                SCM es = $1->get_property ("elements");
                SCM postevs = scm_reverse_x ($3, SCM_EOL);
 
-               for (SCM s = es; ly_c_pair_p (s); s = scm_cdr (s))
+               for (SCM s = es; scm_is_pair (s); s = scm_cdr (s))
                  unsmob_music (scm_car (s))->set_property ("duration", dur);
                es = ly_append2 (es, postevs);
 
@@ -1515,7 +1515,7 @@ chord_body_element:
                if (ex % 2 || q % 2)
                        n->set_property ("force-accidental", SCM_BOOL_T);
 
-               if (ly_c_pair_p (post)) {
+               if (scm_is_pair (post)) {
                        SCM arts = scm_reverse_x (post, SCM_EOL);
                        n->set_property ("articulations", arts);
                }
@@ -1534,7 +1534,7 @@ chord_body_element:
                n->set_property ("drum-type", $1);
                n->set_spot (THIS->here_input ());
 
-               if (ly_c_pair_p ($2)) {
+               if (scm_is_pair ($2)) {
                        SCM arts = scm_reverse_x ($2, SCM_EOL);
                        n->set_property ("articulations", arts);
                }
@@ -2180,7 +2180,7 @@ simple_element:
                Music *m = unsmob_music ($1);
                Input i = THIS->pop_spot ();
                m->set_spot (i);
-               for (SCM s = m->get_property ("elements"); ly_c_pair_p (s); s = scm_cdr (s))
+               for (SCM s = m->get_property ("elements"); scm_is_pair (s); s = scm_cdr (s))
                {
                        unsmob_music (scm_car (s))->set_property ("duration", $2);
                }
index a4b1164c18fe020716392dfbf915fc71dc90d58a..be448bf0fda774614f964d82b55743a971b64c39 100644 (file)
@@ -1444,7 +1444,6 @@ get_bezier (Grob *me,
 
   Real a1 = sqr (len) / 3.0;
   Real a2 = 0.75 * sqr (indent + len / 3.0);
-  Real debug_h = sqrt (a1 - a2);
   Real max_h;
   if (a1 >= a2)
     max_h = sqrt (a1 - a2);
index 2cb3fc3d0542a551962f4e50b6b984953e9d3a2f..56b3c0d113d490fd6e9dbfebc6dd77eccbc9fd03 100644 (file)
@@ -34,7 +34,7 @@
     %
     % ugh. hard coded?
     %
-    
+
     #(paper-set-staff-size (* 20.0 pt))
 
     %
index b10c0fa2fef3668c7121ed144c566c292c776176..25b185abda07126010506cda480717bbe69b0c9c 100644 (file)
@@ -1028,7 +1028,7 @@ def do_file (input_filename):
 
 
                elif process_cmd:
-                       do_process_cmd (chunksg)
+                       do_process_cmd (chunks)
                        ly.progress (_ ("Compiling %s...") % output_filename)
                        output_file.writelines ([s.replacement_text () \
                                                 for s in chunks])