From 72b030aeed611d4a24ed6ade7fcc570cceac4c0d Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 19 Feb 2004 22:42:58 +0000 Subject: [PATCH] (print): broken beams last until end of staff. (print): broken beams start from prefatory matter. --- ChangeLog | 2 ++ lily/beam-quanting.cc | 10 +++++----- lily/beam.cc | 26 +++++++++++++------------- lily/break-algorithm.cc | 4 ++-- lily/dot-column.cc | 2 +- lily/include/beam.hh | 2 +- lily/include/item.hh | 4 ++-- lily/include/spanner.hh | 2 +- lily/include/stem.hh | 2 +- lily/item.cc | 10 +++++----- lily/note-spacing.cc | 2 +- lily/spanner.cc | 4 ++-- lily/stem.cc | 12 ++++++------ lily/tuplet-bracket.cc | 4 ++-- 14 files changed, 44 insertions(+), 42 deletions(-) diff --git a/ChangeLog b/ChangeLog index bc923d46fe..464cf0f02b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2004-02-19 Han-Wen Nienhuys + * lily/include/*.hh (class Item): rename XXX_b () to is_XXX (). + * THANKS: update bugreporter list. * lily/beam.cc (print): broken beams last until end of staff. diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index 40ff8ac422..b78e435a49 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -189,14 +189,14 @@ Beam::quanting (SCM smob) Direction ldir = Direction (stem_infos[0].dir_); Direction rdir = Direction (stem_infos.top ().dir_); - bool knee_b = dirs_found[LEFT] && dirs_found[RIGHT]; + bool is_knee = dirs_found[LEFT] && dirs_found[RIGHT]; int region_size = REGION_SIZE; /* Knees are harder, lets try some more possibilities for knees. */ - if (knee_b) + if (is_knee) region_size += 2; /* @@ -243,7 +243,7 @@ Beam::quanting (SCM smob) int beam_count = get_beam_count (me); Real beam_translation = get_beam_translation (me) / ss; - Real reasonable_score = (knee_b) ? 200000 : 100; + Real reasonable_score = (is_knee) ? 200000 : 100; for (int i = qscores.size (); i--;) if (qscores[i].demerits < reasonable_score) { @@ -263,7 +263,7 @@ Beam::quanting (SCM smob) Real d=score_stem_lengths (stems, stem_infos, base_lengths, stem_xposns, xl, xr, - knee_b, + is_knee, qscores[i].yl, qscores[i].yr); qscores[i].demerits += d; @@ -332,7 +332,7 @@ Beam::score_stem_lengths (Link_array const &stems, for (int i=0; i < stems.size (); i++) { Grob* s = stems[i]; - if (Stem::invisible_b (s)) + if (Stem::is_invisible (s)) continue; Real x = stem_xs[i]; diff --git a/lily/beam.cc b/lily/beam.cc index 4f6f2e84eb..6d53a6c547 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -685,7 +685,7 @@ Beam::consider_auto_knees (Grob* me) for (int i=0; i < stems.size (); i++) { Grob* stem = stems[i]; - if (Stem::invisible_b (stem)) + if (Stem::is_invisible (stem)) continue; Interval hps = Stem::head_positions (stem); @@ -740,7 +740,7 @@ Beam::consider_auto_knees (Grob* me) for (int i = 0; i < stems.size(); i++) { Grob* stem = stems[i]; - if (Stem::invisible_b (stem)) + if (Stem::is_invisible (stem)) continue; Interval hps = hps_array[j++]; @@ -775,7 +775,7 @@ Beam::set_stem_shorten (Grob *me) /* shortening looks silly for x staff beams */ - if (knee_b(me)) + if (is_knee(me)) return ; Real forced_fraction = 1.0 * forced_stem_count (me) @@ -926,7 +926,7 @@ Beam::least_squares (SCM smob) for (int i=0; i < stems.size (); i++) { Grob* s = stems[i]; - if (Stem::invisible_b (s)) + if (Stem::is_invisible (s)) continue; ideals.push (Offset (x_posns[i], Stem::get_stem_info (s).ideal_y_ @@ -1012,7 +1012,7 @@ Beam::shift_region_to_valid (SCM grob) for (int i=0; i < stems.size (); i++) { Grob* s = stems[i]; - if (Stem::invisible_b (s)) + if (Stem::is_invisible (s)) continue; Direction d = Stem::get_direction (s); @@ -1069,7 +1069,7 @@ Beam::check_concave (SCM smob) for (int i = 0; i < stems.size ();) { - if (Stem::invisible_b (stems[i])) + if (Stem::is_invisible (stems[i])) stems.del (i); else i++; @@ -1329,7 +1329,7 @@ Beam::set_stem_lengths (Grob *me) for (int i=0; i < stems.size (); i++) { Grob* s = stems[i]; - if (Stem::invisible_b (s)) + if (Stem::is_invisible (s)) continue; bool french = to_boolean (s->get_grob_property ("french-beaming")); @@ -1376,7 +1376,7 @@ Beam::set_beaming (Grob *me, Beaming_info_list *beaming) int b = beaming->infos_.elem (i).beams_i_drul_[d]; if (i>0 && i < stems.size() -1 - && Stem::invisible_b (st)) + && Stem::is_invisible (st)) b = b infos_.elem(i).beams_i_drul_[-d]; Stem::set_beaming (st, b, d); @@ -1396,7 +1396,7 @@ Beam::forced_stem_count (Grob *me) { Grob *s = stems[i]; - if (Stem::invisible_b (s)) + if (Stem::is_invisible (s)) continue; /* I can imagine counting those boundaries as a half forced stem, @@ -1419,7 +1419,7 @@ Beam::visible_stem_count (Grob *me) int c = 0; for (int i = stems.size (); i--;) { - if (!Stem::invisible_b (stems[i])) + if (!Stem::is_invisible (stems[i])) c++; } return c; @@ -1433,7 +1433,7 @@ Beam::first_visible_stem (Grob *me) for (int i = 0; i < stems.size (); i++) { - if (!Stem::invisible_b (stems[i])) + if (!Stem::is_invisible (stems[i])) return stems[i]; } return 0; @@ -1446,7 +1446,7 @@ Beam::last_visible_stem (Grob *me) Pointer_group_interface__extract_grobs (me, (Grob*) 0, "stems"); for (int i = stems.size (); i--;) { - if (!Stem::invisible_b (stems[i])) + if (!Stem::is_invisible (stems[i])) return stems[i]; } return 0; @@ -1537,7 +1537,7 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis) } bool -Beam::knee_b (Grob* me) +Beam::is_knee (Grob* me) { SCM k = me->get_grob_property ("knee"); if (gh_boolean_p (k)) diff --git a/lily/break-algorithm.cc b/lily/break-algorithm.cc index 56f8e2e109..7176d928ff 100644 --- a/lily/break-algorithm.cc +++ b/lily/break-algorithm.cc @@ -25,7 +25,7 @@ Break_algorithm::find_break_indices () const Array retval; for (int i=0; i < all.size (); i++) - if (Item::breakable_b (all[i])) + if (Item::is_breakable (all[i])) retval.push (i); if (linewidth_ <=0) @@ -43,7 +43,7 @@ Break_algorithm::find_breaks () const Link_array retval; for (int i=0; i < all.size (); i++) - if (Item::breakable_b (all[i])) + if (Item::is_breakable (all[i])) retval.push (all[i]); if (linewidth_ <=0) diff --git a/lily/dot-column.cc b/lily/dot-column.cc index cb7e96c56c..7c691c5ca7 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -53,7 +53,7 @@ Dot_column::side_position (SCM element_smob, SCM axis) if (stem && !Stem::get_beam (stem) && Stem::duration_log (stem) > 2 - && !Stem::invisible_b (stem) + && !Stem::is_invisible (stem) ) { /* diff --git a/lily/include/beam.hh b/lily/include/beam.hh index 297fd9c1be..cb7ec49247 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -25,7 +25,7 @@ public: DECLARE_SCHEME_CALLBACK (rest_collision_callback, (SCM element, SCM axis)); Beam (SCM); static void add_stem (Grob*,Grob*); - static bool knee_b (Grob*); + static bool is_knee (Grob*); static void set_beaming (Grob*,Beaming_info_list *); static void set_stemlens (Grob*); static int get_beam_count (Grob*me); diff --git a/lily/include/item.hh b/lily/include/item.hh index e64fa4f3fa..d446773244 100644 --- a/lily/include/item.hh +++ b/lily/include/item.hh @@ -30,8 +30,8 @@ public: Item (SCM); Item (Item const &); - static bool breakable_b (Grob *); - bool broken_b () const; + static bool is_breakable (Grob *); + bool is_broken () const; Direction break_status_dir () const; diff --git a/lily/include/spanner.hh b/lily/include/spanner.hh index 40617f18e1..f6634e29f3 100644 --- a/lily/include/spanner.hh +++ b/lily/include/spanner.hh @@ -50,7 +50,7 @@ public: Spanner (SCM); Spanner (Spanner const &); - bool broken_b () const; + bool is_broken () const; void do_break (); Real spanner_length () const; diff --git a/lily/include/stem.hh b/lily/include/stem.hh index 65c23a2f7f..d1060f432b 100644 --- a/lily/include/stem.hh +++ b/lily/include/stem.hh @@ -32,7 +32,7 @@ public: static Slice Stem::beam_multiplicity (Grob *); static Real thickness (Grob*); static int head_count (Grob *); - static bool invisible_b (Grob *) ; + static bool is_invisible (Grob *) ; static Interval head_positions (Grob *); static Real get_default_stem_end_position (Grob*me); static void position_noteheads (Grob *); diff --git a/lily/item.cc b/lily/item.cc index 057155b52b..189d1a4da2 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -33,7 +33,7 @@ Item::Item (Item const &s) bool -Item::breakable_b (Grob*me) +Item::is_breakable (Grob*me) { if (me->original_) return false; @@ -42,7 +42,7 @@ Item::breakable_b (Grob*me) me->programming_error ("only items can be breakable."); Item * i =dynamic_cast (me->get_parent (X_AXIS)); - return (i) ? Item::breakable_b (i) : to_boolean (me->get_grob_property ("breakable")); + return (i) ? Item::is_breakable (i) : to_boolean (me->get_grob_property ("breakable")); } Paper_column * @@ -78,7 +78,7 @@ Item::copy_breakable_items () bool -Item::broken_b () const +Item::is_broken () const { return broken_to_drul_[LEFT] || broken_to_drul_[RIGHT]; } @@ -90,10 +90,10 @@ Item::broken_b () const void Item::discretionary_processing () { - if (broken_b ()) + if (is_broken ()) return; - if (Item::breakable_b (this)) + if (Item::is_breakable (this)) copy_breakable_items (); } diff --git a/lily/note-spacing.cc b/lily/note-spacing.cc index fca28671ee..e3fbfbcf70 100644 --- a/lily/note-spacing.cc +++ b/lily/note-spacing.cc @@ -293,7 +293,7 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn, return ; } - if(Stem::invisible_b (stem)) + if(Stem::is_invisible (stem)) { correct_stem_dirs = false; continue; diff --git a/lily/spanner.cc b/lily/spanner.cc index c94bb3de49..d5341c4c55 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -46,7 +46,7 @@ Spanner::do_break_processing () } } - if (get_system () || broken_b ()) + if (get_system () || is_broken ()) return; if (left == right) @@ -260,7 +260,7 @@ Spanner::compare (Spanner * const &p1, Spanner * const &p2) } bool -Spanner::broken_b () const +Spanner::is_broken () const { return broken_intos_.size (); } diff --git a/lily/stem.cc b/lily/stem.cc index 993e6253f6..78c8a63678 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -251,7 +251,7 @@ Stem::add_head (Grob*me, Grob *n) } bool -Stem::invisible_b (Grob*me) +Stem::is_invisible (Grob*me) { return ! (head_count (me) && gh_scm2int (me->get_grob_property ("duration-log")) >= 1); @@ -495,7 +495,7 @@ Stem::position_noteheads (Grob*me) Real reverse_overlap =0.5; heads[i]->translate_axis ((l-thick*reverse_overlap) * d, X_AXIS); - if (invisible_b(me)) + if (is_invisible(me)) heads[i]->translate_axis (-thick*(2 - reverse_overlap) * d , X_AXIS); @@ -721,7 +721,7 @@ Stem::print (SCM smob) if (!lh) return SCM_EOL; - if (invisible_b (me)) + if (is_invisible (me)) return SCM_EOL; Real y1 = Staff_symbol_referencer::get_position (lh); @@ -790,7 +790,7 @@ Stem::off_callback (SCM element_smob, SCM) Real attach =0.0; - if (invisible_b (me)) + if (is_invisible (me)) { attach = 0.0; } @@ -923,8 +923,8 @@ Stem::calc_stem_info (Grob *me) Also, not for knees. Seems to be a good thing. */ bool no_extend_b = to_boolean (me->get_grob_property ("no-stem-extend")); - bool knee_b = to_boolean (beam->get_grob_property ("knee")); - if (!no_extend_b && !knee_b) + bool is_knee = to_boolean (beam->get_grob_property ("knee")); + if (!no_extend_b && !is_knee) { /* Highest beam of (UP) beam must never be lower than middle staffline */ diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index 31914723bd..76983e959e 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -71,7 +71,7 @@ Tuplet_bracket::parallel_beam (Grob *me, Link_array const &cols, bool *equ Spanner*sp = dynamic_cast (me); *equally_long= false; - if (! (b1 && (b1 == b2) && !sp->broken_b())) + if (! (b1 && (b1 == b2) && !sp->is_broken ())) return 0; Link_array beam_stems = Pointer_group_interface__extract_grobs @@ -438,7 +438,7 @@ Tuplet_bracket::after_line_breaking (SCM smob) me->suicide (); return SCM_UNSPECIFIED; } - if (dynamic_cast (me)->broken_b ()) + if (dynamic_cast (me)->is_broken ()) { me->warning (_("Killing tuplet bracket across linebreak.")); me->suicide(); -- 2.39.5