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
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, ());
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");
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");
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;
}
/*
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))
{
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);
}
}