]> git.donarmstrong.com Git - lilypond.git/blob - lily/request-chord.cc
release: 1.5.0
[lilypond.git] / lily / request-chord.cc
1 #include "pitch.hh" 
2 #include "request-chord-iterator.hh"
3 #include "music-list.hh"
4 #include "musical-request.hh"
5
6 Request_chord::Request_chord (SCM s)
7   : Simultaneous_music (s)
8 {
9   set_mus_property ("iterator-ctor",
10                     Request_chord_iterator::constructor_cxx_function);
11 }
12
13 Request_chord::Request_chord ()
14 {
15   set_mus_property ("iterator-ctor",
16                     Request_chord_iterator::constructor_cxx_function);
17 }
18
19
20
21 Pitch
22 Request_chord::to_relative_octave (Pitch last)
23 {
24   for (SCM s = music_list (); gh_pair_p (s);  s = gh_cdr (s))
25     {
26       Music * mus = unsmob_music (gh_car (s));
27       if (Melodic_req *m= dynamic_cast <Melodic_req *> (mus))
28         {
29           Pitch pit = *unsmob_pitch (m->get_mus_property ("pitch"));
30           
31           pit.to_relative_octave (last);
32           m->set_mus_property ("pitch", pit.smobbed_copy ());
33                   
34           return pit;
35         }
36     }
37   return last;
38 }
39
40 Moment
41 Request_chord::start_mom () const
42 {
43   return Music::start_mom ();
44 }
45
46
47
48 ADD_MUSIC (Request_chord);