]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/tuplet-engraver.cc
move from abe.ly
[lilypond.git] / lily / tuplet-engraver.cc
index 2f4b38ffd4be0b995a32c13063b954512ab086be..4c67c67f112f8143534c0c4f1979bdb5dc4a8a9a 100644 (file)
@@ -3,12 +3,12 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1998--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
 
-#include "command-request.hh"
+
 #include "tuplet-bracket.hh"
 #include "note-column.hh"
 #include "time-scaled-music.hh"
@@ -23,7 +23,7 @@ public:
   TRANSLATOR_DECLARATIONS(Tuplet_engraver);
 
 protected:
-  Link_array<Time_scaled_music> time_scaled_musics_;
+  Link_array<Music> time_scaled_musics_;
   /// when does the scaled music stop? Array order is synced with time_scaled_musics_
   Array<Rational> stop_moments_;
   /// when does the current spanner stop? Array order is synced with time_scaled_musics_
@@ -40,15 +40,15 @@ protected:
 };
 
 bool
-Tuplet_engraver::try_music (Music *r)
+Tuplet_engraver::try_music (Music *c)
 {
-  if (Time_scaled_music * c = dynamic_cast<Time_scaled_music *> (r))
+  if (c->is_mus_type ("time-scaled-music"))
     {
-      Music *el = c->element ();
-      if (!dynamic_cast<Request_chord*> (el))
+      Music *el = unsmob_music (c->get_mus_property ("element"));
+      if (el && !el->is_mus_type ("event-chord"))
        {
          time_scaled_musics_.push (c);
-         Rational m = now_mom ().main_part_ + c->length_mom ().main_part_;
+         Rational m = now_mom ().main_part_ + c->get_length ().main_part_;
          stop_moments_.push (m);
 
          SCM s = get_property ("tupletSpannerDuration");
@@ -155,6 +155,7 @@ Tuplet_engraver::Tuplet_engraver(){}
 ENTER_DESCRIPTION(Tuplet_engraver,
 /* descr */       "Catch Time_scaled_music and generate appropriate bracket  ",
 /* creats*/       "TupletBracket",
-/* acks  */       "note-column-interface",
+/* accepts */     "time-scaled-music",
+/* acks  */      "note-column-interface",
 /* reads */       "tupletNumberFormatFunction tupletSpannerDuration tupletInvisible",
 /* write */       "");