]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.111.jcn2
authorJan Nieuwenhuizen <janneke@gnu.org>
Tue, 28 Nov 2000 14:53:45 +0000 (15:53 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Tue, 28 Nov 2000 14:53:45 +0000 (15:53 +0100)
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).

CHANGES
VERSION
input/test/american-chords.ly
input/test/follow-thread.ly [new file with mode: 0644]
input/test/jazz-chords.ly
lily/note-head-line-engraver.cc

diff --git a/CHANGES b/CHANGES
index faa70f5fda68ed6393db43d6fc078cbb8bbd1ca6..3663ff26cbee1220279bf8985f12bc9310c68a38 100644 (file)
--- 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 49edc7cc150317ed59b0285f22cf411b5367242b..12f276691554b6aba013d8a77b2bbe2b5e9f4072 100644 (file)
--- 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.
index 7b92cc0693abaf4b7c66403717d88b891b1e18f8..ac9716fe66c87792832d0947c467ba56e9389f34 100644 (file)
@@ -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 (file)
index 0000000..83b952b
--- /dev/null
@@ -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
index 6387510fe28456b97dba8de84bb1236a2438c690..d5fd1fc651e0e555b5f015694da49fed057b33df 100644 (file)
@@ -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
index 3f7d9d3f53b71c5d1d60487b208e1abf1d19ceca..9469688536d08bb42032d3bd5b63bdd259b884e4 100644 (file)
@@ -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_;
        }
     }
 }