2 score.cc -- implement Score
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
11 #include "music-output-def.hh"
12 #include "music-output.hh"
14 #include "source-file.hh"
15 #include "music-iterator.hh"
17 #include "global-translator.hh"
20 extern String default_out_fn
;
29 Score::Score (Score
const &s
)
31 music_p_
= s
.music_p_
->clone();
32 for (int i
=0; i
< s
.def_p_arr_
.size (); i
++)
33 def_p_arr_
.push(s
.def_p_arr_
[i
]->clone());
34 header_p_
= new Header (*s
.header_p_
);
40 for (int i
=0; i
< def_p_arr_
.size (); i
++)
46 Score::run_translator (Music_output_def
*odef_l
)
48 Global_translator
* trans_p
= odef_l
->get_global_translator_p();
52 *mlog
<< "\nInterpreting music ...";
53 trans_p
->last_mom_
= music_p_
->time_int().max ();
55 Music_iterator
* iter
= Music_iterator::static_get_iterator_p (music_p_
,
57 iter
->construct_children();
62 warning ("Need music in a score");
69 while (iter
->ok() || trans_p
->moments_left_i ())
71 Moment w
= infinity_mom
;
74 w
= iter
->next_moment();
75 DOUT
<< "proccing: " << w
<<"\n";
78 trans_p
->modify_next (w
);
82 iter
->process_and_next (w
);
91 // should we? hampers debugging.
92 warning ("Errors found, /*not processing score*/");
95 Music_output
* output
= trans_p
->get_output_p();
98 output
->header_l_
= header_p_
;
99 output
->default_out_str_
= default_out_fn
;
100 output
->origin_str_
= location_str();
114 for (int i
=0; i
< def_p_arr_
.size (); i
++)
115 run_translator (def_p_arr_
[i
]);
126 for (int i
=0; i
< def_p_arr_
.size (); i
++)
127 def_p_arr_
[i
]->print();
133 Score::add (Music_output_def
*pap_p
)
135 def_p_arr_
.push(pap_p
);