2 music-sequence.cc -- implement Music_sequence
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "music-list.hh"
11 #include "musical-pitch.hh"
13 Music_sequence::Music_sequence (Music_sequence
const&s
)
16 music_p_list_p_
= new Music_list (*s
.music_p_list_p_
);
21 Music_sequence::Music_sequence(Music_list
*mlist_p
)
23 music_p_list_p_
= mlist_p
;
27 Music_sequence::transpose (Musical_pitch rq
)
29 for (Cons
<Music
> *i
= music_p_list_p_
->head_
; i
; i
= i
->next_
)
30 i
->car_
->transpose (rq
);
34 Music_sequence::do_print() const
37 for (Cons
<Music
> *i
= music_p_list_p_
->head_
; i
; i
= i
->next_
)
44 Music_sequence::add_music (Music
*m_p
)
46 music_p_list_p_
->add_music (m_p
);
50 Music_sequence::cumulative_length () const
53 for (Cons
<Music
> *i
= music_p_list_p_
->head_
; i
; i
= i
->next_
)
55 last
+= i
->car_
->length_mom ();
61 Music_sequence::to_relative_octave (Musical_pitch p
)
63 return do_relative_octave (p
, false);
68 Music_sequence::maximum_length () const
71 for (Cons
<Music
> *i
= music_p_list_p_
->head_
; i
; i
= i
->next_
)
72 dur
= dur
>? i
->car_
->length_mom ();
77 Music_sequence::length_i () const
79 return cons_list_size_i (music_p_list_p_
->head_
);