From: Han-Wen Nienhuys Date: Sat, 26 Feb 2011 15:06:04 +0000 (-0300) Subject: Store scoring info in 'annotation, and always print debug info if X-Git-Tag: release/2.13.52-1~12 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=217d48d7cdefb8ad026c7ade58d1f03f17cbb47a;p=lilypond.git Store scoring info in 'annotation, and always print debug info if inspect-quants is set. --- diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index f8a9434e7e..689fd218bf 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -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 diff --git a/lily/beam.cc b/lily/beam.cc index c485813a5a..58ac5d44d2 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -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 " diff --git a/lily/slur-scoring.cc b/lily/slur-scoring.cc index 551d4b4524..63160a9917 100644 --- a/lily/slur-scoring.cc +++ b/lily/slur-scoring.cc @@ -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 diff --git a/lily/slur.cc b/lily/slur.cc index 41db62b1af..433406c92a 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -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 " ); diff --git a/lily/tie-formatting-problem.cc b/lily/tie-formatting-problem.cc index 4d9d58ee5c..0c3279ce21 100644 --- a/lily/tie-formatting-problem.cc +++ b/lily/tie-formatting-problem.cc @@ -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)); } } diff --git a/lily/tie.cc b/lily/tie.cc index 54dbd19670..e8b21d8544 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -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 " ); diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index 168a4f43d8..b47a7bfc39 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -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