]> git.donarmstrong.com Git - lilypond.git/commitdiff
* input/regression/quote-tie.ly: new file.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 8 Jun 2006 15:14:16 +0000 (15:14 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 8 Jun 2006 15:14:16 +0000 (15:14 +0000)
* 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*

ChangeLog
input/regression/quote-tie.ly [new file with mode: 0644]
input/regression/tie-busy-grobs.ly [deleted file]
lily/axis-group-engraver.cc
lily/pango-font.cc
lily/tie-engraver.cc
ly/music-functions-init.ly

index 8f951cc8de5967c40af153d668294b7cc37a1bce..d7442542c604f25f1a966c0b88463ab8718648bf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-06-08  Han-Wen Nienhuys  <hanwen@lilypond.org>
+
+       * 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  <gpermus@gmail.com>
 
        * 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 (file)
index 0000000..5f7a075
--- /dev/null
@@ -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 (file)
index 89acd07..0000000
+++ /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 }}
->>
-
-
-
-
index fc4cc7b9a432fbadf9eb737ccee8822f5c8c1294..7efe7b4874c54e2c7d9426ca2191743fb1d02ac6 100644 (file)
@@ -105,8 +105,6 @@ ADD_TRANSLATOR (Axis_group_engraver,
                /* create */ "VerticalAxisGroup",
                /* accept */ "",
                /* read */
-               "verticalExtent "
-               "minimumVerticalExtent "
-               "extraVerticalExtent ",
+               "currentCommandColumn ",
 
                /* write */ "");
index 73ea7426a65ea4a6bf498d1c9881a4bd138ae7ec..93c4ec5ff7a8986394242bff3f35e0e170cfd89b 100644 (file)
@@ -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;
index 39be6c057f034d8015cd12e96ea9edc1480a23b4..c7484ed0b7a27ed2b62de0242081593d5fecf1f1 100644 (file)
 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);
+           }
        }
     }
 
index ff553e402dd2551d700eeb651d9ba9d24513fed9..32b4d41bd0312095d408514d389111ee6f5e9e13 100644 (file)
@@ -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))
+