X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fscore.cc;h=52a48538b8d8d3cf2630bc77fcfbd66b7cc27aea;hb=9ac6b17dfcca6826c8ab3ea5d65b789086ae15e0;hp=505a1fee5e763e61b9de6c2ad1a4d7e652395fa2;hpb=7556e96abb66c88ae653c96898bcad2c3f18b645;p=lilypond.git diff --git a/lily/score.cc b/lily/score.cc index 505a1fee5e..52a48538b8 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -15,25 +15,36 @@ using namespace std; #include "book.hh" #include "cpu-timer.hh" #include "global-context.hh" +#include "international.hh" #include "lily-parser.hh" #include "lilypond-key.hh" #include "main.hh" #include "music.hh" +#include "music.hh" #include "output-def.hh" #include "paper-book.hh" #include "paper-score.hh" #include "warn.hh" -#include "music.hh" #include "ly-smobs.icc" +Input * +Score::origin () const +{ + return unsmob_input (input_location_); +} + + Score::Score () - : Input () { header_ = SCM_EOL; music_ = SCM_EOL; + input_location_ = SCM_EOL; + error_found_ = false; + smobify_self (); + input_location_ = make_input (Input ()); } Score::~Score () @@ -50,8 +61,10 @@ Score::mark_smob (SCM s) Score *sc = (Score *) SCM_CELL_WORD_1 (s); scm_gc_mark (sc->header_); - for (int i = sc->defs_.size (); i--;) + for (vsize i = sc->defs_.size (); i--;) scm_gc_mark (sc->defs_[i]->self_scm ()); + + scm_gc_mark (sc->input_location_); return sc->music_; } @@ -64,12 +77,14 @@ Score::print_smob (SCM, SCM p, scm_print_state*) } Score::Score (Score const &s) - : Input (s) { header_ = SCM_EOL; music_ = SCM_EOL; + input_location_ = SCM_EOL; error_found_ = s.error_found_; + smobify_self (); + input_location_ = make_input (*s.origin ()); Music *m = unsmob_music (s.music_); if (m) @@ -80,10 +95,10 @@ Score::Score (Score const &s) else music_ = SCM_EOL; - for (int i = 0, n = s.defs_.size (); i < n; i++) + for (vsize i = 0, n = s.defs_.size (); i < n; i++) { Output_def *copy = s.defs_[i]->clone (); - defs_.push (copy); + defs_.push_back (copy); copy->unprotect (); } header_ = ly_make_anonymous_module (false); @@ -106,7 +121,7 @@ default_rendering (SCM music, SCM outdef, /* ugh. */ if (bpd->c_variable ("is-paper") == SCM_BOOL_T) { - Real scale = scm_to_double (bpd->c_variable ("outputscale")); + Real scale = scm_to_double (bpd->c_variable ("output-scale")); Output_def *def = scale_output_def (unsmob_output_def (outdef), scale); Output_def *bdef = scale_output_def (bpd, scale); @@ -134,9 +149,7 @@ default_rendering (SCM music, SCM outdef, if (ly_is_module (header)) paper_book->add_score (header); - SCM systems = pscore->get_paper_systems (); - paper_book->add_score (systems); - + paper_book->add_score (pscore->self_scm ()); paper_book->classic_output (outname); paper_book->unprotect (); } @@ -163,7 +176,7 @@ Score::book_rendering (Output_def *layoutbook, Real scale = 1.0; if (layoutbook && layoutbook->c_variable ("is-paper") == SCM_BOOL_T) - scale = scm_to_double (layoutbook->c_variable ("outputscale")); + scale = scm_to_double (layoutbook->c_variable ("output-scale")); SCM outputs = SCM_EOL; SCM *tail = &outputs; @@ -236,5 +249,5 @@ Score::get_music () const void Score::add_output_def (Output_def *def) { - defs_.push (def); + defs_.push_back (def); }