* lily/music-iterator.cc (quit, do_quit): new function: break link
[lilypond.git] / lily / request-chord.cc
blob3de20f4b4f92535ef6d651ae9ef8bb81e92c9905
1 #include "pitch.hh"
2 #include "request-chord-iterator.hh"
3 #include "music-list.hh"
4 #include "musical-request.hh"
6 Request_chord::Request_chord (SCM s)
7 : Simultaneous_music (s)
9 set_mus_property ("iterator-ctor",
10 Request_chord_iterator::constructor_proc);
13 Request_chord::Request_chord ()
15 set_mus_property ("iterator-ctor",
16 Request_chord_iterator::constructor_proc);
19 Pitch
20 Request_chord::to_relative_octave (Pitch last)
22 for (SCM s = music_list (); gh_pair_p (s); s = ly_cdr (s))
24 Music * mus = unsmob_music (ly_car (s));
25 Melodic_req *m= dynamic_cast <Melodic_req *> (mus);
28 kLudge: rests have pitches now as well.
30 Rest_req *r = dynamic_cast<Rest_req*> (mus);
32 if (r || m)
34 Pitch *old_pit = unsmob_pitch (mus->get_mus_property ("pitch"));
35 if (!old_pit)
36 continue;
38 Pitch new_pit = *old_pit;
39 new_pit.to_relative_octave (last);
40 mus->set_mus_property ("pitch", new_pit.smobbed_copy ());
42 return new_pit;
46 return last;
49 Moment
50 Request_chord::start_mom () const
52 return Music::start_mom ();
55 ADD_MUSIC (Request_chord);