]> git.donarmstrong.com Git - lilypond.git/blob - lily/input-staff.cc
release: 0.0.67
[lilypond.git] / lily / input-staff.cc
1 /*
2   input-staff.cc -- implement Input_staff
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
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"
16
17 Input_staff::Input_staff()
18 {
19     ireg_p_ =0;
20 }
21
22 void
23 Input_staff::add(Input_music*m)
24 {
25     music_.bottom().add(m);
26 }
27
28 Staff*
29 Input_staff::parse(Score*score_l)
30 {
31     Staff *p=new Staff;
32    
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);
38     }
39     return p;
40 }
41
42 Input_staff::Input_staff(Input_staff const&s)
43     : Input(s)
44 {    
45     for (iter_top(s.music_,i); i.ok(); i++)
46         add(i->clone());
47
48     ireg_p_ = (s.ireg_p_)? new Input_register(*s.ireg_p_):0;
49 }
50
51 void
52 Input_staff::print() const
53 {
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
61 }
62 Input_staff::~Input_staff()
63 {
64     delete ireg_p_;
65 }