lilypond-0.0.50
[lilypond.git] / lily / input-staff.cc
blob618d98f012554a60fc0c050c636cdca810c6040f
1 /*
2 input-staff.cc -- implement Input_staff
4 source file of the 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 "complex-staff.hh"
15 #include "my-lily-lexer.hh"
16 #include "input-register.hh"
18 Input_staff::Input_staff()
20 ireg_p_ =0;
23 void
24 Input_staff::add(Input_music*m)
26 music_.bottom().add(m);
29 Staff*
30 Input_staff::parse(Score*score_l)
32 Staff *p=new Complex_staff;
34 p->score_l_ = score_l;
35 p->ireg_p_ = (ireg_p_)? new Input_register(*ireg_p_):0;
36 for (iter_top(music_,i); i.ok(); i++) {
37 Voice_list vl = i->convert();
38 p->add(vl);
40 return p;
43 Input_staff::Input_staff(Input_staff const&s)
44 : Input(s)
46 for (iter_top(s.music_,i); i.ok(); i++)
47 add(i->clone());
49 ireg_p_ = (s.ireg_p_)? new Input_register(*s.ireg_p_):0;
52 void
53 Input_staff::print() const
55 #ifndef NPRINT
56 mtor << "Input_staff {\n";
57 for (iter_top(music_,i); i.ok(); i++)
58 i->print();
59 ireg_p_->print();
60 mtor << "}\n";
61 #endif
63 Input_staff::~Input_staff()
65 delete ireg_p_;