]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/note-head-side.cc
patch::: 1.3.8.uu1
[lilypond.git] / lily / note-head-side.cc
index a5ef70294ca42df6326f86e25cb532a6d80624f7..d5d154ac0d7a6b995e1c9b149c8de8d179f9ccd4 100644 (file)
@@ -7,51 +7,27 @@
   
  */
 
+#include "staff-side.hh"
 #include "note-head-side.hh"
-
 void
 Note_head_side::add_support (Item*head_l)
 {
-  if (support_l_arr_.find_l(head_l))
-    return ;
-  support_l_arr_.push (head_l);
+  Side_position_interface s (this);
+  s.add_support (head_l);
   add_dependency (head_l);
 }
 
-void
-Note_head_side::do_pre_processing ()
-{
-  Interval x_int;
-  for (int i=0; i < support_l_arr_.size(); i++) 
-    {
-      Dimension_cache *common = 
-       common_group (support_l_arr_[i], X_AXIS);
-
-      Real x = support_l_arr_[i]->relative_coordinate (common, X_AXIS)
-       - relative_coordinate (common, X_AXIS);
-
-      x_int.unite (x + support_l_arr_[i]->extent (X_AXIS));
-    }
 
-  if (x_int.empty_b ())
-    x_int = Interval(0,0);
-  
-  translate_axis (-extent(X_AXIS)[-notehead_align_dir_] + x_int[notehead_align_dir_], X_AXIS);
-}
-
-void
-Note_head_side::do_substitute_element_pointer (Score_element*o,Score_element*n)
+Note_head_side::Note_head_side()
 {
-  if (Item* o_l = dynamic_cast <Item *> (o))
-    support_l_arr_.substitute (o_l,dynamic_cast <Item *> (n));
+  Side_position_interface s(this);
+  s.set_axis (X_AXIS);
+  s.set_direction (LEFT);
 }
 
-Note_head_side:: Note_head_side()
-{
-  notehead_align_dir_ = LEFT;
-}
 bool
 Note_head_side::supported_b ()const
 {
-  return support_l_arr_.size ();
+  Side_position_interface s(this);
+  return s.supported_b ();
 }