]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.65
authorfred <fred>
Tue, 26 Mar 2002 23:23:47 +0000 (23:23 +0000)
committerfred <fred>
Tue, 26 Mar 2002 23:23:47 +0000 (23:23 +0000)
lily/beam.cc
lily/grace-align-item.cc
lily/include/dynamic-line-interface.hh [new file with mode: 0644]
lily/include/grace-align-item.hh
lily/include/spanner.hh
lily/multi-measure-rest.cc
lily/tie.cc
lily/tuplet-spanner.cc

index 08173a742f8b9d194b0a1659810ddcd26bed85d4..322655fe7417e077554200041baf7808fa436d27 100644 (file)
@@ -53,10 +53,7 @@ Beam::add_stem (Stem*s)
   assert (!s->beam_l ());
   s->set_elt_pointer ("beam", self_scm_);
 
-  if (!get_bound (LEFT))
-    set_bound (LEFT,s);
-  else
-    set_bound (RIGHT,s);
+  add_bound_item (this, s);
 }
 
 int
@@ -92,8 +89,8 @@ Beam::member_before_line_breaking ()
 
     }
 
-  if (!directional_element (this).get ())
-    directional_element (this).set (get_default_dir ());
+  if (!Directional_element_interface (this).get ())
+    Directional_element_interface (this).set (get_default_dir ());
 
   auto_knees ();
   set_stem_directions ();
@@ -117,7 +114,7 @@ Beam::get_default_dir () const
   for (int i=0; i <stem_count (); i++)
     do { // HUH -- waar slaat dit op?
       Stem *s = stem (i);
-      Direction sd = directional_element (s).get ();
+      Direction sd = Directional_element_interface (s).get ();
       int current = sd ? (1 + d * sd)/2
        : s->get_center_distance ((Direction)-d);
 
@@ -155,13 +152,13 @@ Beam::get_default_dir () const
 void
 Beam::set_stem_directions ()
 {
-  Direction d = directional_element (this).get ();
+  Direction d = Directional_element_interface (this).get ();
   for (int i=0; i <stem_count (); i++)
     {
       Stem *s = stem (i);
       SCM force = s->remove_elt_property ("dir-forced");
       if (!gh_boolean_p (force) || !gh_scm2bool (force))
-       directional_element (s).set (d);
+       Directional_element_interface (s).set (d);
     }
 } 
 
@@ -185,7 +182,7 @@ Beam::auto_knee (String gap_str, bool interstaff_b)
   bool knee_b = false;
   int knee_y = 0;
   SCM gap = get_elt_property (gap_str);
-  Direction d = directional_element (this).get ();
+  Direction d = Directional_element_interface (this).get ();
   
   if (gh_number_p (gap))
     {
@@ -212,10 +209,13 @@ Beam::auto_knee (String gap_str, bool interstaff_b)
     {
       for (int i=0; i < stem_count (); i++)
         {
+         Item *s = stem(i);      
          int y = (int)(stem (i)->head_positions()[d])
-           + (int)calc_interstaff_dist (stem (i), this);
-         directional_element (stem (i)).set (y < knee_y ? UP : DOWN);
-         stem (i)->set_elt_property ("dir-forced", SCM_BOOL_T);
+           + (int)calc_interstaff_dist (s, this);
+
+
+         Directional_element_interface (s).set (y < knee_y ? UP : DOWN);
+         s->set_elt_property ("dir-forced", SCM_BOOL_T);
        }
     }
   return knee_b;
@@ -291,8 +291,8 @@ Beam::member_after_line_breaking ()
   /*
     until here, we used only stem_info, which acts as if dir=up
    */
-  y *= directional_element (this).get ();
-  dy *= directional_element (this).get ();
+  y *= Directional_element_interface (this).get ();
+  dy *= Directional_element_interface (this).get ();
 
   Staff_symbol_referencer_interface st (this);
   Real half_space = st.staff_space () / 2;
@@ -330,7 +330,7 @@ Beam::member_after_line_breaking ()
          */
          int quant_dir = 0;
          if (abs (y_shift) > half_space / 2)
-           quant_dir = sign (y_shift) * directional_element (this).get ();
+           quant_dir = sign (y_shift) * Directional_element_interface (this).get ();
          y = quantise_y_f (y, dy, quant_dir);
        }
     }
@@ -441,8 +441,8 @@ Beam::calc_stem_y_f (Stem* s, Real y, Real dy) const
   Real stem_y = (dy && dx ? (s->relative_coordinate (0, X_AXIS) - x0) / dx * dy : 0) + y;
 
   /* knee */
-   Direction dir  = directional_element(this).get ();
-   Direction sdir = directional_element (s).get ();
+   Direction dir  = Directional_element_interface(this).get ();
+   Direction sdir = Directional_element_interface (s).get ();
    
     /* knee */
    if (dir!= sdir)
@@ -456,7 +456,7 @@ Beam::calc_stem_y_f (Stem* s, Real y, Real dy) const
       // huh, why not for first visible?
       if (//(s != first_visible_stem ()) &&
          me.staff_symbol_l () != last.staff_symbol_l ())
-       stem_y += directional_element (this).get ()
+       stem_y += Directional_element_interface (this).get ()
          * (beam_multiplicity - stem_multiplicity) * interbeam_f;
     }
   return stem_y;
@@ -467,7 +467,7 @@ Beam::check_stem_length_f (Real y, Real dy) const
 {
   Real shorten = 0;
   Real lengthen = 0;
-  Direction dir = directional_element (this).get ();
+  Direction dir = Directional_element_interface (this).get ();
   
   for (int i=0; i < stem_count (); i++)
     {
@@ -571,7 +571,7 @@ Beam::quantise_y_f (Real y, Real dy, int quant_dir)
   if (a.size () <= 1)
     return y;
 
-  Real up_y = directional_element (this).get () * y;
+  Real up_y = Directional_element_interface (this).get () * y;
   Interval iv = quantise_iv (a, up_y/staff_space) * staff_space;
 
   Real q = up_y - iv[SMALLER] <= iv[BIGGER] - up_y 
@@ -579,7 +579,7 @@ Beam::quantise_y_f (Real y, Real dy, int quant_dir)
   if (quant_dir)
     q = iv[(Direction)quant_dir];
 
-  return q * directional_element (this).get ();
+  return q * Directional_element_interface (this).get ();
 }
 
 void
@@ -644,7 +644,7 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const
     nw_f = paper_l ()->get_var ("quartwidth");
 
 
-  Direction dir = directional_element (this).get ();
+  Direction dir = Directional_element_interface (this).get ();
   
   /* half beams extending to the left. */
   if (prev)
index e4467a9e3fe1bb0a6fe6d2af12f18fcdf9362cac..6a6f432ccff08bf7f791ad9d815706ad3f31714c 100644 (file)
@@ -41,8 +41,4 @@ Grace_align_item::member_before_line_breaking ()
 }
 
 
-void
-Grace_align_item::do_add_processing ()
-{
-}
 
diff --git a/lily/include/dynamic-line-interface.hh b/lily/include/dynamic-line-interface.hh
new file mode 100644 (file)
index 0000000..e69de29
index 301178afd3481e458d91274afd663c0876bedda2..25764b2256b9fe1f211fdcd920f76b149e3d314c 100644 (file)
@@ -19,7 +19,7 @@ public:
   VIRTUAL_COPY_CONS (Score_element);
   Grace_align_item (SCM);
 
-  virtual void do_add_processing ();
+
   SCM member_before_line_breaking ();
   static SCM before_line_breaking (SCM);
 };
index 9fb7f0bed6e5054cacede858a7f752f31f3e91c6..3241e2790858df5840580535db41f4fcc6a9a56e 100644 (file)
@@ -60,4 +60,9 @@ protected:
   virtual void do_break_processing ();
   virtual Line_of_score*line_l () const;
 };
+
+
+void add_bound_item (Spanner*, Item* n);
+
+
 #endif
index bf8a009f4552bc2af8852edbc6b1fb06d26312db..27dfeebf5c8657f65798a30f8a356609980e990b 100644 (file)
@@ -143,6 +143,7 @@ Multi_measure_rest::member_brew_molecule () const
 void
 Multi_measure_rest::do_add_processing ()
 {
+#if 0
   if (gh_pair_p (get_elt_pointer ("columns")))
     {
       Link_array<Item> column_arr (Pointer_group_interface__extract_elements (this, (Item*)0, "columns"));
@@ -150,7 +151,7 @@ Multi_measure_rest::do_add_processing ()
       set_bound (LEFT, column_arr[0 >? column_arr.size () - 2]);
       set_bound (RIGHT, column_arr.top ());
     }
-
+#endif
   // set columns to SCM_EOL?
 }
   
@@ -174,6 +175,7 @@ Multi_measure_rest::add_column (Item* c)
   Pointer_group_interface gi (this, "columns");
   gi.add_element (c);
 
+  add_bound_item (this, c);
   
   add_dependency (c);
 }
index ed3d2be69b4e4cc189473831caa193496502680c..02dd922b2daa39e73e5835a0d7849b01fe22b9d9 100644 (file)
@@ -66,13 +66,17 @@ Tie::get_default_dir () const
   Stem * sl =  head(LEFT) ? head (LEFT)->stem_l () :0;
   Stem * sr =  head(RIGHT) ? head (RIGHT)->stem_l () :0;  
 
-  if (sl && directional_element (sl).get () == UP
-      && sr && directional_element (sr).get () == UP)
+  if (sl && Directional_element_interface (sl).get () == UP
+      && sr && Directional_element_interface (sr).get () == UP)
     return DOWN;
   else
     return UP;
 }
 
+/*
+  fixme  must  use spanned drul from heads elt property
+ */
+
 void
 Tie::do_add_processing()
 {
@@ -103,8 +107,8 @@ Tie::member_after_line_breaking ()
       return SCM_UNDEFINED;
     }
 
-  if (!directional_element (this).get ())
-    directional_element (this).set (get_default_dir ());
+  if (!Directional_element_interface (this).get ())
+    Directional_element_interface (this).set (get_default_dir ());
   
   Real staff_space = staff_symbol_referencer (this).staff_space ();
   Real half_space = staff_space / 2;
@@ -154,7 +158,7 @@ Tie::member_after_line_breaking ()
   int ypos_i = int (ypos);
  
   Real dx_f = extent (X_AXIS).length () + dx_f_drul_[RIGHT] - dx_f_drul_[LEFT];
-  Direction dir = directional_element (this).get();
+  Direction dir = Directional_element_interface (this).get();
   if (dx_f < paper_l ()->get_var ("tie_staffspace_length"))
     {
       if (abs (ypos_i) % 2)
@@ -203,7 +207,7 @@ Tie::member_brew_molecule () const
   if (gh_number_p (d))
     a = lookup_l ()->dashed_slur (one, thick, gh_scm2int (d));
   else
-    a = lookup_l ()->slur (one, directional_element (this).get () * thick, thick);
+    a = lookup_l ()->slur (one, Directional_element_interface (this).get () * thick, thick);
   
   return a.create_scheme(); 
 }
@@ -213,7 +217,7 @@ Tie::member_brew_molecule () const
 Bezier
 Tie::get_curve () const
 {
-  Direction d (directional_element (this).get ());
+  Direction d (Directional_element_interface (this).get ());
   Bezier_bow b (get_encompass_offset_arr (), d);
 
   Real staff_space = staff_symbol_referencer (this).staff_space ();
index 5779209b150b1400c125ce706238c58829a9ae48..0f9badfc34e5f97723c4d9173c212988219409e6 100644 (file)
@@ -73,7 +73,7 @@ Tuplet_spanner::member_brew_molecule () const
 
 
       Real staff_space = paper_l ()->get_var ("interline");
-      Direction dir = directional_element (this).get ();
+      Direction dir = Directional_element_interface (this).get ();
       Real dy = gh_scm2double (get_elt_property ("delta-y"));
       SCM number = get_elt_property ("text");
       if (gh_string_p (number) && number_visibility)
@@ -118,6 +118,7 @@ Tuplet_spanner::member_brew_molecule () const
 void
 Tuplet_spanner::do_add_processing ()
 {
+#if 0
   if (gh_pair_p (get_elt_pointer ("columns")))
     {
       Link_array<Note_column> column_arr=
@@ -126,6 +127,7 @@ Tuplet_spanner::do_add_processing ()
       set_bound (LEFT, column_arr[0]);
       set_bound (RIGHT, column_arr.top ());  
     }
+#endif
 }
 
 
@@ -142,7 +144,7 @@ Tuplet_spanner::calc_position_and_height (Real *offset, Real * dy) const
 
   Score_element * common = common_refpoint (get_elt_pointer ("columns"), Y_AXIS);
   
-  Direction d = directional_element (this).get ();
+  Direction d = Directional_element_interface (this).get ();
 
   /*
     Use outer non-rest columns to determine slope
@@ -197,7 +199,7 @@ Tuplet_spanner::calc_dy (Real * dy) const
     Pointer_group_interface__extract_elements (this, (Note_column*)0, "columns");
 
  
-  Direction d = directional_element (this).get ();
+  Direction d = Directional_element_interface (this).get ();
   *dy = column_arr.top ()->extent (Y_AXIS) [d]
     - column_arr[0]->extent (Y_AXIS) [d];
 }
@@ -215,11 +217,11 @@ Tuplet_spanner::member_after_line_breaking ()
       return SCM_UNDEFINED;
     }
 
-  Direction d = directional_element (this).get ();
+  Direction d = Directional_element_interface (this).get ();
   if (!d)
     {
       d = get_default_dir ();
-      directional_element (this).set (d);
+      Directional_element_interface (this).set (d);
 
     }
   Real dy, offset;
@@ -286,6 +288,8 @@ Tuplet_spanner::add_column (Note_column*n)
   gi.add_element (n);
 
   add_dependency (n);
+
+  add_bound_item (this, n);
 }