]> git.donarmstrong.com Git - lilypond.git/commitdiff
Store scoring info in 'annotation, and always print debug info if
authorHan-Wen Nienhuys <hanwen@lilypond.org>
Sat, 26 Feb 2011 15:06:04 +0000 (12:06 -0300)
committerHan-Wen Nienhuys <hanwen@lilypond.org>
Mon, 28 Feb 2011 03:42:16 +0000 (00:42 -0300)
inspect-quants is set.

lily/beam-quanting.cc
lily/beam.cc
lily/slur-scoring.cc
lily/slur.cc
lily/tie-formatting-problem.cc
lily/tie.cc
scm/define-grob-properties.scm

index f8a9434e7eab4f34d0d418ac75b245178346e4f7..689fd218bf616558a4964ff00f2f33bc01f8a3e4 100644 (file)
@@ -450,10 +450,13 @@ Beam_scoring_problem::solve () const {
 
   Beam_configuration *best = NULL;  
 
+  bool debug =
+    to_boolean (beam->layout ()->lookup_variable (ly_symbol2scm ("debug-beam-scoring")));
   SCM inspect_quants = beam->get_property ("inspect-quants");
   if (to_boolean (beam->layout ()->lookup_variable (ly_symbol2scm ("debug-beam-scoring")))
       && scm_is_pair (inspect_quants))
     {
+      debug = true;
       best = force_score (inspect_quants, configs);
     }
   else
@@ -463,7 +466,6 @@ Beam_scoring_problem::solve () const {
       for (vsize i = 0; i < configs.size(); i++)
         queue.push(configs[i]);
 
-
       /*
         TODO
 
@@ -494,7 +496,7 @@ Beam_scoring_problem::solve () const {
   Interval final_positions = best->y;
 
 #if DEBUG_BEAM_SCORING
-  if (to_boolean (beam->layout ()->lookup_variable (ly_symbol2scm ("debug-beam-scoring"))))
+  if (debug)
     {
       // debug quanting
       int completed = 0;
@@ -505,7 +507,7 @@ Beam_scoring_problem::solve () const {
         }
 
       string card = best->score_card_ + to_string (" c%d/%d", completed, configs.size());
-      beam->set_property ("quant-score", ly_string2scm (card));
+      beam->set_property ("annotation", ly_string2scm (card));
     }
 #endif
 
index c485813a5a797cfaf29217e619bc6015a30327eb..58ac5d44d276d61fa98ec69eeada4a68feb71003 100644 (file)
@@ -610,13 +610,6 @@ Beam::print (SCM grob)
 
 #if (DEBUG_BEAM_SCORING)
   SCM annotation = me->get_property ("annotation");
-  if (!scm_is_string (annotation))
-    {
-      SCM debug = me->layout ()->lookup_variable (ly_symbol2scm ("debug-beam-scoring"));
-      if (to_boolean (debug))
-       annotation = me->get_property ("quant-score");
-    }
-
   if (scm_is_string (annotation))
     {
       extract_grob_set (me, "stems", stems);
@@ -1646,7 +1639,6 @@ ADD_INTERFACE (Beam,
               "neutral-direction "
               "normal-stems "
               "positions "
-              "quant-score "
               "quantized-positions "
               "shorten "
               "stems "
index 551d4b4524e0e1946d11e74fe9aa7f00463b567a..63160a99171872556acb773a43bc046b773ebdce 100644 (file)
@@ -306,8 +306,14 @@ Slur::calc_control_points (SCM smob)
 
   SCM end_ys = me->get_property ("positions");
   SCM inspect_quants = me->get_property ("inspect-quants");
+  bool debug_slurs = to_boolean (me->layout ()
+                                ->lookup_variable (ly_symbol2scm ("debug-slur-scoring")));
+
   if (is_number_pair (inspect_quants))
-    end_ys = inspect_quants;
+    {
+      debug_slurs = true;
+      end_ys = inspect_quants;
+    }
   
   Slur_configuration *best = NULL;
   if (is_number_pair (end_ys))
@@ -316,13 +322,11 @@ Slur::calc_control_points (SCM smob)
     best = state.get_best_curve ();
 
 #if DEBUG_SLUR_SCORING
-  bool debug_slurs = to_boolean (me->layout ()
-                                ->lookup_variable (ly_symbol2scm ("debug-slur-scoring")));
   if (debug_slurs)
     {
       string total = best->card ();
       total += to_string (" TOTAL=%.2f idx=%d", best->score (), best->index_); 
-      me->set_property ("quant-score", ly_string2scm (total));
+      me->set_property ("annotation", ly_string2scm (total));
     }
 #endif
   
index 41db62b1afae8356b322e4eff2317b901217ecf9..433406c92a57d9471daab3524cf5c32091af7ebe 100644 (file)
@@ -141,13 +141,6 @@ Slur::print (SCM smob)
 
 #if DEBUG_SLUR_SCORING
   SCM annotation = me->get_property ("annotation");
-  if (!scm_is_string (annotation))
-    {
-      SCM debug = me->layout ()->lookup_variable (ly_symbol2scm ("debug-slur-scoring"));
-      if (to_boolean (debug))
-       annotation = me->get_property ("quant-score");
-    }
-  
   if (scm_is_string (annotation))
     {
       string str;
@@ -504,7 +497,6 @@ ADD_INTERFACE (Slur,
               "line-thickness "
               "note-columns "
               "positions "
-              "quant-score "
               "ratio "
               "thickness "
               );
index 4d9d58ee5c0467ed4372bcec202300d602dc4595..0c3279ce21479b7ed790e16552777c2908c40071 100644 (file)
@@ -1241,7 +1241,7 @@ Tie_formatting_problem::set_debug_scoring (Ties_configuration const &base)
       for (vsize i = 0; i < base.size (); i++)
        {
          string card = base.complete_tie_card (i);
-         specifications_[i].tie_grob_->set_property ("quant-score",
+         specifications_[i].tie_grob_->set_property ("annotation",
                                                      ly_string2scm (card));
        }
     }
index 54dbd19670c36b8b9ee38cd61d714d3029d7b166..e8b21d8544bad329473b39445c5e80dadb973cf5 100644 (file)
@@ -281,12 +281,6 @@ Tie::print (SCM smob)
 
 #if DEBUG_TIE_SCORING
   SCM annotation = me->get_property ("annotation");
-  if (!scm_is_string (annotation))
-    {
-      SCM debug = me->layout ()->lookup_variable (ly_symbol2scm ("debug-tie-scoring"));
-      if (to_boolean (debug))
-       annotation = me->get_property ("quant-score");
-    }
   if (scm_is_string (annotation))
     {
       string str;
@@ -323,7 +317,6 @@ ADD_INTERFACE (Tie,
               "head-direction "
               "line-thickness "
               "neutral-direction "
-              "quant-score "
               "staff-position "
               "thickness "
               );
index 168a4f43d8a3432621128d76f0e48b0c90d3bd05..b47a7bfc39fa7e06e7ba5a8b684857d85b8da458 100644 (file)
@@ -1087,9 +1087,6 @@ did its job.  This ensures that a positioning is only done once.")
      (pure-Y-extent ,number-pair? "The estimated height of a system.")
      (pure-Y-offset-in-progress ,boolean? "A debugging aid for catching
 cyclic dependencies.")
-
-     (quant-score ,string? "The beam quanting score; stored for
-debugging.")
      (quantize-position ,boolean? "If set, a vertical alignment is aligned
 to be within staff spaces.")
      (quantized-positions ,number-pair? "The beam positions after