]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/note-column.cc
Issue 3424: Forgotten @code{} in pitch-scheme.cc
[lilypond.git] / lily / note-column.cc
index a49c41b1346dc5ea0b8db014eac8ae1b5dd858fc..b98b4c68f8079ce1178da7c2cc2883afc978eacf 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1997--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -40,6 +40,31 @@ using namespace std;
   annoying layer between (rest)collision & (note-head + stem)
 */
 
+Interval
+Note_column::accidental_width (Grob *me)
+{
+  extract_grob_set (me, "note-heads", nhs);
+  vector<Grob *> accs;
+  for (vsize i = 0; i < nhs.size (); i++)
+    if (Grob *acc = unsmob_grob (nhs[i]->get_object ("accidental-grob")))
+      accs.push_back (acc);
+
+  Grob *common = common_refpoint_of_array (accs, me, X_AXIS);
+  common = common_refpoint_of_array (nhs, common, X_AXIS);
+
+  Interval nhs_ex = Axis_group_interface::relative_group_extent (nhs, common, X_AXIS);
+  Interval accs_ex = Axis_group_interface::relative_group_extent (accs, common, X_AXIS);
+
+  if (nhs_ex.is_empty ())
+    return accs_ex;
+
+  // want an empty interval here
+  if (accs_ex.is_empty ())
+    return Interval ();
+
+  return Interval (accs_ex[LEFT], nhs_ex[LEFT]);
+}
+
 bool
 Note_column::has_rests (Grob *me)
 {
@@ -64,6 +89,18 @@ Note_column::get_stem (Grob *me)
   return unsmob_item (s);
 }
 
+Item *
+Note_column::get_flag (Grob *me)
+{
+  Item *stem = get_stem (me);
+  if (stem)
+    {
+      SCM s = stem->get_object ("flag");
+      return unsmob_item (s);
+    }
+  return 0;
+}
+
 Slice
 Note_column::head_positions_interval (Grob *me)
 {
@@ -184,12 +221,6 @@ Note_column::dot_column (Grob *me)
   return 0;
 }
 
-Grob *
-Note_column::arpeggio (Grob *me)
-{
-  return unsmob_grob (me->get_object ("arpeggio"));
-}
-
 /* If a note-column contains a cross-staff stem then
    nc->extent (Y_AXIS, refp) will not consider the extent of the stem.
    If you want the extent of the stem to be included (and you are safe
@@ -208,7 +239,6 @@ ADD_INTERFACE (Note_column,
                "Stem and noteheads combined.",
 
                /* properties */
-               "arpeggio "
                "force-hshift "
                "horizontal-shift "
                "ignore-collision "