From: Jan Nieuwenhuizen Date: Tue, 28 Nov 2000 14:53:45 +0000 (+0100) Subject: patch::: 1.3.111.jcn2 X-Git-Tag: release/1.3.112~2 X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=commitdiff_plain;h=a2d1453c850bc637873bdd95bba3f51dd03dfae8;p=lilypond.git patch::: 1.3.111.jcn2 1.3.111.jcn2 ============ * Note_head_line_engraver now also listenes to \property "followThread": Automagically connect note-heads when thread switches staff. * Fixed american-chords example (except for o/, that waits for kerning fix). --- diff --git a/CHANGES b/CHANGES index faa70f5fda..3663ff26cb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,12 @@ +1.3.111.jcn2 +============ + +* Note_head_line_engraver now also listenes to \property +"followThread": Automagically connect note-heads when thread switches +staff. + +* Fixed american-chords example (except for o/, that waits for kerning fix). + 1.3.111.jcn1 ============ diff --git a/VERSION b/VERSION index 49edc7cc15..12f2766915 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=111 -MY_PATCH_LEVEL=jcn1 +MY_PATCH_LEVEL=jcn2 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/input/test/american-chords.ly b/input/test/american-chords.ly index 7b92cc0693..ac9716fe66 100644 --- a/input/test/american-chords.ly +++ b/input/test/american-chords.ly @@ -8,13 +8,13 @@ #(set! chord::names-alist-american (append '( - ;; any changes here, see scm/chord-names.scm + ;; any changes here, see scm/chord-name.scm ) chord::names-alist-american)) chord = \notes\transpose c''\chords{ - \property ChordNames.ChordNames \override #'style = #"american" + \property ChordNames.ChordName \override #'style = #'american c % Major triad cs:m % Minor triad df:m5- % Diminished triad diff --git a/input/test/follow-thread.ly b/input/test/follow-thread.ly new file mode 100644 index 0000000000..83b952b769 --- /dev/null +++ b/input/test/follow-thread.ly @@ -0,0 +1,22 @@ +% followThread: connect note heads with line when thread switches staff + +\score{ + < + \context Staff=one \notes\relative c''{ + \context Thread + a + \translator Staff=two + a,, a + \translator Staff=one + a'' + } + \context Staff=two { \clef bass; \skip 1; } + > + \paper{ + linewidth = 70.\mm; + \translator { + \ScoreContext + followThread = ##t + } + } +} \ No newline at end of file diff --git a/input/test/jazz-chords.ly b/input/test/jazz-chords.ly index 6387510fe2..d5fd1fc651 100644 --- a/input/test/jazz-chords.ly +++ b/input/test/jazz-chords.ly @@ -12,7 +12,7 @@ % chord = \notes\transpose c''\chords{ -\property ChordNames.ChordNames \override #'style = #"jazz" +\property ChordNames.ChordName \override #'style = #'jazz % major chords c c:6 % 6 = major triad with added sixth diff --git a/lily/note-head-line-engraver.cc b/lily/note-head-line-engraver.cc index 3f7d9d3f53..9469688536 100644 --- a/lily/note-head-line-engraver.cc +++ b/lily/note-head-line-engraver.cc @@ -14,6 +14,7 @@ #include "rhythmic-head.hh" #include "side-position-interface.hh" #include "staff-symbol-referencer.hh" +#include "translator-group.hh" #include "protected-scm.hh" /** @@ -37,6 +38,8 @@ private: Spanner* line_; Request* req_; Protected_scm heads_; + Translator* last_staff_; + Grob* last_head_; }; Note_head_line_engraver::Note_head_line_engraver () @@ -44,6 +47,8 @@ Note_head_line_engraver::Note_head_line_engraver () line_ = 0; req_ = 0; heads_ = SCM_EOL; + last_head_ = 0; + last_staff_ = 0; } bool @@ -63,11 +68,22 @@ Note_head_line_engraver::try_music (Music* m) void Note_head_line_engraver::acknowledge_grob (Grob_info info) { - if (req_) + if (Rhythmic_head::has_interface (info.elem_l_)) { - if (Rhythmic_head::has_interface (info.elem_l_)) + if (req_) + heads_ = gh_cons (info.elem_l_->self_scm (), heads_); + else if (to_boolean (get_property ("followThread"))) { - heads_ = gh_cons (info.elem_l_->self_scm (), heads_); + Translator* staff = daddy_trans_l_ && daddy_trans_l_->daddy_trans_l_ + ? daddy_trans_l_->daddy_trans_l_->daddy_trans_l_ : 0; + if (staff != last_staff_) + { + if (last_head_) + heads_ = gh_list (info.elem_l_->self_scm (), + last_head_->self_scm (), SCM_UNDEFINED); + last_staff_ = staff; + } + last_head_ = info.elem_l_; } } }