2 new-repeated-music.cc -- implement New_repeated_music
4 source file of the GNU LilyPond music typesetter
6 (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "new-repeated-music.hh"
11 #include "music-list.hh"
12 #include "musical-pitch.hh"
14 New_repeated_music::New_repeated_music()
22 New_repeated_music::New_repeated_music (New_repeated_music const &s)
25 repeats_i_ = s.repeats_i_;
26 unfold_b_ = s.unfold_b_;
28 repeat_begin_p_ = s.repeat_begin_p_ ? s.repeat_begin_p_->clone () : 0;
29 alternatives_p_ = s.alternatives_p_
30 ? dynamic_cast<Music_sequence*> (s.alternatives_p_->clone ()):0;
33 New_repeated_music::~New_repeated_music ()
35 delete repeat_begin_p_;
36 delete alternatives_p_;
40 New_repeated_music::do_print () const
43 repeat_begin_p_->print();
46 alternatives_p_->print();
50 New_repeated_music::to_relative_octave (Musical_pitch p)
53 p = repeat_begin_p_->to_relative_octave (p);
56 p = alternatives_p_->do_relative_octave (p, true);
62 New_repeated_music::transpose (Musical_pitch p)
65 repeat_begin_p_->transpose (p);
68 alternatives_p_->transpose (p);
72 New_repeated_music::compress (Moment p)
75 repeat_begin_p_->compress (p);
78 alternatives_p_->compress (p);
83 New_repeated_music::length_mom () const
89 m += Rational (repeats_i_) * repeat_begin_p_->length_mom ();
92 m += alternatives_p_->cumulative_length ();
97 m += repeat_begin_p_->length_mom ();
100 m += alternatives_p_->maximum_length ();