X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fperformance-scheme.cc;h=4d3c1e651256eafb38d911131f59b38a303f6349;hb=b872748c6aa8bb721ced458691b38ac2fac5dfc8;hp=ab8e234b17c145da517539666cdbf71aa86afbe9;hpb=0b544cfb7332615ef809b71b57ab656741311ae1;p=lilypond.git diff --git a/lily/performance-scheme.cc b/lily/performance-scheme.cc index ab8e234b17..4d3c1e6512 100644 --- a/lily/performance-scheme.cc +++ b/lily/performance-scheme.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2005--2014 Han-Wen Nienhuys + Copyright (C) 2005--2015 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 @@ -19,14 +19,38 @@ #include "performance.hh" +LY_DEFINE (ly_performance_header, "ly:performance-header", + 1, 0, 0, (SCM performance), + "Return header of performance.") +{ + LY_ASSERT_SMOB (Performance, performance, 1); + Performance *p = unsmob (performance); + return p->get_header (); +} + +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"); + + Performance *p = unsmob (performance); + p->set_header (module); + return SCM_UNSPECIFIED; +} + LY_DEFINE (ly_performance_write, "ly:performance-write", - 2, 0, 0, (SCM performance, SCM filename), - "Write @var{performance} to @var{filename}.") + 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_TYPE (unsmob_performance, performance, 1); + LY_ASSERT_SMOB (Performance, performance, 1); LY_ASSERT_TYPE (scm_is_string, filename, 2); + LY_ASSERT_TYPE (scm_is_string, name, 3); - unsmob_performance (performance)->write_output (ly_scm2string (filename)); + unsmob (performance)->write_output (ly_scm2string (filename), + ly_scm2string (name)); return SCM_UNSPECIFIED; } -