]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/score.cc
thinko for trill-spanner
[lilypond.git] / lily / score.cc
index 1545debcfb449018f47ca6048f08c6321d32f1da..52a48538b8d8d3cf2630bc77fcfbd66b7cc27aea 100644 (file)
@@ -28,13 +28,23 @@ using namespace std;
 
 #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 ()
@@ -51,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_;
 }
 
@@ -65,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)
@@ -81,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);
@@ -107,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);
@@ -135,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 ();
     }
@@ -164,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;
@@ -237,5 +249,5 @@ Score::get_music () const
 void
 Score::add_output_def (Output_def *def)
 {
-  defs_.push (def);
+  defs_.push_back (def);
 }