void
Music_wrapper_iterator::do_quit ()
{
- child_iter_->quit ();
+ if (child_iter_)
+ child_iter_->quit ();
}
void
{
Music *my_music = get_music ();
Music *child = unsmob_music (my_music->get_property ("element"));
- child_iter_ = unsmob_iterator (get_iterator (child));
+ child_iter_ = (child)
+ ? unsmob_iterator (get_iterator (child))
+ : 0;
}
bool
void
Music_wrapper_iterator::process (Moment m)
{
- child_iter_->process (m);
+ if (child_iter_)
+ child_iter_->process (m);
}
Moment
Music_wrapper_iterator::pending_moment () const
{
- return child_iter_->pending_moment ();
+ if (child_iter_)
+ return child_iter_->pending_moment ();
+ else
+ return Music_iterator::pending_moment ();
}
IMPLEMENT_CTOR_CALLBACK (Music_wrapper_iterator);
bool
Music_wrapper_iterator::run_always () const
{
- return child_iter_->run_always ();
+ return (child_iter_ && child_iter_->run_always ());
}
{
Music *me = unsmob_music (m);
Music *elt = unsmob_music (me->get_property ("element"));
- return elt->start_mom ().smobbed_copy ();
+ if (elt)
+ return elt->start_mom ().smobbed_copy ();
+ else
+ return Moment ().smobbed_copy ();
}
MAKE_SCHEME_CALLBACK (Music_wrapper, length_callback, 1);