]> git.donarmstrong.com Git - lilypond.git/commitdiff
* input/regression/accidental-tie.ly (mus): new file
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 20 Feb 2004 00:35:49 +0000 (00:35 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 20 Feb 2004 00:35:49 +0000 (00:35 +0000)
* input/regression/tie-accidental, tie-break-accidental.ly: remove
these longish tests.

30 files changed:
ChangeLog
flower/include/interval.hh
flower/include/interval.tcc
input/regression/accidental-tie.ly [new file with mode: 0644]
input/regression/tie-accidental.ly [deleted file]
input/regression/tie-break-accidental.ly [deleted file]
lily/accidental-engraver.cc
lily/auto-beam-engraver.cc
lily/axis-group-interface.cc
lily/binary-source-file.cc
lily/include/axis-group-interface.hh
lily/include/grob.hh
lily/include/my-lily-lexer.hh
lily/include/simple-spacer.hh
lily/include/source-file.hh
lily/include/system.hh
lily/instrument-name-engraver.cc
lily/lexer.ll
lily/note-spacing.cc
lily/paper-column.cc
lily/parser.yy
lily/script-column-engraver.cc
lily/separating-line-group-engraver.cc
lily/simple-spacer.cc
lily/source-file.cc
lily/source.cc
lily/spacing-spanner.cc
lily/spanner.cc
lily/system.cc
lily/vertical-align-engraver.cc

index 464cf0f02b9d08c34302f2cabb11fa27a6caa9f8..95c459137cef471a6761dab702e3693ae44e499e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-02-20  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * input/regression/accidental-tie.ly (mus): new file
+
+       * input/regression/tie-accidental, tie-break-accidental.ly: remove
+       these longish tests.
+
 2004-02-19  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
        * lily/include/*.hh (class Item): rename XXX_b () to is_XXX ().
index be5f560d7e1e3bd17d1d76141b5a8f0a4f15eac5..eebe675f37ce45e529545cf66dde81aa6d66b62e 100644 (file)
@@ -58,7 +58,7 @@ struct Interval_t : public Drul_array<T> {
     TODO: strip hungarian suffix.
    */
   bool is_empty () const { return elem (LEFT) > elem (RIGHT); }
-  bool contains_b (Interval_t<T> const&) const;
+  bool superset (Interval_t<T> const&) const;
   Interval_t () {
     set_empty ();
   }
index 79e7c548e61ca374162e7069a09527ac729a24f3..2060c92ae74f28111964e498d9d1669be6be6ba1 100644 (file)
@@ -34,7 +34,7 @@ _Interval__compare (const Interval_t<T>&a,Interval_t<T> const&b)
 
 template<class T>
 bool 
-Interval_t<T>::contains_b (Interval_t<T> const& a) const
+Interval_t<T>::superset (Interval_t<T> const& a) const
 {
   int c_i= _Interval__compare (*this, a);
   if (c_i == -2)
diff --git a/input/regression/accidental-tie.ly b/input/regression/accidental-tie.ly
new file mode 100644 (file)
index 0000000..57784df
--- /dev/null
@@ -0,0 +1,28 @@
+\version "2.1.25"
+
+\header {
+
+    texidoc = "The second and third notes should not get accidentals,
+    because they are tied to a note.  However, an accidental is
+    present if the line is broken at the tie, which happens for the G
+    sharp."
+
+}
+
+mus = \notes   \relative c' {
+    f1~
+    f2~f4 % ~ f8
+    fis8  gis8 ~
+    \break
+    gis1
+}
+
+\score {
+    \notes <<
+       \new NoteNames \mus
+       \new Voice { \key g \major \mus }
+    >>
+    \paper {
+       raggedright = ##t
+    }
+}
diff --git a/input/regression/tie-accidental.ly b/input/regression/tie-accidental.ly
deleted file mode 100644 (file)
index 9e5de4f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-
-\version "2.1.22"
-
-\header{
-texidoc="
-When tying notes with accidentals across a bar boundary, the
-accidental must not be drawn on the note in the next bar.  Unless the
-tie crosses a line break, in which case the accidental is repeated if
-it would be different from an untied note.  The next note of the same
-pitch in this next bar should always show the accidental (even if it is
-natural).  Slurring a accidentaled note to a natural one across bar
-boundaries should be explicit.
-
-Pitches can be verified by printing them  with the @code{NoteNames} context.
-"
-}
-
-thenotes = \notes \relative cis' {
-  \time 4/4
-  g'2 g ~ |
-  g g4 gis |
-  gis2 gis ~ |
-  gis4 gis8 ~ gis g4 gis |
-  g2 gis ~ |
-  gis g4 gis |
-  g2 gis( |
-  g!) gis4 gis |
-  \break
-  \key a \major
-  gis2 gis ~ |
-  gis4 gis8 ~ gis g4 gis |
-  gis2 g ~ |
-  g4 gis8 ~ gis g4 gis |
-  g2 gis ~ |
-  gis g4 gis |
-  g2 gis( |
-  
-  % FIXME: check for accidentals at line break could look more cute
-  % maybe move to tie-break-accidental?
-  
-  % Btw: I don't even know what the rule is for the second note in the
-  % next bar, if a reminder accidental was printed.  These are really
-  % not very common cases.  Technically, if it is not tied, it
-  % should get an accidental but it looks a bit silly and redundant.
-  % See last g.
-  
-  g!) gis4 gis ~ | \break
-  gis2  gis ~ | gis g ~\break
-  g2 g
-}
-
-\score {
-  <<
-    \context Staff \thenotes
-    \context NoteNames \thenotes
-  >>
-}
-
diff --git a/input/regression/tie-break-accidental.ly b/input/regression/tie-break-accidental.ly
deleted file mode 100644 (file)
index b04e202..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-\version "2.1.22"
-
-\header {
-texidoc = "First and second bes (tied across line break)
-should get an accidental, but others should not.
-Only first b should get natural sign."
-}
-
-\score {
-  \notes {
-    bes1 ~ | \break
-    bes2 ~ bes4 ~ bes4 ~ | bes1
-    \key  f\major
-    bes1 ~|bes2 b ~|b ~ b ~|b1
-  }
-  \paper {
-    linewidth = 40*\staffspace
-  }
-}
-
index e63c0354ac6f89b543e69d705453d93db9614562..7e160184c3b37b2aaa75a2bccdec77a91429ce44 100644 (file)
@@ -6,8 +6,7 @@
 */
 
 #include "event.hh"
-
-
+#include "spanner.hh"
 #include "item.hh"
 #include "tie.hh"
 #include "rhythmic-head.hh"
@@ -27,11 +26,13 @@ struct Accidental_entry {
   Grob * accidental_;
   Context *origin_;
   Grob*  head_;
+  bool tied_;
   Accidental_entry();
 };
 
 Accidental_entry::Accidental_entry()
 {
+  tied_ = false;
   done_ = false;
   melodic_ =0;
   accidental_ = 0;
@@ -65,7 +66,9 @@ public:
     The next 
    */
   Array<Accidental_entry> accidentals_;
-  Link_array<Grob> ties_;
+  Link_array<Spanner> ties_;
+
+  SCM get_bar_num ();
 };
 
 
@@ -103,15 +106,17 @@ Accidental_engraver::initialize ()
 
 /*
 
-calculates the number of accidentals on basis of the current local key sig
-  (passed as argument)
+  calculates the number of accidentals on basis of the current local key
+  sig (passed as argument)
+
   Returns number of accidentals (0, 1 or 2).
-    Negative (-1 or -2) if accidental has changed.
+  Negative (-1 or -2) if accidental has changed.
 
 */
 static int
-number_accidentals_from_sig (SCM sig, Music *, Pitch *pitch, SCM curbarnum, SCM lazyness, 
-                   bool ignore_octave_b)
+number_accidentals_from_sig (bool *different,
+                            SCM sig, Pitch *pitch, SCM curbarnum, SCM lazyness, 
+                            bool ignore_octave)
 {
   int n = pitch->get_notename ();
   int o = pitch->get_octave();
@@ -120,7 +125,7 @@ number_accidentals_from_sig (SCM sig, Music *, Pitch *pitch, SCM curbarnum, SCM
   int accbarnum_i = 0;
 
   SCM prev;
-  if (ignore_octave_b)
+  if (ignore_octave)
     prev = ly_assoc_cdr (scm_int2num (n), sig);
   else
     prev = scm_assoc (gh_cons (scm_int2num (o), scm_int2num (n)), sig);
@@ -149,17 +154,19 @@ number_accidentals_from_sig (SCM sig, Music *, Pitch *pitch, SCM curbarnum, SCM
     num = 2;
   else
     num = 1;
-  
-  return a == p ? num : -num;
+
+  *different = (a != p);
+  return num;
 }
 
 static int
-number_accidentals (Music * note, Pitch *pitch, Context * origin, 
+number_accidentals (bool *different,
+                   Pitch *pitch, Context * origin, 
                    SCM accidentals, SCM curbarnum)
 {
   int number = 0;
 
-  bool diff = false;
+  *different = false;
   if (gh_pair_p (accidentals) && !gh_symbol_p (ly_car (accidentals)))
     warning (_f ("Accidental typesetting list must begin with context-name: %s", 
                 ly_scm2string (ly_car (accidentals)).to_str0 ()));
@@ -181,10 +188,11 @@ number_accidentals (Music * note, Pitch *pitch, Context * origin,
 
          if (same_octave_b || any_octave_b)
            {
+             bool d = false;
              int n = number_accidentals_from_sig
-               (localsig, note, pitch, curbarnum, lazyness, any_octave_b);
-             diff = diff || (n < 0);
-             number = max (number, abs (n));     
+               (&d, localsig, pitch, curbarnum, lazyness, any_octave_b);
+             *different = *different || d;
+             number = max (number, n);     
            }
          else
            warning (_f ("unknown accidental typesetting: %s. Ignored", 
@@ -208,7 +216,23 @@ number_accidentals (Music * note, Pitch *pitch, Context * origin,
                        ly_scm2string (rule).to_str0 ()));
     }
 
-  return diff ? -number : number;
+  return number;
+}
+
+SCM
+Accidental_engraver::get_bar_num ()
+{
+   SCM barnum = get_property ("currentBarNumber");
+      SCM smp = get_property("measurePosition");
+      
+      Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
+      if (mp.main_part_ < Rational (0)
+         && gh_number_p (barnum))
+       barnum = scm_int2num (gh_scm2int (barnum) - 1);
+      
+
+      return barnum ;
+  
 }
 
 void
@@ -219,10 +243,8 @@ Accidental_engraver::process_acknowledged_grobs ()
       //SCM localsig = get_property ("localKeySignature");
       SCM accidentals =  get_property ("autoAccidentals");
       SCM cautionaries =  get_property ("autoCautionaries");
-      SCM barnum = get_property ("currentBarNumber");
-      SCM smp = get_property("measurePosition");
-      Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
-      if(mp.main_part_<Rational(0) && gh_number_p(barnum)) barnum = scm_int2num(gh_scm2int(barnum)-1);
+      SCM barnum = get_bar_num ();
+      
       bool extra_natural_b = get_property ("extraNatural") == SCM_BOOL_T;
       for (int i = 0; i  < accidentals_.size (); i++) 
        {
@@ -236,23 +258,34 @@ Accidental_engraver::process_acknowledged_grobs ()
          Pitch * pitch = unsmob_pitch (note->get_mus_property ("pitch"));
          if (!pitch)
            continue;
+
+         bool different = false;
+         bool different_caut = false;
          
-         int num = number_accidentals (note, pitch, origin, accidentals, barnum);
-         int num_caut = number_accidentals (note, pitch, origin, cautionaries, barnum);
+         int num = number_accidentals (&different,
+                                       pitch, origin,
+                                       accidentals, barnum);
+         int num_caut = number_accidentals (&different_caut,
+                                            pitch, origin,
+                                            cautionaries, barnum);
+
          bool cautionary = to_boolean (note->get_mus_property ("cautionary"));
          
-         if (abs (num_caut) > abs (num))
+         if (num_caut > num)
            {
              num = num_caut;
+             different = different_caut;
              cautionary = true;
            }
 
-         if(num==0 && to_boolean (note->get_mus_property ("force-accidental")))
-            num=1;
+         if (num == 0 && to_boolean (note->get_mus_property ("force-accidental")))
+           num = 1;
          
-         bool different = num < 0;
-         num = abs (num);
 
+         /*
+           Can not look for ties: it's not guaranteed that they reach
+           us before the notes
+          */
          /* See if there's a tie that makes the accidental disappear */
          Grob *tie_break_reminder = 0;
          bool tie_changes = false;
@@ -321,80 +354,96 @@ Accidental_engraver::process_acknowledged_grobs ()
              for (int i = 0;  i < right_objects_.size ();  i++)
                Side_position_interface::add_support (a, right_objects_[i]);
            }
-         
-
-         /*
-           We should not record the accidental if it is the first
-           note and it is tied from the previous measure.
-
-           Checking whether it is tied also works mostly, but will it
-           always do the correct thing?
-         */
-         
-
-         int n = pitch->get_notename ();
-         int o = pitch->get_octave ();
-         int a = pitch->get_alteration ();
-         SCM on_s = gh_cons (scm_int2num (o), scm_int2num (n));
-
-         while (origin)
-           {
-             /*
-               huh? we set props all the way to the top? 
-              */
-             SCM localsig = origin->get_property ("localKeySignature");
-             bool change = false;
-             if (tie_changes)
-               {
-                 /*
-                   Remember an alteration that is different both from
-                   that of the tied note and of the key signature.
-                 */
-                 localsig = ly_assoc_front_x
-                   (localsig, on_s, gh_cons (SCM_BOOL_T, barnum));
-
-                 change = true;
-               }
-             else
-               {
-                 /*
-                   not really really correct if there are more than one
-                   noteheads with the same notename.
-                 */
-                 localsig = ly_assoc_front_x
-                   (localsig, on_s, gh_cons (scm_int2num (a), barnum));
-
-                 change = true;
-               }
-
-             if (change)
-               origin->set_property ("localKeySignature",  localsig);
-             origin = origin->daddy_context_;
-           }
        }
     }
 }
 
+
+
+
 void
 Accidental_engraver::finalize ()
 {
-  /*
-    Must reset, since Accidental_engraver is GCd.
-   */
   last_keysig_ = SCM_EOL;
 }
 
 void
 Accidental_engraver::stop_translation_timestep ()
 {
-  for (int i = 0; i < accidentals_.size(); i++)
+  for (int j  = ties_.size (); j --; )
+    {
+      Grob * r = Tie::head (ties_[j], RIGHT);
+      for (int i = accidentals_.size ();  i--;)
+       if (accidentals_[i].head_ == r)
+         {
+           if (Grob * g = accidentals_[i].accidental_)
+             {
+               g->set_grob_property ("tie", ties_[j]->self_scm ());
+               accidentals_[i].tied_   = true;
+             }
+           
+           ties_.del (j);
+           break;
+         }
+    }
+
+  for (int i = accidentals_.size (); i--;) 
     {
-      Grob *a = accidentals_[i].accidental_;
-      if (a)
+      SCM barnum = get_bar_num ();
+
+      Music * note = accidentals_[i].melodic_;
+      Context * origin = accidentals_[i].origin_;
+
+      Pitch * pitch = unsmob_pitch (note->get_mus_property ("pitch"));
+      if (!pitch)
+       continue;
+      
+      int n = pitch->get_notename ();
+      int o = pitch->get_octave ();
+      int a = pitch->get_alteration ();
+      SCM on_s = gh_cons (scm_int2num (o), scm_int2num (n));
+
+      while (origin)
        {
-         typeset_grob (a);
+         /*
+           huh? we set props all the way to the top? 
+         */
+         SCM localsig = origin->get_property ("localKeySignature");
+         bool change = false;
+         if (accidentals_[i].tied_)
+           {
+             /*
+               Remember an alteration that is different both from
+               that of the tied note and of the key signature.
+             */
+             localsig = ly_assoc_front_x
+               (localsig, on_s, gh_cons (SCM_BOOL_T, barnum));
+
+             change = true;
+           }
+         else
+           {
+             /*
+               not really really correct if there are more than one
+               noteheads with the same notename.
+             */
+             localsig = ly_assoc_front_x
+               (localsig, on_s, gh_cons (scm_int2num (a), barnum));
+
+             change = true;
+           }
+
+         if (change)
+           origin->set_property ("localKeySignature",  localsig);
+         origin = origin->daddy_context_;
        }
     }
+  
+  for (int i = 0; i < accidentals_.size(); i++)
+    {
+      if (Grob *a = accidentals_[i].accidental_)
+       typeset_grob (a);
+    }
 
   if (accidental_placement_)
     typeset_grob(accidental_placement_);
@@ -403,7 +452,6 @@ Accidental_engraver::stop_translation_timestep ()
   accidentals_.clear();
   left_objects_.clear ();
   right_objects_.clear ();
-  ties_.clear ();
 }
 
 void
@@ -426,7 +474,7 @@ Accidental_engraver::acknowledge_grob (Grob_info info)
     }
   else if (Tie::has_interface (info.grob_))
     {
-      ties_.push (info.grob_);
+      ties_.push (dynamic_cast<Spanner*> (info.grob_));
     }
   else if (Arpeggio::has_interface (info.grob_))
     {
index ffdfe43140abe8aa81fd5ffb5b891bae6954fd10..d7eb017a1734fe98dfcc3dec1aa8634be2884f02 100644 (file)
@@ -45,7 +45,7 @@ private:
   void begin_beam ();
   void end_beam ();
   void junk_beam ();
-  bool same_grace_state_b (Grob* e);
+  bool is_same_grace_state (Grob* e);
   void typeset_beam ();
 
   /*
index f5bc52ced39a97776a28c63d2e5aa26c534e3684..65c05ad1f9378cfd563074b1709106a2cb5b2efb 100644 (file)
@@ -26,7 +26,7 @@ Axis_group_interface::add_element (Grob*me,Grob *e)
 }
 
 bool
-Axis_group_interface::axis_b (Grob*me,Axis a)
+Axis_group_interface::has_axis (Grob*me,Axis a)
 {
   /*
     urg. FIXME, check for Hara_kiri_group_spanner shouldn't be necessary?
index 9f69b5ec986b86dfa880684c77e121b77f87a137..1eceb65b8a785eb9125f988948964f2e32f84f4b 100644 (file)
@@ -29,7 +29,7 @@ String
 Binary_source_file::error_string (char const* pos_str0) const
 {
   assert (this);
-  if (!in_b (pos_str0))
+  if (!contains (pos_str0))
     return "";
 
   char const* begin_str0 = pos_str0 - 8 >? to_str0 ();
@@ -54,7 +54,7 @@ Binary_source_file::error_string (char const* pos_str0) const
 int
 Binary_source_file::get_line (char const* pos_str0) const
 {
-  if (!in_b (pos_str0))
+  if (!contains (pos_str0))
     return 0;
 
   return pos_str0 - to_str0 ();
index 61239d372e7dda4b14c14eed42c09c55a09a43b0..26ab66e14dc65e24e2980664597453581b02f6cc 100644 (file)
@@ -22,7 +22,7 @@ struct Axis_group_interface
 
   static void add_element (Grob* me, Grob*);
   static void set_axes (Grob*,Axis,Axis);
-  static bool axis_b (Grob*,Axis);
+  static bool has_axis (Grob*,Axis);
   static Link_array<Grob> get_children (Grob*);
   static bool has_interface (Grob*);
   
index f5d47300d51bc8d1d4835eddc11687b9391a4eee..f01bf92bdfd84dd0e4a410be1ca665a048c6604a 100644 (file)
@@ -90,8 +90,6 @@ public:
     */
   void add_dependency (Grob*);    
   virtual System * get_system () const;
-  bool linked_b () const;
-
 
   VIRTUAL_COPY_CONS (Grob);
  
index a7653902e64dbfdeba37c03f4f7ae724f360f0fd..6f012b35491253a758b30cec06c07333a5a3c28b 100644 (file)
@@ -64,10 +64,10 @@ public:
   void pop_state ();
   void LexerError (char const *);
   void set_identifier (SCM name_string, SCM);
-  bool note_state_b () const;
-  bool chord_state_b () const;
-  bool lyric_state_b () const;
-  bool figure_state_b () const;
+  bool is_note_state () const;
+  bool is_chord_state () const;
+  bool is_lyric_state () const;
+  bool is_figure_state () const;
 private:
   int lookup_keyword (String);
   int scan_bare_word (String);
index 6c2a16f5d823d027233cfc9cbff276528d80ecb1..48e8dd2e34b87f1caa6e35bbe8b94ef9251a3dd0 100644 (file)
@@ -25,7 +25,7 @@ struct Spring_description
   Real length (Real force) const;
   Spring_description ();
 
-  bool sane_b () const;
+  bool is_sane () const;
 };
 
 struct Simple_spacer
index 18363da1d8f91978128d8fcfbf0d6323890297b6..d1aa173c1512426c33f5b0232c77c164f1ca880d 100644 (file)
@@ -29,7 +29,7 @@ public:
   char const* to_str0 () const;
   virtual String error_string (char const* pos_str0 ) const;
   std::istream * get_istream ();
-  bool in_b (char const* pos_str0 ) const;
+  bool contains (char const* pos_str0 ) const;
   int length () const;
   virtual int get_line (char const* pos_str0 ) const;
   String name_string () const;
index df209eb5fe4e27bcd004834b66fbc17199461a45..8f1506a78e1f0b787c2fde25bbeb5908e0962efc 100644 (file)
@@ -26,8 +26,6 @@ public:
   void post_processing (bool);
 
   System (SCM);
-  /// is #c# contained in #*this#?
-  bool contains_b (Paper_column const *c) const;
   int element_count () const;
   int spanner_count () const;
 
index 5b2ab6b198e0b77b0db10a6f78caafaab666fb7b..bbecea499a335904091a87621a930a472a81d82c 100644 (file)
@@ -105,7 +105,7 @@ Instrument_name_engraver::acknowledge_grob (Grob_info i)
   */
   if (dynamic_cast<Spanner*> (i.grob_)
       && ((Axis_group_interface::has_interface (i.grob_)
-          && Axis_group_interface::axis_b (i.grob_, Y_AXIS)))
+          && Axis_group_interface::has_axis (i.grob_, Y_AXIS)))
       && !Align_interface::has_interface (i.grob_))
     {
       SCM nl = gh_cons (i.grob_->self_scm (),
index 7c622accd2600b1f6e8e0a59d7dbabacec79249b..376bd81fd979caee854cc2564ecf35bd87768f95 100644 (file)
@@ -63,7 +63,7 @@ SCM
 lookup_markup_command (String s);
 
 bool
-valid_version_b (String s);
+is_valid_version (String s);
 
 
 
@@ -171,7 +171,7 @@ HYPHEN              --
        s = s.left_string (s.index_last ('\"'));
 
        yy_pop_state();
-        if (!valid_version_b (s))
+        if (!is_valid_version (s))
                return INVALID;
 }
 <renameinput>\"[^"]*\"     { /* got the version number */
@@ -706,25 +706,25 @@ My_lily_lexer::scan_bare_word (String str)
 }
 
 bool
-My_lily_lexer::note_state_b () const
+My_lily_lexer::is_note_state () const
 {
        return YY_START == notes;
 }
 
 bool
-My_lily_lexer::chord_state_b () const
+My_lily_lexer::is_chord_state () const
 {
        return YY_START == chords;
 }
 
 bool
-My_lily_lexer::lyric_state_b () const
+My_lily_lexer::is_lyric_state () const
 {
        return YY_START == lyrics;
 }
 
 bool
-My_lily_lexer::figure_state_b () const
+My_lily_lexer::is_figure_state () const
 {
        return YY_START == figures;
 }
@@ -762,7 +762,7 @@ Lilypond_version oldest_version ("1.9.0");
 
 
 bool
-valid_version_b (String s)
+is_valid_version (String s)
 {
   Lilypond_version current ( MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL );
   Lilypond_version ver (s);
index e3fbfbcf70889278e9cb6092a2ab3b4062c2b0f3..595000254821e82ffa3755f934cfb392eef5486d 100644 (file)
@@ -141,7 +141,7 @@ Note_spacing::get_spacing (Grob *me, Item* right_col,
   *space = (base_space - increment) + *fixed ;
 
   if (!extents[RIGHT].is_empty ()
-      && (Item::breakable_b (right_col)
+      && (Item::is_breakable (right_col)
          || right_col->original_))
     {
       /*
index 9de3eda80e405dfc05968d5176c10e617f79893d..6ca95c712ec885bf1f9441ddb7f23c2d186e7288 100644 (file)
@@ -99,7 +99,7 @@ Paper_column::is_musical (Grob *me)
 bool
 Paper_column::is_used (Grob*me)
 {
-  return gh_pair_p (me->get_grob_property ("elements")) ||  Item::breakable_b (me)
+  return gh_pair_p (me->get_grob_property ("elements")) ||  Item::is_breakable (me)
     || gh_pair_p (me->get_grob_property ("bounded-by-me"))
     ;
 }
index 99d5e8feb4dcce8f49771cbe52e0bbfdd004c16c..358895ea78ddebba454a2f6ccb824efa6758cfe1 100644 (file)
@@ -118,7 +118,7 @@ tag_music (Music*m,  SCM tag, Input ip)
 
 
 bool
-regular_identifier_b (SCM id)
+is_regular_identifier (SCM id)
 {
   String str = ly_scm2string (id);
   char const *s = str.to_str0 () ;
@@ -144,7 +144,7 @@ make_simple_markup (SCM a)
 
 
 bool
-is_duration_b (int t)
+is_is_duration (int t)
 {
   return t && t == 1 << intlog2 (t);
 }
@@ -503,7 +503,7 @@ assignment:
        */
                Input ip = THIS->pop_spot ();
 
-               if (! regular_identifier_b ($1))
+               if (! is_regular_identifier ($1))
                {
                        ip.warning (_ ("Identifier should have alphabetic characters only"));
                }
@@ -1494,12 +1494,12 @@ post_event:
                $$ = $1;
        }
        | HYPHEN {
-               if (!THIS->lexer_->lyric_state_b ())
+               if (!THIS->lexer_->is_lyric_state ())
                        THIS->parser_error (_ ("Have to be in Lyric mode for lyrics"));
                $$ = MY_MAKE_MUSIC("HyphenEvent");
        }
        | EXTENDER {
-               if (!THIS->lexer_->lyric_state_b ())
+               if (!THIS->lexer_->is_lyric_state ())
                        THIS->parser_error (_ ("Have to be in Lyric mode for lyrics"));
                $$ = MY_MAKE_MUSIC("ExtenderEvent");
        }
@@ -1791,7 +1791,7 @@ optional_notemode_duration:
 steno_duration:
        bare_unsigned dots              {
                int l = 0;
-               if (!is_duration_b ($1))
+               if (!is_is_duration ($1))
                        THIS->parser_error (_f ("not a duration: %d", $1));
                else
                        l =  intlog2 ($1);
@@ -1846,7 +1846,7 @@ tremolo_type:
                $$ =0;
        }
        | ':' bare_unsigned {
-               if (!is_duration_b ($2))
+               if (!is_is_duration ($2))
                        THIS->parser_error (_f ("not a duration: %d", $2));
                $$ = $2;
        }
@@ -1942,7 +1942,7 @@ simple_element:
        pitch exclamations questions oct_check optional_notemode_duration optional_rest {
 
                Input i = THIS->pop_spot ();
-               if (!THIS->lexer_->note_state_b ())
+               if (!THIS->lexer_->is_note_state ())
                        THIS->parser_error (_ ("Have to be in Note mode for notes"));
 
                Music *n = 0;
@@ -2035,7 +2035,7 @@ simple_element:
        
        | lyric_element optional_notemode_duration      {
                Input i = THIS->pop_spot ();
-               if (!THIS->lexer_->lyric_state_b ())
+               if (!THIS->lexer_->is_lyric_state ())
                        THIS->parser_error (_ ("Have to be in Lyric mode for lyrics"));
 
                Music * lreq = MY_MAKE_MUSIC("LyricEvent");
@@ -2050,7 +2050,7 @@ simple_element:
        | new_chord {
                THIS->pop_spot ();
 
-                if (!THIS->lexer_->chord_state_b ())
+                if (!THIS->lexer_->is_chord_state ())
                         THIS->parser_error (_ ("Have to be in Chord mode for chords"));
                 $$ = unsmob_music ($1);
        }
index 80e41b5b9b3989ec3cd1bd5d1fd9e2cbffb560bf..45a2d4d6b01715d6d365270c0cf8fce3bd842f6b 100644 (file)
@@ -51,7 +51,7 @@ Script_column_engraver::acknowledge_grob (Grob_info inf)
   Item *thing = dynamic_cast<Item*> (inf.grob_);
   if (thing && Side_position_interface::has_interface (inf.grob_)) // ugh FIXME
     {
-      if (!Item::breakable_b (thing)
+      if (!Item::is_breakable (thing)
          && Side_position_interface::get_axis (inf.grob_) == Y_AXIS)
        {
          scripts_.push (thing);
index 5f9722190030800f685774d77148b455a4f95961..9f24a4d8234fc58adb11bbd0c438b1656f8d9b7f 100644 (file)
@@ -129,7 +129,7 @@ Separating_line_group_engraver::acknowledge_grob (Grob_info i)
       return ;
     }
   
-  bool ib =Item::breakable_b (it);
+  bool ib =Item::is_breakable (it);
   Item *&p_ref_ (ib ? break_item_
                 : musical_item_);
 
index ff044d676ef7aa04a263681ca2a4757e33fdb5d9..972da55278109175c505388122d853608b56c261 100644 (file)
@@ -254,7 +254,7 @@ Simple_spacer::add_columns (Link_array<Grob> const &icols)
          continue;
        }
 
-      if (!desc.sane_b ())
+      if (!desc.is_sane ())
        {
          programming_error ("Insane spring found. Setting to unit spring.");
 
@@ -395,7 +395,7 @@ Spring_description::Spring_description ()
 
 
 bool
-Spring_description::sane_b () const
+Spring_description::is_sane () const
 {
   return (hooke_ > 0) &&  !isinf (ideal_) && !isnan (ideal_);
 }
index 0ef67667b5bb44c2b2a73d63c18fee7754516862..f4e1ddcfd4ea7669fdb75cfbc39626fe99d26ae3 100644 (file)
@@ -166,7 +166,7 @@ Source_file::~Source_file ()
 Slice
 Source_file::line_slice (char const* pos_str0) const
 {
-  if (!in_b (pos_str0))
+  if (!contains (pos_str0))
     return Slice (0,0);
 
   char const* data_str0 = to_str0 ();
@@ -196,7 +196,7 @@ Source_file::line_slice (char const* pos_str0) const
 String
 Source_file::line_string (char const* pos_str0) const
 {
-  if (!in_b (pos_str0))
+  if (!contains (pos_str0))
     return "";
 
   Slice line = line_slice (pos_str0);
@@ -207,7 +207,7 @@ Source_file::line_string (char const* pos_str0) const
 int
 Source_file::get_char (char const* pos_str0) const
 {
-  if (!in_b (pos_str0))
+  if (!contains (pos_str0))
     return 0;
 
   char const* data_str0 = to_str0 ();
@@ -217,7 +217,7 @@ Source_file::get_char (char const* pos_str0) const
 int
 Source_file::get_column (char const* pos_str0) const
 {
-  if (!in_b (pos_str0))
+  if (!contains (pos_str0))
     return 0;
 
   int ch_i = get_char (pos_str0);
@@ -236,7 +236,7 @@ Source_file::get_column (char const* pos_str0) const
 String
 Source_file::error_string (char const* pos_str0) const
 {
-  if (!in_b (pos_str0))
+  if (!contains (pos_str0))
     return " (" + _ ("position unknown") + ")";
 
   int ch_i = get_char (pos_str0);
@@ -250,7 +250,7 @@ Source_file::error_string (char const* pos_str0) const
 }
 
 bool
-Source_file::in_b (char const* pos_str0) const
+Source_file::contains (char const* pos_str0) const
 {
   return (pos_str0 && (pos_str0 >= to_str0 ()) && (pos_str0 <= to_str0 () + length ()));
 }
@@ -258,7 +258,7 @@ Source_file::in_b (char const* pos_str0) const
 int
 Source_file::get_line (char const* pos_str0) const
 {
-  if (!in_b (pos_str0))
+  if (!contains (pos_str0))
     return 0;
 
   if (!newline_locations_.size())
@@ -298,7 +298,7 @@ Source_file::to_str0 () const
 void
 Source_file::set_pos (char const * pos_str0)
 {
-  if (in_b (pos_str0))
+  if (contains (pos_str0))
     pos_str0_ = pos_str0;
   else
     error (error_string (pos_str0) + "invalid pos");
@@ -310,7 +310,7 @@ Source_file::seek_str0 (int n)
   char const* new_str0 = to_str0 () + n;
   if (n < 0)
     new_str0 += length ();
-  if (in_b (new_str0))
+  if (contains (new_str0))
     pos_str0_ = new_str0;
   else
     error (error_string (new_str0) + "seek past eof");
@@ -323,7 +323,7 @@ Source_file::forward_str0 (int n)
 {
   char const* old_pos = pos_str0_;
   char const* new_str0 = pos_str0_ + n;
-  if (in_b (new_str0))
+  if (contains (new_str0))
     pos_str0_ = new_str0;
   else
     error (error_string (new_str0)  + "forward past eof");
index 1ba43781964eb1368f20f32ce5b0242c66d26023..da6ce5339dda71239529d30c8d31d7e3b11ef788 100644 (file)
@@ -78,7 +78,7 @@ Sources::get_sourcefile (char const* str0)
 {
 
   for (Cons<Source_file> *i = sourcefile_list_; i; i = i->next_)
-    if (i->car_->in_b (str0))  
+    if (i->car_->contains (str0))      
       return i->car_;
   return 0;
 }
index 4399fc5051c13a920fe46c14c72d4307d6a04412..eb83b6097b5529993b266291b58c4fdbe9ad83cc 100644 (file)
@@ -121,8 +121,8 @@ loose_column (Grob *l, Grob *c, Grob *r)
     some cases (two isolated, consecutive clef changes) won't be
     nicely folded, but hey, then don't do that.
   */
-  if(!  ((Paper_column::is_musical (l_neighbor) || Item::breakable_b (l_neighbor))
-        && (Paper_column::is_musical (r_neighbor) || Item::breakable_b (r_neighbor))) )
+  if(!  ((Paper_column::is_musical (l_neighbor) || Item::is_breakable (l_neighbor))
+        && (Paper_column::is_musical (r_neighbor) || Item::is_breakable (r_neighbor))) )
     {
       return false;
     }
@@ -167,7 +167,7 @@ Spacing_spanner::prune_loose_columns (Grob*me,Link_array<Grob> *cols, Rational s
   Real increment = robust_scm2double (me->get_grob_property ("spacing-increment"), 1.2);
   for (int i=0; i < cols->size ();  i++)
     {
-      if (Item::breakable_b (cols->elem(i)) || Paper_column::is_musical (cols->elem (i)))
+      if (Item::is_breakable (cols->elem(i)) || Paper_column::is_musical (cols->elem (i)))
        {
          newcols.push (cols->elem(i));
          continue;
@@ -339,7 +339,7 @@ Spacing_spanner::set_implicit_neighbor_columns (Link_array<Grob> cols)
   for (int i = 0; i < cols.size (); i++)
     {
       Item * it = dynamic_cast<Item*>(cols[i]);
-      if (!Item::breakable_b (it) && !Paper_column::is_musical (it))
+      if (!Item::is_breakable (it) && !Paper_column::is_musical (it))
        continue;
 
       // it->breakable || it->musical
@@ -394,7 +394,7 @@ Spacing_spanner::set_springs (SCM smob)
   for (int i = 1; i < all.size (); i++)
     {
       Grob *sc = all[i];
-      if (Item::breakable_b (sc))
+      if (Item::is_breakable (sc))
         {
          Link_array<Grob> measure (all.slice (j, i+1));          
           do_measure (global_shortest, me, &measure);
@@ -446,7 +446,7 @@ Spacing_spanner::find_shortest (Grob *me, Link_array<Grob> const &cols)
          shortest_in_measure = shortest_in_measure <? this_shortest.main_part_;
        }
       else if (!shortest_in_measure.is_infinity ()
-              && Item::breakable_b (cols[i]))
+              && Item::is_breakable (cols[i]))
        {
          int j = 0;
          for (; j < durations.size(); j++)
@@ -688,7 +688,7 @@ Spacing_spanner::standard_breakable_column_spacing (Grob * me, Item*l, Item*r,
   while (flip (&d) != LEFT);
   
 
-  if (l->breakable_b (l) && r->breakable_b(r))
+  if (l->is_breakable (l) && r->is_breakable (r))
     {
       Moment *dt = unsmob_moment (l->get_grob_property ("measure-length"));
       Moment mlen (1);
index d5341c4c55cc98acc1bfe1aa22838b008b2fe24c..dfa24281a069a24d94857a5b22fe9b170f7126da 100644 (file)
@@ -37,7 +37,7 @@ Spanner::do_break_processing ()
     {
       if (Spanner* parent = dynamic_cast<Spanner*> (get_parent ((Axis)a)))
        {
-         if (!parent->spanned_rank_iv ().contains_b (this->spanned_rank_iv ()))
+         if (!parent->spanned_rank_iv ().superset (this->spanned_rank_iv ()))
            {
              programming_error (to_string ("Spanner `%s' is not fully contained in parent spanner `%s'.",
                                         name ().to_str0 (),
index aaad06c87010a63ef564b166f8f48973e051e4b8..b6d7c70d04d57365008317f1e69207507ff5b7d8 100644 (file)
@@ -131,7 +131,7 @@ System::output_lines ()
            Kill no longer needed grobs. 
           */
          Item * it = dynamic_cast<Item*> (g);
-         if (it && Item::breakable_b(it))
+         if (it && Item::is_breakable (it))
            {
              it->find_prebroken_piece (LEFT)->suicide();
              it->find_prebroken_piece (RIGHT)->suicide();
@@ -570,7 +570,7 @@ System::broken_col_range (Item const*l, Item const*r) const
   while (gh_pair_p (s) && ly_car (s) != l->self_scm ())
     {
       Paper_column*c = dynamic_cast<Paper_column*> (unsmob_grob (ly_car (s)));
-      if (Item::breakable_b (c) && !c->system_)
+      if (Item::is_breakable (c) && !c->system_)
        ret.push (c);
 
       s = ly_cdr (s);
@@ -592,7 +592,7 @@ System::columns ()const
   bool bfound = false;
   for (int i= acs.size (); i -- ;)
     {
-      bool brb = Item::breakable_b (acs[i]);
+      bool brb = Item::is_breakable (acs[i]);
       bfound = bfound || brb;
 
       /*
index 97681de90a14135cd44b53351619a1e60583d2d6..f4d24c71f0e68aae3005f24eb32e815d2cad10db 100644 (file)
@@ -58,7 +58,7 @@ Vertical_align_engraver::qualifies (Grob_info i) const
   int sz = i.origin_contexts ((Translator*)this).size ()  ;
 
   return sz > 0 && Axis_group_interface::has_interface (i.grob_)
-    && !i.grob_->get_parent (Y_AXIS) && Axis_group_interface::axis_b (i.grob_, Y_AXIS);
+    && !i.grob_->get_parent (Y_AXIS) && Axis_group_interface::has_axis (i.grob_, Y_AXIS);
 }
 
 void