]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/chord-name-engraver.cc
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / chord-name-engraver.cc
index 73b3251b8fb137a9406ed226d84599c63f61600b..963c3033f22e67ecaf6b0a0c46ca73dd45cc2d63 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1998--2005 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 1998--2006 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "engraver.hh"
 #include "protected-scm.hh"
 #include "context.hh"
 #include "warn.hh"
+#include "pitch.hh"
 
 class Chord_name_engraver : public Engraver
 {
   TRANSLATOR_DECLARATIONS (Chord_name_engraver);
 protected:
-  virtual void stop_translation_timestep ();
-  virtual void process_music ();
+  void stop_translation_timestep ();
+  void process_music ();
   virtual bool try_music (Music *);
   virtual void finalize ();
   virtual void derived_mark () const;
@@ -30,7 +31,7 @@ private:
   void add_note (Music *);
 
   Item *chord_name_;
-  Link_array<Music> notes_;
+  vector<Music*> notes_;
 
   SCM last_chord_;
 };
@@ -55,7 +56,7 @@ Chord_name_engraver::Chord_name_engraver ()
 void
 Chord_name_engraver::add_note (Music *n)
 {
-  notes_.push (n);
+  notes_.push_back (n);
 }
 
 void
@@ -69,7 +70,7 @@ Chord_name_engraver::process_music ()
   SCM pitches = SCM_EOL;
 
   Music *inversion_event = 0;
-  for (int i = 0; i < notes_.size (); i++)
+  for (vsize i = 0; i < notes_.size (); i++)
     {
       Music *n = notes_[i];
       SCM p = n->get_property ("pitch");
@@ -99,7 +100,7 @@ Chord_name_engraver::process_music ()
          pitches = scm_cons (orig.smobbed_copy (), pitches);
        }
       else
-       programming_error ("Inversion does not have original pitch.");
+       programming_error ("inversion does not have original pitch");
     }
 
   pitches = scm_sort_list (pitches, Pitch::less_p_proc);
@@ -118,7 +119,7 @@ Chord_name_engraver::process_music ()
 
   SCM s = get_property ("chordChanges");
   if (to_boolean (s) && scm_is_pair (last_chord_)
-      && ly_c_equal_p (chord_as_scm, last_chord_))
+      && ly_is_equal (chord_as_scm, last_chord_))
     chord_name_->set_property ("begin-of-line-visible", SCM_BOOL_T);
 
   last_chord_ = chord_as_scm;
@@ -149,12 +150,13 @@ Chord_name_engraver::stop_translation_timestep ()
   The READs description is not strictly accurate:
   which properties are read depend on the chord naming function active.
 */
+#include "translator.icc"
+
 ADD_TRANSLATOR (Chord_name_engraver,
-               /* descr */ "Catch note-events "
+               /* doc */ "Catch note-events "
                "and generate the appropriate chordname.",
-               /* creats*/ "ChordName",
-               /* accepts */ "note-event",
-               /* acks  */ "",
-               /* reads */ "chordChanges chordNameExceptions chordNameFunction "
+               /* create */ "ChordName",
+               /* accept */ "note-event",
+               /* read */ "chordChanges chordNameExceptions chordNameFunction "
                "chordNoteNamer chordRootNamer chordNameExceptions majorSevenSymbol",
                /* write */ "");