]> git.donarmstrong.com Git - lilypond.git/commitdiff
(print): broken beams last until end of staff.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 19 Feb 2004 22:42:58 +0000 (22:42 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 19 Feb 2004 22:42:58 +0000 (22:42 +0000)
(print): broken beams start from prefatory matter.

14 files changed:
ChangeLog
lily/beam-quanting.cc
lily/beam.cc
lily/break-algorithm.cc
lily/dot-column.cc
lily/include/beam.hh
lily/include/item.hh
lily/include/spanner.hh
lily/include/stem.hh
lily/item.cc
lily/note-spacing.cc
lily/spanner.cc
lily/stem.cc
lily/tuplet-bracket.cc

index bc923d46fe2151478d0f70b7c2cb8b98224f4647..464cf0f02b9d08c34302f2cabb11fa27a6caa9f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2004-02-19  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * 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.
index 40ff8ac4221a04bdbae739fefcfa7ec002e49456..b78e435a49114b2af38ede20771f948e56f562e8 100644 (file)
@@ -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<Grob> 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];
index 4f6f2e84ebb74d8b9afb4c0ac9a85a3adbd1fb88..6d53a6c547881b3b8397d0d3cdd4a7ae2aab598e 100644 (file)
@@ -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 <? beaming->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))
index 56f8e2e109fa102975dd4e5255d6bcd2bbfa24f1..7176d928ffb0d1439e292f7527bf848b37250401 100644 (file)
@@ -25,7 +25,7 @@ Break_algorithm::find_break_indices () const
   Array<int> 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<Grob> 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)
index cb7e96c56c1b8adf7f42ee9901182314a7a94b4c..7c691c5ca791485899b29f4f952f0765e02b2454 100644 (file)
@@ -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)
       )
     {
       /*
index 297fd9c1be994a36f6a447967e2730f7cf184ea5..cb7ec49247012dab3f452ba454a8114af1f4a487 100644 (file)
@@ -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);
index e64fa4f3fa42d3956cbea68dc0951ba5a77c1c09..d4467732444a1937fb004f95a93591854b6d9a91 100644 (file)
@@ -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;
   
index 40617f18e131b8fe1028f8a924488b701b7aaaf2..f6634e29f3ac6a4fc5d5e58f57efbd03c244a36e 100644 (file)
@@ -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;
 
index 65c23a2f7f2ac14a8f26d0f1c1558eb08086f26c..d1060f432bf8f31217098074d14bb64107f482b6 100644 (file)
@@ -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 *);
index 057155b52bbb0674b6db481449931a178c0ecd04..189d1a4da2fe2343df5e33a9ba6b1921ad30e5d6 100644 (file)
@@ -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<Item*> (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 ();
 }
 
index fca28671ee048d73b1f7feecdb438eb630c6281f..e3fbfbcf70889278e9cb6092a2ab3b4062c2b0f3 100644 (file)
@@ -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;
index c94bb3de49f1e95b8100da2155712ef2269479a6..d5341c4c55cc98acc1bfe1aa22838b008b2fe24c 100644 (file)
@@ -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 ();
 }
index 993e6253f69f00bf05c846cccb3a79f261879320..78c8a636781fe3b02e5b89e6be4747904a664f66 100644 (file)
@@ -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 */
index 31914723bdd5e358389e05267f97f419abf049e3..76983e959e1083a346f50a8e93c31722a387a3e7 100644 (file)
@@ -71,7 +71,7 @@ Tuplet_bracket::parallel_beam (Grob *me, Link_array<Grob> const &cols, bool *equ
   Spanner*sp = dynamic_cast<Spanner*> (me);  
 
   *equally_long= false;
-  if (! (b1 && (b1 == b2) && !sp->broken_b()))
+  if (! (b1 && (b1 == b2) && !sp->is_broken ()))
       return 0;
 
   Link_array<Grob> 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<Spanner*> (me)->broken_b ())
+  if (dynamic_cast<Spanner*> (me)->is_broken ())
     {
       me->warning (_("Killing tuplet bracket across linebreak."));
       me->suicide();