lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: book-predicate


From: rickysymond
Subject: Re: book-predicate
Date: Fri, 2 Mar 2012 02:07:12 -0800 (PST)

hi...,
Nice stuff here share...
Thanks....

Jan-Peter Voigt wrote:
> 
> Hello David, hello lists,
> 
> now, when we have a book-predicate, we are dealing with books in scheme. 
> And then we might want to set a header after creating a book.
> There is a function ly:score-set-header!, which I copied and adapted for 
> the Book-class.
> This patch compiled and works with the following snippet.
> 
> --snip--
> \version "2.15.32"
> 
> bk = \book {
>    \score {
>      \relative c' {
>        c4 e g b
>      }
>    }
> }
> 
> #(let ((bh (eval-string "(define-module (a b))")))
>       (eval '(define title "Hallo") bh)
>       (ly:book-set-header! bk bh))
> 
> \book { \bk }
> --snip--
> 
> Is this helpful for lily-devel?
> And is there another (better) way of creating a module (for header 
> generation) on the fly in scheme?
> 
> Cheers,
> Jan-Peter
> 
> On 27.02.2012 10:10, David Kastrup wrote:
>> Jan-Peter Voigt<address@hidden>  writes:
>>
>>>> Am 24.02.2012 um 16:24 schrieb:
>>>>
>>>>> Jan-Peter Voigt<address@hidden>  writes:
>>>>>
>>>>>> Hello list,
>>>>>>
>>>>>> when I use books or bookparts for (scheme-)function arguments, I
>>>>>> haven't found the predicate for it.
>>>>>> paper-book? is something else, or am I missing something?
>>>>> Well, you can always use scheme? and file a feature request in the
>>>>> mean
>>>>> time.
>>> Thank you David,
>>>
>>> the scheme?-solution is what I do right now. I will send a feature
>>> request next days.
>> Don't bother.
>>
>> commit 09814b549186893c265bcdf835edbe242f6354cf
>> Author: David Kastrup<address@hidden>
>> Date:   Sun Feb 26 11:23:39 2012 +0100
>>
>>      Implement ly:book? and ly:context-def? predicates
>>
>> Note that a bookpart _is_ a book as well, usually without a paper block
>> of its own.
>>
> 
> 
> From 40a1419a051402ee4bac6d8f7fa65e5b8353b815 Mon Sep 17 00:00:00 2001
> From: Jan-Peter Voigt <address@hidden>
> Date: Fri, 2 Mar 2012 09:54:20 +0100
> Subject: [PATCH] add ly:book-set-header!
> 
> Add a scheme function ly:book-set-header! like ly:score-set-header!
> 
> Function is copied from score-scheme.cc to book-scheme.cc,
> setting public member var header_ in class Book.
> ---
>  lily/book-scheme.cc |   13 +++++++++++++
>  1 files changed, 13 insertions(+), 0 deletions(-)
> 
> diff --git a/lily/book-scheme.cc b/lily/book-scheme.cc
> index 7f1026a..ae505af 100644
> --- a/lily/book-scheme.cc
> +++ b/lily/book-scheme.cc
> @@ -156,6 +156,19 @@ LY_DEFINE (ly_book_header, "ly:book-header",
>    return b->header_ ? b->header_ : SCM_BOOL_F;
>  }
>  
> +LY_DEFINE (ly_book_set_header_x, "ly:book-set-header!",
> +           2, 0, 0, (SCM book, SCM module),
> +           "Set the book header.")
> +{
> +  LY_ASSERT_SMOB (Book, book, 1);
> +  SCM_ASSERT_TYPE (ly_is_module (module), module, SCM_ARG2, __FUNCTION__,
> +                   "module");
> +
> +  Book *b = unsmob_book (book);
> +  b->header_ = (module);
> +  return SCM_UNSPECIFIED;
> +}
> +
>  LY_DEFINE (ly_book_scores, "ly:book-scores",
>             1, 0, 0, (SCM book),
>             "Return scores in @var{book}.")
> -- 
> 1.7.0.4
> 
> 
> _______________________________________________
> lilypond-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-devel
> 
> 


-----
http://www.expresspharmarx.com/purchase/generic-viagra.aspx Generic Viagra  | 
http://www.expresspharmarx.com/purchase/generic-levitra.aspx Generic Levitra 
-- 
View this message in context: 
http://old.nabble.com/Re%3A-book-predicate-tp33426953p33427261.html
Sent from the Gnu - Lilypond - Dev mailing list archive at Nabble.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]