]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/ambitus-engraver.cc
2003 -> 2004
[lilypond.git] / lily / ambitus-engraver.cc
index d0086505d1fc2abf281f4f7a90e88c36ef7df32e..e5f952e9a68ee5328d3a013fb06e6f01331b1a6b 100644 (file)
@@ -3,14 +3,14 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (C) 2002 Juergen Reuter <reuter@ipd.uka.de>
+  (c) 2002--2004 Juergen Reuter <reuter@ipd.uka.de>
 */
 
 #include "engraver.hh"
 #include "item.hh"
 #include "note-head.hh"
 #include "staff-symbol-referencer.hh"
-#include "musical-request.hh"
+#include "event.hh"
 #include "pitch.hh"
 
 /*
  *
  * - If a piece consists of several loosely coupled sections, should
  * there be multiple ambitus grobs allowed, one for each section?
- * Then there probably should be some "\ambitus" request added to
+ * Then there probably should be some "\ambitus" event added to
  * mudela, stating where an ambitus grob should be placed.  This
  * ambitus grob should then represent the ambitus in the range of time
- * between this "\ambitus" request and the next one (or the end of the
- * piece, if there is no more such request).  To be compliant with the
+ * between this "\ambitus" event and the next one (or the end of the
+ * piece, if there is no more such event).  To be compliant with the
  * current implementation, we might implicitly assume an "\ambitus"
- * request at the beginning of the piece, but then the question where
+ * event at the beginning of the piece, but then the question where
  * to put this first ambitus grob (before/after the clef?) becomes
  * even more urgent.
  *
@@ -85,8 +85,8 @@ Ambitus_engraver::Ambitus_engraver ()
    * (pitch_min > pitch_max) means that pitches are not yet
    * initialized
    */
-  pitch_min = Pitch (0, 0, +1);
-  pitch_max = Pitch (0, 0, -1);
+  pitch_min = Pitch (0, 0, SHARP);
+  pitch_max = Pitch (0, 0, FLAT);
 }
 
 void
@@ -136,8 +136,8 @@ Ambitus_engraver::acknowledge_grob (Grob_info info)
     {
       if (Note_head::has_interface (info.grob_))
        {
-         Note_req *nr = dynamic_cast<Note_req*> (info.music_cause ());
-         if (nr)
+         Music *nr = info.music_cause ();
+         if (nr && nr->is_mus_type ("note-event"))
            {
              Pitch pitch = *unsmob_pitch (nr->get_mus_property ("pitch"));
              if (Pitch::compare (pitch_min, pitch_max) > 0) // already init'd?
@@ -162,8 +162,8 @@ Ambitus_engraver::acknowledge_grob (Grob_info info)
 void
 Ambitus_engraver::create_ambitus ()
 {
-  SCM basicProperties = get_property ("Ambitus");
-  ambitus_ = new Item (basicProperties); is_typeset = 0;
+  ambitus_ = make_item ("Ambitus");
+  is_typeset = 0;              // UGH.
   announce_grob (ambitus_, SCM_EOL);
 }
 
@@ -186,9 +186,6 @@ Ambitus_engraver::finalize ()
           * most probably arises from an empty voice, such as shared
           * global timesig/clef definitions.
           */
-#if 0
-         ambitus_->warning("empty ambitus range [ignored]");
-#endif
          ambitus_->suicide();
        }
     }
@@ -197,7 +194,7 @@ Ambitus_engraver::finalize ()
 ENTER_DESCRIPTION(Ambitus_engraver,
 /* descr */       "",
 /* creats*/       "Ambitus",
-/* accepts */ "general-music",
+/* accepts */ "",
 /* acks  */     "note-head-interface",
 /* reads */       "",
 /* write */       "");