lilypond-1.1.7
[lilypond.git] / src / input-score.cc
blobf39d47a4b1a91e9df75e514644f595d0c10138b7
1 /*
2 input-score.cc -- implement Input_score
4 source file of the LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
9 #include "debug.hh"
10 #include "input-score.hh"
11 #include "input-staff.hh"
12 #include "input-music.hh"
13 #include "score.hh"
14 #include "paper-def.hh"
15 #include "midi-def.hh"
16 #include "staff.hh"
19 void
20 Input_score::add(Input_staff*s)
22 staffs_.bottom().add(s);
25 void
26 Input_score::set(Paper_def*p)
28 delete paper_p_;
29 paper_p_ = p;
32 void
33 Input_score::set(Midi_def* midi_p)
35 delete midi_p_;
36 midi_p_ = midi_p;
39 Input_score::Input_score(Input_score const&s)
41 paper_p_ = (s.paper_p_)? new Paper_def(*s.paper_p_) :0;
42 midi_p_ = (s.midi_p_)? new Midi_def(*s.midi_p_) : 0;
43 defined_ch_c_l_ = s.defined_ch_c_l_;
44 errorlevel_i_ = s.errorlevel_i_;
45 score_wide_music_p_ = (s.score_wide_music_p_) ?
46 s.score_wide_music_p_->clone():0;
49 Score*
50 Input_score::parse()
52 Score *s_p = new Score;
53 s_p->defined_ch_c_l_= defined_ch_c_l_;
54 s_p->errorlevel_i_ = errorlevel_i_;
55 if (midi_p_)
56 s_p->set(new Midi_def(*midi_p_));
57 if (paper_p_)
58 s_p->set( new Paper_def(*paper_p_));
60 for (iter_top(staffs_,i); i.ok(); i++) {
61 Staff* staf_p=i->parse(s_p, score_wide_music_p_);
62 s_p->add(staf_p);
65 return s_p;
68 void
69 Input_score::set(Input_music *m_p)
71 delete score_wide_music_p_;
72 score_wide_music_p_ =m_p;
76 Input_score::~Input_score()
78 delete paper_p_;
79 delete score_wide_music_p_;
80 delete midi_p_;
83 Input_score::Input_score()
85 score_wide_music_p_ =0;
86 defined_ch_c_l_=0;
87 paper_p_= 0;
88 midi_p_ = 0;
89 errorlevel_i_ = 0;
92 void
93 Input_score::print()const
95 #ifndef NPRINT
96 mtor << "Input_score {\n";
97 for (iter_top(staffs_,i); i.ok(); i++) {
98 i->print();
100 mtor << "}\n";
101 #endif