2 lyric-combine-music-iterator.cc -- implement Lyric_combine_music_iterator
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "translator-group.hh"
11 #include "lyric-combine-music-iterator.hh"
12 #include "lyric-combine-music.hh"
13 #include "musical-request.hh"
18 Busy_playing_req
*busy_req
;
19 Melisma_req
*melisma_start_req
;
20 Melisma_req
*melisma_stop_req
;
21 Melisma_playing_req
* melisma_playing_req
;
23 Lyric_combine_music_iterator::Lyric_combine_music_iterator ()
27 busy_req
= new Busy_playing_req
;
28 melisma_playing_req
= new Melisma_playing_req
;
29 melisma_stop_req
= new Melisma_req
;
30 melisma_start_req
= new Melisma_req
;
32 melisma_start_req
->set_span_dir (START
);
33 melisma_stop_req
->set_span_dir (STOP
);
40 Lyric_combine_music_iterator::pending_moment () const
42 Moment musnext
= music_iter_p_
->pending_moment ();
47 Lyric_combine_music_iterator::ok () const
49 return music_iter_p_
->ok ();
54 Lyric_combine_music_iterator::construct_children ()
56 Lyric_combine_music
const * m
= dynamic_cast<Lyric_combine_music
const*> (music_l ());
58 music_iter_p_
= get_iterator_p (m
->music_l ());
59 lyric_iter_p_
= get_iterator_p (m
->lyrics_l ());
63 Lyric_combine_music_iterator::process (Moment m
)
65 Moment my_next
= music_iter_p_
->pending_moment ();
69 music_iter_p_
->process (m
);
71 bool busy
= try_music (busy_req
);
74 bool melisma_b
= try_music (melisma_playing_req
);
77 if (lyric_iter_p_
->ok ())
80 #if 0 // devise a new way for this
81 if (melisma_b
&& !melisma_started_b_
)
82 lyric_iter_p_
->try_music (melisma_start_req
);
83 else if (melisma_started_b_
)
84 lyric_iter_p_
->try_music (melisma_stop_req
);
87 Moment m
= lyric_iter_p_
->pending_moment ();
88 lyric_iter_p_
->process (m
);
95 Lyric_combine_music_iterator::~Lyric_combine_music_iterator ()
101 Lyric_combine_music_iterator::Lyric_combine_music_iterator (Lyric_combine_music_iterator
const & src
)
102 : Music_iterator (src
)
105 lyric_iter_p_
= src
.lyric_iter_p_
? src
.lyric_iter_p_
->clone () : 0;
106 music_iter_p_
= src
.music_iter_p_
? src
.music_iter_p_
->clone () : 0;
109 Lyric_combine_music_iterator::try_music_in_children (Music
*m
) const
111 Music_iterator
* i
= music_iter_p_
->try_music (m
);
115 return lyric_iter_p_
->try_music (m
);
119 IMPLEMENT_CTOR_CALLBACK (Lyric_combine_music_iterator
);