-1.3.64.jcn3
-============
+1.3.64.uu1
+==========
+
+* Bugfix: translate volta spanner at start of line.
+
+* Changed directional_element() calls to instantiations
+of Directional_element_interface.
+
+* Removed Dynamic_line_spanner, and cleaned up Dynamic_engraver.
+
+* Removed Staff_info type. Information about columns is now transferred
+via currentMusicalColumn and currentCommandColumn.
-* Fixed non-broken interstaff slurs.
1.3.64.jcn2
============
* Fixed slur attachment positions, added missing rule and use simple
default starting positions for attachments.
+* Started rewrite of slur ending code, interstaff slurs are broken for
+now.
-1.3.63.jcn1
-============
-
-* Started grand redo of slur endings, interstaff slurs are broken for now.
-
-* Fixed download url.
+* Fixed download URL of the webpage.
-* Moved direction.cc to flower.
+* Moved direction.cc to flower/.
-1.3.63.uu1
-==========
+1.3.64
+======
* Lyrics centered on notehead.
@mudelafile{staccato-pos.ly}
+Dynamics appear below or above the staff. If multiple dynamics are
+linked with (de)crescendi, they should be on the same line.
+
+@mudelafile{dyn-line.ly}
+
@section Chord names
Chord names are generated from a list pitches, and are customisable
PACKAGE_NAME=LilyPond
MAJOR_VERSION=1
MINOR_VERSION=3
-PATCH_LEVEL=64
-MY_PATCH_LEVEL=jcn3
+PATCH_LEVEL=65
+MY_PATCH_LEVEL=
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
[c <c e,>]
}
\paper{
- castingalgorithm = \Wordwrap;
+
linewidth = 60.0\mm;
}
}
>
\paper{
- castingalgorithm = \Wordwrap;
+
}
}
indent = 0.0\pt;
%for broken!
linewidth= 30.\mm;
- castingalgorithm = \Wordwrap;
+
}
}
\grandstaff
\paper{
linewidth=80.0\mm;
- castingalgorithm = \Wordwrap;
+
\translator { \VoiceContext noAutoBeaming = "1"; }
\translator { \HaraKiriStaffContext }
\translator { \OrchestralScoreContext skipBars = 1; }
\$quite_long_lyrics_staff
>
\paper{
-% castingalgorithm = \Wordwrap;
+
}
}
indent = 0.0\pt;
%for broken!
% linewidth= 30.\mm;
- castingalgorithm = \Wordwrap;
}
}
indent = 0.0\pt;
%for broken!
% linewidth= 30.\mm;
- castingalgorithm = \Wordwrap;
+
}
}
[g,( e, )c' c]
}
\paper{
- castingalgorithm = \Wordwrap;
+
linewidth = 50.0\mm;
}
}
[d''8( f )a, d'] r2
}
\paper{
- castingalgorithm = \Wordwrap;
+
linewidth = 50.0\mm;
}
}
}
\paper{
linewidth = 80.\mm;
- castingalgorithm = \Wordwrap;
+
}
}
}
>
\paper{
- castingalgorithm = \Wordwrap;
+
}
}
if (isdir_b (al))
{
Direction d = to_dir (al);
- directional_element (align_item_p_).set (d);
+ Directional_element_interface (align_item_p_).set (d);
}
typeset_element (align_item_p_);
Axis_group_interface (staffline_p_).set_interface ();
Axis_group_interface (staffline_p_).set_axes (Y_AXIS, Y_AXIS);
- Item * it = get_staff_info().command_pcol_l ();
+ Score_element * it = unsmob_element (get_property ("currentCommandColumn"));
Pointer_group_interface (it, "bounded-by-me").add_element (staffline_p_);
staffline_p_->set_bound(LEFT,it);
&& gh_number_p (gh_cdr (dims)))
staffline_p_->set_elt_property ("extra-extent-Y", dims);
- Item * it = get_staff_info().command_pcol_l ();
+Score_element * it = unsmob_element (get_property ("currentCommandColumn"));
Pointer_group_interface (it, "bounded-by-me").add_element (staffline_p_);
staffline_p_->set_bound(RIGHT,it);
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
}
- 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 ();
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);
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);
}
}
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))
{
{
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;
/*
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;
*/
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);
}
}
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)
// 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;
{
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++)
{
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
if (quant_dir)
q = iv[(Direction)quant_dir];
- return q * directional_element (this).get ();
+ return q * Directional_element_interface (this).get ();
}
void
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)
Breathing_sign::member_after_line_breaking ()
{
Real space = staff_symbol_referencer (this).staff_space();
- Direction d = directional_element (this). get ();
+ Direction d = Directional_element_interface (this). get ();
if (!d)
{
d = UP;
- directional_element(this).set (d);
+ Directional_element_interface (this).set (d);
}
translate_axis(2.0 * space * d, Y_AXIS);
It's amazing Mike:
Stem:: type_i () ->first_head ()->get_direction () ->
- directional_element (me).set (d);
+ Directional_element_interface (me).set (d);
don't understand this comment.
{
elt_l_->set_elt_property ("direction", gh_int2scm (d));
}
-
-Directional_element_interface
-directional_element (Score_element const*s)
-{
- return s;
-}
{
Pointer_group_interface gi (this, "dots");
gi.set_interface ();
- directional_element (this).set (RIGHT);
+ Directional_element_interface (this).set (RIGHT);
Axis_group_interface (this).set_interface ();
Axis_group_interface (this).set_axes(X_AXIS,X_AXIS);
SCM d= get_elt_property ("dot-count");
if (gh_number_p (d) && gh_scm2int (d))
{
- if (!directional_element (this).get ())
- directional_element (this).set (UP);
+ if (!Directional_element_interface (this).get ())
+ Directional_element_interface (this).set (UP);
Staff_symbol_referencer_interface si (this);
int p = int (si.position_f ());
if (!(p % 2))
- si.set_position (p + directional_element (this).get ());
+ si.set_position (p + Directional_element_interface (this).get ());
}
return SCM_UNDEFINED;
/*
TODO:
- * direction of text-dynamic-request if not equalt to direction
- of line-spanner
-
- * FIXME: this has gotten a bit too hairy.
- */
-
-class Dynamic_line_spanner : public Spanner
-{
-public:
- Dynamic_line_spanner (SCM);
- VIRTUAL_COPY_CONS(Score_element);
- void add_column (Note_column*);
- void add_element (Score_element*);
-};
-
-Dynamic_line_spanner::Dynamic_line_spanner (SCM s)
- : Spanner (s)
-{
- Side_position_interface (this).set_axis (Y_AXIS);
- Axis_group_interface (this).set_interface ();
- Axis_group_interface (this).set_axes (X_AXIS, Y_AXIS);
-}
-
-void
-Dynamic_line_spanner::add_column (Note_column* n)
-{
- if (!get_bound (LEFT))
- set_bound (LEFT, n);
- else
- set_bound (RIGHT, n);
-
- add_dependency (n);
-}
-
-
-void
-Dynamic_line_spanner::add_element (Score_element* e)
-{
- e->set_parent (this, Y_AXIS);
- Axis_group_interface (this).add_element (e);
-}
+ * direction of text-dynamic-request if not equal to direction of
+ line-spanner
+*/
/**
print text & hairpin dynamics.
Crescendo * cresc_p_;
Text_script_req* text_req_l_;
- Span_req * span_start_req_l_;
- Drul_array<Span_req*> span_req_l_drul_;
+
+ Span_req * current_cresc_req_;
+ Drul_array<Span_req*> accepted_spanreqs_drul_;
- Dynamic_line_spanner* line_spanner_;
- Dynamic_line_spanner* finished_line_spanner_;
- Moment last_request_mom_;
+ Spanner* line_spanner_;
+ Spanner* finished_line_spanner_;
- Array<Note_column*> pending_column_arr_;
+ Link_array<Note_column> pending_column_arr_;
Link_array<Score_element> pending_element_arr_;
- void typeset_all ();
+ void typeset_all ();
public:
VIRTUAL_COPY_CONS(Translator);
Dynamic_engraver ();
protected:
- void announce_element (Score_element_info);
-
virtual void do_removal_processing ();
virtual void acknowledge_element (Score_element_info);
virtual bool do_try_music (Music *req_l);
ADD_THIS_TRANSLATOR (Dynamic_engraver);
-void
-Dynamic_engraver::announce_element (Score_element_info i)
-{
- Group_interface (i.elem_l_, "interfaces").add_thing (ly_symbol2scm ("dynamic"));
-
- Engraver::announce_element (i);
-}
-
Dynamic_engraver::Dynamic_engraver ()
{
finished_cresc_p_ = 0;
line_spanner_ = 0;
finished_line_spanner_ = 0;
- span_start_req_l_ = 0;
+ current_cresc_req_ = 0;
cresc_p_ =0;
text_req_l_ = 0;
- span_req_l_drul_[START] = 0;
- span_req_l_drul_[STOP] = 0;
+ accepted_spanreqs_drul_[START] = 0;
+ accepted_spanreqs_drul_[STOP] = 0;
}
void
Dynamic_engraver::do_post_move_processing ()
{
text_req_l_ = 0;
- span_req_l_drul_[START] = 0;
- span_req_l_drul_[STOP] = 0;
+ accepted_spanreqs_drul_[START] = 0;
+ accepted_spanreqs_drul_[STOP] = 0;
}
bool
if ((s->span_type_str_ == "crescendo"
|| s->span_type_str_ == "decrescendo"))
{
- span_req_l_drul_[s->span_dir_] = s;
+ accepted_spanreqs_drul_[s->span_dir_] = s;
return true;
}
}
void
Dynamic_engraver::do_process_music ()
{
- if ((span_req_l_drul_[START] || span_req_l_drul_[STOP] || text_req_l_)
- && !line_spanner_
- && pending_element_arr_.size ())
+ if (accepted_spanreqs_drul_[START] || accepted_spanreqs_drul_[STOP] || text_req_l_)
+
{
- line_spanner_ = new Dynamic_line_spanner (get_property ("basicDynamicLineSpannerProperties"));
- for (int i = 0; i < pending_column_arr_.size (); i++)
- line_spanner_->add_column (pending_column_arr_[i]);
- pending_column_arr_.clear ();
- announce_element (Score_element_info
- (line_spanner_,
- text_req_l_ ? text_req_l_ : span_req_l_drul_[START]));
+ if (!line_spanner_)
+ {
+ line_spanner_ = new Spanner (get_property ("basicDynamicLineSpannerProperties"));
- }
+ Side_position_interface (line_spanner_).set_axis (Y_AXIS);
+ Axis_group_interface (line_spanner_).set_interface ();
+ Axis_group_interface (line_spanner_).set_axes (Y_AXIS, Y_AXIS);
+ announce_element (Score_element_info
+ (line_spanner_,
+ text_req_l_ ? text_req_l_ : accepted_spanreqs_drul_[START]));
- if (line_spanner_ && pending_element_arr_.size ())
- {
- for (int i = 0; i < pending_element_arr_.size (); i++)
- line_spanner_->add_element (pending_element_arr_[i]);
- pending_element_arr_.clear ();
+ }
}
/*
- TODO: This should be optionised:
- * break when group of dynamic requests ends
- * break now (only if no cresc. in progress)
- * continue through piece */
- if (span_req_l_drul_[START] || span_req_l_drul_[STOP] || text_req_l_)
+ TODO: should finish and create new spanner if vertical dyn-direction is changed.
+ */
+ else if (!accepted_spanreqs_drul_[START] && !text_req_l_)
{
- last_request_mom_ = now_mom ();
+ finished_line_spanner_ = line_spanner_;
+ line_spanner_ = 0;
}
- else
- {
- /*
+
+ /*
+ todo: resurrect dynamic{direction, padding,minimumspace}
+ */
+ /*
During a (de)crescendo, pending request will not be cleared,
and a line-spanner will always be created, as \< \! are already
two requests.
Maybe always creating a line-spanner for a (de)crescendo (see
below) is not a good idea:
- a\< b\p \!c
+ a\< b\p \!c
the \p will be centred on the line-spanner, and thus clash
with the hairpin. When axis-group code is in place, the \p
Urg, but line-spanner must always have at least same duration
as (de)crecsendo, b.o. line-breaking.
- */
- if (now_mom () > last_request_mom_ && !span_start_req_l_)
- {
- for (int i = 0; i < pending_element_arr_.size (); i++)
- {
- Score_element* e = pending_element_arr_[i];
- Side_position_interface (e).set_axis (Y_AXIS);
- Side_position_interface (e).add_staff_support ();
-
- /*
- UGH UGH
- */
- Direction d = directional_element (e).get ();
- if (!d)
- {
- SCM s = get_property ("dynamicDirection");
- if (!isdir_b (s))
- s = get_property ("verticalDirection");
- if (isdir_b (s))
- d = to_dir (s);
- directional_element (e).set (d);
- }
-
- SCM s = get_property ("dynamicPadding");
- if (gh_number_p (s))
- e->set_elt_property ("padding", s);
- s = get_property ("dynamicMinimumSpace");
- if (gh_number_p (s))
- e->set_elt_property ("minimum-space", s);
- }
- pending_element_arr_.clear ();
- if (line_spanner_)
- {
- for (int i = 0; i < pending_column_arr_.size (); i++)
- line_spanner_->add_column (pending_column_arr_[i]);
- pending_column_arr_.clear ();
- finished_line_spanner_ = line_spanner_;
- line_spanner_ = 0;
- }
- }
- }
+ */
+
if (text_req_l_)
{
text_p_ = new Item (get_property ("basicDynamicTextProperties"));
text_p_->set_elt_property ("text", ly_str02scm (loud.ch_C ()));
if (Direction d=text_req_l_->get_direction ())
- directional_element (text_p_).set (d);
- pending_element_arr_.push (text_p_);
+ Directional_element_interface (line_spanner_).set (d);
+
+ Axis_group_interface (line_spanner_).add_element (text_p_);
text_p_->add_offset_callback (Side_position_interface::aligned_on_self,
Y_AXIS);
announce_element (Score_element_info (text_p_, text_req_l_));
}
- if (span_req_l_drul_[STOP])
+ if (accepted_spanreqs_drul_[STOP])
{
if (!cresc_p_)
{
- span_req_l_drul_[STOP]->warning
+ accepted_spanreqs_drul_[STOP]->warning
(_ ("can't find start of (de)crescendo"));
}
else
{
assert (!finished_cresc_p_);
- cresc_p_->set_bound (RIGHT, get_staff_info ().musical_pcol_l ());
+ cresc_p_->set_bound (RIGHT, unsmob_element (get_property ("currentMusicalColumn")));
finished_cresc_p_ = cresc_p_;
cresc_p_ = 0;
- span_start_req_l_ = 0;
+ current_cresc_req_ = 0;
}
}
- if (span_req_l_drul_[START])
+ if (accepted_spanreqs_drul_[START])
{
- if (span_start_req_l_)
+ if (current_cresc_req_)
{
- span_req_l_drul_[START]->warning
- (span_start_req_l_->span_dir_ == 1
+ accepted_spanreqs_drul_[START]->warning
+ (current_cresc_req_->span_dir_ == 1
?
_ ("already have a crescendo")
: _ ("already have a decrescendo"));
}
else
{
- span_start_req_l_ = span_req_l_drul_[START];
+ current_cresc_req_ = accepted_spanreqs_drul_[START];
cresc_p_ = new Crescendo (get_property ("basicCrescendoProperties"));
cresc_p_->set_elt_property
("grow-direction",
- gh_int2scm ((span_req_l_drul_[START]->span_type_str_ == "crescendo")
+ gh_int2scm ((accepted_spanreqs_drul_[START]->span_type_str_ == "crescendo")
? BIGGER : SMALLER));
- SCM s = get_property ((span_req_l_drul_[START]->span_type_str_ + "Text").ch_C());
+ SCM s = get_property ((accepted_spanreqs_drul_[START]->span_type_str_ + "Text").ch_C());
if (gh_string_p (s))
{
cresc_p_->set_elt_property ("start-text", s);
- daddy_trans_l_->set_property (span_req_l_drul_[START]->span_type_str_
+ daddy_trans_l_->set_property (accepted_spanreqs_drul_[START]->span_type_str_
+ "Text", SCM_UNDEFINED);
}
- s = get_property ((span_req_l_drul_[START]->span_type_str_ + "Spanner").ch_C());
+ s = get_property ((accepted_spanreqs_drul_[START]->span_type_str_ + "Spanner").ch_C());
/*
if (gh_string_p (s)) //&& ly_scm2string (s) != "hairpin")
{
cresc_p_->set_elt_property ("spanner", s);
- daddy_trans_l_->set_property (span_req_l_drul_[START]->span_type_str_
+ daddy_trans_l_->set_property (accepted_spanreqs_drul_[START]->span_type_str_
+ "Spanner", SCM_UNDEFINED);
}
- cresc_p_->set_bound (LEFT, get_staff_info ().musical_pcol_l ());
+ cresc_p_->set_bound (LEFT, unsmob_element (get_property ("currentMusicalColumn")));
/*
it is not a special symbol, like Crescendo.
*/
-
+
if (text_p_)
{
index_set_cell (cresc_p_->get_elt_property ("dynamic-drul"),
index_set_cell (finished_cresc_p_->get_elt_property ("dynamic-drul"),
RIGHT, SCM_BOOL_T);
}
- pending_element_arr_.push (cresc_p_);
+
+ Axis_group_interface (line_spanner_).add_element (cresc_p_);
cresc_p_->set_elt_property ("self-alignment-Y", gh_int2scm (0));
cresc_p_->add_offset_callback
(Side_position_interface::aligned_on_self, Y_AXIS);
- announce_element (Score_element_info (cresc_p_, span_req_l_drul_[START]));
+ announce_element (Score_element_info (cresc_p_, accepted_spanreqs_drul_[START]));
}
}
}
void
Dynamic_engraver::do_removal_processing ()
{
+ typeset_all ();
+
if (cresc_p_)
{
typeset_element (cresc_p_ );
- span_start_req_l_->warning (_ ("unterminated (de)crescendo"));
- cresc_p_ =0;
+ finished_cresc_p_ = cresc_p_;
+ current_cresc_req_->warning (_ ("unterminated (de)crescendo"));
}
- typeset_all ();
if (line_spanner_)
{
- Side_position_interface (line_spanner_).add_staff_support ();
- typeset_element (line_spanner_);
- line_spanner_ = 0;
+ finished_line_spanner_ = line_spanner_;
}
+ typeset_all ();
}
void
if (finished_line_spanner_)
{
Side_position_interface (finished_line_spanner_).add_staff_support ();
+
+ if (!finished_line_spanner_->get_bound (LEFT))
+ {
+ Score_element * cmc
+ = unsmob_element (get_property ("currentMusicalColumn"));
+ finished_line_spanner_->set_bound (LEFT, cmc);
+ }
+ if (!finished_line_spanner_->get_bound (RIGHT))
+ finished_line_spanner_->set_bound (RIGHT,
+ finished_line_spanner_->get_bound (LEFT));
+
+
typeset_element (finished_line_spanner_);
finished_line_spanner_ = 0;
}
if (line_spanner_)
{
Side_position_interface (line_spanner_).add_support (n);
- line_spanner_->add_column (n);
- }
- else
- {
- pending_column_arr_.push (n);
+ add_bound_item (line_spanner_,n);
}
}
}
}
-Staff_info
-Engraver_group_engraver::get_staff_info() const
-{
- Staff_info inf = Engraver::get_staff_info();
- return inf;
-}
+
#include "score-element.hh"
#include "group-interface.hh"
-void
-Engraver::fill_staff_info (Staff_info&)
-{
-
-}
void
Engraver::announce_element (Score_element_info i)
return dynamic_cast<Paper_def*>(output_def_l_);
}
-
-Staff_info
-Engraver::get_staff_info() const
-{
- if (daddy_grav_l())
- return daddy_grav_l()->get_staff_info();
- Staff_info info;
- return info;
-}
-
-
-
-
-
Engraver_group_engraver*
Engraver::daddy_grav_l () const
{
if (extender_p_)
{
req_l_->warning (_ ("unterminated extender"));
- extender_p_->set_bound(RIGHT, get_staff_info ().command_pcol_l ());
+ extender_p_->set_bound(RIGHT, unsmob_element (get_property ("currentCommandColumn")));
}
}
}
-void
-Grace_align_item::do_add_processing ()
-{
-}
Axis_group_interface (last_musical_col_l_).add_element (align_l_);
}
- last_musical_col_l_ = get_staff_info ().musical_pcol_l ();
+ last_musical_col_l_ = dynamic_cast<Paper_column*>( unsmob_element (get_property ("currentMusicalColumn")));
}
void
if (hyphen_p_)
{
req_l_->warning (_ ("unterminated hyphen"));
- hyphen_p_->set_bound(RIGHT, get_staff_info ().command_pcol_l ());
+ hyphen_p_->set_bound(RIGHT, unsmob_element (get_property ("currentCommandColumn")));
}
}
// bool set_interface ();
};
-Directional_element_interface directional_element (Score_element const*);
#endif /* DIRECTIONAL_ELEMENT_HH */
public:
VIRTUAL_COPY_CONS(Translator);
- virtual Staff_info get_staff_info() const;
virtual void do_announces();
virtual void announce_element (Score_element_info);
};
Announce element. Default: pass on to daddy. Utility
*/
virtual void announce_element (Score_element_info);
-
- /**
- Get information on the staff. Default: ask daddy.
- */
- virtual Staff_info get_staff_info() const;
- virtual void fill_staff_info (Staff_info&);
-
public:
VIRTUAL_COPY_CONS(Translator);
Engraver_group_engraver * daddy_grav_l() const;
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);
};
+++ /dev/null
-/*
- key-engraver.hh -- declare Key_engraver
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef KEYGRAV_HH
-#define KEYGRAV_HH
-#error
-#endif // KEYGRAV_HH
protected:
/* Engraver_group_engraver interface */
- virtual Staff_info get_staff_info() const;
+
virtual bool do_try_music (Music*);
virtual void do_creation_processing();
virtual void do_removal_processing();
virtual void do_break_processing ();
virtual Line_of_score*line_l () const;
};
+
+
+void add_bound_item (Spanner*, Item* n);
+
+
#endif
-/*
- staff-info.hh -- declare Staff_info
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef STAFF_INFO_HH
-#define STAFF_INFO_HH
-
-#include "lily-proto.hh"
-
-/** struct to pass staff info along a Engraver hierarchy.
-
- JUNKME.
- */
-struct Staff_info {
- Paper_column *musical_l_;
- Paper_column *command_l_;
-
- Paper_column * command_pcol_l();
- Paper_column * musical_pcol_l();
- Staff_info();
-};
-
-#endif // STAFF_INFO_HH
Line_group_engraver_group::do_removal_processing()
{
Engraver_group_engraver::do_removal_processing ();
- Item * it = get_staff_info().command_pcol_l ();
+ Score_element * it
+ = unsmob_element (get_property (ly_symbol2scm ("currentCommandColumn")));
Pointer_group_interface (it, "bounded-by-me").add_element (staffline_p_);
staffline_p_->set_bound(RIGHT,it);
Line_group_engraver_group::do_creation_processing()
{
create_line_spanner ();
- Item * it = get_staff_info().command_pcol_l ();
+ Score_element * it
+ = unsmob_element (get_property (ly_symbol2scm ("currentCommandColumn")));
staffline_p_->set_bound(LEFT,it);
Pointer_group_interface (it, "bounded-by-me").add_element (staffline_p_);
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"));
set_bound (LEFT, column_arr[0 >? column_arr.size () - 2]);
set_bound (RIGHT, column_arr.top ());
}
-
+#endif
// set columns to SCM_EOL?
}
Pointer_group_interface gi (this, "columns");
gi.add_element (c);
+ add_bound_item (this, c);
add_dependency (c);
}
if (news[i])
*current[i] = news[i];
}
-}
-
-Staff_info
-Score_engraver::get_staff_info() const
-{
- Staff_info inf = Engraver_group_engraver::get_staff_info();
- inf.command_l_ = command_column_l_;
- inf.musical_l_ = musical_column_l_;
-
- return inf;
+ if (new_musical_l)
+ set_property ("currentMusicalColumn", new_musical_l->self_scm_);
+ if (new_command_l)
+ set_property ("currentCommandColumn", new_command_l->self_scm_);
}
Music_output*
{
sep_span_p_ = new Separating_group_spanner (SCM_EOL);
announce_element (Score_element_info (sep_span_p_, 0));
- sep_span_p_->set_bound (LEFT, get_staff_info ().command_pcol_l ());
+ sep_span_p_->set_bound (LEFT, unsmob_element (get_property ("currentCommandColumn")));
}
void
Separating_line_group_engraver::do_removal_processing ()
{
- sep_span_p_->set_bound (RIGHT, get_staff_info ().command_pcol_l ());
+ sep_span_p_->set_bound (RIGHT, unsmob_element (get_property ("currentCommandColumn")));
typeset_element (sep_span_p_);
sep_span_p_ =0;
}
Pointer_group_interface (this, "note-columns").add_element (n);
add_dependency (n);
}
+
+ add_bound_item (this, n);
}
void
void
Slur::do_add_processing ()
{
+#if 0
Link_array<Note_column> encompass_arr =
Pointer_group_interface__extract_elements (this, (Note_column*)0, "note-columns");
if (encompass_arr.size () > 1)
set_bound (RIGHT, encompass_arr.top ());
}
+#endif
}
{
Offset o;
Stem* stem_l = col->stem_l ();
- Direction dir = directional_element (this).get ();
+ Direction dir = Directional_element_interface (this).get ();
if (!stem_l)
{
o[Y_AXIS] = col->extent (Y_AXIS)[dir];
return o;
}
- Direction stem_dir = directional_element (stem_l).get ();
+ Direction stem_dir = Directional_element_interface (stem_l).get ();
o[X_AXIS] = stem_l->relative_coordinate (0, X_AXIS);
/*
void
Slur::set_extremities ()
{
- 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 ());
Direction dir = LEFT;
do
Default position is centered in X, on outer side of head Y
*/
o += Offset (0.5 * n->extent (X_AXIS).length (),
- 0.5 * ss * directional_element (this).get ());
+ 0.5 * ss * Directional_element_interface (this).get ());
}
else if (str == "alongside-stem")
{
*/
o += Offset (n->extent (X_AXIS).length ()
* (1 + st->get_direction ()),
- 0.5 * ss * directional_element (this).get ());
+ 0.5 * ss * Directional_element_interface (this).get ());
}
else if (str == "stem")
{
SCM l = scm_assoc
(scm_listify (a,
gh_int2scm (st->get_direction () * dir),
- gh_int2scm (directional_element (this).get () * dir),
+ gh_int2scm (Directional_element_interface (this).get () * dir),
SCM_UNDEFINED),
scm_eval (ly_symbol2scm ("slur-extremity-offset-alist")));
if (gh_number_p (d))
a = lookup_l ()->dashed_slur (one, thick, thick * gh_scm2double (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();
}
Slur::set_control_points ()
{
Slur_bezier_bow bb (get_encompass_offset_arr (),
- directional_element (this).get ());
+ Directional_element_interface (this).get ());
Real staff_space = Staff_symbol_referencer_interface (this).staff_space ();
Real h_inf = paper_l ()->get_var ("slur_height_limit_factor") * staff_space;
Bezier b;
int i = 0;
- // URGURG?
- if (!directional_element (this).get ()
+ if (!Directional_element_interface (this).get ()
|| ! gh_symbol_p (index_cell (get_elt_property ("attachment"), LEFT)))
((Slur*)this)->set_extremities ();
}
Array<Offset> enc (get_encompass_offset_arr ());
- Direction dir = directional_element (this).get ();
+ Direction dir = Directional_element_interface (this).get ();
Real x1 = enc[0][X_AXIS];
Real x2 = enc.top ()[X_AXIS];
Spacing_engraver::do_creation_processing ()
{
spacing_p_ =new Spacing_spanner (SCM_EOL);
- spacing_p_->set_bound (LEFT, get_staff_info ().command_pcol_l ());
+ spacing_p_->set_bound (LEFT, unsmob_element (get_property ("currentCommandColumn")));
announce_element (Score_element_info (spacing_p_, 0));
}
void
Spacing_engraver::do_removal_processing ()
{
- Paper_column * p = get_staff_info ().command_pcol_l ();
-
+ Score_element * p = unsmob_element (get_property ("currentCommandColumn"));
spacing_p_->set_bound (RIGHT, p);
typeset_element (spacing_p_);
spacing_p_ =0;
shortest_playing = shortest_playing <? starter;
Paper_column * sc
- = dynamic_cast<Paper_column*> (get_staff_info ().musical_pcol_l ());
+ = dynamic_cast<Paper_column*> (unsmob_element (get_property ("currentMusicalColumn")));
SCM sh = smobify (new Moment (shortest_playing));
SCM st = smobify (new Moment (starter));
if (!left || !right)
return;
- if (left == right)
- {
- warning (_f ("Spanner `%s' has equal left and right spanpoints",
- classname (this)));
- }
-
/*
Check if our parent in X-direction spans equally wide
or wider than we do.
{
set_parent (i, X_AXIS);
}
-
- if (spanned_drul_[Direction(-d)] == spanned_drul_[d]
- && i)
- warning (_f ("Spanner `%s' has equal left and right spanpoints",
- classname (this)));
}
while (flip (&d) != LEFT);
}
+void
+add_bound_item (Spanner* sp, Item*it)
+{
+ if (!sp->get_bound (LEFT))
+ sp->set_bound (LEFT, it);
+ else
+ sp->set_bound (RIGHT, it);
+}
-/*
- staff-info.cc -- implement Staff_info
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "proto.hh"
-
-#include "staff-info.hh"
-#include "paper-column.hh"
-
-Staff_info::Staff_info()
-{
- command_l_ =0;
- musical_l_ =0;
-}
-
-
-Paper_column*
-Staff_info::command_pcol_l()
-{
- return command_l_;
-}
-
-Paper_column*
-Staff_info::musical_pcol_l()
-{
- return musical_l_;
-}
-
Staff_symbol_engraver::do_creation_processing()
{
span_p_ = new Staff_symbol (get_property ("staffSymbolBasicProperties"));
- span_p_->set_bound(LEFT,get_staff_info().command_pcol_l ());
+ span_p_->set_bound(LEFT,unsmob_element (get_property ("currentCommandColumn")));
announce_element (Score_element_info (span_p_, 0));
}
if (gh_number_p (n))
span_p_->set_elt_property ("line-count", n);
- span_p_->set_bound(RIGHT,get_staff_info().command_pcol_l ());
+ span_p_->set_bound(RIGHT,unsmob_element (get_property ("currentCommandColumn")));
typeset_element (span_p_);
span_p_ =0;
}
int beams_i = stem->beam_count(RIGHT) >? stem->beam_count (LEFT);
mol.translate (Offset(stem->relative_coordinate (0, X_AXIS) - relative_coordinate (0, X_AXIS),
stem->stem_end_position () * ss / 2 -
- directional_element (beam).get () * beams_i * interbeam_f));
+ Directional_element_interface (beam).get () * beams_i * interbeam_f));
}
else
{
Direction
Stem::get_direction () const
{
- Direction d = directional_element (this).get ();
+ Direction d = Directional_element_interface (this).get ();
if (!d)
{
Stem * me = (Stem*) this;
d = get_default_dir ();
// urg, AAARGH!
- directional_element (me).set (d);
+ Directional_element_interface (me).set (d);
}
return d ;
}
if (!dir)
{
dir = get_default_dir ();
- directional_element (this).set (dir);
+ Directional_element_interface (this).set (dir);
}
/*
{
assert (beam_l ());
- Direction beam_dir = directional_element (beam_l ()).get ();
+ Direction beam_dir = Directional_element_interface (beam_l ()).get ();
if (!beam_dir)
{
programming_error ("Beam dir not set.");
Real stem_length = a[multiplicity <? (a.size () - 1)] * staff_space;
- if (!beam_dir || (beam_dir == directional_element (this).get ()))
+ if (!beam_dir || (beam_dir == Directional_element_interface (this).get ()))
/* normal beamed stem */
{
if (multiplicity)
System_start_delimiter_engraver::do_creation_processing()
{
delim_ = new System_start_delimiter (get_property ("basicSystemStartDelimiterProperties"));
- delim_->set_bound (LEFT, get_staff_info ().command_pcol_l ());
+ delim_->set_bound (LEFT, unsmob_element (get_property ("currentCommandColumn")));
/*
You can't override the glyph using \property, you must do it in
if (gh_number_p (collapse))
delim_->set_elt_property ("collapse-height", collapse);
- delim_->set_bound (RIGHT, get_staff_info ().command_pcol_l ());
+ delim_->set_bound (RIGHT, unsmob_element (get_property ("currentCommandColumn")));
typeset_element (delim_);
}
void
Tie_column::set_directions ()
{
- Link_array<Tie> s =
+ Link_array<Tie> ties =
Pointer_group_interface__extract_elements (this, (Tie*)0, "ties");
- Direction d = directional_element (this).get ();
+ Direction d = Directional_element_interface (this).get ();
if (d)
{
- for (int i = s.size (); i--;)
- directional_element (s[i]).set (d);
+ for (int i = ties.size (); i--;)
+ {
+ Tie * t = ties[i];
+ Directional_element_interface (t).set (d);
+ }
return;
}
- if (s.size () == 1)
+ if (ties.size () == 1)
{
- directional_element (s[0]).set (s[0]->get_default_dir ());
+ Tie * t = ties[0];
+ Directional_element_interface (t).set (t->get_default_dir ());
return;
}
- s.sort (tie_compare);
- directional_element (s[0]).set (DOWN);
- s.del (0);
- directional_element (s.pop ()).set (UP);
+ ties.sort (tie_compare);
+ Directional_element_interface tie0(ties[0]);
+ tie0.set (DOWN);
+ ties.del (0);
+
+ Directional_element_interface tietop(ties.pop ());
+ tietop.set (UP);
- for (int i=s.size(); i--; )
+ for (int i=ties.size(); i--; )
{
- Real p = s[i]->position_f ();
+ Tie * t = ties[i];
+ Real p = t->position_f ();
Direction d = (Direction) sign (p);
if (!d)
d = UP;
- directional_element (s[i]).set (d);
+ Directional_element_interface (t).set (d);
}
}
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()
{
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;
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)
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();
}
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 ();
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)
void
Tuplet_spanner::do_add_processing ()
{
+#if 0
if (gh_pair_p (get_elt_pointer ("columns")))
{
Link_array<Note_column> column_arr=
set_bound (LEFT, column_arr[0]);
set_bound (RIGHT, column_arr.top ());
}
+#endif
}
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
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];
}
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;
gi.add_element (n);
add_dependency (n);
+
+ add_bound_item (this, n);
}
valign_p_->set_elt_property ("stacking-dir",
gh_int2scm (DOWN));
- valign_p_->set_bound(LEFT,get_staff_info().command_pcol_l ());
+ valign_p_->set_bound(LEFT,unsmob_element (get_property ("currentCommandColumn")));
announce_element (Score_element_info (valign_p_ , 0));
}
valign_p_->set_elt_property ("threshold",
gh_cons (min,max));
}
- valign_p_->set_bound(RIGHT,get_staff_info().command_pcol_l ());
+ valign_p_->set_bound(RIGHT,unsmob_element (get_property ("currentCommandColumn")));
typeset_element (valign_p_);
valign_p_ =0;
}
{
set_elt_pointer ("bars", SCM_EOL);
Side_position_interface (this).set_axis (Y_AXIS);
- directional_element (this).set (UP);
+ Directional_element_interface (this).set (UP);
}
SCM
Volta_spanner::member_brew_molecule () const
{
- Molecule mol;
-
+
Link_array<Bar> bar_arr
= Pointer_group_interface__extract_elements (this, (Bar*)0, "bars");
if (!bar_arr.size ())
- return mol.create_scheme();
+ return SCM_EOL;
bool no_vertical_start = false;
bool no_vertical_end = to_boolean (get_elt_property ("last-volta"));
Real staff_space = paper_l ()->get_var ("interline");
Real half_space = staff_space / 2;
-
- Real w = spanner_length ()
- - get_broken_left_end_align ()
- - half_space;
+ Real left = get_broken_left_end_align ();
+ Real w = spanner_length () - left - half_space;
Real h = paper_l()->get_var ("volta_spanner_height");
Real t = paper_l ()->get_var ("volta_thick");
SCM_UNDEFINED));
Box b (Interval (0, w), Interval (0, h));
- Molecule volta (b, at);
- mol.add_molecule (volta);
-
+ Molecule mol (b, at);
Molecule num (lookup_l ()->text ("volta",
ly_scm2string (get_elt_property("text")),
paper_l ()));
mol.add_at_edge (X_AXIS, LEFT, num, - num.extent (X_AXIS).length ()
- staff_space);
+ mol.translate_axis (left, X_AXIS);
return mol.create_scheme();
}
void
Volta_spanner::do_add_processing ()
{
+#if 0
Link_array<Bar> bar_arr
= Pointer_group_interface__extract_elements (this, (Bar*)0, "bars");
set_bound (LEFT, bar_arr[0]);
set_bound (RIGHT, bar_arr.top ());
}
+#endif
}
GLUE_SCORE_ELEMENT(Volta_spanner,after_line_breaking);
Side_position_interface (this).add_support (b);
add_dependency (b);
+
+ add_bound_item (this, b);
}
void
(dot-count . 1)
)
basicDynamicLineSpannerProperties = #`(
-
+ (dynamic-interface . #t)
+ (axes . ( 1))
)
basicDynamicTextProperties = # `(
(style . "dynamic")
+ (dynamic-interface . #t)
(molecule-callback . ,Text_item::brew_molecule)
(script-priority . 100)
(self-alignment-Y . 0)
)
leftEdgeBasicProperties = #`(
- (break-align-symbol . Left_edge_item)
- (breakable . #t)
+ (break-align-symbol . Left_edge_item)
+ (breakable . #t)
)
basicGraceAlignItemProperties = #`(
(axes . (0))
Begin3
Title: LilyPond
-Version: 1.3.64
+Version: 1.3.65
Entered-date: 26JUN00
Description:
Keywords: music notation typesetting midi fonts engraving
janneke@gnu.org (Jan Nieuwenhuizen)
Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
- 1000k lilypond-1.3.64.tar.gz
+ 1000k lilypond-1.3.65.tar.gz
Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 1000k lilypond-1.3.64.tar.gz
+ 1000k lilypond-1.3.65.tar.gz
Copying-policy: GPL
End
Name: lilypond
-Version: 1.3.64
+Version: 1.3.65
Release: 1
Copyright: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.64.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.65.tar.gz
Summary: A program for printing sheet music.
URL: http://www.cs.uu.nl/~hanwen/lilypond
# Icon: lilypond-icon.gif