lilypond-1.1.21
[lilypond.git] / lily / input-staff.cc
blob0b127baacb6a868c2078ff0bc420da2eadaf54c8
1 /*
2 input-staff.cc -- implement Input_staff
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
9 #include "debug.hh"
10 #include "score.hh"
11 #include "input-music.hh"
12 #include "input-staff.hh"
13 #include "staff.hh"
14 #include "my-lily-lexer.hh"
15 #include "input-register.hh"
17 Input_staff::Input_staff()
19 ireg_p_ =0;
22 void
23 Input_staff::add(Input_music*m)
25 music_.bottom().add(m);
28 Staff*
29 Input_staff::parse(Score*score_l)
31 Staff *p=new Staff;
33 p->score_l_ = score_l;
34 p->ireg_p_ = (ireg_p_)? new Input_register(*ireg_p_):0;
35 for (iter_top(music_,i); i.ok(); i++) {
36 Voice_list vl = i->convert();
37 p->add(vl);
39 return p;
42 Input_staff::Input_staff(Input_staff const&s)
43 : Input(s)
45 for (iter_top(s.music_,i); i.ok(); i++)
46 add(i->clone());
48 ireg_p_ = (s.ireg_p_)? new Input_register(*s.ireg_p_):0;
51 void
52 Input_staff::print() const
54 #ifndef NPRINT
55 mtor << "Input_staff {\n";
56 for (iter_top(music_,i); i.ok(); i++)
57 i->print();
58 ireg_p_->print();
59 mtor << "}\n";
60 #endif
62 Input_staff::~Input_staff()
64 delete ireg_p_;