]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/request-iterator.cc
release: 1.3.73
[lilypond.git] / lily / request-iterator.cc
index 410a38d37cd7cbfb870c60f5395e6154484b7e06..51c7604281988204c346c1a4f3a40354796abeea 100644 (file)
@@ -1,83 +1,25 @@
-/*
-  request-iterator.cc -- implement Request_chord_iterator
-
+/*   
+  request-iterator.cc --  implement Simple_music_iterator
+  
   source file of the GNU LilyPond music typesetter
-
-  (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "translator-group.hh"
-#include "debug.hh"
+  
+  (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
 #include "request-iterator.hh"
-#include "music-list.hh"
-#include "request.hh"
-
-
-
-void
-Request_chord_iterator::construct_children()
-{
-  elt_duration_ =elt_l ()->duration ();
-  get_req_translator_l();
-}
-
-Request_chord*
-Request_chord_iterator::elt_l () const
-{
-  return (Request_chord*) music_l_;
-}
-
-Request_chord_iterator::Request_chord_iterator ()
-{
-  last_b_ = false;
-}
-
-
-bool
-Request_chord_iterator::ok() const
-{
-  return (elt_duration_ && !last_b_) || first_b_;
-}
-
-
-
-Moment
-Request_chord_iterator::next_moment() const
-{
-  Moment m (0);
-  if  (!first_b_)
-    m = elt_duration_;
-  return m;
-}
+#include "music.hh"
+#include "input.hh"
 
 void
-Request_chord_iterator::do_print() const
-{
-#ifndef NPRINT
-  DOUT << "duration: " << elt_duration_;
-#endif
-}
-
-void
-Request_chord_iterator::do_process_and_next (Moment mom)
+Simple_music_iterator::do_process_and_next (Moment m)
 {
   if (first_b_)
     {
-      for (PCursor<Music*> i (elt_l ()->music_p_list_p_->top ()); i.ok(); i++)
-       {
-         if (Request * req_l = dynamic_cast<Request*> (i.ptr()))
-           {
-             bool gotcha = report_to_l()->try_music (req_l);
-             if (!gotcha)
-               req_l->warning (_f ("junking request: `%s\'", classname( req_l)));
-           }
-         else
-           i.ptr ()->warning (_f ("Huh? Not a Request: `%s\'",
-                                  classname (i.ptr())));
-       }
+      bool g= try_music (music_l_);
+      if (!g)
+       music_l_->origin ()->warning (_f ("Junking music: `%s'", classname(music_l_)));
+
       first_b_ = false;
     }
-
-  if (mom >= elt_duration_)
-    last_b_ = true;
+  Music_iterator::do_process_and_next (m);
 }