From b01113ffaeec02548a79f02f2d389c2292815200 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Wed, 9 Mar 2005 08:14:39 +0000 Subject: [PATCH] * lily/paper-book.cc (classic_output): Reinstate header_0_ hack. * lily/book.cc (process): Oops, add score_.header_. * lily/paper-book.cc: Fold hearders, score and texts into scores_. * scm/backend-library.scm (ly:system): Typo. --- ChangeLog | 5 ++++- input/regression/score-text.ly | 30 ++++++++++++++++++------------ lily/book.cc | 4 ++-- lily/include/paper-book.hh | 1 + lily/paper-book.cc | 18 +++++++++++------- scm/backend-library.scm | 1 - 6 files changed, 36 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 96300d92fd..befd3d7fbc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ 2005-03-09 Jan Nieuwenhuizen - * lily/book.cc: + * lily/paper-book.cc (classic_output): Reinstate header_0_ hack. + + * lily/book.cc (process): Oops, add score_.header_. + * lily/paper-book.cc: Fold hearders, score and texts into scores_. * lily/parser.yy: Handle toplevel and book texts as score. diff --git a/input/regression/score-text.ly b/input/regression/score-text.ly index 2cf43d5621..0347f19f82 100644 --- a/input/regression/score-text.ly +++ b/input/regression/score-text.ly @@ -9,20 +9,25 @@ \paper { linewidth = #110 } -\markup { - \fill-line { "High up above" } -} -<< - \relative { - \clef bass - d,2 d c4 bes a2 \break - c2 c d4 f g2 + +%% using Book and Score to get text in lilypond-book +\book { + \markup { + \fill-line { "High up above" } } - \addlyrics { - My first Li -- ly song, - Not much can go wrong! + \score { + << + \relative { + \clef bass + d,2 d c4 bes a2 \break + c2 c d4 f g2 + } + \addlyrics { + My first Li -- ly song, + Not much can go wrong! + } + >> } ->> \markup { %%TODO: make \verse markup. \fill-line { @@ -46,3 +51,4 @@ } } } +} \ No newline at end of file diff --git a/lily/book.cc b/lily/book.cc index 0ba3fdf7f8..4d764f3be3 100644 --- a/lily/book.cc +++ b/lily/book.cc @@ -106,8 +106,8 @@ Book::process (String outname, Output_def *default_def) titling? */ if (scm_is_vector (systems)) { - if (ly_c_module_p (header_)) - paper_book->add_score (header_); + if (ly_c_module_p (score->header_)) + paper_book->add_score (score->header_); paper_book->add_score (systems); } } diff --git a/lily/include/paper-book.hh b/lily/include/paper-book.hh index a95ed8e3f6..1b783fd5fa 100644 --- a/lily/include/paper-book.hh +++ b/lily/include/paper-book.hh @@ -28,6 +28,7 @@ class Paper_book public: SCM header_; + SCM header_0_; SCM scores_; Output_def *paper_; diff --git a/lily/paper-book.cc b/lily/paper-book.cc index d3a7e8512f..0ad8a14be7 100644 --- a/lily/paper-book.cc +++ b/lily/paper-book.cc @@ -20,6 +20,7 @@ Paper_book::Paper_book () { header_ = SCM_EOL; + header_0_ = SCM_EOL; pages_ = SCM_BOOL_F; scores_ = SCM_EOL; systems_ = SCM_BOOL_F; @@ -43,6 +44,7 @@ Paper_book::mark_smob (SCM smob) if (b->paper_) scm_gc_mark (b->paper_->self_scm ()); scm_gc_mark (b->header_); + scm_gc_mark (b->header_0_); scm_gc_mark (b->pages_); scm_gc_mark (b->scores_); return b->systems_; @@ -124,16 +126,12 @@ Paper_book::classic_output (String outname) /* Generate all stencils to trigger font loads. */ systems (); - // ugh code dup SCM scopes = SCM_EOL; if (ly_c_module_p (header_)) scopes = scm_cons (header_, scopes); -#if 0 - if (ly_c_module_p (scores_[0].header_)) - scopes = scm_cons (scores_[0].header_, scopes); -#endif - //end ugh + if (ly_c_module_p (header_0_)) + scopes = scm_cons (header_0_, scopes); String format = output_backend_global; String mod_nm = "scm framework-" + format; @@ -251,10 +249,16 @@ Paper_book::systems () for (SCM s = scm_reverse (scores_); s != SCM_EOL; s = scm_cdr (s)) { if (ly_c_module_p (scm_car (s))) - header = scm_car (s); + { + header = scm_car (s); + if (header_0_ == SCM_EOL) + header_0_ = header; + } else if (scm_is_vector (scm_car (s))) { Stencil title = score_title (header); + if (title.is_empty ()) + title = score_title (header_); if (!title.is_empty ()) { Paper_system *ps = new Paper_system (title, true); diff --git a/scm/backend-library.scm b/scm/backend-library.scm index 431c7b48a6..cb4ac82b0d 100644 --- a/scm/backend-library.scm +++ b/scm/backend-library.scm @@ -84,4 +84,3 @@ '("tex" "dvi" "ps" "pdf" "png")) new-fmts) - -- 2.39.2