]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/note-column.cc
release: 1.5.28
[lilypond.git] / lily / note-column.cc
index 56a29d08a3d313501e0d8db8241e2fe28018206a..5c1b664bbe9c5aee17aa42be34988d3877f6cb75 100644 (file)
@@ -37,7 +37,6 @@ Note_column::shift_compare (Grob *const &p1, Grob *const&p2)
 void
 Note_column::set_interface (Grob* me)
 {
-  me->set_grob_property ("note-heads", SCM_EOL);  
   me->set_interface (ly_symbol2scm ("note-column-interface"));
   
   Axis_group_interface::set_interface (me);
@@ -48,7 +47,7 @@ Item *
 Note_column::stem_l (Grob*me) 
 {
   SCM s = me->get_grob_property ("stem");
-  return  dynamic_cast<Item*> (unsmob_grob (s));
+  return  unsmob_item (s);
 }
   
 Slice
@@ -100,7 +99,7 @@ Note_column::add_head (Grob*me,Grob *h)
     }
   else if (Note_head::has_interface (h))
     {
-      Pointer_group_interface::add_element (me, ly_symbol2scm ("note-heads"),h);
+      Pointer_group_interface::add_grob (me, ly_symbol2scm ("note-heads"),h);
     }
   Axis_group_interface::add_element (me, h);
 }
@@ -140,3 +139,21 @@ Note_column::has_interface (Grob*me)
 {
   return me && me->has_interface (ly_symbol2scm ("note-column-interface"));
 }
+
+/*
+  Return the first Accidentals grob that we find in a note-head. 
+ */
+Grob* 
+Note_column::accidentals (Grob *me)
+{
+  SCM heads = me->get_grob_property ("note-heads");
+  for (;gh_pair_p (heads); heads =gh_cdr (heads))
+    {
+      Grob * h = unsmob_grob (gh_car (heads));
+      Grob *a = h ? unsmob_grob(h->get_grob_property ("accidentals")) : 0;
+      if (a)
+       return a;
+    }
+
+  return 0;
+}