paper_book->add_performance (perf->self_scm ());
else if (Paper_score *pscore = dynamic_cast<Paper_score *> (output))
{
- if (ly_is_module (score->header_))
- paper_book->add_score (score->header_);
+ if (ly_is_module (score->get_header ()))
+ paper_book->add_score (score->get_header ());
paper_book->add_score (pscore->self_scm ());
}
SCM music_;
SCM input_location_;
+ SCM header_;
public:
Input *origin() const;
vector<Output_def*> defs_;
string user_key_;
- SCM header_;
bool error_found_;
Score ();
void add_output_def (Output_def *def);
void set_music (SCM music);
SCM book_rendering (Output_def *, Output_def *);
+ SCM get_header () const;
+ void set_header (SCM module);
};
DECLARE_UNSMOB (Score, score);
$$->user_key_ = ly_scm2string ($2);
}
| score_body lilypond_header {
- $$->header_ = $2;
+ $$->set_header ($2);
}
| score_body output_def {
if ($2->lookup_variable (ly_symbol2scm ("is-paper")) == SCM_BOOL_T)
{
LY_ASSERT_SMOB (Score, score, 1);
Score *sc = unsmob_score (score);
- return sc->header_;
+ return sc->get_header ();
+}
+
+
+LY_DEFINE (ly_score_set_header_x, "ly:score-set-header!",
+ 2, 0, 0, (SCM score, SCM module),
+ "Set the score header.")
+{
+ LY_ASSERT_SMOB (Score, score, 1);
+ SCM_ASSERT_TYPE (ly_is_module (module), module, SCM_ARG2, __FUNCTION__,
+ "module");
+
+ Score *sc = unsmob_score (score);
+ return sc->get_header ();
}
{
defs_.push_back (def);
}
+
+SCM
+Score::get_header () const
+{
+ return header_;
+}
+
+void
+Score::set_header (SCM module)
+{
+ assert (ly_is_module (module));
+ header_ = module;
+}