Code cleanup
[opus_libre.git] / lib / 10-score.scm
blob414dfe7e2ce7badd4b783333af81c2147976b699
1 ;------------------------------------------------------------------;
2 ; opus_libre -- 10-score.scm                                       ;
3 ;                                                                  ;
4 ; (c) 2008-2010 Valentin Villenave <valentin@villenave.net>        ;
5 ;                                                                  ;
6 ;     opus_libre is a free framework for GNU LilyPond: you may     ;
7 ; redistribute it and/or modify it under the terms of the GNU      ;
8 ; General Public License, version 3 or later: gnu.org/licenses     ;
9 ;                                                                  ;
10 ;------------------------------------------------------------------;
12 ; Score assembly.
14 ;; Browsing scores sub-directory
15 (define conf:scores-dir "scores")
16 (define conf:default-score "etc/blank")
18 (define-public (defined-string? sym)
19   (string? (ly:parser-lookup parser sym)))
21 (define-public (exists? loc) (access? loc F_OK))
23 (define score-dir
24   (if (defined-string? 'scores)
25       (let* ((score-subdir (ly:parser-lookup parser 'scores))
26              (full-dir
27                (string-append conf:scores-dir "/" score-subdir)))
28         (if (exists? full-dir)
29             full-dir
30             (begin (ly:warning "Score directory not found: ~a.
31 A blank score will be created instead." full-dir)
32                conf:default-score)))
33   (begin (ly:warning "Score directory not defined!
34 A blank score will be created instead.")
35      conf:default-score)))