2 input-staff.cc -- implement Input_staff
4 source file of the LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
11 #include "input-music.hh"
12 #include "input-staff.hh"
14 #include "complex-staff.hh"
15 #include "lyricstaff.hh"
20 Input_staff::Input_staff(String s
)
22 score_wide_music_p_
=0;
28 Input_staff::add(Input_music
*m
)
30 music_
.bottom().add(m
);
34 Input_staff::parse(Score
*score_l
, Input_music
*default_score_wide
)
37 if (type
== "melodic")
38 p
= new Complex_staff
;
39 else if (type
== "lyric")
42 error( "Unknown staff-type `" + type
+"\'", defined_ch_c_l_
);
46 p
->score_l_
= score_l
;
48 for (iter_top(music_
,i
); i
.ok(); i
++) {
49 Voice_list vl
= i
->convert();
52 Voice_list vl
= (score_wide_music_p_
) ? score_wide_music_p_
->convert()
53 : default_score_wide
->convert();
58 Input_staff::Input_staff(Input_staff
const&s
)
60 for (iter_top(s
.music_
,i
); i
.ok(); i
++)
62 defined_ch_c_l_
= s
.defined_ch_c_l_
;
64 score_wide_music_p_
= (s
.score_wide_music_p_
) ?
65 s
.score_wide_music_p_
->clone() : 0;
69 Input_staff::print() const
72 mtor
<< "Input_staff {\n";
73 for (iter_top(music_
,i
); i
.ok(); i
++)
79 Input_staff::set_score_wide(Input_music
*m_p
)
81 delete score_wide_music_p_
;
82 score_wide_music_p_
= m_p
;
85 Input_staff::~Input_staff()
87 delete score_wide_music_p_
;