X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fpaper-outputter-scheme.cc;h=d7fe624952264fafe49a307fe802632875946631;hb=b8f8b574e67eca24e4719ebb3100649cf5c3de08;hp=4fa9cd285391fe64f98fdff1b99a99c0b6b1d8a5;hpb=bdf4ab13203502e7ec7cf9cf5896527643a07c1f;p=lilypond.git diff --git a/lily/paper-outputter-scheme.cc b/lily/paper-outputter-scheme.cc index 4fa9cd2853..d7fe624952 100644 --- a/lily/paper-outputter-scheme.cc +++ b/lily/paper-outputter-scheme.cc @@ -3,34 +3,40 @@ source file of the GNU LilyPond music typesetter - (c) 2005 Han-Wen Nienhuys + (c) 2005--2006 Han-Wen Nienhuys */ #include "paper-outputter.hh" -#include "warn.hh" + +#include "international.hh" #include "stencil.hh" +#include "warn.hh" LY_DEFINE (ly_make_paper_outputter, "ly:make-paper-outputter", - 2, 0, 0, (SCM outname, SCM format), + 2, 0, 0, (SCM port, SCM format), "Create an outputter that evaluates within " - "@code{output-}@var{format}, writing to file @var{outname}.") + "@code{output-}@var{format}, writing to @var{port}.") { - SCM_ASSERT_TYPE (scm_is_string (outname), outname, SCM_ARG1, __FUNCTION__, - "String"); + SCM_ASSERT_TYPE (ly_is_port (port), port, SCM_ARG1, __FUNCTION__, + "port"); SCM_ASSERT_TYPE (scm_is_string (format), format, SCM_ARG2, __FUNCTION__, "String"); - String outname_str = ly_scm2string (outname); - String f = ly_scm2string (format); + string f = ly_scm2string (format); + + string output_name = ""; + + SCM port_name = scm_port_filename (port); + if (scm_is_string (port_name)) + output_name = ly_scm2string (port_name); + + message (_f ("Layout output to `%s'...", + output_name.c_str ())); - progress_indication (_f ("Layout output to `%s'...", - outname_str == "-" - ? String ("") - : outname_str)); progress_indication ("\n"); - Paper_outputter *po = new Paper_outputter (outname_str, f); + Paper_outputter *po = new Paper_outputter (port, f); - scm_gc_unprotect_object (po->self_scm ()); + po->unprotect (); return po->self_scm (); }