X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fperformance-scheme.cc;h=4d3c1e651256eafb38d911131f59b38a303f6349;hb=a6a51abfd0195a3cf7d6ea095cf69808852f21ce;hp=3f45829882b8b174e73f99bb077973333800850e;hpb=f9214bac21e9926dc3248416f58190c98c4167a9;p=lilypond.git diff --git a/lily/performance-scheme.cc b/lily/performance-scheme.cc index 3f45829882..4d3c1e6512 100644 --- a/lily/performance-scheme.cc +++ b/lily/performance-scheme.cc @@ -1,23 +1,56 @@ /* - performance-scheme.cc -- implement Performance bindings + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2005--2015 Han-Wen Nienhuys - (c) 2005--2007 Han-Wen Nienhuys + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #include "performance.hh" -LY_DEFINE (ly_performance_write, "ly:performance-write", - 2, 0, 0, (SCM performance, SCM filename), - "Write @var{performance} to @var{filename}") +LY_DEFINE (ly_performance_header, "ly:performance-header", + 1, 0, 0, (SCM performance), + "Return header of performance.") { - Performance *perf = dynamic_cast (unsmob_music_output (performance)); + LY_ASSERT_SMOB (Performance, performance, 1); + Performance *p = unsmob (performance); + return p->get_header (); +} - SCM_ASSERT_TYPE (perf, performance, SCM_ARG1, __FUNCTION__, "Performance"); - SCM_ASSERT_TYPE (scm_is_string (filename), filename, SCM_ARG2, __FUNCTION__, "file name"); +LY_DEFINE (ly_performance_set_header_x, "ly:performance-set-header!", + 2, 0, 0, (SCM performance, SCM module), + "Set the performance header.") +{ + LY_ASSERT_SMOB (Performance, performance, 1); + SCM_ASSERT_TYPE (ly_is_module (module), module, SCM_ARG2, __FUNCTION__, + "module"); - perf->write_output (ly_scm2string (filename)); + Performance *p = unsmob (performance); + p->set_header (module); return SCM_UNSPECIFIED; } +LY_DEFINE (ly_performance_write, "ly:performance-write", + 3, 0, 0, (SCM performance, SCM filename, SCM name), + "Write @var{performance} to @var{filename} storing @var{name} as " + "the name of the performance in the file metadata.") +{ + LY_ASSERT_SMOB (Performance, performance, 1); + LY_ASSERT_TYPE (scm_is_string, filename, 2); + LY_ASSERT_TYPE (scm_is_string, name, 3); + + unsmob (performance)->write_output (ly_scm2string (filename), + ly_scm2string (name)); + return SCM_UNSPECIFIED; +}