/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 2005--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ Copyright (C) 2005--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
"All output definitions in a score.")
{
LY_ASSERT_SMOB (Score, score, 1);
- Score *sc = unsmob_score (score);
+ Score *sc = unsmob<Score> (score);
SCM l = SCM_EOL;
for (vsize i = 0; i < sc->defs_.size (); i++)
{
LY_ASSERT_SMOB (Score, score, 1);
LY_ASSERT_SMOB (Output_def, def, 2);
- Score *sc = unsmob_score (score);
- Output_def *output_def = unsmob_output_def (def);
+ Score *sc = unsmob<Score> (score);
+ Output_def *output_def = unsmob<Output_def> (def);
sc->add_output_def (output_def);
return SCM_UNSPECIFIED;
}
"Return score header.")
{
LY_ASSERT_SMOB (Score, score, 1);
- Score *sc = unsmob_score (score);
+ Score *sc = unsmob<Score> (score);
return sc->get_header ();
}
SCM_ASSERT_TYPE (ly_is_module (module), module, SCM_ARG2, __FUNCTION__,
"module");
- Score *sc = unsmob_score (score);
+ Score *sc = unsmob<Score> (score);
sc->set_header (module);
return SCM_UNSPECIFIED;
}
"Return score music.")
{
LY_ASSERT_SMOB (Score, score, 1);
- Score *sc = unsmob_score (score);
+ Score *sc = unsmob<Score> (score);
return sc->get_music ();
}
"Was there an error in the score?")
{
LY_ASSERT_SMOB (Score, score, 1);
- Score *sc = unsmob_score (score);
+ Score *sc = unsmob<Score> (score);
return scm_from_bool (sc->error_found_);
}
LY_ASSERT_SMOB (Score, score, 1);
LY_ASSERT_SMOB (Output_def, layout, 2);
- Score *sc = unsmob_score (score);
- Output_def *od = unsmob_output_def (layout);
+ Score *sc = unsmob<Score> (score);
+ Output_def *od = unsmob<Output_def> (layout);
if (sc->error_found_)
return SCM_EOL;
/* UGR, FIXME, these are default \layout blocks once again. They
suck. */
for (vsize i = 0; !score_def && i < sc->defs_.size (); i++)
- if (sc->defs_[i]->c_variable ("is-layout") == SCM_BOOL_T)
+ if (to_boolean (sc->defs_[i]->c_variable ("is-layout")))
score_def = sc->defs_[i];
if (!score_def)
return SCM_BOOL_F;
- score_def = scale_output_def (score_def, output_scale (od));
+ /* Don't rescale if the layout has already been scaled */
+ if (to_boolean (score_def->c_variable ("cloned")))
+ score_def = score_def->clone ();
+ else
+ score_def = scale_output_def (score_def, output_scale (od));
+
score_def->parent_ = od;
SCM context = ly_run_translator (sc->get_music (), score_def->unprotect ());