-1.3.32.jcn3
+--- ../lilypond-1.3.32.hwn1/CHANGES Tue Mar 14 12:47:50 2000
+++ b/CHANGES Tue Mar 14 15:16:52 2000
+@@ -1,3 +1,12 @@
+1.3.32.hwn2
+===========
+
+* Cleanups for Dynamic_engraver and Dynamic_line_spanner.
+
+* Warn if last column in score is musical. Helps catch programming errors.
+
+* Spanner::spanned_drul_ now is private.
+
+ 1.3.32.jcn2
+ ===========
+ 1.3.32.jcn3
===========
* Embedded newlines in text items are now allowed. This helps avoiding
MAJOR_VERSION=1
MINOR_VERSION=3
PATCH_LEVEL=32
-MY_PATCH_LEVEL=jcn3
+MY_PATCH_LEVEL=hwn2
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
--- /dev/null
+
+\time 3/2; < a1.
+ { s1 \> s4 \! s4\ppp} >
+
{
assert (!note_l_drul_[d]);
note_l_drul_[d] = note_l;
- //set_bounds (d, head_l);
+ //set_bound (d, head_l);
// add_dependency (head_l);
}
{
staffline_p_ = get_spanner_p ();
staffline_p_->set_axes (Y_AXIS, Y_AXIS);
- staffline_p_->set_bounds(LEFT,get_staff_info().command_pcol_l ());
+ staffline_p_->set_bound(LEFT,get_staff_info().command_pcol_l ());
announce_element (Score_element_info (staffline_p_, 0));
}
void
Axis_group_engraver::do_removal_processing ()
{
- staffline_p_->set_bounds(RIGHT,get_staff_info().command_pcol_l ());
+ staffline_p_->set_bound(RIGHT,get_staff_info().command_pcol_l ());
typeset_element (staffline_p_);
staffline_p_ = 0;
}
assert (!s->beam_l ());
s->set_elt_property ("beam", self_scm_);
- if (!spanned_drul_[LEFT])
- set_bounds (LEFT,s);
+ if (!get_bound (LEFT))
+ set_bound (LEFT,s);
else
- set_bounds (RIGHT,s);
+ set_bound (RIGHT,s);
}
int
mol.add_molecule (sb);
}
mol.translate_axis (x0
- - spanned_drul_[LEFT]->relative_coordinate (0, X_AXIS), X_AXIS);
+ - get_bound (LEFT)->relative_coordinate (0, X_AXIS), X_AXIS);
return mol;
}
Direction d = LEFT;
do
{
- Paper_column* s = dynamic_cast<Paper_column*>(spanned_drul_[d]); // UGH
+ Paper_column* s = dynamic_cast<Paper_column*>(get_bound (d)); // UGH
broken[d] = (!s->musical_b ());
}
while (flip (&d) != LEFT);
{
public:
Dynamic_line_spanner ();
-
- void add_column (Note_column*);
+ VIRTUAL_COPY_CONS(Score_element);
+ void add_column (Item*);
Direction get_default_dir () const;
-protected:
- virtual void do_post_processing ();
};
Dynamic_line_spanner::Dynamic_line_spanner ()
}
void
-Dynamic_line_spanner::add_column (Note_column* n)
+Dynamic_line_spanner::add_column (Item* n)
{
- if (!spanned_drul_[LEFT])
- set_bounds (LEFT, n);
- set_bounds (RIGHT, n);
+ if (!get_bound (LEFT))
+ set_bound (LEFT, n);
+ else
+ set_bound (RIGHT, n);
add_dependency (n);
}
return DOWN;
}
-void
-Dynamic_line_spanner::do_post_processing ()
-{
- Spanner::do_post_processing ();
- Direction dir = directional_element (this).get ();
- if (!dir)
- dir = get_default_dir ();
-
- /*
- Hier is ook vast iets voor?
- */
- Staff_symbol_referencer_interface si (this);
- Real above_staff = si.line_count () + 2;
-
-#if 0
- // Aargh, nu snap ik waarom ik het niet snap
- // zie Staff_symbol_referencer_interface::set_position
-
- if (si.position_f () * dir < above_staff)
- si.set_position (above_staff * (int)dir);
-
- SCM s = get_elt_property ("padding");
- if (gh_number_p (s))
- {
- si.set_position (si.position_f () + gh_scm2double (s) * (int) dir);
- }
-#else
- Real dy = 0;
- Real pos = si.position_f () * dir;
- if (pos * dir < above_staff)
- dy = above_staff;
-
- SCM s = get_elt_property ("padding");
- if (gh_number_p (s))
- dy += gh_scm2double (s);
-
- Real half_space = si.staff_space () / 2;
- translate_axis (dy*half_space*dir, Y_AXIS);
-#endif
-
-}
-
/**
print text & hairpin dynamics.
*/
text_req_l_ = 0;
span_req_l_drul_[START] = 0;
span_req_l_drul_[STOP] = 0;
+
+ /* ugr; we must attach the Dynamic_line_spanner to something
+ to be sure that the linebreaker will not be confused
+ */
+ // if (line_spanner_)
+ // line_spanner_->add_column (LEFT, get_staff_info ().command_pcol_l ());
}
bool
else
{
assert (!finished_cresc_p_);
- cresc_p_->set_bounds(RIGHT, get_staff_info ().musical_pcol_l ());
- cresc_p_->add_dependency (get_staff_info ().musical_pcol_l ());
+ cresc_p_->set_bound(RIGHT, get_staff_info ().musical_pcol_l ());
+ // cresc_p_->add_dependency (get_staff_info ().musical_pcol_l ());
finished_cresc_p_ = cresc_p_;
cresc_p_ = 0;
span_start_req_l_ = 0;
+ "Spanner", SCM_UNDEFINED);
}
- cresc_p_->set_bounds(LEFT, get_staff_info ().musical_pcol_l ());
- cresc_p_->set_bounds(RIGHT, get_staff_info ().musical_pcol_l ());
- cresc_p_->add_dependency (get_staff_info ().musical_pcol_l ());
+ cresc_p_->set_bound(LEFT, get_staff_info ().musical_pcol_l ());
+
- // arrragh, brr, urg: we know how wide text is, no?
+ // cresc_p_->add_dependency (get_staff_info ().musical_pcol_l ());
+
+ /*
+ We know how wide the text is, if we can be sure that the
+ text already has relevant pointers into the paperdef,
+ and it has its font-size property set.
+
+ Since font-size may be set by a context higher up, we
+ can not be sure of the size.
+ */
+
+
if (text_p_)
{
index_set_cell (cresc_p_->get_elt_property ("dynamic-drul"),
assert (line_spanner_);
cresc_p_->set_parent (line_spanner_, Y_AXIS);
- cresc_p_->add_dependency (line_spanner_);
+ // cresc_p_->add_dependency (line_spanner_);
announce_element (Score_element_info (cresc_p_, span_req_l_drul_[START]));
}
}
typeset_all ();
}
+
void
Dynamic_engraver::do_removal_processing ()
{
{
if (finished_cresc_p_)
{
- //finished_cresc_p_->set_bounds (RIGHT, get_staff_info ().musical_pcol_l ());
typeset_element (finished_cresc_p_);
finished_cresc_p_ =0;
}
TODO: This should be optionised:
* break when group of dynamic requests ends
* break now
- * continue through piece
- */
+ * continue through piece */
if (line_spanner_ && last_request_mom_ < now_mom ())
{
+
+ side_position (line_spanner_).add_staff_support ();
+
typeset_element (line_spanner_);
line_spanner_ = 0;
}
{
current_lyric_l_ = t;
if (extender_spanner_p_
- && !extender_spanner_p_->spanned_drul_[RIGHT]
+ && !extender_spanner_p_->get_bound (RIGHT)
)
{
extender_spanner_p_->set_textitem (RIGHT, t);
if (extender_spanner_p_)
{
req_l_->warning (_ ("unterminated extender"));
- extender_spanner_p_->set_bounds(RIGHT, get_staff_info ().command_pcol_l ());
+ extender_spanner_p_->set_bound(RIGHT, get_staff_info ().command_pcol_l ());
}
}
Direction d = LEFT;
do
{
- Item* t = spanned_drul_[d]
- ? spanned_drul_[d] : spanned_drul_[(Direction)-d];
+ Item* t = get_bound (d)
+ ? get_bound (d) : get_bound ((Direction)-d);
if (d == LEFT)
dx_f_drul_[d] += t->extent (X_AXIS).length ();
else
void
Extender_spanner::set_textitem (Direction d, Item* textitem_l)
{
- set_bounds (d, textitem_l);
+ set_bound (d, textitem_l);
add_dependency (textitem_l);
}
{
current_lyric_l_ = t;
if (hyphen_spanner_p_
- && !hyphen_spanner_p_->spanned_drul_[RIGHT]
+ && !hyphen_spanner_p_->get_bound (RIGHT)
)
{
hyphen_spanner_p_->set_textitem (RIGHT, t);
if (hyphen_spanner_p_)
{
req_l_->warning (_ ("unterminated hyphen"));
- hyphen_spanner_p_->set_bounds(RIGHT, get_staff_info ().command_pcol_l ());
+ hyphen_spanner_p_->set_bound(RIGHT, get_staff_info ().command_pcol_l ());
}
}
Direction d = LEFT;
do
{
- Item* t = spanned_drul_[d]
- ? spanned_drul_[d] : spanned_drul_[(Direction)-d];
+ Item* t = get_bound (d)
+ ? get_bound (d) : get_bound ((Direction)-d);
if (d == LEFT)
dx_f_drul_[d] += t->extent (X_AXIS).length ();
else
void
Hyphen_spanner::set_textitem (Direction d, Item* textitem_l)
{
- set_bounds (d, textitem_l);
+ set_bound (d, textitem_l);
add_dependency (textitem_l);
}
-/*
- atom.hh -- declare Atom
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#ifndef ATOM_HH
-#define ATOM_HH
-
-#include "lily-proto.hh"
-
-#include "lily-guile.hh"
-
-
-#endif
#include "align-element.hh"
#include "axis-group-item.hh"
-class Axis_align_item : public virtual Align_element,
- public virtual Axis_group_item
+/*
+ UGH. FIXME: multiple inheritance.
+ */
+class Axis_align_item : public virtual Align_element, public virtual Axis_group_item
{
public:
Axis_align_item ();
#include "align-element.hh"
#include "axis-group-spanner.hh"
-class Axis_align_spanner : public virtual Align_element,
- public virtual Axis_group_spanner
+/*
+ FIXME: multiple inheritance
+ */
+class Axis_align_spanner : public virtual Align_element, public virtual Axis_group_spanner
{
public:
VIRTUAL_COPY_CONS(Score_element);
/**
Treat a group of elements a unity in either or both axis sense .
This is a wrapper around Axis_group_administration
- */
+
+ FIXME: remove this class, and make interface of it, so we can remove multiple inheritance.
+*/
class Axis_group_element : public virtual Score_element
{
/// modify fields of E for removal.
/**
A grouping item. Its special support is in do_breakable_col_processing().
*/
-
-class Axis_group_item : public virtual Axis_group_element,
- public virtual Item
+class Axis_group_item : public virtual Axis_group_element, public virtual Item
{
public:
VIRTUAL_COPY_CONS(Score_element);
#include "spanner.hh"
#include "axis-group-element.hh"
-/** An element which groups a line in a certain direction. The most
- useful example of this is the Vertical_group_spanner */
+/**
+ An element which groups a line in a certain direction. The most
+ useful example of this is the Vertical_group_spanner
+*/
class Axis_group_spanner : public virtual Axis_group_element,
public virtual Spanner
#include "axis-group-spanner.hh"
#include "super-element.hh"
-/// the columns of a score that form one line.
+/// the columns of a score that form one line. FIXME: multiple inheritance
class Line_of_score : public Axis_group_spanner, public Super_element
{
public:
*/
class Spanner : public virtual Score_element {
-public:
Drul_array<Item*> spanned_drul_;
- Link_array<Spanner> broken_into_l_arr_;
- void set_bounds (Direction d, Item*);
+public:
+ Link_array<Spanner> broken_into_l_arr_;
+ void set_bound (Direction d, Item*);
+ Item *get_bound (Direction d) const;
Spanner ();
Spanner (Spanner const &);
dependency graph, and calls the appropriate
Score_element::do_XXX_processing function on each Score_element it encounters.
-
- */
+
+ FIXME: remove this class, to eliminate multiple inheritance. Merge
+ with Line_of_score ? */
class Super_element : public virtual Score_element {
public:
void space_processing ();
{
Engraver_group_engraver::do_removal_processing ();
- staffline_p_->set_bounds(RIGHT,get_staff_info().command_pcol_l ());
+ staffline_p_->set_bound(RIGHT,get_staff_info().command_pcol_l ());
Engraver_group_engraver::typeset_element (staffline_p_);
staffline_p_ = 0;
}
Line_group_engraver_group::do_creation_processing()
{
create_line_spanner ();
- staffline_p_->set_bounds(LEFT,get_staff_info().command_pcol_l ());
+ staffline_p_->set_bound(LEFT,get_staff_info().command_pcol_l ());
Engraver::announce_element (Score_element_info (staffline_p_,0));
}
line_l->rank_i_ = i;
Link_array<Paper_column> c (breaking[i].cols_);
pscore_l_->typeset_element (line_l);
- line_l->set_bounds(LEFT,c[0]);
- line_l->set_bounds(RIGHT,c.top ());
+ line_l->set_bound(LEFT,c[0]);
+ line_l->set_bound(RIGHT,c.top ());
for (int j=0; j < c.size(); j++)
{
c[j]->translate_axis (breaking[i].config_[j],X_AXIS);
Direction d = LEFT;
do
{
- Item * col = spanned_drul_[d]->column_l ();
+ Item * col = get_bound (d)->column_l ();
Interval coldim = col->extent (X_AXIS)
+ col->relative_coordinate (0, X_AXIS);
Molecule mol;
Real x_off = 0.0;
- Real rx = spanned_drul_[LEFT]->relative_coordinate (0, X_AXIS);
+ Real rx = get_bound (LEFT)->relative_coordinate (0, X_AXIS);
/*
we gotta stay clear of sp_iv, so move a bit to the right if
needed.
{
Link_array<Item> column_arr (Group_interface__extract_elements (this, (Item*)0, "columns"));
- set_bounds (LEFT, column_arr[0 >? column_arr.size () - 2]);
- set_bounds (RIGHT, column_arr.top ());
+ set_bound (LEFT, column_arr[0 >? column_arr.size () - 2]);
+ set_bound (RIGHT, column_arr.top ());
}
// set columns to SCM_EOL?
{
Array<Rod> a;
- if (!(spanned_drul_[LEFT] && spanned_drul_[RIGHT]))
+ if (!(get_bound (LEFT) && get_bound (RIGHT)))
{
programming_error ("Multi_measure_rest::get_rods (): I am not spanned!");
return a;
}
- Item * l = spanned_drul_[LEFT]->column_l ();
- Item * r = spanned_drul_[RIGHT]->column_l ();
+ Item * l = get_bound (LEFT)->column_l ();
+ Item * r = get_bound (RIGHT)->column_l ();
Item * lb = l->find_broken_piece (RIGHT);
Item * rb = r->find_broken_piece (LEFT);
{
Score_element * se = unsmob_element (e);
se->fixup_refpoint ();
+
+ if (!dynamic_cast<Line_of_score*> (se) && !se->parent_l (Y_AXIS))
+ {
+ programming_error ("No parent!");
+ }
}
}
}
{
scoreline_l_ = pscore_p_->line_l_;
- scoreline_l_->set_bounds(LEFT, command_column_l_);
+ scoreline_l_->set_bound(LEFT, command_column_l_);
command_column_l_->set_elt_property ("breakable", SCM_BOOL_T);
Score_engraver::do_removal_processing()
{
Engraver_group_engraver::do_removal_processing();
- scoreline_l_->set_bounds(RIGHT,command_column_l_);
+ scoreline_l_->set_bound(RIGHT,command_column_l_);
command_column_l_->set_elt_property ("breakable", SCM_BOOL_T);
+
typeset_all ();
+
+
+ if (musical_column_l_->linked_b ())
+ programming_error ("Last column in score should be non-musical");
set_columns (0,0);
}
*/
Direction d = LEFT;
do {
- if (!s->spanned_drul_[d])
+ if (!s->get_bound (d))
{
- s->set_bounds(d, command_column_l_);
+ s->set_bound(d, command_column_l_);
::warning (_f ("unbound spanner `%s'", classname(s)));
}
} while (flip(&d) != LEFT);
We're forgetting about this column. Dump it, and make SCM
forget it.
- (UGH.) */
+ FIXME: we should have another way of not putting this
+ column into the spacing problem. Maybe we shouldn't
+ even prevent this.
+
+ */
scm_unprotect_object ((*current[i])->self_scm_);
*current[i] =0;
}
{
sep_span_p_ = new Separating_group_spanner;
announce_element (Score_element_info (sep_span_p_, 0));
- sep_span_p_->set_bounds (LEFT, get_staff_info ().command_pcol_l ());
+ sep_span_p_->set_bound (LEFT, get_staff_info ().command_pcol_l ());
}
void
Separating_line_group_engraver::do_removal_processing ()
{
- sep_span_p_->set_bounds (RIGHT, get_staff_info ().command_pcol_l ());
+ sep_span_p_->set_bound (RIGHT, get_staff_info ().command_pcol_l ());
typeset_element (sep_span_p_);
sep_span_p_ =0;
}
if (encompass_arr.size ())
{
- set_bounds (LEFT, encompass_arr[0]);
+ set_bound (LEFT, encompass_arr[0]);
if (encompass_arr.size () > 1)
- set_bounds (RIGHT, encompass_arr.top ());
+ set_bound (RIGHT, encompass_arr.top ());
}
}
dx_f_drul_[d] = 0;
dy_f_drul_[d] = 0;
- if ((note_column_drul[d] == spanned_drul_[d])
+ if ((note_column_drul[d] == get_bound (d))
&& note_column_drul[d]->first_head ()
&& (note_column_drul[d]->stem_l ()))
{
&& !((my_dir == stem_l->get_direction ())
&& stem_l->beam_l () && (stem_l->beam_count (-d) >= 1)))
{
- dx_f_drul_[d] = spanned_drul_[d]->extent (X_AXIS).length () / 2;
+ dx_f_drul_[d] = get_bound (d)->extent (X_AXIS).length () / 2;
dx_f_drul_[d] -= d * x_gap_f;
if (stem_l->get_direction () != my_dir)
else
{
dx_f_drul_[d] = stem_l->hpos_f ()
- - spanned_drul_[d]->relative_coordinate (0, X_AXIS);
+ - get_bound (d)->relative_coordinate (0, X_AXIS);
/*
side attached to beamed stem
*/
if (fix_broken_b)
{
- Direction d = (encompass_arr.top () != spanned_drul_[RIGHT]) ?
+ Direction d = (encompass_arr.top () != get_bound (RIGHT)) ?
RIGHT : LEFT;
dy_f_drul_[d] = info_drul[d][Y_AXIS];
if (!interstaff_b)
int cross_count = cross_staff_count ();
bool cross_b = cross_count && cross_count < encompass_arr.size ();
- if (encompass_arr[0] != spanned_drul_[LEFT])
+ if (encompass_arr[0] != get_bound (LEFT))
{
first--;
Real is = calc_interstaff_dist (encompass_arr[0], this);
/*
right is broken edge
*/
- if (encompass_arr.top () != spanned_drul_[RIGHT])
+ if (encompass_arr.top () != get_bound (RIGHT))
{
last++;
}
{
Array<Rod> a;
Rod r;
- r.item_l_drul_ = spanned_drul_;
+ r.item_l_drul_[LEFT] = get_bound (LEFT);
+ r.item_l_drul_[RIGHT] = get_bound (RIGHT);
+
r.distance_f_ = paper_l ()->get_var ("slur_x_minimum");
a.push (r);
-#if 0
-SCM
-ugly_scm (Bezier b)
-{
- b.translate (-b.control_[0]);
- Real alpha = b.control_[3].arg ();
-
- b.rotate ( -alpha);
- if (b.control_[1][Y_AXIS] < 0)
- {
- b.control_[1][Y_AXIS] *= -1;
- b.control_[2][Y_AXIS] *= -1;
- }
-
- Real len = b.control_[3][X_AXIS];
- Real indent = 10 *b.control_[1][X_AXIS] / len ;
- Real ht = 10 *b.control_[1][Y_AXIS] / len ;
-
- SCM res = scm_eval (scm_listify (ly_symbol2scm ("slur-ugly"), gh_double2scm (indent), gh_double2scm (ht), SCM_UNDEFINED ));
-
- return res;
-}
-#endif
-
-
/*
Ugh should have dash-length + dash-period
*/
else
a = lookup_l ()->slur (one, directional_element (this).get () * thick, thick);
-#if 0
- SCM u = ugly_scm (one);
- if (gh_pair_p (u))
- {
- Molecule mark = lookup_l ()-> text ( "roman",
- to_str (gh_scm2double (gh_car (u)), "%0.2f") + "," +
- to_str(gh_scm2double (gh_cdr (u)), "%0.2f"),
- paper_l ());
-
- mark.translate_axis (20 , Y_AXIS);
- a.add_molecule (mark);
- }
-#endif
return a;
}
Spacing_engraver::do_creation_processing ()
{
spacing_p_ =new Spacing_spanner;
- spacing_p_->set_bounds (LEFT, get_staff_info ().command_pcol_l ());
+ spacing_p_->set_bound (LEFT, get_staff_info ().command_pcol_l ());
announce_element (Score_element_info (spacing_p_, 0));
}
{
Paper_column * p = get_staff_info ().command_pcol_l ();
- spacing_p_->set_bounds (RIGHT, p);
+ spacing_p_->set_bound (RIGHT, p);
typeset_element (spacing_p_);
spacing_p_ =0;
}
if (left == right)
{
warning (_ ("Left spanpoint is right spanpoint"));
- return;
- }
-
- Link_array<Item> break_points = pscore_l_->broken_col_range (left,right);
-
- break_points.insert (left,0);
- break_points.push (right);
- for (int i=1; i < break_points.size(); i++)
- {
- Drul_array<Item*> bounds;
- bounds[LEFT] = break_points[i-1];
- bounds[RIGHT] = break_points[i];
+ /*
+ FIXME: this is broken.
+ */
+ /*
+ If we have a spanner spanning one column, we must break it
+ anyway because it might provide a parent for another item. */
Direction d = LEFT;
do
{
- Item *&pc_l = bounds[d] ;
- if (!pc_l->line_l())
- pc_l = pc_l->find_broken_piece(- d);
-
- assert (pc_l);
+ Item* bound = left->find_broken_piece (d);
+ Spanner * span_p = dynamic_cast<Spanner*>( clone ());
+ span_p->set_bound (LEFT, bound);
+ span_p->set_bound (RIGHT, bound);
+
+ assert (span_p->line_l ());
+ pscore_l_->typeset_element (span_p);
+ broken_into_l_arr_.push (span_p);
}
while ((flip(&d))!= LEFT);
+ }
+ else
+ {
+ Link_array<Item> break_points = pscore_l_->broken_col_range (left,right);
- Spanner *span_p = dynamic_cast<Spanner*>(clone ());
- span_p->set_bounds(LEFT,bounds[LEFT]);
- span_p->set_bounds(RIGHT,bounds[RIGHT]);
+ break_points.insert (left,0);
+ break_points.push (right);
+
+ for (int i=1; i < break_points.size(); i++)
+ {
+ Drul_array<Item*> bounds;
+ bounds[LEFT] = break_points[i-1];
+ bounds[RIGHT] = break_points[i];
+ Direction d = LEFT;
+ do
+ {
+ Item *&pc_l = bounds[d] ;
+ if (!pc_l->line_l())
+ pc_l = pc_l->find_broken_piece(- d);
+
+ assert (pc_l);
+ }
+ while ((flip(&d))!= LEFT);
+
+ Spanner *span_p = dynamic_cast<Spanner*>(clone ());
+ span_p->set_bound(LEFT,bounds[LEFT]);
+ span_p->set_bound(RIGHT,bounds[RIGHT]);
- pscore_l_->typeset_element (span_p);
- broken_into_l_arr_.push (span_p);
+ pscore_l_->typeset_element (span_p);
+ broken_into_l_arr_.push (span_p);
+ }
}
-
broken_into_l_arr_.sort (Spanner::compare);
}
do
{
if (!spanned_drul_[i]->line_l())
- set_bounds(i,spanned_drul_[i]->find_broken_piece((Direction) -i));
+ set_bound(i,spanned_drul_[i]->find_broken_piece((Direction) -i));
}
while (flip(&i) != LEFT);
}
+
+Item*
+Spanner::get_bound (Direction d) const
+{
+ return spanned_drul_ [d];
+}
+
void
-Spanner::set_bounds(Direction d, Item*i)
+Spanner::set_bound(Direction d, Item*i)
{
spanned_drul_[d] =i;
if (i)
Staff_symbol_engraver::do_creation_processing()
{
span_p_ = new Staff_symbol;
- span_p_->set_bounds(LEFT,get_staff_info().command_pcol_l ());
+ span_p_->set_bound(LEFT,get_staff_info().command_pcol_l ());
announce_element (Score_element_info (span_p_, 0));
}
if (gh_number_p (n))
span_p_->set_elt_property ("line-count", n);
- span_p_->set_bounds(RIGHT,get_staff_info().command_pcol_l ());
+ span_p_->set_bound(RIGHT,get_staff_info().command_pcol_l ());
typeset_element (span_p_);
span_p_ =0;
}
}
/*
- Huh? -- jcn
+
+ This sets the position relative to the center of the staff symbol.
+
+ The function is hairy, because it can be callled in two situations:
+
+ 1. There is no staff yet; we must set staff-position
+
+ 2. There is a staff, and perhaps someone even applied a
+ translate_axis (). Then we must compensate for the translation
+
+ In either case, we set a callback to be sure that our new position
+ will be extracted from staff-position
+
*/
void
Staff_symbol_referencer_interface::set_position (Real p)
if (st && elt_l_->common_refpoint(st, Y_AXIS))
{
Real oldpos = position_f ();
- // Aargh!
elt_l_->set_elt_property ("staff-position", gh_double2scm (p - oldpos));
}
else
Staff_symbol::do_brew_molecule() const
{
Score_element * common
- = spanned_drul_[LEFT]->common_refpoint (spanned_drul_[RIGHT], X_AXIS);
+ = get_bound (LEFT)->common_refpoint (get_bound (RIGHT), X_AXIS);
Real width =
// right_shift - left_shift
- + spanned_drul_[RIGHT]->relative_coordinate (common , X_AXIS)
- - spanned_drul_[LEFT]->relative_coordinate (common, X_AXIS)
+ + get_bound (RIGHT)->relative_coordinate (common , X_AXIS)
+ - get_bound (LEFT)->relative_coordinate (common, X_AXIS)
;
Real t = paper_l ()->get_var ("stafflinethickness");
Group_interface g (this, "ties");
if (!g.count ())
{
- set_bounds (LEFT, s->head (LEFT));
- set_bounds (RIGHT, s->head (RIGHT));
+ set_bound (LEFT, s->head (LEFT));
+ set_bound (RIGHT, s->head (RIGHT));
}
group (this, "ties").add_element (s);
assert (!head (d));
index_set_cell (get_elt_property ("heads"), d, head_l->self_scm_);
- set_bounds (d, head_l);
+ set_bound (d, head_l);
add_dependency (head_l);
}
{
Array<Rod> a;
Rod r;
- r.item_l_drul_ = spanned_drul_;
+
+ r.item_l_drul_ [LEFT]=get_bound (LEFT);
+ r.item_l_drul_ [RIGHT]=get_bound (RIGHT);
+
r.distance_f_ = paper_l ()->get_var ("tie_x_minimum");
a.push (r);
return a;
Link_array<Note_column> column_arr=
Group_interface__extract_elements (this, (Note_column*)0, "columns");
- set_bounds (LEFT, column_arr[0]);
- set_bounds (RIGHT, column_arr.top ());
+ set_bound (LEFT, column_arr[0]);
+ set_bound (RIGHT, column_arr.top ());
}
}
Score_element *b = unsmob_element (gh_car (bs));
Beam * beam_l = dynamic_cast<Beam*> (b);
if (!broken_b ()
- && spanned_drul_[LEFT]->column_l () == beam_l->spanned_drul_[LEFT]->column_l ()
- && spanned_drul_[RIGHT]->column_l () == beam_l->spanned_drul_[RIGHT]->column_l ())
+ && get_bound (LEFT)->column_l () == beam_l->get_bound (LEFT)->column_l ()
+ && get_bound (RIGHT)->column_l () == beam_l->get_bound (RIGHT)->column_l ())
set_elt_property ("parallel-beam", SCM_BOOL_T);
}
}
valign_p_->set_axis (Y_AXIS);
valign_p_->set_elt_property ("stacking-dir", gh_int2scm (DOWN));
- valign_p_->set_bounds(LEFT,get_staff_info().command_pcol_l ());
+ valign_p_->set_bound(LEFT,get_staff_info().command_pcol_l ());
announce_element (Score_element_info (valign_p_ , 0));
}
valign_p_->threshold_interval_[SMALLER] = gh_scm2double (dist);
}
- valign_p_->set_bounds(RIGHT,get_staff_info().command_pcol_l ());
+ valign_p_->set_bound(RIGHT,get_staff_info().command_pcol_l ());
typeset_element (valign_p_);
valign_p_ =0;
}
if (bar_arr.size ())
{
- set_bounds (LEFT, bar_arr[0]);
- set_bounds (RIGHT, bar_arr.top ());
+ set_bound (LEFT, bar_arr[0]);
+ set_bound (RIGHT, bar_arr.top ());
}
}