]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/staff-side.cc
release: 0.1.11
[lilypond.git] / lily / staff-side.cc
index 5d9bd748ab3e2a1276e4975694e127a698185503..a58d2f2828ad3bcf84f69873af8368fddc9458ca 100644 (file)
@@ -25,16 +25,16 @@ Staff_side::Staff_side()
   pos_i_ =0;
   sym_int_ = Interval (0,0);
   staff_size_i_ = 0;
-  staff_sym_l_=0;
-  dir_i_ =0;
-  inside_staff_b_ =false;
+  staff_sym_l_ = 0;
+  dir_ = CENTER;
+  inside_staff_b_ = false;
 }
 
 void
 Staff_side::read_staff_sym()
 {
   if (! staff_sym_l_)
-       return ;
+    return ;
   staff_size_i_ = staff_sym_l_->steps_i();
 }
 
@@ -45,10 +45,10 @@ Staff_side::support_height() const
   Interval r;
   
   for (int i=0; i < support_l_arr_.size(); i++)
-       r.unite (support_l_arr_[i]->height());
+    r.unite (support_l_arr_[i]->height());
   if (r.empty_b()) 
     {
-       r = Interval (0,0);
+      r = Interval (0,0);
     }
   return r;
 }
@@ -61,13 +61,13 @@ Staff_side::add_support (Score_elem*i)
 }
 
 int
-Staff_side::get_position_i()const
+Staff_side::get_position_i() const
 {
-  if (!dir_i_
+  if (!dir_) 
     {
-       warning ("Staff_side::get_position_i(): " 
-               "somebody forgot to set my vertical direction, returning -20");
-       return -20;
+      warning ("Staff_side::get_position_i(): " 
+              "somebody forgot to set my vertical direction, returning -20");
+      return -20;
     }
   
 
@@ -75,23 +75,23 @@ Staff_side::get_position_i()const
   Real inter_f = paper()-> internote_f ();
   if (!inside_staff_b_) 
     {
-       y  = (dir_i_ > 0 && staff_sym_l_) ? staff_sym_l_->steps_i() + 2: -2; 
-       y *=inter_f;
-       Interval v= support_height();
-
-       if (dir_i_ > 0) 
-         {
-           y = y >? (v.max() + 2*inter_f);
-         }
-       else if (dir_i_ < 0) 
-         {
-           y = y <? (v.min() - 2*inter_f);
-         }
+      y  = (dir_ > 0 && staff_sym_l_) ? staff_sym_l_->steps_i() + 2: -2; 
+      y *=inter_f;
+      Interval v= support_height();
+
+      if (dir_ > 0) 
+       {
+         y = y >? (v.max() + 2*inter_f);
+       }
+      else if (dir_ < 0) 
+       {
+         y = y <? (v.min() - 2*inter_f);
+       }
     }
   else 
     {
-       Interval v= support_height();
-       y = v[dir_i_]  + 2*dir_i_*inter_f;      // ugh
+      Interval v= support_height();
+      y = v[dir_]  + 2*dir_*inter_f;   // ugh
     }
   return int (rint (Real (y)/inter_f)); // should ret a float?
 }
@@ -107,8 +107,8 @@ Staff_side::do_post_processing()
 {
   sym_int_ = symbol_height();
   pos_i_ = get_position_i();
-  if (dir_i_)
-       pos_i_ += int (rint (- sym_int_[-dir_i_] / paper()->internote_f ()));
+  if (dir_)
+    pos_i_ += int (rint (- sym_int_[-dir_] / paper()->internote_f ()));
 }
 
 void
@@ -116,7 +116,7 @@ Staff_side::do_substitute_dependency (Score_elem*o, Score_elem*n)
 { 
   support_l_arr_.unordered_substitute (o,n);
   if (staff_sym_l_ == o)
-       staff_sym_l_ = n ? (Staff_symbol*) n->spanner():0;
+    staff_sym_l_ = n ? (Staff_symbol*) n->spanner():0;
 }