]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lily-parser.cc
(bezier-sandwich): New function.
[lilypond.git] / lily / lily-parser.cc
index 1700609a18149506d75da9d336760229931457a0..d83528ccc59e863c27cb138c97c3c1f3c9784e3d 100644 (file)
@@ -7,7 +7,10 @@
        Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
+
 #include "book.hh"
+#include "lilypond-key.hh"
+#include "context-selector.hh"
 #include "grob-selector.hh"
 #include "file-name.hh"
 #include "file-path.hh"
@@ -101,8 +104,9 @@ Lily_parser::parse_file (String init, String name, String out_name)
   set_yydebug (0);
 
   lexer_->new_input (init, sources_);
-#ifdef TWEAK  
-  String s = global_path.find (name + ".t");
+#ifdef TWEAK
+  File_name f (name);
+  String s = global_path.find (f.base_ + ".twy");
   if (s == "")
     Grob_selector::set_tweaks (SCM_EOL);
   else
@@ -111,12 +115,13 @@ Lily_parser::parse_file (String init, String name, String out_name)
       SCM tweaks = scm_eval_string (scm_makfrom0str (s.to_str0 ()));
       Grob_selector::set_tweaks (tweaks);
     }
+  Context_selector::set_tweaks (SCM_EOL);
 #endif  
 
   /* Read .ly IN_FILE, lex, parse, write \score blocks from IN_FILE to
      OUT_FILE (unless IN_FILE redefines output file name).  */
   do_yyparse ();
-  
+
   if (!define_spots_.is_empty ())
     {
       define_spots_.top ().warning (_ ("Braces don't match"));
@@ -430,6 +435,8 @@ LY_DEFINE (ly_parser_print_score, "ly:parser-print-score",
   Lily_parser *parser = unsmob_my_lily_parser (parser_smob);
   Score *score = unsmob_score (score_smob);
 
+  Object_key * key = new Lilypond_general_key (0, score->user_key_, 0);
+  
   if (score->error_found_)
     return SCM_UNSPECIFIED;
   
@@ -450,16 +457,19 @@ LY_DEFINE (ly_parser_print_score, "ly:parser-print-score",
   for (int i = 0; i < score->defs_.size (); i++)
     default_rendering (score->get_music (), score->defs_[i]->self_scm (),
                       paper,
-                      header, os);
+                      header, os,
+                      key->self_scm ());
 
   if (score->defs_.is_empty ())
     {
       Output_def *layout = get_layout (parser);
       default_rendering (score->get_music(), layout->self_scm (),
                         get_paper (parser)->self_scm (),
-                        header, os);
+                        header, os, key->self_scm ());
       scm_gc_unprotect_object (layout->self_scm ());
     }
+
+  scm_gc_unprotect_object (key->self_scm ());
   return SCM_UNSPECIFIED;
 }
 
@@ -503,8 +513,8 @@ LY_DEFINE (ly_parser_print_book, "ly:parser-print-book",
   (*c)++;
 
   Output_def *layout = get_layout (parser);
-
   Paper_book* pb = book->process (outname.to_string (), layout);
+  
   if (pb)
     {
       pb->output (outname.to_string ());