]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/quote-iterator.cc
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / quote-iterator.cc
index 44266a6bc469b703f2b206fd13e4d00547e20030..9ca8fd25b7ed4dacf22b551e35bf838350894f91 100644 (file)
@@ -3,14 +3,17 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2004--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
+#include "music-wrapper-iterator.hh"
+
 #include "context.hh"
-#include "event.hh"
-#include "music-sequence.hh"
+#include "input.hh"
+#include "international.hh"
 #include "lily-guile.hh"
-#include "music-wrapper-iterator.hh"
+#include "music-sequence.hh"
+#include "music.hh"
 #include "warn.hh"
 
 class Quote_iterator : public Music_wrapper_iterator
@@ -18,14 +21,14 @@ class Quote_iterator : public Music_wrapper_iterator
 public:
   Quote_iterator ();
   Moment vector_moment (int idx) const;
-  Interpretation_context_handle quote_outlet_;
+  Context_handle quote_outlet_;
 
   Moment start_moment_;
   Moment stop_moment_;
   SCM event_vector_;
   int event_idx_;
   int end_idx_;
-
+  
   SCM transposed_musics_;
 
   DECLARE_SCHEME_CALLBACK (constructor, ());
@@ -104,7 +107,7 @@ void
 Quote_iterator::construct_children ()
 {
   Music_wrapper_iterator::construct_children ();
-
+      
   SCM name = get_music ()->get_property ("quoted-context-type");
   SCM id = get_music ()->get_property ("quoted-context-id");
 
@@ -116,9 +119,7 @@ Quote_iterator::construct_children ()
       quote_outlet_.set_context (cue_context);
     }
   else
-    {
-      quote_outlet_.set_context (get_outlet ());
-    }
+    quote_outlet_.set_context (get_outlet ());
 
   event_vector_ = get_music ()->get_property ("quoted-events");
 
@@ -159,14 +160,14 @@ Quote_iterator::pending_moment () const
   Moment m (infty);
 
   if (Music_wrapper_iterator::ok ())
-    m = m <? Music_wrapper_iterator::pending_moment ();
+    m = min (m, Music_wrapper_iterator::pending_moment ());
 
   /*
     In case event_idx_ < 0, we're not initted yet, and the wrapped
     music expression determines the starting moment.
   */
   if (quote_ok ())
-    m = m <? vector_moment (event_idx_) - start_moment_;
+    m = min (m, vector_moment (event_idx_) - start_moment_);
 
   return m;
 }
@@ -221,7 +222,9 @@ Quote_iterator::process (Moment m)
       /*
        The pitch that sounds like central C
       */
-      Pitch *me_pitch = unsmob_pitch (get_outlet ()->get_property ("instrumentTransposition"));
+      Pitch *me_pitch = unsmob_pitch (get_music ()->get_property ("quoted-transposition"));
+      if (!me_pitch)
+       me_pitch = unsmob_pitch (get_outlet ()->get_property ("instrumentTransposition"));
 
       for (SCM s = scm_cdr (entry); scm_is_pair (s); s = scm_cdr (s))
        {
@@ -249,10 +252,7 @@ Quote_iterator::process (Moment m)
                  mus->transpose (diff);
                }
 
-             bool b = quote_outlet_.get_outlet ()->try_music (mus);
-             if (!b)
-               mus->origin ()->warning (_f ("in quotation: junking event %s",
-                                            mus->name ()));
+             quote_outlet_.get_outlet ()->try_music (mus);
            }
        }