]> git.donarmstrong.com Git - lilypond.git/commitdiff
(get_best_curve): handle opt_idx < 0 case.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 27 Jan 2006 23:56:20 +0000 (23:56 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 27 Jan 2006 23:56:20 +0000 (23:56 +0000)
ChangeLog
lily/slur-scoring.cc

index a92df34669fed22b1db8e0bcb7e35b9806993449..8cf5660fc8588c1ae4c2c5f0e4f2455c47b01a4e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-01-28  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * lily/slur-scoring.cc (get_best_curve): handle opt_idx < 0 case.
+
 2006-01-27  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * lily/main.cc (main): Debugging aid: catch exceptions.
index d842abfc09b5841bd7da6a763a6039f575af5a4f..769f84f6338e581a3818d5cb96ec275b09f9d0c4 100644 (file)
@@ -430,9 +430,17 @@ Slur_score_state::get_best_curve ()
     }
 
 #if DEBUG_SLUR_SCORING
-  configurations_[opt_idx]->score_card_ += to_string ("=%.2f", opt);
-  configurations_[opt_idx]->score_card_ += to_string ("i%d", opt_idx);
-
+  if (opt_idx >= 0)
+    {
+      configurations_[opt_idx]->score_card_ += to_string ("=%.2f", opt);
+      configurations_[opt_idx]->score_card_ += to_string ("i%d", opt_idx);
+    }
+  else
+    {
+      programming_error ("No optimal slur found. Guessing 0.");
+      opt_idx = 0;
+    }
+  
   // debug quanting
   slur_->set_property ("quant-score",
                       scm_makfrom0str (configurations_[opt_idx]->score_card_.c_str ()));