From: Han-Wen Nienhuys Date: Thu, 8 Jun 2006 15:14:16 +0000 (+0000) Subject: * input/regression/quote-tie.ly: new file. X-Git-Tag: release/2.10.0-2~541 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f2074d26f6b8afa53512a31f8f74594806a39d55;p=lilypond.git * input/regression/quote-tie.ly: new file. * lily/tie-engraver.cc (struct Head_event_tuple): add end_moment_ to Head_event_tuple, so we deal gracefully with ties on cue-endings. * lily/pango-font.cc (pango_item_string_stencil): type correctness for FcChar8* --- diff --git a/ChangeLog b/ChangeLog index 8f951cc8de..d7442542c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-06-08 Han-Wen Nienhuys + + * input/regression/quote-tie.ly: new file. + + * lily/tie-engraver.cc (struct Head_event_tuple): add end_moment_ + to Head_event_tuple, so we deal gracefully with ties on + cue-endings. + + * lily/pango-font.cc (pango_item_string_stencil): type correctness + for FcChar8* + 2006-06-08 Graham Percival * input/test/ smart-transpose.ly, reverse-music.ly: diff --git a/input/regression/quote-tie.ly b/input/regression/quote-tie.ly new file mode 100644 index 0000000000..5f7a07525e --- /dev/null +++ b/input/regression/quote-tie.ly @@ -0,0 +1,29 @@ +\version "2.9.7" + +\header { + + texidoc = " Voices from different cues must not be tied together. In +this example, the first note has a tie. This note should not be tied +to the 2nd note. " + +} + +\paper { + ragged-right = ##t +} + +cueI = \relative c'' { + a1 ~ | a | a | +} +\addquote "cueI" { \cueI } + +cueII = \relative c' { + R1 | e | a | +} +\addquote "cueII" { \cueII } + +\new Staff { + \cueDuring "cueI" #UP { R1 } | + R1 + \cueDuring "cueII" #UP { R1 } | +} diff --git a/input/regression/tie-busy-grobs.ly b/input/regression/tie-busy-grobs.ly deleted file mode 100644 index 89acd070a9..0000000000 --- a/input/regression/tie-busy-grobs.ly +++ /dev/null @@ -1,27 +0,0 @@ -\version "2.7.39" -\header { - - texidoc = "Tie engraver uses @code{busyGrobs} to keep track of -note heads. By throwing many mixed tuplets on the queue, -one may have collisions between ties and beams. -" - -} - -\layout { - ragged-right = ##t -} - - -\context Staff \relative c'' -<< - { \times 2/3 { c'8~ c8~ c8~ c8~ c8~ c8 } } - \\ - { \voiceTwo \times 2/5 { a,4 ~a4 ~a4~ a4~ a4 }} - \\ - { \voiceThree { b,8 ~ b8 ~ b8 ~ b8 }} ->> - - - - diff --git a/lily/axis-group-engraver.cc b/lily/axis-group-engraver.cc index fc4cc7b9a4..7efe7b4874 100644 --- a/lily/axis-group-engraver.cc +++ b/lily/axis-group-engraver.cc @@ -105,8 +105,6 @@ ADD_TRANSLATOR (Axis_group_engraver, /* create */ "VerticalAxisGroup", /* accept */ "", /* read */ - "verticalExtent " - "minimumVerticalExtent " - "extraVerticalExtent ", + "currentCommandColumn ", /* write */ ""); diff --git a/lily/pango-font.cc b/lily/pango-font.cc index 73ea7426a6..93c4ec5ff7 100644 --- a/lily/pango-font.cc +++ b/lily/pango-font.cc @@ -126,14 +126,14 @@ Pango_font::pango_item_string_stencil (PangoItem const *item, string str) const b.scale (scale_); char const *ps_name_str0 = FT_Get_Postscript_Name (ftface); FcPattern *fcpat = fcfont->font_pattern; - char *file_name_as_ptr = 0; - FcPatternGetString (fcpat, FC_FILE, 0, (FcChar8 **) & file_name_as_ptr); + FcChar8 *file_name_as_ptr = 0; + FcPatternGetString (fcpat, FC_FILE, 0, &file_name_as_ptr); string file_name; if (file_name_as_ptr) { /* Normalize file name. */ - file_name = File_name (file_name_as_ptr).to_string (); + file_name = File_name ((char const *)file_name_as_ptr).to_string (); } SCM glyph_exprs = SCM_EOL; diff --git a/lily/tie-engraver.cc b/lily/tie-engraver.cc index 39be6c057f..c7484ed0b7 100644 --- a/lily/tie-engraver.cc +++ b/lily/tie-engraver.cc @@ -32,16 +32,15 @@ struct Head_event_tuple { Grob *head_; + Moment end_moment_; SCM tie_definition_; Music *event_; + Head_event_tuple () { - } - Head_event_tuple (Grob *h, Music *m, SCM def) - { - head_ = h; - event_ = m; - tie_definition_ = def; + event_ = 0; + head_ = 0; + tie_definition_ = SCM_EOL; } }; @@ -138,6 +137,17 @@ Tie_engraver::start_translation_timestep () { context ()->set_property ("tieMelismaBusy", ly_bool2scm (heads_to_tie_.size ())); + + + if (!to_boolean (get_property ("tieWaitForNote"))) + { + Moment now = now_mom (); + for (vsize i = heads_to_tie_.size (); i--; ) + { + if (now > heads_to_tie_[i].end_moment_) + heads_to_tie_.erase (heads_to_tie_.begin () + i); + } + } } void @@ -165,8 +175,29 @@ Tie_engraver::stop_translation_timestep () for (vsize i = 0; i < now_heads_.size (); i++) { - heads_to_tie_.push_back (Head_event_tuple (now_heads_[i], event_, - start_definition)); + Grob *head = now_heads_[i]; + Music *left_mus = unsmob_music (head->get_property ("cause")); + if (left_mus) + { + Head_event_tuple event_tup; + + event_tup.head_ = head; + event_tup.tie_definition_ = start_definition; + event_tup.event_ = event_; + + Moment end = now_mom (); + if (end.grace_part_) + { + end.grace_part_ += left_mus->get_length ().main_part_; + } + else + { + end += left_mus->get_length (); + } + event_tup.end_moment_ = end; + + heads_to_tie_.push_back (event_tup); + } } } diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly index ff553e402d..32b4d41bd0 100644 --- a/ly/music-functions-init.ly +++ b/ly/music-functions-init.ly @@ -485,3 +485,24 @@ acceleration/deceleration. " argument)) + + + +resetRelativeOctave = +#(define-music-function + (parser location reference-note) + (ly:music?) + "Set the octave inside a \\relative section." + + (let* + ((notes (ly:music-property reference-note 'elements)) + (pitch (ly:music-property (car notes) 'pitch))) + + (set! (ly:music-property reference-note 'elements) '()) + (set! (ly:music-property reference-note + 'to-relative-callback) + (lambda (music last-pitch) + pitch)) + + reference-note)) +