X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fscore-scheme.cc;h=83111f670755cf74ae935c1ff5a938dcf4b9205e;hb=a79a35cbb512c1e1ba291b2e3eb0a5fcb1c6dd45;hp=3b256b01f4dd92cf8038f5789974b2a6f1ad028b;hpb=711cf44d0ab28f3159230c84d63c0b19199408b0;p=lilypond.git diff --git a/lily/score-scheme.cc b/lily/score-scheme.cc index 3b256b01f4..83111f6707 100644 --- a/lily/score-scheme.cc +++ b/lily/score-scheme.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 2005--2006 Han-Wen Nienhuys + (c) 2005--2007 Han-Wen Nienhuys */ #include "score.hh" @@ -11,7 +11,6 @@ #include "music.hh" #include "output-def.hh" #include "global-context.hh" -#include "lilypond-key.hh" #include "music-output.hh" #include "paper-score.hh" #include "paper-book.hh" @@ -21,8 +20,7 @@ LY_DEFINE (ly_make_score, "ly:make-score", (SCM music), "Return score with @var{music} encapsulated in @var{score}.") { - Music *mus = unsmob_music (music); - SCM_ASSERT_TYPE (mus, music, SCM_ARG1, __FUNCTION__, "music"); + LY_ASSERT_SMOB (Music, music, 1); Score *score = new Score; score->set_music (music); @@ -34,12 +32,12 @@ LY_DEFINE (ly_score_output_defs, "ly:score-output-defs", 1, 0, 0, (SCM score), "All output defs in a score.") { + LY_ASSERT_SMOB (Score, score, 1); Score *sc = unsmob_score (score); - SCM_ASSERT_TYPE (sc, score, SCM_ARG1, __FUNCTION__, "score"); SCM l = SCM_EOL; for (vsize i = 0; i < sc->defs_.size (); i++) - l = scm_cons (sc->defs_[i]->self_scm(), l); + l = scm_cons (sc->defs_[i]->self_scm (), l); return scm_reverse_x (l, SCM_EOL); } @@ -49,8 +47,8 @@ LY_DEFINE (ly_score_header, "ly:score-header", 1, 0, 0, (SCM score), "return score header.") { + LY_ASSERT_SMOB (Score, score, 1); Score *sc = unsmob_score (score); - SCM_ASSERT_TYPE (sc, score, SCM_ARG1, __FUNCTION__, "score"); return sc->header_; } @@ -59,8 +57,8 @@ LY_DEFINE (ly_score_music, "ly:score-music", 1, 0, 0, (SCM score), "return score music.") { + LY_ASSERT_SMOB (Score, score, 1); Score *sc = unsmob_score (score); - SCM_ASSERT_TYPE (sc, score, SCM_ARG1, __FUNCTION__, "score"); return sc->get_music (); } @@ -68,27 +66,27 @@ LY_DEFINE (ly_score_error_p, "ly:score-error?", 1, 0, 0, (SCM score), "Was there an error in the score?") { + LY_ASSERT_SMOB (Score, score, 1); Score *sc = unsmob_score (score); - SCM_ASSERT_TYPE (sc, score, SCM_ARG1, __FUNCTION__, "score"); return scm_from_bool (sc->error_found_); } LY_DEFINE (ly_score_embedded_format, "ly:score-embedded-format", - 2, 1, 0, (SCM score, SCM layout, SCM key), + 2, 0, 0, (SCM score, SCM layout), "Run @var{score} through @var{layout}, an output definition, " "scaled to correct output-scale already, " "return a list of layout-lines. " "\nTake optional Object_key argument.") { + 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); if (sc->error_found_) return SCM_EOL; - SCM_ASSERT_TYPE (sc, score, SCM_ARG1, __FUNCTION__, "Score"); - SCM_ASSERT_TYPE (od, layout, SCM_ARG2, __FUNCTION__, "Output_def"); - Output_def *score_def = 0; /* UGR, FIXME, these are default \layout blocks once again. They @@ -107,8 +105,7 @@ LY_DEFINE (ly_score_embedded_format, "ly:score-embedded-format", itself. */ score_def->parent_ = od; - SCM context = ly_run_translator (sc->get_music (), score_def->self_scm (), - key); + SCM context = ly_run_translator (sc->get_music (), score_def->self_scm ()); SCM output = ly_format_output (context); scm_remember_upto_here_1 (prot);