From: Han-Wen Nienhuys Date: Tue, 26 Sep 2006 10:49:11 +0000 (+0000) Subject: * scm/define-grob-properties.scm (all-user-grob-properties): add X-Git-Tag: cvs/HEAD~59 X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=commitdiff_plain;h=f505233bbb52b9536514846bf63641a79eaa6219;p=lilypond.git * scm/define-grob-properties.scm (all-user-grob-properties): add forced property. * lily/accidental.cc (after_line_breaking): read forced property. * lily/accidental-engraver.cc (process_acknowledged): set 'forced property. * input/regression/accidental-forced-tie.ly: new file. --- diff --git a/ChangeLog b/ChangeLog index 2b9d591750..f35d6e6f0b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2006-09-26 Han-Wen Nienhuys + + * scm/define-grob-properties.scm (all-user-grob-properties): add + forced property. + + * lily/accidental.cc (after_line_breaking): read forced property. + + * lily/accidental-engraver.cc (process_acknowledged): set 'forced + property. + + * input/regression/accidental-forced-tie.ly: new file. + 2006-09-25 Han-Wen Nienhuys * ly/engraver-init.ly: set ignoreFiguredBassRest in Staff context. @@ -23,7 +35,7 @@ rename make_foo_from_properties to internal_make_foo and move it from context-property.cc to a member function of Engraver. - + * lily/include/lily-guile-macros.hh: overload ly_symbol2scm macro so that there is no more need to use internal_foo diff --git a/input/regression/accidental-forced-tie.ly b/input/regression/accidental-forced-tie.ly new file mode 100644 index 0000000000..6c5b605ccb --- /dev/null +++ b/input/regression/accidental-forced-tie.ly @@ -0,0 +1,13 @@ +\version "2.9.18" + +\header { + texidoc = "Accidentals can be forced with ! and ? even if the notes are tied." +} + +\layout { + ragged-right = ##t +} + +\relative { + gis'4 ~ gis!~ gis? + } diff --git a/lily/accidental-engraver.cc b/lily/accidental-engraver.cc index f1e0a270b7..e08d3b3771 100644 --- a/lily/accidental-engraver.cc +++ b/lily/accidental-engraver.cc @@ -333,8 +333,8 @@ Accidental_engraver::process_acknowledged () pitch, origin, cautionaries, barnum); - bool cautionary = to_boolean (note->get_property ("cautionary")); + bool cautionary = to_boolean (note->get_property ("cautionary")); if (num_caut > num) { num = num_caut; @@ -342,7 +342,8 @@ Accidental_engraver::process_acknowledged () cautionary = true; } - if (num == 0 && to_boolean (note->get_property ("force-accidental"))) + bool forced = to_boolean (note->get_property ("force-accidental")); + if (num == 0 && forced) num = 1; /* Cannot look for ties: it's not guaranteed that they reach @@ -350,6 +351,10 @@ Accidental_engraver::process_acknowledged () if (num && !note->in_event_class ("trill-span-event")) create_accidental (&accidentals_[i], num > 1, cautionary); + + + if (forced || cautionary) + accidentals_[i].accidental_->set_property ("forced", SCM_BOOL_T); } } } diff --git a/lily/accidental.cc b/lily/accidental.cc index d79c17a9e9..0557883267 100644 --- a/lily/accidental.cc +++ b/lily/accidental.cc @@ -47,8 +47,12 @@ Accidental_interface::after_line_breaking (SCM smob) Grob *me = unsmob_grob (smob); Grob *tie = unsmob_grob (me->get_object ("tie")); - if (tie && !tie->original ()) - me->suicide (); + if (tie && !tie->original () + && !to_boolean (me->get_property ("forced"))) + { + me->suicide (); + } + return SCM_UNSPECIFIED; } @@ -256,6 +260,7 @@ ADD_INTERFACE (Accidental_interface, "accidental-interface", "avoid-slur " "cautionary " "cautionary-style " + "forced " "style " "tie " ); diff --git a/lily/part-combine-iterator.cc b/lily/part-combine-iterator.cc index 2a85da8037..3400dc8e88 100644 --- a/lily/part-combine-iterator.cc +++ b/lily/part-combine-iterator.cc @@ -17,7 +17,9 @@ typedef enum Outlet_type { - CONTEXT_ONE, CONTEXT_TWO, CONTEXT_SHARED, CONTEXT_SOLO, CONTEXT_NULL, NUM_OUTLETS + CONTEXT_ONE, CONTEXT_TWO, + CONTEXT_SHARED, CONTEXT_SOLO, + CONTEXT_NULL, NUM_OUTLETS }; static const char *outlet_names_[NUM_OUTLETS] = diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index ccc8642ff9..6fe9dea48d 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -202,6 +202,7 @@ include @code{medium}, @code{bold}, @code{bold-narrow}, etc.") (font-shape ,symbol? "Select the shape of a font. Choices include @code{upright}, @code{italic}, @code{caps}.") + (forced ,boolean? "manually forced accidental") (forced-distance ,ly:dimension? "A fixed distance between object reference points in an alignment.")