]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/note-performer.cc
Merge branch 'master' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / lily / note-performer.cc
index 8a39546b41c32c2e4062c54bceedb1211eccd8ac..ff296311ffead109a8de2936f8542a3170b8aa0d 100644 (file)
@@ -3,14 +3,13 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1996--2006 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 1996--2007 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "performer.hh"
 #include "audio-item.hh"
 #include "audio-column.hh"
 #include "global-context.hh"
-#include "music.hh"
 #include "stream-event.hh"
 #include "warn.hh"
 
@@ -39,11 +38,10 @@ Note_performer::process_music ()
 {
   if (note_evs_.size ())
     {
-      int transposing = 0;
-
+      Pitch transposing;
       SCM prop = get_property ("instrumentTransposition");
       if (unsmob_pitch (prop))
-       transposing = unsmob_pitch (prop)->semitone_pitch ();
+       transposing = *unsmob_pitch (prop);
 
       while (note_evs_.size ())
        {
@@ -54,21 +52,28 @@ Note_performer::process_music ()
          if (Pitch *pitp = unsmob_pitch (pit))
            {
               SCM articulations = n->get_property ("articulations");
-              Music *tie_event = 0;
+              Stream_event *tie_event = 0;
               for (SCM s = articulations;
                    !tie_event && scm_is_pair (s);
                    s = scm_cdr (s))
                 {
-                  Music *m = unsmob_music (scm_car (s));
-                  if (!m)
+                  Stream_event *ev = unsmob_stream_event (scm_car (s));
+                  if (!ev)
                     continue;
          
-                  if (m->is_mus_type ("tie-event"))
-                    tie_event = m;
+                  if (ev->in_event_class ("tie-event"))
+                    tie_event = ev;
                 }
 
-             Audio_note *p = new Audio_note (*pitp, get_event_length (n), 
-                                              tie_event, - transposing);
+             Moment len = get_event_length (n);
+             if (now_mom().grace_part_)
+               {
+                 len.grace_part_ = len.main_part_;
+                 len.main_part_ = Rational (0);
+               }
+             
+             Audio_note *p = new Audio_note (*pitp, len, 
+                                              tie_event, transposing.negated ());
              Audio_element_info info (p, n);
              announce_element (info);
              notes_.push_back (p);
@@ -95,7 +100,6 @@ Note_performer::listen_note (Stream_event *ev)
 }
 
 ADD_TRANSLATOR (Note_performer, "", "",
-               "note-event ",
                "", "");
 
 Note_performer::Note_performer ()