]> git.donarmstrong.com Git - lilypond.git/blob - lily/book-scheme.cc
remove PDF related files
[lilypond.git] / lily / book-scheme.cc
1 #include "book.hh"
2 #include "output-def.hh"
3 #include "score.hh"
4 #include "ly-module.hh"
5
6 LY_DEFINE(ly_make_book, "ly:make-book",
7           2, 0, 1, (SCM paper, SCM header, SCM scores),
8           "Make a \\book of @var{paper} and @var{header} (which may be #f as well)  "
9           "containing @code{\\scores}.")
10 {
11   Output_def * odef = unsmob_output_def (paper);
12   SCM_ASSERT_TYPE (odef, paper,
13                    SCM_ARG1, __FUNCTION__, "Output_def");
14
15   Book *book = new Book;
16   book->paper_ = odef;
17
18   if (ly_c_module_p (header))
19     book->header_ = header;
20   
21   for (SCM s = scores; scm_is_pair (s); s = scm_cdr (s))
22     {
23       Score *score = unsmob_score (scm_car (s));
24       if (score)
25         book->scores_.push (score);
26     }
27   
28   SCM x = book->self_scm ();
29   scm_gc_unprotect_object (x);
30   return x;
31 }