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"
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
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"));
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;
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;
}
(*c)++;
Output_def *layout = get_layout (parser);
-
Paper_book* pb = book->process (outname.to_string (), layout);
+
if (pb)
{
pb->output (outname.to_string ());