]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/accidental-engraver.cc
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / accidental-engraver.cc
index b240dfa03250e8425b945b9a046620a785a6c47d..05990a6853dcd6b38396376996c16be53d16566d 100644 (file)
@@ -77,13 +77,13 @@ public:
     to store all information before we can really create the
     accidentals.
   */
-  Link_array<Grob> left_objects_;
-  Link_array<Grob> right_objects_;
+  vector<Grob*> left_objects_;
+  vector<Grob*> right_objects_;
 
   Grob *accidental_placement_;
 
-  std::vector<Accidental_entry> accidentals_;
-  Link_array<Spanner> ties_;
+  vector<Accidental_entry> accidentals_;
+  vector<Spanner*> ties_;
 };
 
 /*
@@ -387,10 +387,11 @@ Accidental_engraver::create_accidental (Accidental_entry *entry,
 
 Grob *
 Accidental_engraver::make_standard_accidental (Music *note,
-                                              Grob *support,
+                                              Grob *note_head,
                                               Engraver *trans)
 {
 
+  (void)note;
   /*
     We construct the accidentals at the originating Voice
     level, so that we get the property settings for
@@ -399,7 +400,7 @@ Accidental_engraver::make_standard_accidental (Music *note,
   Grob *a
     = make_grob_from_properties (trans,
                                 ly_symbol2scm ("Accidental"),
-                                note->self_scm (),
+                                note_head->self_scm (),
                                 "Accidental");
 
   /*
@@ -407,31 +408,39 @@ Accidental_engraver::make_standard_accidental (Music *note,
     so it is put left of the accidentals.
   */
   for (vsize i = 0; i < left_objects_.size (); i++)
-    Side_position_interface::add_support (left_objects_[i], a);
+    {
+      if (left_objects_[i]->get_property ("side-axis") == scm_from_int (X_AXIS))
+       Side_position_interface::add_support (left_objects_[i], a);
+    }
+
+  /*
+    Hmm. Junkme? 
+   */
   for (vsize i = 0; i < right_objects_.size (); i++)
     Side_position_interface::add_support (a, right_objects_[i]);
 
-  a->set_parent (support, Y_AXIS);
+  a->set_parent (note_head, Y_AXIS);
 
   if (!accidental_placement_)
     accidental_placement_ = make_item ("AccidentalPlacement",
                                       a->self_scm ());
   Accidental_placement::add_accidental (accidental_placement_, a);
 
-  support->set_object ("accidental-grob", a->self_scm ());
+  note_head->set_object ("accidental-grob", a->self_scm ());
 
   return a;
 }
 
 Grob *
 Accidental_engraver::make_suggested_accidental (Music *note,
-                                               Grob *note_head, Engraver *trans)
+                                               Grob *note_head,
+                                               Engraver *trans)
 {
-
+  (void) note;
   Grob *a
     = make_grob_from_properties (trans,
                                 ly_symbol2scm ("AccidentalSuggestion"),
-                                note->self_scm (),
+                                note_head->self_scm (),
                                 "AccidentalSuggestion");
 
   Side_position_interface::add_support (a, note_head);
@@ -529,10 +538,11 @@ Accidental_engraver::acknowledge_rhythmic_head (Grob_info info)
 {
   Music *note = info.music_cause ();
   if (note
-      && note->is_mus_type ("note-event"))
+      && (note->is_mus_type ("note-event")
+         || note->is_mus_type ("trill-span-event")))
     {
       /*
-       std::string harmonics usually don't have accidentals.
+       string harmonics usually don't have accidentals.
       */
       if (to_boolean (get_property ("harmonicAccidentals"))
          || !ly_is_equal (info.grob ()->get_property ("style"),
@@ -583,6 +593,7 @@ ADD_ACKNOWLEDGER (Accidental_engraver, rhythmic_head);
 ADD_ACKNOWLEDGER (Accidental_engraver, tie);
 
 ADD_TRANSLATOR (Accidental_engraver,
+               
                "Make accidentals.  "
                "Catch note heads, ties and notices key-change events.  "
                "This engraver usually lives at Staff level, but "