]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/score.cc
* scripts/abc2ly.py (try_parse_comment): idem.
[lilypond.git] / lily / score.cc
index 505a1fee5e763e61b9de6c2ad1a4d7e652395fa2..3f00330e61336c875aa3c97d618157468e2befd7 100644 (file)
@@ -15,25 +15,34 @@ 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;
   error_found_ = false;
+  input_location_ = SCM_EOL;
   smobify_self ();
+  input_location_ = make_input (Input ());
 }
 
 Score::~Score ()
@@ -50,8 +59,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 +75,13 @@ Score::print_smob (SCM, SCM p, scm_print_state*)
 }
 
 Score::Score (Score const &s)
-  : Input (s)
 {
   header_ = SCM_EOL;
   music_ = SCM_EOL;
   error_found_ = s.error_found_;
+  input_location_ = SCM_EOL;
   smobify_self ();
+  input_location_ = make_input (*s.origin ()); 
 
   Music *m = unsmob_music (s.music_);
   if (m)
@@ -80,10 +92,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 +118,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 +146,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 +173,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 +246,5 @@ Score::get_music () const
 void
 Score::add_output_def (Output_def *def)
 {
-  defs_.push (def);
+  defs_.push_back (def);
 }