#include "music-iterator.hh"
#include "music.hh"
+using std::string;
+
/*
This iterator is hairy. It tracks both lyric and melody contexts,
and has a complicated communication route, reading/writing
if ((e->in_event_class ("note-event") || e->in_event_class ("cluster-note-event"))
&& music_context_)
- busy_moment_ = max (music_context_->now_mom (),
+ busy_moment_ = std::max (music_context_->now_mom (),
busy_moment_);
}
bool
Lyric_combine_music_iterator::ok () const
{
- return lyric_iter_ && lyric_iter_->ok ();
+ return lyric_iter_ && lyric_iter_->ok ()
+ && !(music_context_ && music_context_->is_removable ());
}
void
&& (!music_context_ || ly_scm2string (voice_name) != music_context_->id_string ())
&& scm_is_symbol (voice_type))
{
- Context *t = get_outlet ();
- while (t && t->get_parent_context ())
- t = t->get_parent_context ();
-
- string name = ly_scm2string (voice_name);
- return find_context_below (t, voice_type, name);
+ return find_context_below (find_top_context (get_outlet ()),
+ voice_type, ly_scm2string (voice_name));
}
return 0;