]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/head-column.cc
partial: 0.1.13.jcn
[lilypond.git] / lily / head-column.cc
index 4a50701e63e6b1c63cf3bfaf845b06abaa00dd95..b8707965a65003ffb1d0c0823ef208f6cf52a220 100644 (file)
 #include "head-column.hh"
 #include "note-head.hh"
 #include "stem.hh"
+#include "script.hh"
 
 Head_column::Head_column()
 {
-    stem_l_ = 0;
-    dir_i_ =0;
+  stem_l_ = 0;
+  dir_ =CENTER;
 }
 
 void
-Head_column::do_substitute_dependency(Score_elem*o,
-                                     Score_elem*n)
+Head_column::do_substitute_dependency (Score_elem*o,
+                                      Score_elem*n)
 {
-    Script_column::do_substitute_dependency(o,n);
-    if (o->name() == Note_head::static_name()) {
-       head_l_arr_.substitute( (Note_head*)o->item(), 
-                               (n)? (Note_head*)n->item() : 0);
+  Script_column::do_substitute_dependency (o,n);
+  if (o->name() == Note_head::static_name ()) 
+    {
+      head_l_arr_.substitute ((Note_head*)o->item(), 
+                             (n)? (Note_head*)n->item() : 0);
     }
-    if (stem_l_ == o) {
-       stem_l_ = n ? (Stem*)n->item():0;
+  if (stem_l_ == o) 
+    {
+      stem_l_ = n ? (Stem*)n->item():0;
     }
 }
 
 
 void
-Head_column::set(Stem*stem_l)
+Head_column::set (Stem*stem_l)
 {
-    stem_l_ = stem_l;
-    add_dependency(stem_l);
+  stem_l_ = stem_l;
+  Score_elem::add_dependency (stem_l);
+  for (int i=0; i < script_l_arr_.size(); i++)
+    script_l_arr_[i]->set_stem (stem_l);
 }
 
 void
-Head_column::add(Note_head *n_l)
+Head_column::add (Script *script_l)
 {
-    add_support(n_l);
-    head_l_arr_.push(n_l);
+  Script_column::add (script_l) ;
+  if  (stem_l_)
+    script_l->set_stem (stem_l_);
 }
+void
+Head_column::add (Note_head *n_l)
+{
+  add_support (n_l);
+  head_l_arr_.push (n_l);
+}
+
 
 
-IMPLEMENT_STATIC_NAME(Head_column);
 IMPLEMENT_IS_TYPE_B1(Head_column,Script_column);
 
 void
 Head_column::do_print() const
 {
 #ifndef NPRINT
-    mtor << "heads: " << head_l_arr_.size();
+  DOUT << "heads: " << head_l_arr_.size();
 #endif
 }
 
 void
 Head_column::do_pre_processing()
 {
-    if (!dir_i_){
-       if (stem_l_)
-           dir_i_ = stem_l_->dir_i_;
+  if (!dir_)
+    {
+      if (stem_l_)
+       dir_ = stem_l_->dir_;
     }
-    Script_column::do_pre_processing();
+  Script_column::do_pre_processing();
 }