X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fbook.cc;h=c7f5dd02378372ba377320d9c1a94dec2899d17b;hb=5d84bfad4626892bcffd05adcced53c8a2329047;hp=8ba2aac9080432144e58aa035a70575871dd7b50;hpb=0c14539bc83d6bb405141b6f21430b33d1e8fcf0;p=lilypond.git diff --git a/lily/book.cc b/lily/book.cc index 8ba2aac908..c7f5dd0237 100644 --- a/lily/book.cc +++ b/lily/book.cc @@ -32,7 +32,7 @@ using namespace std; #include "performance.hh" #include "paper-score.hh" #include "page-marker.hh" - +#include "ly-module.hh" Book::Book () { @@ -107,7 +107,7 @@ Book::~Book () SCM -Book::mark_smob () +Book::mark_smob () const { if (paper_) scm_gc_mark (paper_->self_scm ()); @@ -229,7 +229,18 @@ Book::process_score (SCM s, Paper_book *output_paper_book, Output_def *layout) Music_output *output = unsmob (scm_car (outputs)); if (Performance *perf = dynamic_cast (output)) - output_paper_book->add_performance (perf->self_scm ()); + { + output_paper_book->add_performance (perf->self_scm ()); + // Associate the performance with a \header block (if there is + // one in effect in the scope of the current score), to make the + // header metadata accessible when outputting the performance. + if (ly_is_module (score->get_header ())) + perf->set_header (score->get_header ()); + else if (ly_is_module (output_paper_book->header_)) + perf->set_header (output_paper_book->header_); + else if (ly_is_module (output_paper_book->header_0_)) + perf->set_header (output_paper_book->header_0_); + } else if (Paper_score *pscore = dynamic_cast (output)) { if (ly_is_module (score->get_header ()))