From: hanwen Date: Fri, 7 Oct 2005 09:12:03 +0000 (+0000) Subject: (marked-up-headfoot): change tagline X-Git-Tag: release/2.7.16^2~114 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=96c4d1f4fc1803a72eb985be99750c69ab1978f7;p=lilypond.git (marked-up-headfoot): change tagline handling. tagline = ##f will blank the tagline as well. --- diff --git a/ChangeLog b/ChangeLog index e8a659cbed..9e278a1f27 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ +2005-10-07 Han-Wen Nienhuys + + * scm/titling.scm (marked-up-headfoot): change tagline + handling. tagline = ##f will blank the tagline as well. + 2005-10-06 Han-Wen Nienhuys + * Documentation/topdocs/NEWS.tely: add entry for Figured bass. + + * lily/new-figured-bass-engraver.cc (struct + New_figured_bass_engraver): add new_music_found_ member. + + * lily/lilypond-version.cc (Lilypond_version): deal with + incorrectly formatted version strings. + * ly/engraver-init.ly (AncientRemoveEmptyStaffContext): switch on New_figured_bass_engraver by default. diff --git a/Documentation/topdocs/NEWS.tely b/Documentation/topdocs/NEWS.tely index b91fed2ee0..4d228c6d21 100644 --- a/Documentation/topdocs/NEWS.tely +++ b/Documentation/topdocs/NEWS.tely @@ -45,6 +45,20 @@ This document is also available in @uref{NEWS.pdf,PDF}. @itemize @bullet +@item +Support for figured bass has been rewritten. Now it supports continuation lines. + +@lilypond[raggedright,fragment] +<< +\relative { c4 c c c } +\figures { + \set useBassFigureExtenders = ##t + <6+ 4 3> <6 4 3> <4 3+> +} >> +@end lilypond + +This feature was sponsored by Trent Johnston. + @item Vertical alignments of staves can now be tuned easily for individual systems. diff --git a/THANKS b/THANKS index 763153aebe..9485bf54a5 100644 --- a/THANKS +++ b/THANKS @@ -29,8 +29,10 @@ D. Josiah Boothby Kieren MacMillan Kris Shaffer Nancho Alvarez +Nicolas Sceaux Steve Doonan Sven Axelsson +Trent Johnston Trevor Bača Yoshinobu Ishizaki Vicente Solsona Dellá diff --git a/input/regression/figured-bass-continuation.ly b/input/regression/figured-bass-continuation.ly new file mode 100644 index 0000000000..ea4fa2704a --- /dev/null +++ b/input/regression/figured-bass-continuation.ly @@ -0,0 +1,24 @@ +\header { + + texidoc = "Figured bass extender lines run between repeated bass +figures. They are switched on with @code{useBassFigureExtenders}" + +} + +\version "2.7.12" +\paper { + raggedright = ##t +} + +<< + \relative \new Voice { + c8 c b b a a b b + c^"the same with extenders" c b b a a b b + + } + \figures { + <6+ 4 3>4 <6 4 3> <4 3+> r4 + \set useBassFigureExtenders = ##t + <6+ 4 3> <6 4 3> <4 3+> r4 + } +>> diff --git a/lily/lilypond-version.cc b/lily/lilypond-version.cc index 80db995225..6479f0a91c 100644 --- a/lily/lilypond-version.cc +++ b/lily/lilypond-version.cc @@ -6,6 +6,8 @@ (c) 1998--2005 Jan Nieuwenhuizen */ +#include + #include "lilypond-input-version.hh" #include "string-convert.hh" #include "array.hh" @@ -19,13 +21,21 @@ Lilypond_version::Lilypond_version (int major, int minor, int patch) Lilypond_version::Lilypond_version (String str) { + major_ = 0; + minor_ = 0; + patch_ = 0; + Array version; version = String_convert::split (str, '.'); - major_ = version[0].to_int (); - minor_ = version[1].to_int (); + if (version.size () > 0 && isdigit (version[0][0])) + major_ = version[0].to_int (); + if (version.size () > 1 && isdigit (version[1][0])) + minor_ = version[1].to_int (); + patch_ = 0; - if (version.size () >= 3) + if (version.size () >= 3 + && isdigit (version[2][0])) patch_ = version[2].to_int (); if (version.size () >= 4) diff --git a/lily/lyric-hyphen.cc b/lily/lyric-hyphen.cc index 4bafc7e508..8e78407d88 100644 --- a/lily/lyric-hyphen.cc +++ b/lily/lyric-hyphen.cc @@ -23,7 +23,8 @@ Hyphen_spanner::print (SCM smob) me->get_bound (RIGHT)); if (bounds[LEFT]->break_status_dir () - && Paper_column::when_mom (bounds[LEFT]) == Paper_column::when_mom (bounds[RIGHT]->get_column ())) + && (Paper_column::when_mom (bounds[LEFT]) + == Paper_column::when_mom (bounds[RIGHT]->get_column ()))) return SCM_EOL; Grob *common = bounds[LEFT]->common_refpoint (bounds[RIGHT], X_AXIS); diff --git a/lily/new-figured-bass-engraver.cc b/lily/new-figured-bass-engraver.cc index f3186193ec..8687828117 100644 --- a/lily/new-figured-bass-engraver.cc +++ b/lily/new-figured-bass-engraver.cc @@ -28,19 +28,26 @@ struct Figure_group SCM number_; SCM alteration_; - bool is_continuation_; Item *figure_item_; Music *current_music_; Figure_group () { - is_continuation_ = false; continuation_line_ = 0; number_ = SCM_EOL; alteration_ = SCM_EOL; group_ = 0; current_music_ = 0; } + bool is_continuation () const + { + return + current_music_ + && ly_is_equal (number_, + current_music_->get_property ("figure")) + && ly_is_equal (alteration_, + current_music_->get_property ("alteration")); + } }; struct New_figured_bass_engraver : public Engraver @@ -48,11 +55,14 @@ struct New_figured_bass_engraver : public Engraver TRANSLATOR_DECLARATIONS(New_figured_bass_engraver); void clear_spanners(); void add_brackets (); + void create_grobs (); protected: Array groups_; Spanner *alignment_; Link_array new_musics_; bool continuation_; + bool new_music_found_; + Moment stop_moment_; Music *rest_event_; @@ -94,6 +104,7 @@ New_figured_bass_engraver::New_figured_bass_engraver () alignment_ = 0; continuation_ = false; rest_event_ = 0; + new_music_found_ = false; } void @@ -107,7 +118,6 @@ New_figured_bass_engraver::start_translation_timestep () for (int i = 0; i < groups_.size (); i++) { groups_[i].current_music_ = 0; - groups_[i].is_continuation_ = false; } continuation_ = false; } @@ -115,35 +125,33 @@ New_figured_bass_engraver::start_translation_timestep () bool New_figured_bass_engraver::try_music (Music *m) { - if (m->is_mus_type ("rest-event")) + new_music_found_ = true; + if (m->is_mus_type ("rest-event")) { rest_event_ = m; return true; } - else - { - SCM fig = m->get_property ("figure"); - for (int i = 0; i < groups_.size (); i++) - { - if (!groups_[i].current_music_ - && ly_is_equal (groups_[i].number_, fig)) - { - groups_[i].current_music_ = m; - groups_[i].is_continuation_ = - ly_is_equal (groups_[i].alteration_, - m->get_property ("alteration")); + else + { + stop_moment_ = now_mom () + m->get_length (); + + SCM fig = m->get_property ("figure"); + for (int i = 0; i < groups_.size (); i++) + { + if (!groups_[i].current_music_ + && ly_is_equal (groups_[i].number_, fig)) + { + groups_[i].current_music_ = m; - continuation_ = true; - return true; - } - } + continuation_ = true; + return true; + } + } - new_musics_.push (m); + new_musics_.push (m); - stop_moment_ = now_mom () + m->get_length (); - - return true; - } + return true; + } } void @@ -205,15 +213,31 @@ New_figured_bass_engraver::process_music () clear_spanners (); return; } + + if (!new_music_found_) + return ; + new_music_found_ = false; + + /* + Don't need to sync alignments, if we're not using extenders. + */ + bool use_extenders = to_boolean (get_property ("useBassFigureExtenders")); + if (!use_extenders) + { + alignment_ = 0; + for (int i = 0; i < groups_.size (); i++) + { + groups_[i].group_ = 0; + groups_[i].continuation_line_ = 0; + } + } - Grob *muscol = dynamic_cast (unsmob_grob (get_property ("currentMusicalColumn"))); if (!continuation_) { clear_spanners (); - alignment_ = make_spanner ("BassFigureAlignment", SCM_EOL); - alignment_->set_bound (LEFT, muscol); } + int k = 0; for (int i = 0; i < new_musics_.size (); i++) { @@ -234,20 +258,18 @@ New_figured_bass_engraver::process_music () for (int i = 0; i < groups_.size (); i++) { - if (!groups_[i].is_continuation_) + if (!groups_[i].is_continuation ()) { groups_[i].number_ = SCM_BOOL_F; groups_[i].alteration_ = SCM_BOOL_F; } } - SCM proc = get_property ("newFiguredBassFormatter"); - alignment_->set_bound (RIGHT, muscol); - - if (to_boolean (get_property ("useBassFigureExtenders"))) + if (use_extenders) + for (int i = 0; i < groups_.size(); i++) { - if (groups_[i].is_continuation_) + if (groups_[i].is_continuation ()) { if (!groups_[i].continuation_line_) { @@ -269,16 +291,27 @@ New_figured_bass_engraver::process_music () else groups_[i].continuation_line_ = 0; } - + create_grobs (); + add_brackets (); +} + +void +New_figured_bass_engraver::create_grobs () +{ + Grob *muscol = dynamic_cast (unsmob_grob (get_property ("currentMusicalColumn"))); + if (!alignment_) + { + alignment_ = make_spanner ("BassFigureAlignment", SCM_EOL); + alignment_->set_bound (LEFT, muscol); + } + alignment_->set_bound (RIGHT, muscol); + + SCM proc = get_property ("newFiguredBassFormatter"); for (int i = 0; i < groups_.size(); i++) { Figure_group &group = groups_[i]; - if (group.continuation_line_) - { - group.continuation_line_->set_bound (RIGHT, muscol); - } - else if (group.current_music_) + if (group.current_music_) { Item *item = make_item ("NewBassFigure", @@ -312,13 +345,22 @@ New_figured_bass_engraver::process_music () group.figure_item_ = item; } - groups_[i].group_->set_bound (RIGHT, muscol); + if (group.continuation_line_) + { + /* + UGH should connect to the bass staff, and get the note heads. + */ + group.figure_item_->set_property ("transparent", SCM_BOOL_T); + group.continuation_line_->set_bound (RIGHT, group.figure_item_); + } + + + if (groups_[i].group_) + groups_[i].group_->set_bound (RIGHT, muscol); } - add_brackets (); } - ADD_TRANSLATOR (New_figured_bass_engraver, /* doc */ diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm index 2eaceda23c..c7da88a649 100644 --- a/scm/define-context-properties.scm +++ b/scm/define-context-properties.scm @@ -26,6 +26,7 @@ ;; TODO FIXME (useBassFigureExtenders ,boolean? "") (figuredBassAlterationDirection ,ly:dir? "") + (newFiguredBassFormatter ,procedure? "") (aDueText ,string? "Text to print at a unisono passage.") (alignBelowContext ,string? "Where to insert newly created context in vertiical alignment.") diff --git a/scm/define-music-properties.scm b/scm/define-music-properties.scm index a0b45d2491..8bc0e995ab 100644 --- a/scm/define-music-properties.scm +++ b/scm/define-music-properties.scm @@ -106,8 +106,7 @@ translation property") "Change to what kind of state? Options are solo1, solo2 and unisono") - (figure ,markup? "a `figure' (which may be -a string) for figured bass") + (figure ,integer? "a bass figure") (alteration ,number? "alteration for figured bass") (bracket-start ,boolean? "start a bracket here. TODO: use SpanEvents?") diff --git a/scm/titling.scm b/scm/titling.scm index 428c07d5cd..ab429c85f9 100644 --- a/scm/titling.scm +++ b/scm/titling.scm @@ -36,16 +36,11 @@ page:last?, page:page-number-string and page:page-number (cdr entry))) alist)) alists)) - (tagline (ly:modules-lookup scopes 'tagline)) - (default-tagline (ly:output-def-lookup layout 'tagline)) - (pgnum-alist (list (cons 'header:tagline - (cond - ((markup? tagline) tagline) - ((markup? default-tagline) default-tagline) - (else ""))) + (ly:modules-lookup scopes 'tagline + (ly:output-def-lookup layout 'tagline))) (cons 'page:last? last?) (cons 'page:page-number-string (number->string page-number)) @@ -54,7 +49,7 @@ page:last?, page:page-number-string and page:page-number (list pgnum-alist) prefixed-alists (layout-extract-page-properties layout)))) - + (display prefixed-alists) (interpret-markup layout props potential-markup)) empty-stencil))