volatile/configurable variables (FIXME: better name).
* lily/music-output-def.cc (c_lookup_variable): Rename (WAS:
get_scmvar).
+2004-04-29 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * lily/page.cc (Page): Do not use ly_scheme_function for
+ volatile/configurable variables (FIXME: better name).
+
+ * lily/music-output-def.cc (c_lookup_variable): Rename (WAS:
+ get_scmvar).
+
2004-04-29 Han-Wen Nienhuys <hanwen@xs4all.nl>
* scripts/convert-ly.py (FatalConversionError.subst): use
%% #(paper-set-staff-size (* 11.0 pt))
raggedright = ##t
- linewidth = 40\mm
+ linewidth = 0\mm
indent = 0 \mm
- %% #(define page-to-stencil page-stack-lines)
- #(define (page-to-stencil page)
- (box-stencil (page-stack-lines page) 0.1 0.5))
+ #(define page-to-stencil page-stack-lines)
+ %%#(define (page-to-stencil page)
+ %% (box-stencil (page-stack-lines page) 0.1 0.5))
\context {
\StaffContext
}
}
+noCruft = \paper {
+ \context {
+ \StaffContext
+ %% Hmm, no effect ?
+ %% \override StaffSymbol #'print-function = ##f
+ %% Clef = \turnOff
+ %% StaffSymbol = \turnOff
+ %% TimeSignature = \turnOff
+ \override Clef #'print-function = ##f
+ \override StaffSymbol #'line-count = #0
+ \override TimeSignature #'print-function = ##f
+ }
+}
+
+noCruftInBed = \paper {
+ \inBed
+
+ %%\noCruft
+ %%URGHSr
+ \context {
+ \StaffContext
+ %% Hmm, no effect ?
+ %% \override StaffSymbol #'print-function = ##f
+ %% Clef = \turnOff
+ %% StaffSymbol = \turnOff
+ %% TimeSignature = \turnOff
+ \override Clef #'print-function = ##f
+ \override StaffSymbol #'line-count = #0
+ \override TimeSignature #'print-function = ##f
+ }
+}
+
+tuning = \markup {
+ \score { \notes { \clef bass <c, g, d g>1 } \paper{ \inBed }}
+}
+
+#(define-public (my-footer paper page-number)
+ (let ((props (page-properties paper)))
+ (interpret-markup paper props
+ (markup #:fill-line ( #:line ( "Tuning: " tuning) "")))))
+
+tempoChange = \markup {
+ %% wtf, no horizontal shift?
+ "" %%\kern #-10
+ \translate #'(-15 . 0)
+ \score { \notes \times 2/3 { c'8 c' c' } \paper { \noCruftInBed }}
+ " ="
+ \score { \notes { c'8[ c'] } \paper { \noCruftInBed } }
+}
+
\header {
- title = "title"
- subtitle = \markup { \fill-line <
- "subtitle with score: "
- \score { \relative \notes { a'^"Hi" b c } \paper { \inBed } }
- "woo!"
- > }
- subsubtitle = "subsubtitle"
+ title = "Solo Cello Suites"
+ subtitle = "Suite IV"
+ subsubtitle = \markup { \fill-line < { "Originalstimmung: " \tuning } > }
+}
+
+\paper {
+ #(define make-footer my-footer)
}
\relative {
- a' b c d \break
- a b c d \break
- %% interesting bug:
- %%a b^\markup { \score{ \notes\relative{ <b'1 dis fis> } \paper{ \inBed }}} c d
- a b c d \break
- a b c d \break
+ \time 4/8
+ \times 2/3 { c'8 d e } \times 2/3 {c d e}
+ \time 4/8
+ g8^\tempoChange a8 g8 a \break
}
Break_node first_node ;
optimal_paths.push (first_node);
- bool ragged_right = to_boolean (pscore_->paper_->get_scmvar ("raggedright"));
- bool ragged_last = to_boolean (pscore_->paper_->get_scmvar ("raggedlast"));
+ bool ragged_right = to_boolean (pscore_->paper_->c_variable ("raggedright"));
+ bool ragged_last = to_boolean (pscore_->paper_->c_variable ("raggedlast"));
Real worst_force = 0.0;
for (int break_idx = 1; break_idx< breaks.size (); break_idx++)
void assign_context_def (SCM transdef);
SCM find_context_def (SCM name) const;
String outname_string () ;
- SCM get_scmvar (String id) const;
+ SCM c_variable (String id) const;
SCM lookup_variable (SCM sym) const;
void set_variable (SCM, SCM sym);
// fixme: dependencies
}
SCM
-Music_output_def::get_scmvar (String s) const
+Music_output_def::lookup_variable (SCM sym) const
+{
+ SCM var = ly_module_lookup (scope_, sym);
+
+ return scm_variable_ref (var);
+}
+
+SCM
+Music_output_def::c_variable (String s) const
{
return lookup_variable (ly_symbol2scm (s.to_str0 ()));
}
scm_module_define (scope_, sym, val);
}
-SCM
-Music_output_def::lookup_variable (SCM sym) const
-{
- SCM var = ly_module_lookup (scope_, sym);
-
- return scm_variable_ref (var);
-}
-
LY_DEFINE (ly_paper_lookup, "ly:paper-lookup",
2, 0,0, (SCM pap, SCM sym),
"Lookup @var{sym} in @var{pap}. "
page_count_++;
- SCM make_header = ly_scheme_function ("make-header");
- SCM make_footer = ly_scheme_function ("make-footer");
-
- header_ = scm_call_2 (make_header, paper_->self_scm (),
+ header_ = scm_call_2 (paper_->c_variable ("make-header"),
+ paper_->self_scm (),
scm_int2num (number_));
if (unsmob_stencil (header_))
unsmob_stencil (header_)->align_to (Y_AXIS, UP);
- footer_ = scm_call_2 (make_footer, paper_->self_scm (),
+ footer_ = scm_call_2 (paper_->c_variable ("make-footer"),
+ paper_->self_scm (),
scm_int2num (number_));
if (unsmob_stencil (footer_))
unsmob_stencil (footer_)->align_to (Y_AXIS, UP);
// JUNKME
SCM
-stencil2line (Stencil* stil, bool is_title = false)
+stencil2line (Stencil *stil, bool is_title = false)
{
static SCM z;
if (!z)
Paper_def *paper = papers_[0];
SCM scopes = this->scopes (0);
- SCM make_tagline = ly_scheme_function ("make-tagline");
+ SCM make_tagline = paper->c_variable ("make-tagline");
tagline_ = scm_call_2 (make_tagline, paper->self_scm (), scopes);
Real tag_height = 0;
if (Stencil *s = unsmob_stencil (tagline_))
tag_height = s->extent (Y_AXIS).length ();
height_ += tag_height;
- SCM make_copyright = ly_scheme_function ("make-copyright");
+ SCM make_copyright = paper->c_variable ("make-copyright");
copyright_ = scm_call_2 (make_copyright, paper->self_scm (), scopes);
Real copy_height = 0;
if (Stencil *s = unsmob_stencil (copyright_))
tag_height = s->extent (Y_AXIS).length ();
SCM all = lines ();
- SCM proc = paper->get_scmvar ("page-breaking");
+ SCM proc = paper->c_variable ("page-breaking");
SCM breaks = scm_apply_0 (proc, scm_list_n (all, scm_make_real (height_),
scm_make_real (text_height),
scm_make_real (-copy_height),
for (int i = 0; i < page_count; i++)
{
if (i)
- page = new Page (paper, i+1);
+ page = new Page (paper, i + 1);
+
int next = i + 1 < page_count
? ly_scm2int (scm_vector_ref (breaks, scm_int2num (i))) : 0;
while ((!next && all != SCM_EOL) || line <= next)
*/
compound_fixed_note_space = compound_fixed_note_space <? compound_note_space;
- bool packed = to_boolean (me->get_paper ()->get_scmvar ("packed"));
+ bool packed = to_boolean (me->get_paper ()->c_variable ("packed"));
Real strength, distance;
/*
#(define page-to-stencil ly:page-header-lines-footer-stencil)
+ #(define make-header plain-header)
+ #(define make-footer plain-footer)
+ %%#(define make-footer empty-markup)
+ #(define make-tagline TAGLINE-or-tagline-from-header)
+ #(define make-copyright copyright-from-header)
+
\include "engraver-init.ly"
}
;;;;
;;;; source file of the GNU LilyPond music typesetter
;;;;
-;;;; (c) 2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-;;;; Jan Nieuwenhuizen <janneke@gnu.org>
-
+;;;; (c) 2004 Nicolas Sceaux <nicolas.sceaux@free.fr>
+;;;; Jan Nieuwenhuizen <janneke@gnu.org>
(define gen-lily-sym
;; Generate a lilyvartmpXX symbol, that may be (hopefully) unique.
(variable-ref v)
(if (module? (cdr modules)) (ly:modules-lookup (cdr modules) sym)))))
-(define (page-properties paper)
+(define-public (page-properties paper)
(list (append `((linewidth . ,(ly:paper-get-number
paper 'linewidth)))
(ly:paper-lookup paper 'text-font-defaults))))
("" (get 'opus))
#:fill-line (#:large #:bigger #:caps (get 'piece) "")))))))
-(define-public (make-header paper page-number)
+(define-public (plain-header paper page-number)
(let ((props (page-properties paper) ))
(interpret-markup paper props
(markup #:fill-line
("" #:bold (number->string page-number))))))
-(define-public (make-footer paper page-number)
+(define-public (plain-footer paper page-number)
(let ((props (page-properties paper)))
(interpret-markup paper props
(define TAGLINE
(string-append "Engraved by LilyPond (version " (lilypond-version) ")"))
-(define-public (make-tagline paper scopes)
+(define-public (TAGLINE-or-tagline-from-header paper scopes)
(let* ((props (page-properties paper))
(tagline-var (ly:modules-lookup scopes 'tagline))
(tagline (if (markup? tagline-var) tagline-var TAGLINE)))
(markup #:fill-line (tagline "")))))
((markup? tagline) (interpret-markup paper props tagline)))))
-(define-public (make-copyright paper scopes)
+(define-public (copyright-from-header paper scopes)
(let ((props (page-properties paper))
(copyright (ly:modules-lookup scopes 'copyright)))