-1.3.108.jcn5
-============
+1.3.108.uu1
+===========
-* Fixed mark default font.
+* Bugfix: resurrected point-and-click.
-1.3.108.jcn2
-============
+* Use scheme object props for storing type predicates and doc-strings
+Dump global lists of properties into auto-documentation.
+
+* Bugfix: extent callback for Rest, so ledger lines don't disappear for
+rest-collisions.
+
+* Removed some hair from chord code
+
+* Rewrite of engraver pass scheme: try to make graphical objects in
+acknowledge_element()/process_acknowledged(), not in process_music()
+
+* Remove Translator::status_ and associated code. Removes the need for
+various XXXX functions as wrapper for do_XXX functions.
-* Removed some hair from chord code.
+* Search replace: Score_element -> Grob (Graphical object),
+{pre,post}_move_processing -> {stop,start}_translation_timestep,
+do_try_music -> try_music.
1.3.107.jcn3
============
Grace notes without beams should have a slash, if @code{flagStyle} is
not set. Main note scripts don't end up on the grace note.
-@c @lily pondfile{grace.ly}
+@lilypondfile{grace.ly}
@section Beams, slurs and other spanners
second staff line. This does not hold for grace note beams.
Override with @code{noStemExtend}.
-@c @lily pondfile{beam-position.ly}
+@lilypondfile{beam-position.ly}
Slurs should look nice and symmetric. The curvature may increase
only to avoid noteheads, and as little as possible. Slurs never
@unnumberedsec What is LilyPond?
-LilyPond is a music typesetter. It produces beautiful sheet music using
-a high level description file as input. It excels at typesetting
+LilyPond is a music typesetting. It produces beautiful sheet music
+using a high level description file as input. It excels at typesetting
classical music, but you can also print pop-songs. With LilyPond we
hope to make music publication software available to anyone on the
internet.
@uref{Documentation/user/out-www/lilypond.html, manual} or other
@uref{Documentation/out-www/index.html, documentation}.
-
-
@html
<a name="music">
@end html
the examples included. We have @uref{short-examples.html,short
examples} and @uref{long-examples.html,longer examples}. The
examples include sound bites in MIDI, pictures in PNG, printable scores
-in PostScript, and LilyPond input.
-
-Others use LilyPond too.
+in PostScript, and LilyPond input. Others use LilyPond too, and have put
+scores on the web. Head over to @uref{http://appel.lilypond.org/wiki/index.php?DownloadLilyPondScores}
@uref{http://www.geocities.com/Vienna/Studio/1714/harpsichord.html,John
Sankey}, harpsichordist to the internet, is typesetting the complete
@uref{http://www.geocities.com/Vienna/Studio/1714/scarlattidwn.html,sonatas
PACKAGE_NAME=LilyPond
MAJOR_VERSION=1
MINOR_VERSION=3
-PATCH_LEVEL=108
-MY_PATCH_LEVEL=jcn5
+PATCH_LEVEL=109
+MY_PATCH_LEVEL=
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
m =\notes \relative c'' {
\property Staff.automaticMelismata = ##t
\autoBeamOff
- %g4 r8 \times 2/3 { g'8( f )e } r8 \grace { [d16 c b] } e4
- g4 r8 \times 2/3 { g'8( f )e } r8 e4
+ g4 r8 \times 2/3 { g'8( f )e } r8 \grace { [d16 c b] } e4
\emptyText
d8.^"melisma" \melisma c16
\melismaEnd
protected:
void deprecated_process_music ();
- virtual void acknowledge_element (Score_element_info);
+ virtual void acknowledge_grob (Grob_info);
- virtual void process_acknowledged ();
- virtual void do_pre_move_processing ();
+ virtual void create_grobs ();
+ virtual void stop_translation_timestep ();
private:
Item* text_p_;
{
text_p_ = new Item (get_property ("TextScript"));
Side_position::set_axis (text_p_, Y_AXIS);
- announce_element (text_p_, 0);
+ announce_grob (text_p_, 0);
Direction dir = UP;
SCM text;
}
Side_position::set_direction (text_p_, dir);
- text_p_->set_elt_property ("text", text);
+ text_p_->set_grob_property ("text", text);
}
}
}
void
-A2_engraver::acknowledge_element (Score_element_info i)
+A2_engraver::acknowledge_grob (Grob_info i)
{
if (!to_boolean (get_property ("combineParts")))
return ;
{
if (Note_head::has_interface (i.elem_l_))
{
- Score_element*t = text_p_;
+ Grob*t = text_p_;
Side_position::add_support (t, i.elem_l_);
if (Side_position::get_axis (t) == X_AXIS
&& !t->parent_l (Y_AXIS))
{
if (daddy_trans_l_->id_str_ == "one")
{
- i.elem_l_->set_elt_property ("direction", gh_int2scm (1));
+ i.elem_l_->set_grob_property ("direction", gh_int2scm (1));
}
else if (daddy_trans_l_->id_str_ == "two")
{
- i.elem_l_->set_elt_property ("direction", gh_int2scm (-1));
+ i.elem_l_->set_grob_property ("direction", gh_int2scm (-1));
}
}
}
}
void
-A2_engraver::process_acknowledged ()
+A2_engraver::create_grobs ()
{
deprecated_process_music ();
}
void
-A2_engraver::do_pre_move_processing ()
+A2_engraver::stop_translation_timestep ()
{
if (text_p_)
{
Side_position::add_staff_support (text_p_);
- typeset_element (text_p_);
+ typeset_grob (text_p_);
text_p_ = 0;
}
}
*/
#include "align-interface.hh"
-#include "score-element.hh"
+#include "grob.hh"
#include "group-interface.hh"
#include "axis-group-interface.hh"
#include "paper-def.hh"
SCM
Align_interface::alignment_callback (SCM element_smob, SCM axis)
{
- Score_element * me = unsmob_element (element_smob);
+ Grob * me = unsmob_element (element_smob);
Axis ax = (Axis )gh_scm2int (axis);
- Score_element * par = me->parent_l (ax);
- if (par && !to_boolean (par->get_elt_property ("alignment-done")))
+ Grob * par = me->parent_l (ax);
+ if (par && !to_boolean (par->get_grob_property ("alignment-done")))
{
Align_interface::do_side_processing (par, ax);
}
from the outside by setting minimum-space and extra-space in its
children */
void
-Align_interface::do_side_processing (Score_element * me, Axis a)
+Align_interface::do_side_processing (Grob * me, Axis a)
{
- me->set_elt_property ("alignment-done", SCM_BOOL_T);
+ me->set_grob_property ("alignment-done", SCM_BOOL_T);
- SCM d = me->get_elt_property ("stacking-dir");
+ SCM d = me->get_grob_property ("stacking-dir");
Direction stacking_dir = gh_number_p(d) ? to_dir (d) : CENTER;
if (!stacking_dir)
stacking_dir = DOWN;
Array<Interval> dims;
- Link_array<Score_element> elems;
- Link_array<Score_element> all_elts
- = Pointer_group_interface__extract_elements ( me, (Score_element*) 0, "elements");
+ Link_array<Grob> elems;
+ Link_array<Grob> all_elts
+ = Pointer_group_interface__extract_elements ( me, (Grob*) 0, "elements");
for (int i=0; i < all_elts.size(); i++)
{
Interval y = all_elts[i]->extent(me, a);
if (!y.empty_b())
{
- Score_element *e =dynamic_cast<Score_element*>(all_elts[i]);
+ Grob *e =dynamic_cast<Grob*>(all_elts[i]);
// todo: fucks up if item both in Halign & Valign.
- SCM min_dims = e->remove_elt_property ("minimum-space");
+ SCM min_dims = e->remove_grob_property ("minimum-space");
if (gh_pair_p (min_dims) &&
gh_number_p (gh_car (min_dims))
&& gh_number_p (gh_cdr (min_dims)))
}
- SCM extra_dims = e->remove_elt_property ("extra-space");
+ SCM extra_dims = e->remove_grob_property ("extra-space");
if (gh_pair_p (extra_dims) &&
gh_number_p (gh_car (extra_dims))
&& gh_number_p (gh_cdr (extra_dims)))
Interval threshold = Interval (0, Interval::infinity ());
- SCM thr = me->get_elt_property ("threshold");
+ SCM thr = me->get_grob_property ("threshold");
if (gh_pair_p (thr))
{
Real ss = 1.0;
Axis
-Align_interface::axis (Score_element*me)
+Align_interface::axis (Grob*me)
{
- return Axis (gh_scm2int (gh_car (me->get_elt_property ("axes"))));
+ return Axis (gh_scm2int (gh_car (me->get_grob_property ("axes"))));
}
should use generic Scm funcs.
*/
int
-Align_interface::get_count (Score_element*me,Score_element*s)
+Align_interface::get_count (Grob*me,Grob*s)
{
- SCM e = me->get_elt_property ("elements");
+ SCM e = me->get_grob_property ("elements");
int c =0;
while (gh_pair_p (e))
{
}
void
-Align_interface::add_element (Score_element*me,Score_element* s)
+Align_interface::add_element (Grob*me,Grob* s)
{
s->add_offset_callback (Align_interface::alignment_callback_proc, Align_interface::axis (me));
Axis_group_interface::add_element (me, s);
void
-Align_interface::set_interface (Score_element*me)
+Align_interface::set_interface (Grob*me)
{
me->set_interface (ly_symbol2scm ("align-interface"));
}
void
-Align_interface::set_axis (Score_element*me,Axis a)
+Align_interface::set_axis (Grob*me,Axis a)
{
Axis_group_interface::set_axes (me, a,a );
}
bool
-Align_interface::has_interface (Score_element*me)
+Align_interface::has_interface (Grob*me)
{
return me && me->has_interface (ly_symbol2scm ("align-interface"));
}
class Align_note_column_engraver: public Engraver
{
Item * align_item_p_;
- Score_element * now_column_l_;
- Score_element * accidental_l_;
+ Grob * now_column_l_;
+ Grob * accidental_l_;
- virtual void process_acknowledged ();
- virtual void do_post_move_processing ();
+ virtual void create_grobs ();
+ virtual void start_translation_timestep ();
virtual void do_creation_processing ();
virtual void do_removal_processing ();
- virtual void acknowledge_element (Score_element_info);
+ virtual void acknowledge_grob (Grob_info);
public:
VIRTUAL_COPY_CONS(Translator);
Align_note_column_engraver ();
Side_position::set_direction (align_item_p_, LEFT);
// needed for setting font size.
- announce_element (align_item_p_, 0);
+ announce_grob (align_item_p_, 0);
}
void
Align_note_column_engraver::do_removal_processing ()
{
- if (!align_item_p_)
- {
- programming_error ("Align_note_column_engraver:: urg\n");
- return;
- }
-
SCM al = get_property ("graceAlignPosition");
if (isdir_b (al))
{
Directional_element_interface::set (align_item_p_,d);
}
- typeset_element (align_item_p_);
+ typeset_grob (align_item_p_);
align_item_p_ =0;
}
void
-Align_note_column_engraver::acknowledge_element (Score_element_info inf)
+Align_note_column_engraver::acknowledge_grob (Grob_info inf)
{
if (Note_column::has_interface(inf.elem_l_))
{
}
}
void
-Align_note_column_engraver::process_acknowledged ()
+Align_note_column_engraver::create_grobs ()
{
if (now_column_l_ && accidental_l_)
{
Real extra_space = gh_scm2double(grsp);
SCM e = gh_cons (gh_double2scm (-extra_space),
gh_double2scm (0.0));
- now_column_l_->set_elt_property ("extra-space", e);
+ now_column_l_->set_grob_property ("extra-space", e);
}
}
}
void
-Align_note_column_engraver::do_post_move_processing ()
+Align_note_column_engraver::start_translation_timestep ()
{
now_column_l_ =0;
accidental_l_ =0;
Arpeggio_engraver ();
protected:
- virtual void acknowledge_element (Score_element_info);
- virtual void process_acknowledged ();
- virtual void do_pre_move_processing ();
- virtual bool do_try_music (Music *);
+ virtual void acknowledge_grob (Grob_info);
+ virtual void create_grobs ();
+ virtual void stop_translation_timestep ();
+ virtual bool try_music (Music *);
private:
Item* arpeggio_;
Arpeggio_req *arpeggio_req_;
- Link_array <Score_element> stems_;
- Link_array<Score_element> supports_;
+ Link_array <Grob> stems_;
+ Link_array<Grob> supports_;
};
Arpeggio_engraver::Arpeggio_engraver ()
}
bool
-Arpeggio_engraver::do_try_music (Music* m)
+Arpeggio_engraver::try_music (Music* m)
{
if (!arpeggio_req_)
{
}
void
-Arpeggio_engraver::acknowledge_element (Score_element_info info)
+Arpeggio_engraver::acknowledge_grob (Grob_info info)
{
if (arpeggio_req_)
{
}
void
-Arpeggio_engraver::process_acknowledged ()
+Arpeggio_engraver::create_grobs ()
{
if (!arpeggio_ && !stems_.empty ())
{
{
Side_position::add_support (arpeggio_, supports_[i]);
}
- announce_element (arpeggio_, arpeggio_req_);
+ announce_grob (arpeggio_, arpeggio_req_);
}
}
void
-Arpeggio_engraver::do_pre_move_processing ()
+Arpeggio_engraver::stop_translation_timestep ()
{
if (arpeggio_)
{
- typeset_element (arpeggio_);
+ typeset_grob (arpeggio_);
arpeggio_ = 0;
}
arpeggio_req_ = 0;
#include "molecule.hh"
#include "paper-def.hh"
#include "arpeggio.hh"
-#include "score-element.hh"
+#include "grob.hh"
#include "stem.hh"
#include "staff-symbol-referencer.hh"
#include "staff-symbol.hh"
#include "font-interface.hh"
bool
-Arpeggio::has_interface (Score_element* me)
+Arpeggio::has_interface (Grob* me)
{
return me && me->has_interface (ly_symbol2scm ("arpeggio-interface"));
}
SCM
Arpeggio::brew_molecule (SCM smob)
{
- Score_element *me = unsmob_element (smob);
+ Grob *me = unsmob_element (smob);
- Score_element * common = me;
- for (SCM s = me->get_elt_property ("stems"); gh_pair_p (s); s = gh_cdr (s))
+ Grob * common = me;
+ for (SCM s = me->get_grob_property ("stems"); gh_pair_p (s); s = gh_cdr (s))
{
- Score_element * stem = unsmob_element (gh_car (s));
+ Grob * stem = unsmob_element (gh_car (s));
common = common->common_refpoint (Staff_symbol_referencer::staff_symbol_l (stem),
Y_AXIS);
}
Interval heads;
Real my_y = me->relative_coordinate (common, Y_AXIS);
- for (SCM s = me->get_elt_property ("stems"); gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = me->get_grob_property ("stems"); gh_pair_p (s); s = gh_cdr (s))
{
- Score_element * stem = unsmob_element (gh_car (s));
- Score_element * ss = Staff_symbol_referencer::staff_symbol_l (stem);
+ Grob * stem = unsmob_element (gh_car (s));
+ Grob * ss = Staff_symbol_referencer::staff_symbol_l (stem);
Interval iv =Stem::head_positions (stem);
iv *= Staff_symbol::staff_space (ss)/2.0;
SCM
Arpeggio::width_callback (SCM smob, SCM axis)
{
- Score_element * me = unsmob_element (smob);
+ Grob * me = unsmob_element (smob);
Axis a = (Axis)gh_scm2int (axis);
assert (a == X_AXIS);
Molecule arpeggio = Font_interface::get_default_font (me)->find_by_name ("scripts-arpeggio");
/*
TODO: figure what to do in grace?
+
+ TODO: documentme.
*/
class Auto_beam_engraver : public Engraver
{
VIRTUAL_COPY_CONS (Translator);
protected:
- virtual void do_pre_move_processing ();
- virtual void do_post_move_processing ();
+ virtual void stop_translation_timestep ();
+ virtual void start_translation_timestep ();
virtual void do_removal_processing ();
- virtual void acknowledge_element (Score_element_info);
- virtual void process_acknowledged ();
+ virtual void acknowledge_grob (Grob_info);
+ virtual void create_grobs ();
private:
void begin_beam ();
Spanner* create_beam_p ();
void end_beam ();
void junk_beam ();
- bool same_grace_state_b (Score_element* e);
+ bool same_grace_state_b (Grob* e);
void typeset_beam ();
+ /*
+ shortest_mom is the shortest note in the beam.
+ */
Moment shortest_mom_;
Spanner *finished_beam_p_;
Link_array<Item>* stem_l_arr_p_;
-
+
+
+ bool first_b_;
Moment last_add_mom_;
+
+ /*
+ Projected ending of the beam we're working on.
+ */
Moment extend_mom_;
Moment beam_start_moment_;
Moment beam_start_location_;
Auto_beam_engraver::Auto_beam_engraver ()
{
+ first_b_ = true;
stem_l_arr_p_ = 0;
shortest_mom_ = Moment (1, 8);
finished_beam_p_ = 0;
grouping_p_ = 0;
}
+/*
+ rename me: consider_end_or_begin () ?
+ */
void
Auto_beam_engraver::consider_end_and_begin (Moment test_mom)
{
*/
if (Stem::beam_l ((*stem_l_arr_p_)[i]))
{
+ scm_unprotect_object (beam_p->self_scm ());
return 0;
}
Beam::add_stem (beam_p,(*stem_l_arr_p_)[i]);
}
- announce_element (beam_p, 0);
+ announce_grob (beam_p, 0);
return beam_p;
}
{
finished_grouping_p_->beamify ();
Beam::set_beaming (finished_beam_p_, finished_grouping_p_);
- typeset_element (finished_beam_p_);
+ typeset_grob (finished_beam_p_);
finished_beam_p_ = 0;
delete finished_grouping_p_;
}
void
-Auto_beam_engraver::do_post_move_processing ()
+Auto_beam_engraver::start_translation_timestep ()
{
+ first_b_ =true;
/*
don't beam over skips
*/
}
void
-Auto_beam_engraver::do_pre_move_processing ()
+Auto_beam_engraver::stop_translation_timestep ()
{
- if (stem_l_arr_p_)
- {
- Moment now = now_mom ();
- if ((extend_mom_ < now)
- || ((extend_mom_ == now) && (last_add_mom_ != now )))
- {
- end_beam ();
- }
- else if (!stem_l_arr_p_->size ())
- {
- junk_beam ();
- }
- }
+
typeset_beam ();
}
}
bool
-Auto_beam_engraver::same_grace_state_b (Score_element* e)
+Auto_beam_engraver::same_grace_state_b (Grob* e)
{
- bool gr = e->get_elt_property ("grace") == SCM_BOOL_T;
+ bool gr = e->get_grob_property ("grace") == SCM_BOOL_T;
SCM wg =get_property ("weAreGraceContext");
return (to_boolean (wg)) == gr;
}
void
-Auto_beam_engraver::acknowledge_element (Score_element_info info)
+Auto_beam_engraver::acknowledge_grob (Grob_info info)
{
if (!same_grace_state_b (info.elem_l_))
return;
if shortest duration would change
reconsider ending/starting beam first.
*/
- Moment mom = unsmob_duration (rhythmic_req->get_mus_property ("duration"))->length_mom ();
- consider_end_and_begin (mom);
+ Moment dur = unsmob_duration (rhythmic_req->get_mus_property ("duration"))->length_mom ();
+ consider_end_and_begin (dur);
if (!stem_l_arr_p_)
return;
- if (mom < shortest_mom_)
+
+ if (dur < shortest_mom_)
{
+ shortest_mom_ = dur;
if (stem_l_arr_p_->size ())
{
- shortest_mom_ = mom;
+ shortest_mom_ = dur;
consider_end_and_begin (shortest_mom_);
if (!stem_l_arr_p_)
return;
}
- shortest_mom_ = mom;
}
+
Moment now = now_mom ();
grouping_p_->add_stem (now - beam_start_moment_ + beam_start_location_,
}
void
-Auto_beam_engraver::process_acknowledged ()
+Auto_beam_engraver::create_grobs ()
{
- if (!stem_l_arr_p_)
- consider_end_and_begin (shortest_mom_);
+ if (first_b_)
+ {
+ first_b_ = false;
+ consider_end_and_begin (shortest_mom_);
+ }
+ else
+ {
+ if (stem_l_arr_p_)
+ {
+ Moment now = now_mom ();
+ if ((extend_mom_ < now)
+ || ((extend_mom_ == now) && (last_add_mom_ != now )))
+ {
+ end_beam ();
+ }
+ else if (!stem_l_arr_p_->size ())
+ {
+ junk_beam ();
+ }
+ }
+ }
}
{
protected:
Spanner *staffline_p_;
- Link_array<Score_element> elts_;
+ Link_array<Grob> elts_;
virtual void do_creation_processing();
virtual void do_removal_processing();
- virtual void acknowledge_element (Score_element_info);
- virtual void process_acknowledged ();
+ virtual void acknowledge_grob (Grob_info);
+ virtual void create_grobs ();
virtual Spanner* get_spanner_p () const;
- virtual void add_element (Score_element*) ;
+ virtual void add_element (Grob*) ;
public:
VIRTUAL_COPY_CONS(Translator);
Axis_group_engraver ();
Axis_group_interface::set_interface (staffline_p_);
Axis_group_interface::set_axes (staffline_p_, Y_AXIS, Y_AXIS);
- Score_element * it = unsmob_element (get_property ("currentCommandColumn"));
+ Grob * it = unsmob_element (get_property ("currentCommandColumn"));
staffline_p_->set_bound(LEFT,it);
- announce_element (staffline_p_, 0);
+ announce_grob (staffline_p_, 0);
}
Spanner*
if (gh_pair_p (dims) && gh_number_p (gh_car (dims))
&& gh_number_p (gh_cdr (dims)))
{
- staffline_p_->set_extent_callback (Score_element::preset_extent_proc, Y_AXIS);
- staffline_p_->set_elt_property ("extent-Y", dims);
+ staffline_p_->set_extent_callback (Grob::preset_extent_proc, Y_AXIS);
+ staffline_p_->set_grob_property ("extent-Y", dims);
}
dims = get_property ((type + "MinimumVerticalExtent").ch_C());
if (gh_pair_p (dims) && gh_number_p (gh_car (dims))
&& gh_number_p (gh_cdr (dims)))
- staffline_p_->set_elt_property ("minimum-extent-Y", dims);
+ staffline_p_->set_grob_property ("minimum-extent-Y", dims);
dims = get_property ((type + "ExtraVerticalExtent").ch_C());
if (gh_pair_p (dims) && gh_number_p (gh_car (dims))
&& gh_number_p (gh_cdr (dims)))
- staffline_p_->set_elt_property ("extra-extent-Y", dims);
+ staffline_p_->set_grob_property ("extra-extent-Y", dims);
- Score_element * it = unsmob_element (get_property ("currentCommandColumn"));
+ Grob * it = unsmob_element (get_property ("currentCommandColumn"));
staffline_p_->set_bound(RIGHT,it);
- typeset_element (staffline_p_);
+ typeset_grob (staffline_p_);
staffline_p_ = 0;
}
void
-Axis_group_engraver::acknowledge_element (Score_element_info i)
+Axis_group_engraver::acknowledge_grob (Grob_info i)
{
elts_.push (i.elem_l_);
}
cyclic parent relationship if we have two Axis_group_engravers in
the context. */
void
-Axis_group_engraver::process_acknowledged ()
+Axis_group_engraver::create_grobs ()
{
/* UGH UGH UGH */
for (int i=0; i < elts_.size (); i++)
{
- Score_element *par = elts_[i]->parent_l (Y_AXIS);
+ Grob *par = elts_[i]->parent_l (Y_AXIS);
if ((!par || !Axis_group_interface::has_interface (par))
&& ! elts_[i]->empty_b (Y_AXIS))
}
void
-Axis_group_engraver::add_element (Score_element*e)
+Axis_group_engraver::add_element (Grob*e)
{
Axis_group_interface::add_element (staffline_p_, e);
}
{
protected:
virtual Spanner*get_spanner_p ()const;
- virtual void acknowledge_element (Score_element_info);
- virtual void add_element (Score_element *e);
+ virtual void acknowledge_grob (Grob_info);
+ virtual void add_element (Grob *e);
public:
VIRTUAL_COPY_CONS(Translator);
};
void
-Hara_kiri_engraver::add_element (Score_element*e)
+Hara_kiri_engraver::add_element (Grob*e)
{
Hara_kiri_group_spanner::add_element (staffline_p_, e);
}
}
void
-Hara_kiri_engraver::acknowledge_element (Score_element_info i)
+Hara_kiri_engraver::acknowledge_grob (Grob_info i)
{
- Axis_group_engraver::acknowledge_element (i);
+ Axis_group_engraver::acknowledge_grob (i);
if (Rhythmic_head::has_interface (i.elem_l_)
|| i.elem_l_->has_interface (ly_symbol2scm ("lyric-syllable-interface")))
{
*/
#include "hara-kiri-group-spanner.hh"
#include "axis-group-interface.hh"
-#include "score-element.hh"
+#include "grob.hh"
void
-Axis_group_interface::add_element (Score_element*me,Score_element *e)
+Axis_group_interface::add_element (Grob*me,Grob *e)
{
- for (SCM ax = me->get_elt_property ("axes"); ax != SCM_EOL ; ax = gh_cdr (ax))
+ for (SCM ax = me->get_grob_property ("axes"); ax != SCM_EOL ; ax = gh_cdr (ax))
{
Axis a = (Axis) gh_scm2int (gh_car (ax));
}
bool
-Axis_group_interface::axis_b (Score_element*me,Axis a )
+Axis_group_interface::axis_b (Grob*me,Axis a )
{
/*
urg. FIXME, check for Hara_kiri_group_spanner shouldn't be necessary?
}
Interval
-Axis_group_interface::relative_group_extent (Axis a, Score_element *common, SCM elts)
+Axis_group_interface::relative_group_extent (Axis a, Grob *common, SCM elts)
{
Interval r;
for (SCM s = elts; gh_pair_p (s); s = gh_cdr (s))
{
- Score_element * se = unsmob_element (gh_car (s));
+ Grob * se = unsmob_element (gh_car (s));
Interval dims = se->extent (common, a);
if (!dims.empty_b ())
r.unite (dims);
SCM
Axis_group_interface::group_extent_callback (SCM element_smob, SCM scm_axis)
{
- Score_element *me = unsmob_element (element_smob);
+ Grob *me = unsmob_element (element_smob);
Axis a = (Axis) gh_scm2int (scm_axis);
- Score_element * common =(Score_element*) me;
+ Grob * common =(Grob*) me;
- for (SCM s = me->get_elt_property ("elements"); gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = me->get_grob_property ("elements"); gh_pair_p (s); s = gh_cdr (s))
{
- Score_element * se = unsmob_element (gh_car (s));
+ Grob * se = unsmob_element (gh_car (s));
common = se->common_refpoint (common, a);
}
Real my_coord = me->relative_coordinate (common, a);
- Interval r (relative_group_extent (a, common, me->get_elt_property ("elements")));
+ Interval r (relative_group_extent (a, common, me->get_grob_property ("elements")));
return ly_interval2scm (r - my_coord);
}
void
-Axis_group_interface::set_axes (Score_element*me,Axis a1, Axis a2)
+Axis_group_interface::set_axes (Grob*me,Axis a1, Axis a2)
{
// set_interface () ?
SCM sa1= gh_int2scm (a1);
SCM sa2 = gh_int2scm (a2);
- SCM axes = me->get_elt_property ("axes");
+ SCM axes = me->get_grob_property ("axes");
if (!gh_pair_p (axes)
|| scm_memq (sa1, axes) == SCM_BOOL_F
SCM ax = gh_cons (sa1, SCM_EOL);
if (a1 != a2)
ax= gh_cons (sa2, ax);
- me->set_elt_property ("axes", ax);
+ me->set_grob_property ("axes", ax);
}
if (a1 != X_AXIS && a2 != X_AXIS)
/*
why so convoluted ? (fixme/documentme?)
*/
- if (me->has_extent_callback_b (Score_element::molecule_extent_proc, a1))
+ if (me->has_extent_callback_b (Grob::molecule_extent_proc, a1))
me->set_extent_callback (Axis_group_interface::group_extent_callback_proc,a1);
- if (me->has_extent_callback_b (Score_element::molecule_extent_proc, a2))
+ if (me->has_extent_callback_b (Grob::molecule_extent_proc, a2))
me->set_extent_callback (Axis_group_interface::group_extent_callback_proc,a2);
}
-Link_array<Score_element>
-Axis_group_interface::get_children (Score_element*me)
+Link_array<Grob>
+Axis_group_interface::get_children (Grob*me)
{
- Link_array<Score_element> childs;
+ Link_array<Grob> childs;
childs.push (me) ;
if (!has_interface (me))
return childs;
- for (SCM ep = me->get_elt_property ("elements"); gh_pair_p (ep); ep = gh_cdr (ep))
+ for (SCM ep = me->get_grob_property ("elements"); gh_pair_p (ep); ep = gh_cdr (ep))
{
- Score_element* e = unsmob_element (gh_car (ep));
+ Grob* e = unsmob_element (gh_car (ep));
if (e)
childs.concat (Axis_group_interface::get_children (e));
}
}
bool
-Axis_group_interface::has_interface (Score_element*me)
+Axis_group_interface::has_interface (Grob*me)
{
return me && me->has_interface (ly_symbol2scm ("axis-group-interface"));
}
void
-Axis_group_interface::set_interface (Score_element*me)
+Axis_group_interface::set_interface (Grob*me)
{
if (!has_interface (me))
{
void request_bar (String type_str);
protected:
- virtual void do_creation_processing ();
virtual void do_removal_processing ();
void deprecated_process_music();
- virtual void do_pre_move_processing();
- virtual void process_acknowledged ();
+ virtual void stop_translation_timestep();
+ virtual void create_grobs ();
private:
void typeset_bar ();
Bar_engraver::Bar_engraver()
{
bar_p_ =0;
- do_post_move_processing();
}
void
bar_p_ = new Item (get_property ("BarLine"));
SCM gl = get_property ("whichBar");
- if (scm_equal_p (gl, bar_p_->get_elt_property ("glyph")) != SCM_BOOL_T)
- bar_p_->set_elt_property ("glyph", gl);
+ if (scm_equal_p (gl, bar_p_->get_grob_property ("glyph")) != SCM_BOOL_T)
+ bar_p_->set_grob_property ("glyph", gl);
- announce_element (bar_p_, 0);
+ announce_grob (bar_p_, 0);
}
}
-void
-Bar_engraver::do_creation_processing ()
-{
-}
-
void
Bar_engraver::do_removal_processing ()
{
void
Bar_engraver::deprecated_process_music()
{
- SCM b =get_property ("whichBar");
- if (gh_string_p (b))
+ if (!bar_p_ && gh_string_p (get_property ("whichBar")))
{
create_bar ();
}
}
void
-Bar_engraver::process_acknowledged ()
+Bar_engraver::create_grobs ()
{
deprecated_process_music ();
}
{
if (bar_p_)
{
- typeset_element (bar_p_);
+ typeset_grob (bar_p_);
bar_p_ =0;
}
}
lines may only be broken if there is a barline in all staffs
*/
void
-Bar_engraver::do_pre_move_processing()
+Bar_engraver::stop_translation_timestep()
{
if (!bar_p_)
{
Item* text_p_;
protected:
- virtual void do_pre_move_processing ();
- virtual void acknowledge_element (Score_element_info);
+ virtual void stop_translation_timestep ();
+ virtual void acknowledge_grob (Grob_info);
virtual void do_creation_processing ();
- virtual void process_acknowledged ();
+ virtual void create_grobs ();
void create_items();
void deprecated_process_music ();
public:
create_items ();
// guh.
- text_p_->set_elt_property ("text",
+ text_p_->set_grob_property ("text",
ly_str02scm (to_str (gh_scm2int (bn)).ch_C()));
}
}
void
-Bar_number_engraver::process_acknowledged ()
+Bar_number_engraver::create_grobs ()
{
deprecated_process_music ();
}
void
-Bar_number_engraver::acknowledge_element (Score_element_info inf)
+Bar_number_engraver::acknowledge_grob (Grob_info inf)
{
- Score_element * s = inf.elem_l_;
+ Grob * s = inf.elem_l_;
if (Staff_symbol::has_interface (s))
{
SCM sts = get_property ("staffsFound");
}
else if (text_p_
&& dynamic_cast<Item*> (s)
- && s->get_elt_property ("break-align-symbol") == ly_symbol2scm ("Left_edge_item"))
+ && s->get_grob_property ("break-align-symbol") == ly_symbol2scm ("Left_edge_item"))
{
/*
By default this would land on the Paper_column -- so why
}
void
-Bar_number_engraver::do_pre_move_processing ()
+Bar_number_engraver::stop_translation_timestep ()
{
if (text_p_)
{
- text_p_->set_elt_property ("side-support-elements", get_property ("staffsFound"));
- typeset_element (text_p_);
+ text_p_->set_grob_property ("side-support-elements", get_property ("staffsFound"));
+ typeset_grob (text_p_);
text_p_ =0;
}
}
text_p_ = new Item (b);
Side_position::set_axis(text_p_,Y_AXIS);
- announce_element (text_p_, 0);
+ announce_grob (text_p_, 0);
}
#include "lookup.hh"
#include "paper-column.hh"
#include "main.hh"
-#include "score-element.hh"
+#include "grob.hh"
#include "bar.hh"
#include "string.hh"
#include "molecule.hh"
SCM
Bar::brew_molecule (SCM smob)
{
- Score_element * me = unsmob_element (smob);
+ Grob * me = unsmob_element (smob);
- SCM s = me->get_elt_property ("glyph");
- SCM barsiz_proc = me->get_elt_property ("barsize-procedure");
+ SCM s = me->get_grob_property ("glyph");
+ SCM barsiz_proc = me->get_grob_property ("barsize-procedure");
if (gh_string_p (s) && gh_procedure_p (barsiz_proc))
{
String str =ly_scm2string (s);
Molecule
-Bar::compound_barline (Score_element*me, String str, Real h)
+Bar::compound_barline (Grob*me, String str, Real h)
{
- Real kern = gh_scm2double (me->get_elt_property ("kern"));
- Real thinkern = gh_scm2double (me->get_elt_property ("thin-kern"));
- Real hair = gh_scm2double (me->get_elt_property ("hair-thickness"));
- Real fatline = gh_scm2double (me->get_elt_property ("thick-thickness"));
+ Real kern = gh_scm2double (me->get_grob_property ("kern"));
+ Real thinkern = gh_scm2double (me->get_grob_property ("thin-kern"));
+ Real hair = gh_scm2double (me->get_grob_property ("hair-thickness"));
+ Real fatline = gh_scm2double (me->get_grob_property ("thick-thickness"));
Real staffline = me->paper_l ()->get_var ("stafflinethickness");
Molecule
-Bar::simple_barline (Score_element*,Real w, Real h)
+Bar::simple_barline (Grob*,Real w, Real h)
{
return Lookup::filledbox (Box (Interval(0,w), Interval(-h/2, h/2)));
}
SCM
Bar::before_line_breaking (SCM smob)
{
- Score_element*me=unsmob_element (smob);
+ Grob*me=unsmob_element (smob);
Item * item = dynamic_cast<Item*> (me);
- SCM g = me->get_elt_property ("glyph");
+ SCM g = me->get_grob_property ("glyph");
SCM orig = g;
Direction bsd = item->break_status_dir ();
if (gh_string_p (g) && bsd)
{
- SCM proc = me->get_elt_property ("break-glyph-function");
+ SCM proc = me->get_grob_property ("break-glyph-function");
g = gh_call2 (proc, g, gh_int2scm (bsd));
}
if (!gh_string_p (g))
{
- me->set_elt_property ("molecule-callback", SCM_BOOL_T);
+ me->set_grob_property ("molecule-callback", SCM_BOOL_T);
me->set_extent_callback (SCM_EOL, X_AXIS);
// leave y_extent for spanbar?
}
if (! gh_equal_p (g, orig))
- me->set_elt_property ("glyph", g);
+ me->set_grob_property ("glyph", g);
/*
*/
if (gh_string_p (g))
{
- Score_element * col = item->column_l ();
- SCM dirlist = col->get_elt_property ("dir-list");
+ Grob * col = item->column_l ();
+ SCM dirlist = col->get_grob_property ("dir-list");
SCM scmdir = gh_int2scm (-1);
if (scm_memq (scmdir, dirlist) == SCM_BOOL_F)
{
dirlist = gh_cons (scmdir, dirlist);
- col->set_elt_property ("dir-list", dirlist);
+ col->set_grob_property ("dir-list", dirlist);
}
}
}
void
-Bar::set_interface (Score_element*me)
+Bar::set_interface (Grob*me)
{
me->set_interface (ly_symbol2scm ("bar-line-interface"));
}
bool
-Bar::has_interface (Score_element*m)
+Bar::has_interface (Grob*m)
{
return m && m->has_interface (ly_symbol2scm ("bar-line-interface"));
}
SCM
Bar::get_staff_bar_size (SCM smob)
{
- Score_element*me = unsmob_element (smob);
+ Grob*me = unsmob_element (smob);
Real ss = Staff_symbol_referencer::staff_space (me);
- SCM size = me->get_elt_property ("bar-size");
+ SCM size = me->get_grob_property ("bar-size");
if (gh_number_p (size))
return gh_double2scm (gh_scm2double(size)*ss);
else
void typeset_beam ();
void set_melisma (bool);
protected:
- virtual void do_pre_move_processing ();
- virtual void do_post_move_processing ();
+ virtual void stop_translation_timestep ();
+ virtual void start_translation_timestep ();
virtual void do_removal_processing ();
- virtual void process_acknowledged ();
- virtual void acknowledge_element (Score_element_info);
- virtual bool do_try_music (Music*);
+ virtual void create_grobs ();
+ virtual void acknowledge_grob (Grob_info);
+ virtual bool try_music (Music*);
void deprecated_process_music ();
public:
Beam_engraver ();
}
bool
-Beam_engraver::do_try_music (Music *m)
+Beam_engraver::try_music (Music *m)
{
if (Span_req * c = dynamic_cast<Span_req*>(m))
{
/* urg, must copy to Auto_beam_engraver too */
- announce_element (beam_p_, reqs_drul_[START]);
+ announce_grob (beam_p_, reqs_drul_[START]);
}
reqs_drul_[STOP] = 0;
reqs_drul_[START] = 0;
finished_beam_info_p_->beamify ();
Beam::set_beaming (finished_beam_p_, finished_beam_info_p_);
- typeset_element (finished_beam_p_);
+ typeset_grob (finished_beam_p_);
delete finished_beam_info_p_;
finished_beam_info_p_ =0;
finished_beam_p_ = 0;
}
void
-Beam_engraver::do_post_move_processing ()
+Beam_engraver::start_translation_timestep ()
{
reqs_drul_ [START] =0;
if(beam_p_) {
}
void
-Beam_engraver::do_pre_move_processing ()
+Beam_engraver::stop_translation_timestep ()
{
typeset_beam ();
}
}
void
-Beam_engraver::process_acknowledged ()
+Beam_engraver::create_grobs ()
{
deprecated_process_music ();
}
void
-Beam_engraver::acknowledge_element (Score_element_info info)
+Beam_engraver::acknowledge_grob (Grob_info info)
{
if (beam_p_)
{
if (Stem::beam_l (stem_l))
return;
- bool stem_grace = stem_l->get_elt_property ("grace") == SCM_BOOL_T;
+ bool stem_grace = stem_l->get_grob_property ("grace") == SCM_BOOL_T;
SCM wg =get_property ("weAreGraceContext");
bool wgb= to_boolean (wg);
*/
}
- stem_l->set_elt_property ("duration-log",
+ stem_l->set_grob_property ("duration-log",
gh_int2scm (durlog));
Moment stem_location = now_mom () - beam_start_mom_ + beam_start_location_;
beam_info_p_->add_stem (stem_location,
#include "warn.hh"
void
-Beam::add_stem (Score_element*me, Score_element*s)
+Beam::add_stem (Grob*me, Grob*s)
{
Pointer_group_interface:: add_element(me, "stems", s);
s->add_dependency (me);
assert (!Stem::beam_l (s));
- s->set_elt_property ("beam", me->self_scm ());
+ s->set_grob_property ("beam", me->self_scm ());
add_bound_item (dynamic_cast<Spanner*> (me), dynamic_cast<Item*> (s));
}
int
-Beam::get_multiplicity (Score_element*me)
+Beam::get_multiplicity (Grob*me)
{
int m = 0;
- for (SCM s = me->get_elt_property ("stems"); gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = me->get_grob_property ("stems"); gh_pair_p (s); s = gh_cdr (s))
{
- Score_element * sc = unsmob_element (gh_car (s));
+ Grob * sc = unsmob_element (gh_car (s));
if (Stem::has_interface (sc))
m = m >? Stem::beam_count (sc,LEFT) >? Stem::beam_count (sc,RIGHT);
SCM
Beam::before_line_breaking (SCM smob)
{
- Score_element * me = unsmob_element (smob);
+ Grob * me = unsmob_element (smob);
// Why?
if (visible_stem_count (me) < 2)
}
Direction
-Beam::get_default_dir (Score_element*me)
+Beam::get_default_dir (Grob*me)
{
Drul_array<int> total;
total[UP] = total[DOWN] = 0;
for (int i=0; i <stems.size (); i++)
do { // HUH -- waar slaat dit op?
- Score_element *s = stems[i];
+ Grob *s = stems[i];
Direction sd = Directional_element_interface::get (s);
int current = sd ? (1 + d * sd)/2
: Stem::get_center_distance (s, (Direction)-d);
} while (flip(&d) != DOWN);
- SCM func = me->get_elt_property ("dir-function");
+ SCM func = me->get_grob_property ("dir-function");
SCM s = gh_call2 (func,
gh_cons (gh_int2scm (count[UP]),
gh_int2scm (count[DOWN])),
/*
If dir is not determined: get default
*/
- return to_dir (me->get_elt_property ("default-neutral-direction"));
+ return to_dir (me->get_grob_property ("default-neutral-direction"));
}
once stem gets cleaned-up.
*/
void
-Beam::set_stem_directions (Score_element*me)
+Beam::set_stem_directions (Grob*me)
{
Link_array<Item> stems
=Pointer_group_interface__extract_elements (me, (Item*) 0, "stems");
for (int i=0; i <stems.size (); i++)
{
- Score_element *s = stems[i];
- SCM force = s->remove_elt_property ("dir-forced");
+ Grob *s = stems[i];
+ SCM force = s->remove_grob_property ("dir-forced");
if (!gh_boolean_p (force) || !gh_scm2bool (force))
Directional_element_interface ::set (s,d);
}
}
void
-Beam::auto_knees (Score_element*me)
+Beam::auto_knees (Grob*me)
{
if (!auto_knee (me,"auto-interstaff-knee-gap", true))
auto_knee (me, "auto-knee-gap", false);
don't set, or unset autoKneeGap/autoInterstaffKneeGap.
*/
bool
-Beam::auto_knee (Score_element*me, String gap_str, bool interstaff_b)
+Beam::auto_knee (Grob*me, String gap_str, bool interstaff_b)
{
bool knee_b = false;
int knee_y = 0;
- SCM gap = me->get_elt_property (gap_str.ch_C());
+ SCM gap = me->get_grob_property (gap_str.ch_C());
Direction d = Directional_element_interface::get (me);
Link_array<Item> stems=
+ (int)calc_interstaff_dist (s, dynamic_cast<Spanner*> (me));
Directional_element_interface::set (s,y < knee_y ? UP : DOWN);
- s->set_elt_property ("dir-forced", SCM_BOOL_T);
+ s->set_grob_property ("dir-forced", SCM_BOOL_T);
}
}
return knee_b;
scmify forced-fraction
*/
void
-Beam::set_stem_shorten (Score_element*m)
+Beam::set_stem_shorten (Grob*m)
{
Spanner*me = dynamic_cast<Spanner*> (m);
if (!visible_stem_count (me))
int multiplicity = get_multiplicity (me);
- SCM shorten = me->get_elt_property ("beamed-stem-shorten");
+ SCM shorten = me->get_grob_property ("beamed-stem-shorten");
if (shorten == SCM_EOL)
return;
Item* s = stems[i];
if (Stem::invisible_b (s))
continue;
- if (gh_number_p (s->get_elt_property ("shorten")))
- s->set_elt_property ("shorten", gh_double2scm (shorten_f));
+ if (gh_number_p (s->get_grob_property ("shorten")))
+ s->set_grob_property ("shorten", gh_double2scm (shorten_f));
}
}
SCM
Beam::after_line_breaking (SCM smob)
{
- Score_element * me = unsmob_element (smob);
+ Grob * me = unsmob_element (smob);
/* first, calculate y, dy */
Real y, dy;
*/
/* check for user-override of dy */
- SCM s = me->remove_elt_property ("height-hs");
+ SCM s = me->remove_grob_property ("height-hs");
if (gh_number_p (s))
{
dy = gh_scm2double (s) * half_space;
}
- me->set_elt_property ("height", gh_double2scm (dy));
+ me->set_grob_property ("height", gh_double2scm (dy));
/* check for user-override of y */
- s = me->remove_elt_property ("y-position-hs");
+ s = me->remove_grob_property ("y-position-hs");
if (gh_number_p (s))
{
y = gh_scm2double (s) * half_space;
// UGH. Y is not in staff position unit?
// Ik dacht datwe daar juist van weg wilden?
set_stem_length (me, y, dy);
- me->set_elt_property ("y-position", gh_double2scm (y));
+ me->set_grob_property ("y-position", gh_double2scm (y));
return SCM_UNSPECIFIED;
}
See Documentation/tex/fonts.doc
*/
void
-Beam::calc_default_position_and_height (Score_element*me,Real* y, Real* dy)
+Beam::calc_default_position_and_height (Grob*me,Real* y, Real* dy)
{
*y = 0;
*dy = 0;
}
bool
-Beam::suspect_slope_b (Score_element*me, Real y, Real dy)
+Beam::suspect_slope_b (Grob*me, Real y, Real dy)
{
/* first, calculate y, dy */
/*
*/
Real first_ideal = Stem::calc_stem_info (first_visible_stem (me)).idealy_f_;
Real last_ideal = Stem::calc_stem_info (last_visible_stem (me)).idealy_f_;
- Real lengthened = gh_scm2double (me->get_elt_property ("outer-stem-length-limit"));
- Real steep = gh_scm2double (me->get_elt_property ("slope-limit"));
+ Real lengthened = gh_scm2double (me->get_grob_property ("outer-stem-length-limit"));
+ Real steep = gh_scm2double (me->get_grob_property ("slope-limit"));
// ugh -> use commonx
Real dx = last_visible_stem (me)->relative_coordinate (0, X_AXIS) - first_visible_stem (me)->relative_coordinate (0, X_AXIS);
corresponds with some tables in [Wanske]
*/
Real
-Beam::calc_slope_damping_f (Score_element*me,Real dy)
+Beam::calc_slope_damping_f (Grob*me,Real dy)
{
- SCM damp = me->get_elt_property ("damping");
+ SCM damp = me->get_grob_property ("damping");
int damping = gh_scm2int (damp);
if (damping)
}
Real
-Beam::calc_stem_y_f (Score_element*me,Item* s, Real y, Real dy)
+Beam::calc_stem_y_f (Grob*me,Item* s, Real y, Real dy)
{
int beam_multiplicity = get_multiplicity (me);
int stem_multiplicity = (Stem::flag_i (s) - 2) >? 0;
- SCM space_proc = me->get_elt_property ("space-function");
+ SCM space_proc = me->get_grob_property ("space-function");
SCM space = gh_call1 (space_proc, gh_int2scm (beam_multiplicity));
- Real thick = gh_scm2double (me->get_elt_property ("thickness")) ;
+ Real thick = gh_scm2double (me->get_grob_property ("thickness")) ;
Real interbeam_f = gh_scm2double (space) ;
// ugh -> use commonx
}
Real
-Beam::check_stem_length_f (Score_element*me,Real y, Real dy)
+Beam::check_stem_length_f (Grob*me,Real y, Real dy)
{
Real shorten = 0;
Real lengthen = 0;
stem directions and length should set to relative to the chord's
position of the beam. */
void
-Beam::set_stem_length (Score_element*me,Real y, Real dy)
+Beam::set_stem_length (Grob*me,Real y, Real dy)
{
Real half_space = Staff_symbol_referencer::staff_space (me)/2;
Link_array<Item> stems=
+ n * staff_space
*/
Real
-Beam::quantise_dy_f (Score_element*me,Real dy)
+Beam::quantise_dy_f (Grob*me,Real dy)
{
Array<Real> a;
- SCM proc = me->get_elt_property ("height-quants");
+ SCM proc = me->get_grob_property ("height-quants");
SCM quants = gh_call2 (proc, me->self_scm (),
gh_double2scm (me->paper_l ()->get_var ("stafflinethickness")
/ 1.0));
if extend_b then stems must *not* get shorter
*/
Real
-Beam::quantise_y_f (Score_element*me,Real y, Real dy, int quant_dir)
+Beam::quantise_y_f (Grob*me,Real y, Real dy, int quant_dir)
{
int multiplicity = get_multiplicity (me);
Real thick = me->paper_l ()->get_var ("stafflinethickness");
- SCM proc = me->get_elt_property ("vertical-position-quant-function");
+ SCM proc = me->get_grob_property ("vertical-position-quant-function");
SCM quants = scm_apply (proc,
me->self_scm (),
gh_list (gh_int2scm (multiplicity),
}
void
-Beam::set_beaming (Score_element*me,Beaming_info_list *beaming)
+Beam::set_beaming (Grob*me,Beaming_info_list *beaming)
{
- Link_array<Score_element> stems=
- Pointer_group_interface__extract_elements (me, (Score_element*)0, "stems");
+ Link_array<Grob> stems=
+ Pointer_group_interface__extract_elements (me, (Grob*)0, "stems");
Direction d = LEFT;
for (int i=0; i < stems.size(); i++)
FIXME: clean me up.
*/
Molecule
-Beam::stem_beams (Score_element*me,Item *here, Item *next, Item *prev)
+Beam::stem_beams (Grob*me,Item *here, Item *next, Item *prev)
{
// ugh -> use commonx
if ((next && !(next->relative_coordinate (0, X_AXIS) > here->relative_coordinate (0, X_AXIS))) ||
Real staffline_f = me->paper_l ()->get_var ("stafflinethickness");
int multiplicity = get_multiplicity (me);
- SCM space_proc = me->get_elt_property ("space-function");
+ SCM space_proc = me->get_grob_property ("space-function");
SCM space = gh_call1 (space_proc, gh_int2scm (multiplicity));
- Real thick = gh_scm2double (me->get_elt_property ("thickness")) ;
+ Real thick = gh_scm2double (me->get_grob_property ("thickness")) ;
Real interbeam_f = gh_scm2double (space) ;
Real bdy = interbeam_f;
Real dx = visible_stem_count (me) ?
last_visible_stem (me)->relative_coordinate (0, X_AXIS) - first_visible_stem (me)->relative_coordinate (0, X_AXIS)
: 0.0;
- Real dy = gh_scm2double (me->get_elt_property ("height"));
+ Real dy = gh_scm2double (me->get_grob_property ("height"));
Real dydx = dy && dx ? dy/dx : 0;
Molecule leftbeams;
else {
int t = Stem::type_i (here);
- SCM proc = me->get_elt_property ("flag-width-function");
+ SCM proc = me->get_grob_property ("flag-width-function");
SCM result = gh_call1 (proc, gh_int2scm (t));
nw_f = gh_scm2double (result);
}
int j = 0;
Real gap_f = 0;
- SCM gap = me->get_elt_property ("gap");
+ SCM gap = me->get_grob_property ("gap");
if (gh_number_p (gap))
{
int gap_i = gh_scm2int ( (gap));
SCM
Beam::brew_molecule (SCM smob)
{
- Score_element * me =unsmob_element (smob);
+ Grob * me =unsmob_element (smob);
Molecule mol;
- if (!gh_pair_p (me->get_elt_property ("stems")))
+ if (!gh_pair_p (me->get_grob_property ("stems")))
return SCM_EOL;
Real x0,dx;
Link_array<Item>stems =
}
- Real dy = gh_scm2double (me->get_elt_property ("height"));
+ Real dy = gh_scm2double (me->get_grob_property ("height"));
Real dydx = dy && dx ? dy/dx : 0;
- Real y = gh_scm2double (me->get_elt_property ("y-position"));
+ Real y = gh_scm2double (me->get_grob_property ("y-position"));
for (int j=0; j <stems.size (); j++)
}
int
-Beam::forced_stem_count (Score_element*me)
+Beam::forced_stem_count (Grob*me)
{
Link_array<Item>stems =
Pointer_group_interface__extract_elements ( me, (Item*) 0, "stems");
use filter and standard list functions.
*/
int
-Beam::visible_stem_count (Score_element*me)
+Beam::visible_stem_count (Grob*me)
{
Link_array<Item>stems =
Pointer_group_interface__extract_elements (me, (Item*) 0, "stems");
}
Item*
-Beam::first_visible_stem(Score_element*me)
+Beam::first_visible_stem(Grob*me)
{
Link_array<Item>stems =
Pointer_group_interface__extract_elements ( me, (Item*) 0, "stems");
}
Item*
-Beam::last_visible_stem(Score_element*me)
+Beam::last_visible_stem(Grob*me)
{
Link_array<Item>stems =
Pointer_group_interface__extract_elements ( me, (Item*) 0, "stems");
SCM
Beam::rest_collision_callback (SCM element_smob, SCM axis)
{
- Score_element *rest = unsmob_element (element_smob);
+ Grob *rest = unsmob_element (element_smob);
Axis a = (Axis) gh_scm2int (axis);
assert (a == Y_AXIS);
- Score_element * st = unsmob_element (rest->get_elt_property ("stem"));
- Score_element * stem = st;
+ Grob * st = unsmob_element (rest->get_grob_property ("stem"));
+ Grob * stem = st;
if (!stem)
return gh_double2scm (0.0);
- Score_element * beam = unsmob_element (stem->get_elt_property ("beam"));
+ Grob * beam = unsmob_element (stem->get_grob_property ("beam"));
if (!beam || !Beam::has_interface (beam) || !Beam::visible_stem_count (beam))
return gh_double2scm (0.0);
// todo: make sure this calced already.
- SCM s = beam->get_elt_property ("height");
+ SCM s = beam->get_grob_property ("height");
if (gh_number_p (s))
beam_dy = gh_scm2double (s);
- s = beam->get_elt_property ("y-position");
+ s = beam->get_grob_property ("y-position");
if (gh_number_p (s))
beam_y = gh_scm2double (s);
Real rest_dim = rest->extent (rest, Y_AXIS)[d]*2.0 / staff_space ; // refp??
Real minimum_dist
- = gh_scm2double (rest->get_elt_property ("minimum-beam-collision-distance"));
+ = gh_scm2double (rest->get_grob_property ("minimum-beam-collision-distance"));
Real dist =
minimum_dist + -d * (beamy - rest_dim) >? 0;
bool
-Beam::has_interface (Score_element*me)
+Beam::has_interface (Grob*me)
{
return me->has_interface (ly_symbol2scm ("beam-interface"));
}
void
-Beam::set_interface (Score_element*me)
+Beam::set_interface (Grob*me)
{
/*
why the init? No way to tell difference between default and user
override. */
- me->set_elt_property ("height", gh_int2scm (0)); // ugh.
- me->set_elt_property ("y-position" ,gh_int2scm (0));
+ me->set_grob_property ("height", gh_int2scm (0)); // ugh.
+ me->set_grob_property ("y-position" ,gh_int2scm (0));
me->set_interface (ly_symbol2scm("beam-interface"));
}
Array<int>
Break_algorithm::find_break_indices () const
{
- Link_array<Score_element> all = pscore_l_->line_l_->column_l_arr ();
+ Link_array<Grob> all = pscore_l_->line_l_->column_l_arr ();
Array<int> retval;
for (int i=0; i < all.size (); i++)
}
-Link_array<Score_element>
+Link_array<Grob>
Break_algorithm::find_breaks () const
{
- Link_array<Score_element> all = pscore_l_->line_l_->column_l_arr ();
- Link_array<Score_element> retval;
+ Link_array<Grob> all = pscore_l_->line_l_->column_l_arr ();
+ Link_array<Grob> retval;
for (int i=0; i < all.size (); i++)
if (Item::breakable_b (all[i]))
Simple_spacer*
-Break_algorithm::generate_spacing_problem (Link_array<Score_element> curline, Interval line) const
+Break_algorithm::generate_spacing_problem (Link_array<Grob> curline, Interval line) const
{
Simple_spacer * sp = new Simple_spacer;
Protected_scm column_alist_;
protected:
virtual void do_removal_processing ();
- virtual void acknowledge_element(Score_element_info i);
- virtual void do_pre_move_processing ();
+ virtual void acknowledge_grob(Grob_info i);
+ virtual void stop_translation_timestep ();
void add_column (SCM);
public:
void
Break_align_engraver::add_column (SCM smob)
{
- Score_element * e = unsmob_element (smob);
+ Grob * e = unsmob_element (smob);
Break_align_interface::add_element (align_l_,e);
- typeset_element (e);
+ typeset_grob (e);
}
void
}
void
-Break_align_engraver::do_pre_move_processing ()
+Break_align_engraver::stop_translation_timestep ()
{
SCM order = get_property ("breakAlignOrder");
for (; gh_pair_p (order); order = gh_cdr (order))
if (align_l_)
{
- typeset_element (align_l_);
+ typeset_grob (align_l_);
align_l_ = 0;
}
}
}
void
-Break_align_engraver::acknowledge_element (Score_element_info inf)
+Break_align_engraver::acknowledge_grob (Grob_info inf)
{
if (Item * item_l = dynamic_cast <Item *> (inf.elem_l_))
{
if (item_l->empty_b (X_AXIS) || item_l->parent_l (X_AXIS))
return;
- SCM bp=item_l->get_elt_property ("breakable");
+ SCM bp=item_l->get_grob_property ("breakable");
bool breakable = (to_boolean (bp));
if (!breakable)
return ;
- SCM align_name = item_l->get_elt_property ("break-align-symbol");
+ SCM align_name = item_l->get_grob_property ("break-align-symbol");
if (!gh_symbol_p (align_name))
return ;
{
align_l_ = new Item (get_property ("BreakAlignment"));
Break_align_interface::set_interface (align_l_);
- announce_element (align_l_,0);
+ announce_grob (align_l_,0);
SCM edge_sym = ly_symbol2scm ("Left_edge_item");
Item * edge = new Item (get_property ("LeftEdge"));
We must have left-edge in the middle. Instrument-names
are left to left-edge, so they don't enter the staff.
*/
- align_l_->set_elt_property ("self-alignment-X", edge->self_scm ());
+ align_l_->set_grob_property ("self-alignment-X", edge->self_scm ());
/*
TODO: switch off ignoring empty stuff?
*/
- edge->set_extent_callback (Score_element::point_dimension_callback_proc, X_AXIS);
+ edge->set_extent_callback (Grob::point_dimension_callback_proc, X_AXIS);
- align_l_->set_elt_property ("self-alignment-X", edge->self_scm ());
+ align_l_->set_grob_property ("self-alignment-X", edge->self_scm ());
- announce_element (edge, 0);
+ announce_grob (edge, 0);
column_alist_ = scm_assoc_set_x (column_alist_, edge_sym, edge->self_scm ());
}
if (s != SCM_BOOL_F)
{
- Score_element *e = unsmob_element (gh_cdr(s));
+ Grob *e = unsmob_element (gh_cdr(s));
group = dynamic_cast<Item*> (e);
}
else
Axis_group_interface::set_interface (group);
Axis_group_interface::set_axes (group, X_AXIS,X_AXIS);
- group->set_elt_property ("break-align-symbol", align_name);
+ group->set_grob_property ("break-align-symbol", align_name);
group->set_parent (align_l_, Y_AXIS);
- announce_element (group, 0);
+ announce_grob (group, 0);
column_alist_ = scm_assoc_set_x (column_alist_, align_name, group->self_scm ());
}
SCM
Break_align_interface::before_line_breaking (SCM smob)
{
- Score_element* me = unsmob_element (smob);
+ Grob* me = unsmob_element (smob);
do_alignment (me);
return SCM_UNSPECIFIED;
}
SCM
Break_align_interface::alignment_callback (SCM element_smob, SCM axis)
{
- Score_element *me = unsmob_element (element_smob);
+ Grob *me = unsmob_element (element_smob);
Axis a = (Axis) gh_scm2int (axis);
assert (a == X_AXIS);
- Score_element *par = me->parent_l (a);
- if (par && !to_boolean (par->get_elt_property ("break-alignment-done")))\
+ Grob *par = me->parent_l (a);
+ if (par && !to_boolean (par->get_grob_property ("break-alignment-done")))\
{
- par->set_elt_property ("break-alignment-done", SCM_BOOL_T);
+ par->set_grob_property ("break-alignment-done", SCM_BOOL_T);
Break_align_interface::do_alignment (par);
}
SCM
Break_align_interface::self_align_callback (SCM element_smob, SCM axis)
{
- Score_element *me = unsmob_element (element_smob);
+ Grob *me = unsmob_element (element_smob);
Axis a = (Axis) gh_scm2int (axis);
assert (a == X_AXIS);
Direction bsd = item->break_status_dir();
if (bsd == LEFT)
{
- me->set_elt_property ("self-alignment-X", gh_int2scm (RIGHT));
+ me->set_grob_property ("self-alignment-X", gh_int2scm (RIGHT));
}
return Side_position::aligned_on_self (element_smob, axis);
}
void
-Break_align_interface::add_element (Score_element*me, Score_element *toadd)
+Break_align_interface::add_element (Grob*me, Grob *toadd)
{
Axis_group_interface::add_element (me, toadd);
}
void
-Break_align_interface::do_alignment (Score_element *me)
+Break_align_interface::do_alignment (Grob *me)
{
Item * item = dynamic_cast<Item*> (me);
Item *column = item->column_l ();
- Link_array<Score_element> elems;
- Link_array<Score_element> all_elems
- = Pointer_group_interface__extract_elements (me, (Score_element*)0,
+ Link_array<Grob> elems;
+ Link_array<Grob> all_elems
+ = Pointer_group_interface__extract_elements (me, (Grob*)0,
"elements");
for (int i=0; i < all_elems.size(); i++)
{
Interval y = all_elems[i]->extent(all_elems[i], X_AXIS);
if (!y.empty_b())
- elems.push (dynamic_cast<Score_element*> (all_elems[i]));
+ elems.push (dynamic_cast<Grob*> (all_elems[i]));
}
if (!elems.size ())
SCM current_origin = ly_symbol2scm ("none");
for (int i=0; i <= elems.size (); i++)
{
- Score_element *next_elt = i < elems.size ()
+ Grob *next_elt = i < elems.size ()
? elems[i]
: 0 ;
if (next_elt)
{
- next_origin = next_elt->get_elt_property ("break-align-symbol");
+ next_origin = next_elt->get_grob_property ("break-align-symbol");
next_origin =
gh_symbol_p (next_origin)?
next_origin : ly_symbol2scm ("none")
else
next_origin = ly_symbol2scm ("begin-of-note");
- SCM alist = me->get_elt_property ("space-alist");
+ SCM alist = me->get_grob_property ("space-alist");
SCM e = scm_assoc (scm_listify (current_origin,
next_origin,
SCM_UNDEFINED), alist);
symbol_list = gh_cdr (scm_reverse (symbol_list));
for (int i=0; i <elems.size()-1; i++)
{
- elems[i]->set_elt_property (gh_car (symbol_list),
+ elems[i]->set_grob_property (gh_car (symbol_list),
scm_cons (gh_double2scm (0),
gh_double2scm (dists[i+1])));
// urg
- SCM first_pair = elems[0]->get_elt_property ("minimum-space");
+ SCM first_pair = elems[0]->get_grob_property ("minimum-space");
if (gh_pair_p (first_pair))
first_pair = first_pair;
else
first_pair = gh_cons (gh_double2scm (0.0), gh_double2scm (0.0));
scm_set_car_x (first_pair, gh_double2scm (-dists[0]));
- elems[0]->set_elt_property ("minimum-space", first_pair);
+ elems[0]->set_grob_property ("minimum-space", first_pair);
/*
The pairs are in the format of an interval (ie. CAR < CDR).
*/
- column->set_elt_property ("extra-space",
+ column->set_grob_property ("extra-space",
scm_cons (gh_double2scm (pre_space),
gh_double2scm (spring_len)));
- column->set_elt_property ("stretch-distance",
+ column->set_grob_property ("stretch-distance",
gh_cons (gh_double2scm (-dists[0]),
gh_double2scm (stretch_distance)));
}
void
-Break_align_interface::set_interface (Score_element*me)
+Break_align_interface::set_interface (Grob*me)
{
Align_interface::set_interface (me);
Align_interface::set_axis (me,X_AXIS);
VIRTUAL_COPY_CONS(Translator);
protected:
- virtual bool do_try_music (Music *req_l);
+ virtual bool try_music (Music *req_l);
void deprecated_process_music();
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing();
+ virtual void stop_translation_timestep();
+ virtual void start_translation_timestep();
private:
Breathing_sign_req * breathing_sign_req_l_;
- Score_element * breathing_sign_p_;
+ Grob * breathing_sign_p_;
};
Breathing_sign_engraver::Breathing_sign_engraver()
}
bool
-Breathing_sign_engraver::do_try_music (Music*r_l)
+Breathing_sign_engraver::try_music (Music*r_l)
{
if (Breathing_sign_req * b= dynamic_cast <Breathing_sign_req *> (r_l))
{
Breathing_sign::set_interface (breathing_sign_p_);
- announce_element (breathing_sign_p_, breathing_sign_req_l_);
+ announce_grob (breathing_sign_p_, breathing_sign_req_l_);
}
}
void
-Breathing_sign_engraver::do_pre_move_processing()
+Breathing_sign_engraver::stop_translation_timestep()
{
if(breathing_sign_p_)
{
- typeset_element(breathing_sign_p_);
+ typeset_grob(breathing_sign_p_);
breathing_sign_p_ = 0;
}
}
void
-Breathing_sign_engraver::do_post_move_processing()
+Breathing_sign_engraver::start_translation_timestep()
{
breathing_sign_req_l_ = 0;
}
SCM
Breathing_sign::brew_molecule (SCM smob)
{
- Score_element * me = unsmob_element (smob);
+ Grob * me = unsmob_element (smob);
Real space = Staff_symbol_referencer::staff_space (me);
// todo: cfg'able.
SCM
Breathing_sign::offset_callback (SCM element_smob, SCM )
{
- Score_element *me = unsmob_element (element_smob);
+ Grob *me = unsmob_element (element_smob);
Direction d = Directional_element_interface::get (me);
if (!d)
}
void
-Breathing_sign::set_interface (Score_element *b)
+Breathing_sign::set_interface (Grob *b)
{
Staff_symbol_referencer::set_interface (b);
VIRTUAL_COPY_CONS (Translator);
protected:
- virtual void do_pre_move_processing ();
- virtual void acknowledge_element (Score_element_info i);
+ virtual void stop_translation_timestep ();
+ virtual void acknowledge_grob (Grob_info i);
void deprecated_process_music ();
- virtual bool do_try_music (Music *);
+ virtual bool try_music (Music *);
private:
void add_note (Note_req *);
}
bool
-Chord_name_engraver::do_try_music (Music* m)
+Chord_name_engraver::try_music (Music* m)
{
if (Note_req* n = dynamic_cast<Note_req*> (m))
{
return false;
}
-/* Uh, if we do acknowledge_element, shouldn't we postpone
+/* Uh, if we do acknowledge_grob, shouldn't we postpone
deprecated_process_music until do_process_acknowlegded?
Sigh, I can *never* remember how this works, can't we
do_creation0
post_move1
- do_try_music2
- deprecated_process_music3 (or is it acknowledge_element3 ?)
- acknowledge_element4
+ try_music2
+ deprecated_process_music3 (or is it acknowledge_grob3 ?)
+ acknowledge_grob4
do_pre_move9
and what was the deal with this ``do'' prefix again? */
void
-Chord_name_engraver::acknowledge_element (Score_element_info i)
+Chord_name_engraver::acknowledge_grob (Grob_info i)
{
if (Note_req* n = dynamic_cast<Note_req*> (i.req_l_))
add_note (n);
#endif
chord_name_p_ = new Item (get_property ("ChordName"));
- chord_name_p_->set_elt_property ("chord", chord_);
- announce_element (chord_name_p_, 0);
+ chord_name_p_->set_grob_property ("chord", chord_);
+ announce_grob (chord_name_p_, 0);
SCM s = get_property ("drarnChords"); //FIXME!
if (to_boolean (s) && last_chord_ != SCM_EOL &&
gh_equal_p (chord_, last_chord_))
- chord_name_p_->set_elt_property ("begin-of-line-visible", SCM_BOOL_T);
+ chord_name_p_->set_grob_property ("begin-of-line-visible", SCM_BOOL_T);
}
}
void
-Chord_name_engraver::do_pre_move_processing ()
+Chord_name_engraver::stop_translation_timestep ()
{
if (chord_name_p_)
{
- typeset_element (chord_name_p_);
+ typeset_grob (chord_name_p_);
}
chord_name_p_ = 0;
#include "molecule.hh"
#include "paper-def.hh"
#include "font-interface.hh"
-#include "score-element.hh"
+#include "grob.hh"
#include "paper-column.hh"
#include "line-of-score.hh"
#include "staff-symbol-referencer.hh"
Item* me = dynamic_cast<Item*> (unsmob_element (smob));
assert (me);
- SCM s = me->get_elt_property ("begin-of-line-visible");
+ SCM s = me->get_grob_property ("begin-of-line-visible");
if (to_boolean (s))
{
if (Paper_column::rank_i (me->column_l ()) -
SCM
Chord_name::brew_molecule (SCM smob)
{
- Score_element *me = unsmob_element (smob);
- SCM style = me->get_elt_property ("style");
+ Grob *me = unsmob_element (smob);
+ SCM style = me->get_grob_property ("style");
- if (!gh_string_p (style))
- style = ly_str02scm ("banter");
+ if (!gh_symbol_p (style))
+ style = ly_symbol2scm ("banter");
- SCM chord = me-> get_elt_property ("chord");
- SCM func = me->get_elt_property (ly_symbol2scm ("chord-name-function"));
+ SCM chord = me-> get_grob_property ("chord");
+ SCM func = me->get_grob_property (ly_symbol2scm ("chord-name-function"));
SCM text = gh_call2 (func, style, chord);
SCM properties = Font_interface::font_alist_chain (me);
Molecule mol = Text_item::text2molecule (me, text, properties);
- SCM space = me->get_elt_property ("word-space");
+ SCM space = me->get_grob_property ("word-space");
if (gh_number_p (space))
{
Molecule m;
protected:
virtual void do_removal_processing();
void deprecated_process_music();
- virtual bool do_try_music (Music*);
- virtual void acknowledge_element (Score_element_info);
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing();
- virtual void process_acknowledged ();
+ virtual bool try_music (Music*);
+ virtual void acknowledge_grob (Grob_info);
+ virtual void stop_translation_timestep();
+ virtual void start_translation_timestep();
+ virtual void create_grobs ();
};
Chord_tremolo_engraver::Chord_tremolo_engraver()
}
bool
-Chord_tremolo_engraver::do_try_music (Music * m)
+Chord_tremolo_engraver::try_music (Music * m)
{
Repeated_music * rp = dynamic_cast<Repeated_music*> (m);
if (rp
}
void
-Chord_tremolo_engraver::process_acknowledged ()
+Chord_tremolo_engraver::create_grobs ()
{
deprecated_process_music ();
}
{
beam_p_ = new Spanner (get_property ("Beam"));
Beam::set_interface (beam_p_);
- beam_p_->set_elt_property ("chord-tremolo", SCM_BOOL_T);
+ beam_p_->set_grob_property ("chord-tremolo", SCM_BOOL_T);
SCM smp = get_property ("measurePosition");
Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
beam_start_location_ = mp;
- announce_element (beam_p_, repeat_);
+ announce_grob (beam_p_, repeat_);
}
}
{
if (finished_beam_p_)
{
- typeset_element (finished_beam_p_);
+ typeset_grob (finished_beam_p_);
finished_beam_p_ = 0;
}
}
void
-Chord_tremolo_engraver::acknowledge_element (Score_element_info info)
+Chord_tremolo_engraver::acknowledge_grob (Grob_info info)
{
if (beam_p_)
{
if (Stem::has_interface (info.elem_l_))
{
- Score_element * s = info.elem_l_;
+ Grob * s = info.elem_l_;
int f = Stem::flag_i (s);
f = (f > 2) ? f - 2 : 1;
Stem::set_beaming (s, f, LEFT);
don't understand this comment.
--hwn.
*/
- SCM d = s->get_elt_property ("direction");
+ SCM d = s->get_grob_property ("direction");
if (Stem::type_i (s ) != 1)
{
int gap_i =Stem::flag_i (s ) - ((Stem::type_i (s ) >? 2) - 2);
- beam_p_->set_elt_property ("beam-gap", gh_int2scm(gap_i));
+ beam_p_->set_grob_property ("beam-gap", gh_int2scm(gap_i));
}
- s->set_elt_property ("direction", d);
+ s->set_grob_property ("direction", d);
if (dynamic_cast <Rhythmic_req *> (info.req_l_))
{
}
if (Note_head::has_interface (info.elem_l_))
{
- info.elem_l_->set_elt_property ("duration-log", gh_int2scm (intlog2 (note_head_i_)));
+ info.elem_l_->set_grob_property ("duration-log", gh_int2scm (intlog2 (note_head_i_)));
}
}
}
void
-Chord_tremolo_engraver::do_post_move_processing ()
+Chord_tremolo_engraver::start_translation_timestep ()
{
if (beam_p_ && stop_mom_ == now_mom ())
{
void
-Chord_tremolo_engraver::do_pre_move_processing ()
+Chord_tremolo_engraver::stop_translation_timestep ()
{
typeset_beam ();
}
/* Hmm, rewrite this using ly_split_list? */
SCM
-ly_delete1 (SCM s, SCM list)
+ly_remove_member (SCM s, SCM list)
{
SCM removed = SCM_EOL;
for (SCM i = list; gh_pair_p (i); i = gh_cdr (i))
-/*****
- Parser stuff
-
- Construct from parser output:
-
- PITCHES is the plain chord, it does not include bass or inversion
-
- Part of Chord:: namespace for now, because we do lots of
- chord-manipulating stuff. */
+/*
+ Parser stuff
+
+ Construct from parser output:
+ PITCHES is the plain chord, it does not include bass or inversion
+
+ Part of Chord:: namespace for now, because we do lots of
+ chord-manipulating stuff.
+*/
SCM
Chord::tonic_add_sub_to_pitches (SCM tonic, SCM add, SCM sub)
{
protected:
void deprecated_process_music ();
- virtual void do_pre_move_processing ();
+ virtual void stop_translation_timestep ();
virtual void do_creation_processing ();
- virtual void do_post_move_processing ();
- virtual void process_acknowledged ();
- virtual void acknowledge_element (Score_element_info);
+ virtual void start_translation_timestep ();
+ virtual void create_grobs ();
+ virtual void acknowledge_grob (Grob_info);
private:
Item * clef_p_;
ie. a breakpoint)
*/
void
-Clef_engraver::acknowledge_element (Score_element_info info)
+Clef_engraver::acknowledge_grob (Grob_info info)
{
deprecated_process_music ();
Item * item =dynamic_cast <Item *> (info.elem_l_);
to know c0-pos for this. (?)
*/
- item->set_elt_property ("c0-position", get_property ("centralCPosition"));
+ item->set_grob_property ("c0-position", get_property ("centralCPosition"));
}
}
}
if (!clef_p_)
{
Item *c= new Item (get_property ("Clef"));
- announce_element (c, 0);
+ announce_grob (c, 0);
Staff_symbol_referencer::set_interface (c);
g->set_parent (clef_p_, Y_AXIS);
g->set_parent (clef_p_, X_AXIS);
- g->set_elt_property ("direction", gh_int2scm (sign (gh_scm2int (oct))));
+ g->set_grob_property ("direction", gh_int2scm (sign (gh_scm2int (oct))));
octavate_p_ = g;
- announce_element (octavate_p_, 0);
+ announce_grob (octavate_p_, 0);
}
}
void
-Clef_engraver::process_acknowledged ()
+Clef_engraver::create_grobs ()
{
deprecated_process_music ();
}
create_clef ();
- clef_p_->set_elt_property ("non-default", SCM_BOOL_T);
+ clef_p_->set_grob_property ("non-default", SCM_BOOL_T);
}
}
void
-Clef_engraver::do_pre_move_processing ()
+Clef_engraver::stop_translation_timestep ()
{
if (clef_p_)
{
SCM vis = 0;
- if (to_boolean (clef_p_->get_elt_property ("non-default")))
+ if (to_boolean (clef_p_->get_grob_property ("non-default")))
{
vis = get_property ("explicitClefVisibility");
}
if (vis)
{
- clef_p_->set_elt_property ("visibility-lambda", vis);
+ clef_p_->set_grob_property ("visibility-lambda", vis);
if (octavate_p_)
- octavate_p_->set_elt_property ("visibility-lambda", vis);
+ octavate_p_->set_grob_property ("visibility-lambda", vis);
}
- typeset_element (clef_p_);
+ typeset_grob (clef_p_);
clef_p_ =0;
if (octavate_p_)
- typeset_element (octavate_p_);
+ typeset_grob (octavate_p_);
octavate_p_ = 0;
}
}
void
-Clef_engraver::do_post_move_processing ()
+Clef_engraver::start_translation_timestep ()
{
}
{
Item * s = dynamic_cast<Item*> (unsmob_element (smob));
- SCM style_sym =s->get_elt_property ("style");
- String style;
- if (gh_string_p (style_sym))
- style = ly_scm2string (style_sym);
-
- SCM glyph = s->get_elt_property ("glyph");
+ SCM glyph = s->get_grob_property ("glyph");
if (gh_string_p (glyph))
{
String str = ly_scm2string (glyph);
- if (to_boolean (s->get_elt_property ("non-default")) &&
+ if (to_boolean (s->get_grob_property ("non-default")) &&
s->break_status_dir() != RIGHT &&
- to_boolean (s->get_elt_property ("full-size-change")))
+ to_boolean (s->get_grob_property ("full-size-change")))
{
str += "_change";
- s->set_elt_property ("glyph", ly_str02scm (str.ch_C()));
+ s->set_grob_property ("glyph", ly_str02scm (str.ch_C()));
}
}
else
}
bool
-Clef::has_interface (Score_element* me)
+Clef::has_interface (Grob* me)
{
return me->has_interface (ly_symbol2scm ("clef-interface"));
}
void
-Clef::set_interface (Score_element* me)
+Clef::set_interface (Grob* me)
{
me->set_interface (ly_symbol2scm ("clef-interface"));
}
SCM
Clef::brew_molecule (SCM smob)
{
- Score_element * sc = unsmob_element (smob);
- SCM glyph = sc->get_elt_property ("glyph");
+ Grob * sc = unsmob_element (smob);
+ SCM glyph = sc->get_grob_property ("glyph");
if (gh_string_p (glyph))
{
return Font_interface::get_default_font (sc)->find_by_name (String (ly_scm2string (glyph))).smobbed_copy ();
a collision object. */
class Collision_engraver : public Engraver {
Item * col_p_;
- Link_array<Score_element> note_column_l_arr_;
+ Link_array<Grob> note_column_l_arr_;
protected:
- virtual void acknowledge_element (Score_element_info);
- virtual void process_acknowledged ();
- virtual void do_pre_move_processing();
+ virtual void acknowledge_grob (Grob_info);
+ virtual void create_grobs ();
+ virtual void stop_translation_timestep();
public:
VIRTUAL_COPY_CONS(Translator);
Collision_engraver();
void
-Collision_engraver::process_acknowledged ()
+Collision_engraver::create_grobs ()
{
if (col_p_ || note_column_l_arr_.size () < 2)
return ;
Axis_group_interface::set_interface (col_p_);
Axis_group_interface::set_axes (col_p_, X_AXIS, Y_AXIS);
- announce_element (col_p_,0);
+ announce_grob (col_p_,0);
}
for (int i=0; i< note_column_l_arr_.size (); i++)
}
void
-Collision_engraver::acknowledge_element (Score_element_info i)
+Collision_engraver::acknowledge_grob (Grob_info i)
{
if (Note_column::has_interface (i.elem_l_))
{
}
void
-Collision_engraver::do_pre_move_processing()
+Collision_engraver::stop_translation_timestep()
{
if (col_p_)
{
- typeset_element (col_p_);
+ typeset_grob (col_p_);
col_p_ =0;
}
note_column_l_arr_.clear ();
SCM
Collision::force_shift_callback (SCM element_smob, SCM axis)
{
- Score_element *me = unsmob_element (element_smob);
+ Grob *me = unsmob_element (element_smob);
Axis a = (Axis) gh_scm2int (axis);
assert (a == X_AXIS);
/*
ugh. the way DONE is done is not clean
*/
- if (!unsmob_element (me->get_elt_property ("done")))
+ if (!unsmob_element (me->get_grob_property ("done")))
{
- me->set_elt_property ("done", me->self_scm ());
+ me->set_grob_property ("done", me->self_scm ());
do_shifts (me);
}
TODO: make callback of this.
*/
void
-Collision::do_shifts(Score_element* me)
+Collision::do_shifts(Grob* me)
{
SCM autos (automatic_shift (me));
SCM hand (forced_shift (me));
- Link_array<Score_element> done;
+ Link_array<Grob> done;
Real wid
- = gh_scm2double (me->get_elt_property ("note-width"));
+ = gh_scm2double (me->get_grob_property ("note-width"));
for (; gh_pair_p (hand); hand =gh_cdr (hand))
{
- Score_element * s = unsmob_element (gh_caar (hand));
+ Grob * s = unsmob_element (gh_caar (hand));
Real amount = gh_scm2double (gh_cdar (hand));
s->translate_axis (amount *wid, X_AXIS);
}
for (; gh_pair_p (autos); autos =gh_cdr (autos))
{
- Score_element * s = unsmob_element (gh_caar (autos));
+ Grob * s = unsmob_element (gh_caar (autos));
Real amount = gh_scm2double (gh_cdar (autos));
if (!done.find_l (s))
This should be put into Scheme.
*/
SCM
-Collision::automatic_shift (Score_element *me)
+Collision::automatic_shift (Grob *me)
{
- Drul_array<Link_array<Score_element> > clash_groups;
+ Drul_array<Link_array<Grob> > clash_groups;
Drul_array<Array<int> > shifts;
SCM tups = SCM_EOL;
- SCM s = me->get_elt_property ("elements");
+ SCM s = me->get_grob_property ("elements");
for (; gh_pair_p (s); s = gh_cdr (s))
{
SCM car = gh_car (s);
- Score_element * se = unsmob_element (car);
+ Grob * se = unsmob_element (car);
if (Note_column::has_interface (se))
clash_groups[Note_column::dir (se)].push (se);
}
do
{
Array<int> & shift (shifts[d]);
- Link_array<Score_element> & clashes (clash_groups[d]);
+ Link_array<Grob> & clashes (clash_groups[d]);
clashes.sort (Note_column::shift_compare);
for (int i=0; i < clashes.size (); i++)
{
SCM sh
- = clashes[i]->get_elt_property ("horizontal-shift");
+ = clashes[i]->get_grob_property ("horizontal-shift");
if (gh_number_p (sh))
shift.push (gh_scm2int (sh));
all of them again. */
if (extents[UP].size () && extents[DOWN].size ())
{
- Score_element *cu_l =clash_groups[UP][0];
- Score_element *cd_l =clash_groups[DOWN][0];
+ Grob *cu_l =clash_groups[UP][0];
+ Grob *cd_l =clash_groups[DOWN][0];
/*
TODO.
*/
- Score_element * nu_l= Note_column::first_head(cu_l);
- Score_element * nd_l = Note_column::first_head(cd_l);
+ Grob * nu_l= Note_column::first_head(cu_l);
+ Grob * nd_l = Note_column::first_head(cd_l);
int downpos = Note_column::head_positions_interval (cd_l)[BIGGER];
int uppos = Note_column::head_positions_interval (cu_l)[SMALLER];
&& Rhythmic_head::balltype_i (nu_l) == Rhythmic_head::balltype_i (nd_l);
- if (!to_boolean (me->get_elt_property ("merge-differently-dotted")))
+ if (!to_boolean (me->get_grob_property ("merge-differently-dotted")))
merge = merge && Rhythmic_head::dot_count (nu_l) == Rhythmic_head::dot_count (nd_l);
/*
SCM
-Collision::forced_shift (Score_element *me)
+Collision::forced_shift (Grob *me)
{
SCM tups = SCM_EOL;
- SCM s = me->get_elt_property ("elements");
+ SCM s = me->get_grob_property ("elements");
for (; gh_pair_p (s); s = gh_cdr (s))
{
- Score_element * se = unsmob_element (gh_car (s));
+ Grob * se = unsmob_element (gh_car (s));
- SCM force = se->remove_elt_property ("force-hshift");
+ SCM force = se->remove_grob_property ("force-hshift");
if (gh_number_p (force))
{
tups = gh_cons (gh_cons (se->self_scm (), force),
void
-Collision::add_column (Score_element*me,Score_element* ncol_l)
+Collision::add_column (Grob*me,Grob* ncol_l)
{
ncol_l->add_offset_callback (Collision::force_shift_callback_proc, X_AXIS);
Axis_group_interface::add_element (me, ncol_l);
SCM
Hairpin::brew_molecule (SCM smob)
{
- Score_element *me= unsmob_element (smob);
+ Grob *me= unsmob_element (smob);
Spanner *span = dynamic_cast<Spanner*>(me);
Real line = me->paper_l ()->get_var ("stafflinethickness");
Real broken_left = span->get_broken_left_end_align ();
- SCM s = me->get_elt_property("grow-direction");
+ SCM s = me->get_grob_property("grow-direction");
if (!isdir_b (s))
{
me->suicide ();
}
Direction grow_dir = to_dir (s);
- Real padding = gh_scm2double (me->get_elt_property ("padding"));
+ Real padding = gh_scm2double (me->get_grob_property ("padding"));
Real width = span->spanner_length ();
width -= span->get_broken_left_end_align ();
if (!broken [d])
{
- Real r = b->extent (b, X_AXIS)[-d] + padding;
+
+ Interval e =b->extent (b, X_AXIS);
+ Real r = 0.0;
+ if (!e.empty_b ())
+ r = e[-d] + padding;
width += d * r;
extra_off[d] = r;
}
while (flip (&d) != LEFT);
bool continued = broken[Direction (-grow_dir)];
- Real height = gh_scm2double (me->get_elt_property ("height"));
- Real thick = line * gh_scm2double (me->get_elt_property ("thickness"));
+ Real height = gh_scm2double (me->get_grob_property ("height"));
+ Real thick = line * gh_scm2double (me->get_grob_property ("thickness"));
const char* type = (grow_dir < 0) ? "decrescendo" : "crescendo";
SCM hairpin = gh_list (ly_symbol2scm (type),
calc_interstaff_dist (Item *item, Spanner *span)
{
Real interstaff = 0.0;
- Score_element *common = item->common_refpoint (span, Y_AXIS);
+ Grob *common = item->common_refpoint (span, Y_AXIS);
if (Align_interface::has_interface (common) && Align_interface::axis(common) == Y_AXIS)
{
- SCM threshold = common->get_elt_property ("threshold");
+ SCM threshold = common->get_grob_property ("threshold");
if (!gh_pair_p (threshold)
|| !scm_equal_p (gh_car (threshold), gh_cdr (threshold)))
warning (_ ("minVerticalAlign != maxVerticalAlign: cross staff spanners may be broken"));
if (gh_pair_p (threshold))
interstaff = gh_scm2double (gh_car (threshold)) * interstaff;
- Score_element * span_refpoint = span;
+ Grob * span_refpoint = span;
while (span_refpoint->parent_l (Y_AXIS) != common)
span_refpoint = span_refpoint->parent_l (Y_AXIS);
- Score_element * note_refpoint = item;
+ Grob * note_refpoint = item;
while (note_refpoint->parent_l (Y_AXIS) != common)
note_refpoint = note_refpoint->parent_l (Y_AXIS);
int span_prio =
- Align_interface::get_count (common,(Score_element*) dynamic_cast<Score_element *> (span_refpoint));
+ Align_interface::get_count (common,(Grob*) dynamic_cast<Grob *> (span_refpoint));
int item_prio =
- Align_interface::get_count (common,(Score_element*) dynamic_cast<Score_element *> (note_refpoint));
+ Align_interface::get_count (common,(Grob*) dynamic_cast<Grob *> (note_refpoint));
/*
our staff is lower -> interstaff *= -1
{
public:
Custos_engraver();
- virtual void do_post_move_processing();
- virtual void acknowledge_element(Score_element_info);
+ virtual void start_translation_timestep();
+ virtual void acknowledge_grob(Grob_info);
void deprecated_process_music ();
- virtual void process_acknowledged ();
- virtual void do_pre_move_processing ();
+ virtual void create_grobs ();
+ virtual void stop_translation_timestep ();
virtual void do_removal_processing ();
VIRTUAL_COPY_CONS(Translator);
private:
Item * create_custos();
bool custos_permitted;
- Link_array<Score_element> custos_arr_;
+ Link_array<Grob> custos_arr_;
Array<Pitch> pitches_;
};
void
-Custos_engraver::do_pre_move_processing()
+Custos_engraver::stop_translation_timestep()
{
/*
delay typeset until we're at the next moment, so we can silence custodes at the end of the piece.
}
void
-Custos_engraver::do_post_move_processing ()
+Custos_engraver::start_translation_timestep ()
{
for (int i = custos_arr_.size (); i--;)
{
- typeset_element (custos_arr_[i]);
+ typeset_grob (custos_arr_[i]);
}
custos_arr_.clear ();
pitches_.clear ();
}
void
-Custos_engraver::acknowledge_element (Score_element_info info)
+Custos_engraver::acknowledge_grob (Grob_info info)
{
Item *item = dynamic_cast <Item *>(info.elem_l_);
if (item)
}
void
-Custos_engraver::process_acknowledged ()
+Custos_engraver::create_grobs ()
{
deprecated_process_music ();
{
Item *c = create_custos ();
- c->set_elt_property ("staff-position",
+ c->set_grob_property ("staff-position",
gh_int2scm (pitches_[i].steps ()));
}
SCM basicProperties = get_property ("Custos");
Item* custos = new Item (basicProperties);
- announce_element (custos, 0);
+ announce_grob (custos, 0);
custos_arr_.push (custos);
return custos;
for (int i = custos_arr_.size (); i--;)
{
custos_arr_[i]->suicide ();
- typeset_element (custos_arr_[i]);
+ typeset_grob (custos_arr_[i]);
}
custos_arr_.clear ();
}
*
* (3) The thickness of the ledger line is fixed (limitation).
*/
-Molecule create_ledger_line (Interval x_extent, Score_element *me)
+Molecule create_ledger_line (Interval x_extent, Grob *me)
{
Molecule line;
Molecule slice = Font_interface::get_default_font (me)->find_by_name ("noteheads-ledgerending");
return line;
}
-void add_streepjes(Score_element* me,
+void add_streepjes(Grob* me,
int pos,
int interspaces,
Molecule* custos_p_)
Custos::brew_molecule (SCM smob)
{
Item *me = (Item *)unsmob_element (smob);
- SCM scm_style = me->get_elt_property ("style");
+ SCM scm_style = me->get_grob_property ("style");
- if (gh_string_p (scm_style))
+ if (gh_symbol_p (scm_style))
{
- String style = ly_scm2string (scm_style);
+ String style = ly_scm2string (scm_symbol_to_string (scm_style));
String idx = "custodes-";
int interspaces = Staff_symbol_referencer::line_count (me)-1;
}
bool
-Custos::has_interface (Score_element*m)
+Custos::has_interface (Grob*m)
{
return m && m->has_interface (ly_symbol2scm ("custos-interface"));
}
#include "warn.hh"
#include "dimension-cache.hh"
#include "parray.hh"
-#include "score-element.hh"
+#include "grob.hh"
Dimension_cache::Dimension_cache (Dimension_cache const &d)
bool
-Directional_element_interface::has_interface (Score_element*me)
+Directional_element_interface::has_interface (Grob*me)
{
- return isdir_b (me->get_elt_property (direction_sym));
+ return isdir_b (me->get_grob_property (direction_sym));
}
Direction
-Directional_element_interface::get (Score_element*me)
+Directional_element_interface::get (Grob*me)
{
// return dir_;
- SCM d= me->get_elt_property (direction_sym);
+ SCM d= me->get_grob_property (direction_sym);
if (!isdir_b(d))
return CENTER;
}
void
-Directional_element_interface::set (Score_element*me, Direction d)
+Directional_element_interface::set (Grob*me, Direction d)
{
SCM sd = gh_int2scm (d);
- if (me->get_elt_property (direction_sym) != sd)
- me->set_elt_property (direction_sym, sd);
+ if (me->get_grob_property (direction_sym) != sd)
+ me->set_grob_property (direction_sym, sd);
}
class Dot_column_engraver : public Engraver
{
- Score_element *dotcol_p_ ;
+ Grob *dotcol_p_ ;
Link_array<Item> head_l_arr_;
public:
VIRTUAL_COPY_CONS(Translator);
Dot_column_engraver();
protected:
- virtual void acknowledge_element (Score_element_info);
- virtual void do_pre_move_processing ();
+ virtual void acknowledge_grob (Grob_info);
+ virtual void stop_translation_timestep ();
};
}
void
-Dot_column_engraver::do_pre_move_processing ()
+Dot_column_engraver::stop_translation_timestep ()
{
if (dotcol_p_)
{
- typeset_element (dotcol_p_);
+ typeset_grob (dotcol_p_);
dotcol_p_ =0;
}
head_l_arr_.clear ();
}
void
-Dot_column_engraver::acknowledge_element (Score_element_info info)
+Dot_column_engraver::acknowledge_grob (Grob_info info)
{
- Score_element *d = unsmob_element (info.elem_l_->get_elt_property ("dot"));
+ Grob *d = unsmob_element (info.elem_l_->get_grob_property ("dot"));
if (d)
{
if (!dotcol_p_)
Dot_column::set_interface (dotcol_p_);
Side_position::set_axis (dotcol_p_, X_AXIS);
Side_position::set_direction (dotcol_p_, RIGHT);
- announce_element (dotcol_p_, 0);
+ announce_grob (dotcol_p_, 0);
}
Dot_column::add_head (dotcol_p_, info.elem_l_);
void
-Dot_column::set_interface (Score_element* me)
+Dot_column::set_interface (Grob* me)
{
Directional_element_interface::set (me, RIGHT);
SCM
Dot_column::force_shift_callback (SCM element_smob, SCM axis)
{
- Score_element *me = unsmob_element (element_smob);
+ Grob *me = unsmob_element (element_smob);
Axis a = (Axis) gh_scm2int (axis);
assert (a == Y_AXIS);
me = me->parent_l (X_AXIS);
- SCM dots = me->get_elt_property ("dots");
+ SCM dots = me->get_grob_property ("dots");
do_shifts (dots);
return gh_double2scm (0.0);
}
SCM
Dot_column::do_shifts (SCM l)
{
- Link_array<Score_element> dots;
+ Link_array<Grob> dots;
while (gh_pair_p (l))
{
dots.push (unsmob_element (gh_car (l)));
for (int i=0; i < dots.size (); pos += 2, i++)
{
- Score_element * d = dots[i];
+ Grob * d = dots[i];
Staff_symbol_referencer::set_position (d,pos);
}
}
bool
-Dot_column::has_interface (Score_element*m)
+Dot_column::has_interface (Grob*m)
{
return m && m->has_interface (ly_symbol2scm ("dot-column-interface"));
}
void
-Dot_column::add_head (Score_element * me, Score_element *rh)
+Dot_column::add_head (Grob * me, Grob *rh)
{
- Score_element * d = unsmob_element (rh->get_elt_property ("dot"));
+ Grob * d = unsmob_element (rh->get_grob_property ("dot"));
if (d)
{
Side_position::add_support (me,rh);
SCM
Dots::quantised_position_callback (SCM element_smob, SCM axis)
{
- Score_element *me = unsmob_element (element_smob);
+ Grob *me = unsmob_element (element_smob);
Axis a = (Axis) gh_scm2int (axis);
assert (a == Y_AXIS);
- SCM d= me->get_elt_property ("dot-count");
+ SCM d= me->get_grob_property ("dot-count");
if (gh_number_p (d) && gh_scm2int (d))
{
if (!Directional_element_interface::get (me))
SCM
Dots::brew_molecule (SCM d)
{
- Score_element *sc = unsmob_element (d);
+ Grob *sc = unsmob_element (d);
Molecule mol;
- SCM c = sc->get_elt_property ("dot-count");
+ SCM c = sc->get_grob_property ("dot-count");
if (gh_number_p (c))
{
Spanner* finished_line_spanner_;
Link_array<Note_column> pending_column_arr_;
- Link_array<Score_element> pending_element_arr_;
+ Link_array<Grob> pending_element_arr_;
void typeset_all ();
protected:
virtual void do_removal_processing ();
- virtual void acknowledge_element (Score_element_info);
- virtual bool do_try_music (Music *req_l);
+ virtual void acknowledge_grob (Grob_info);
+ virtual bool try_music (Music *req_l);
void deprecated_process_music ();
- virtual void do_pre_move_processing ();
- virtual void process_acknowledged ();
- virtual void do_post_move_processing ();
+ virtual void stop_translation_timestep ();
+ virtual void create_grobs ();
+ virtual void start_translation_timestep ();
};
ADD_THIS_TRANSLATOR (Dynamic_engraver);
}
void
-Dynamic_engraver::do_post_move_processing ()
+Dynamic_engraver::start_translation_timestep ()
{
script_req_l_ = 0;
accepted_spanreqs_drul_[START] = 0;
}
bool
-Dynamic_engraver::do_try_music (Music * m)
+Dynamic_engraver::try_music (Music * m)
{
if (dynamic_cast <Text_script_req*> (m)
&& m->get_mus_property ("text-type") == ly_symbol2scm ("dynamic"))
Music * rq = accepted_spanreqs_drul_[START];
if (script_req_l_)
rq = script_req_l_ ;
- announce_element (line_spanner_, rq);
+ announce_grob (line_spanner_, rq);
}
if (script_req_l_)
{
script_p_ = new Item (get_property ("DynamicText"));
- script_p_->set_elt_property ("text",
+ script_p_->set_grob_property ("text",
script_req_l_->get_mus_property ("text"));
if (Direction d = script_req_l_->get_direction ())
Directional_element_interface::set (line_spanner_, d);
Axis_group_interface::add_element (line_spanner_, script_p_);
- announce_element (script_p_, script_req_l_);
+ announce_grob (script_p_, script_req_l_);
}
if (accepted_spanreqs_drul_[STOP])
else
{
assert (!finished_cresc_p_);
- Score_element* cc = unsmob_element (get_property ("currentMusicalColumn"));
+ Grob* cc = unsmob_element (get_property ("currentMusicalColumn"));
cresc_p_->set_bound (RIGHT, cc);
if (!gh_string_p (s) || ly_scm2string (s) == "hairpin")
{
cresc_p_ = new Spanner (get_property ("Crescendo"));
- cresc_p_->set_elt_property ("grow-direction",
+ cresc_p_->set_grob_property ("grow-direction",
gh_int2scm ((start_type == "crescendo")
? BIGGER : SMALLER));
else
{
cresc_p_ = new Spanner (get_property ("TextSpanner"));
- cresc_p_->set_elt_property ("type", s);
+ cresc_p_->set_grob_property ("type", s);
daddy_trans_l_->set_property (start_type
+ "Spanner", SCM_UNDEFINED);
s = get_property ((start_type + "Text").ch_C());
if (gh_string_p (s))
{
- cresc_p_->set_elt_property ("edge-text",
+ cresc_p_->set_grob_property ("edge-text",
gh_cons (s, ly_str02scm ("")));
daddy_trans_l_->set_property (start_type + "Text",
SCM_UNDEFINED);
: unsmob_element (get_property ("currentMusicalColumn")));
Axis_group_interface::add_element (line_spanner_, cresc_p_);
- announce_element (cresc_p_, accepted_spanreqs_drul_[START]);
+ announce_grob (cresc_p_, accepted_spanreqs_drul_[START]);
}
}
script_req_l_ = 0;
}
void
-Dynamic_engraver::do_pre_move_processing ()
+Dynamic_engraver::stop_translation_timestep ()
{
typeset_all ();
}
void
-Dynamic_engraver::process_acknowledged ()
+Dynamic_engraver::create_grobs ()
{
deprecated_process_music ();
}
? script_p_
: unsmob_element (get_property ("currentMusicalColumn")));
- typeset_element (finished_cresc_p_);
+ typeset_grob (finished_cresc_p_);
finished_cresc_p_ =0;
}
if (script_p_)
{
- typeset_element (script_p_);
+ typeset_grob (script_p_);
script_p_ = 0;
}
if (finished_line_spanner_)
{
Side_position::add_staff_support (finished_line_spanner_);
extend_spanner_over_elements (finished_line_spanner_);
- typeset_element (finished_line_spanner_);
+ typeset_grob (finished_line_spanner_);
finished_line_spanner_ = 0;
}
}
void
-Dynamic_engraver::acknowledge_element (Score_element_info i)
+Dynamic_engraver::acknowledge_grob (Grob_info i)
{
if (Note_column::has_interface (i.elem_l_))
{
~Dynamic_performer ();
protected:
- virtual bool do_try_music (Music* req_l);
+ virtual bool try_music (Music* req_l);
void deprecated_process_music ();
- virtual void do_pre_move_processing ();
- virtual void process_acknowledged ();
+ virtual void stop_translation_timestep ();
+ virtual void create_grobs ();
private:
Music* script_req_l_;
}
void
-Dynamic_performer::process_acknowledged ()
+Dynamic_performer::create_grobs ()
{
deprecated_process_music ();
}
void
-Dynamic_performer::do_pre_move_processing ()
+Dynamic_performer::stop_translation_timestep ()
{
if (audio_p_)
{
}
bool
-Dynamic_performer::do_try_music (Music* r)
+Dynamic_performer::try_music (Music* r)
{
if (!script_req_l_)
{
#include "engraver.hh"
#include "debug.hh"
#include "paper-score.hh"
-#include "score-element.hh"
+#include "grob.hh"
ADD_THIS_TRANSLATOR(Engraver_group_engraver);
void
-Engraver_group_engraver::announce_element (Score_element_info info)
+Engraver_group_engraver::announce_grob (Grob_info info)
{
announce_info_arr_.push (info);
- Engraver::announce_element (info);
+ Engraver::announce_grob (info);
}
void
-Engraver_group_engraver::process_acknowledged ()
+Engraver_group_engraver::create_grobs ()
{
for (SCM p = simple_trans_list_; gh_pair_p (p); p = gh_cdr ( p))
Translator * t = unsmob_translator (gh_car (p));
Engraver * eng = dynamic_cast<Engraver*> (t);
if (eng)
- eng->process_acknowledged ();
+ eng->create_grobs ();
}
}
void
-Engraver_group_engraver::acknowledge_elements ()
+Engraver_group_engraver::acknowledge_grobs ()
{
for (int j =0; j < announce_info_arr_.size(); j++)
{
- Score_element_info info = announce_info_arr_[j];
+ Grob_info info = announce_info_arr_[j];
for (SCM p = simple_trans_list_; gh_pair_p (p); p = gh_cdr (p))
{
Translator * t = unsmob_translator (gh_car (p));
Engraver * eng = dynamic_cast<Engraver*> (t);
if (eng && eng!= info.origin_trans_l_)
- eng->acknowledge_element (info);
+ eng->acknowledge_grob (info);
}
}
}
dynamic_cast<Engraver_group_engraver*> (t)->do_announces ();
}
- process_acknowledged ();
+ create_grobs ();
- // debug
- int i = 0;
- while (announce_info_arr_.size () && i++ < 5)
+ while (announce_info_arr_.size ())
{
- acknowledge_elements ();
+ acknowledge_grobs ();
announce_info_arr_.clear ();
- process_acknowledged ();
+ create_grobs ();
}
+}
+
+#include <iostream.h>
- if (announce_info_arr_.size ())
+/*
+ order is : top to bottom (as opposed to do_announces)
+ */
+void
+Engraver_group_engraver::process_music ()
+{
+ for (SCM p = simple_trans_list_; gh_pair_p (p); p =gh_cdr ( p))
{
- printf ("do_announces: elt: %s\n",
- announce_info_arr_[0].elem_l_->name ().ch_C ());
- announce_info_arr_.clear ();
+ Translator * t = unsmob_translator (gh_car (p));
+ Engraver * eng = dynamic_cast<Engraver*> (t);
+
+ if (eng)
+ eng->process_music ();
+ }
+ for (SCM p = trans_group_list_; gh_pair_p (p); p =gh_cdr ( p))
+ {
+ Translator * t = unsmob_translator (gh_car (p));
+ Engraver*eng = dynamic_cast<Engraver*> (t);
+ if (eng)
+ eng->process_music ();
}
}
-
-
(c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "music-list.hh"
-#include "musical-request.hh"
+#include "music.hh"
#include "engraver.hh"
#include "engraver-group-engraver.hh"
-#include "debug.hh"
-#include "paper-def.hh"
-#include "score-element.hh"
-#include "group-interface.hh"
+#include "grob.hh"
void
-Engraver::announce_element (Score_element_info inf)
+Engraver::announce_grob (Grob_info inf)
{
- daddy_grav_l()->announce_element (inf);
+ daddy_grav_l()->announce_grob (inf);
}
void
-Engraver::announce_element (Score_element* e, Music *m)
+Engraver::announce_grob (Grob* e, Music *m)
{
if (m && m->origin ()->location_str ().length_i ())
{
- e->set_elt_property ("origin", m->get_mus_property ("origin"));
+ e->set_grob_property ("origin", m->get_mus_property ("origin"));
}
- Score_element_info i (e, m);
+ Grob_info i (e, m);
if (!i.origin_trans_l_)
i.origin_trans_l_ = this;
- daddy_grav_l()->announce_element (i);
+ daddy_grav_l()->announce_grob (i);
}
void
-Engraver::typeset_element (Score_element*p)
+Engraver::typeset_grob (Grob*p)
{
- daddy_grav_l()->typeset_element (p);
+ daddy_grav_l()->typeset_grob (p);
}
-Paper_def*
-Engraver::paper_l () const
-{
- return dynamic_cast<Paper_def*>(output_def_l_);
-}
-
Engraver_group_engraver*
Engraver::daddy_grav_l () const
{
? dynamic_cast<Engraver_group_engraver *> (daddy_trans_l_)
: 0;
}
+
+void
+Engraver::process_music ()
+{
+
+}
then. */
class Extender_engraver : public Engraver
{
- Score_element *last_lyric_l_;
- Score_element *current_lyric_l_;
+ Grob *last_lyric_l_;
+ Grob *current_lyric_l_;
Extender_req* req_l_;
Spanner* extender_p_;
public:
VIRTUAL_COPY_CONS (Translator);
protected:
- virtual void acknowledge_element (Score_element_info);
+ virtual void acknowledge_grob (Grob_info);
virtual void do_removal_processing();
void deprecated_process_music();
- virtual bool do_try_music (Music*);
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing ();
- virtual void process_acknowledged ();
+ virtual bool try_music (Music*);
+ virtual void stop_translation_timestep();
+ virtual void start_translation_timestep ();
+ virtual void create_grobs ();
private:
};
}
void
-Extender_engraver::acknowledge_element (Score_element_info i)
+Extender_engraver::acknowledge_grob (Grob_info i)
{
// -> text_item
if (i.elem_l_->has_interface (ly_symbol2scm("text-item-interface")))
bool
-Extender_engraver::do_try_music (Music* r)
+Extender_engraver::try_music (Music* r)
{
if (Extender_req* p = dynamic_cast <Extender_req *> (r))
{
}
void
-Extender_engraver::process_acknowledged ()
+Extender_engraver::create_grobs ()
{
deprecated_process_music ();
}
Lyric_extender (extender_p_).set_textitem (LEFT, last_lyric_l_);
- announce_element (extender_p_, req_l_);
+ announce_grob (extender_p_, req_l_);
}
}
void
-Extender_engraver::do_pre_move_processing ()
+Extender_engraver::stop_translation_timestep ()
{
if (extender_p_)
{
- typeset_element (extender_p_);
+ typeset_grob (extender_p_);
extender_p_ = 0;
}
}
void
-Extender_engraver::do_post_move_processing ()
+Extender_engraver::start_translation_timestep ()
{
req_l_ = 0;
}
#include "all-font-metrics.hh"
#include "font-metric.hh"
#include "font-interface.hh"
-#include "score-element.hh"
+#include "grob.hh"
#include "paper-def.hh"
#include "warn.hh"
SCM
-Font_interface::font_alist_chain (Score_element *me)
+Font_interface::font_alist_chain (Grob *me)
{
SCM defaults = gh_cdr (scm_assoc (ly_symbol2scm ("font-defaults"),
me->paper_l ()->style_sheet_ ));
todo: split up this func, reuse in text_item?
*/
Font_metric *
-Font_interface::get_default_font (Score_element*me)
+Font_interface::get_default_font (Grob*me)
{
- Font_metric * fm = unsmob_metrics (me->get_elt_property ("font"));
+ Font_metric * fm = unsmob_metrics (me->get_grob_property ("font"));
if (fm)
return fm;
fm = get_font (me, font_alist_chain (me));
- me->set_elt_property ("font", fm->self_scm ());
+ me->set_grob_property ("font", fm->self_scm ());
return fm;
}
Font_metric *
-Font_interface::get_font (Score_element *me, SCM chain)
+Font_interface::get_font (Grob *me, SCM chain)
{
SCM ss = me->paper_l ()->style_sheet_;
}
SCM
-Font_interface::add_style (Score_element* me, SCM style, SCM chain)
+Font_interface::add_style (Grob* me, SCM style, SCM chain)
{
assert (gh_symbol_p (style));
// thanks to GDBs wonderful casting abilities, we need these:
Item*
-to_item (Score_element* g)
+to_item (Grob* g)
{
return dynamic_cast<Item*>(g);
}
Spanner*
-to_spanner (Score_element*g)
+to_spanner (Grob*g)
{
return dynamic_cast<Spanner*>(g);
}
Gourlay_breaking::do_solve () const
{
Array<Break_node> optimal_paths;
- Link_array<Score_element> all =
+ Link_array<Grob> all =
pscore_l_->line_l_->column_l_arr ();
Array<int> breaks = find_break_indices ();
for (int start_idx = break_idx; start_idx--;)
{
- Link_array<Score_element> line = all.slice (breaks[start_idx], breaks[break_idx]+1);
+ Link_array<Grob> line = all.slice (breaks[start_idx], breaks[break_idx]+1);
line[0] = dynamic_cast<Item*> (line[0]) ->find_prebroken_piece (RIGHT);
line.top () = dynamic_cast<Item*> (line.top ())->find_prebroken_piece (LEFT);
Column_x_positions const &this_one) const
{
Real break_penalties = 0.0;
- Score_element * pc = this_one.cols_.top ();
+ Grob * pc = this_one.cols_.top ();
if (pc->original_l_)
{
- SCM pen = pc->get_elt_property ("penalty");
+ SCM pen = pc->get_grob_property ("penalty");
if (gh_number_p (pen))
{
break_penalties += gh_scm2double (pen);
SCM
Grace_align_item::before_line_breaking (SCM smob)
{
- Score_element*me = unsmob_element (smob);
+ Grob*me = unsmob_element (smob);
- SCM space = me->get_elt_property ("horizontal-space");
- me->set_elt_property ("threshold",
+ SCM space = me->get_grob_property ("horizontal-space");
+ me->set_grob_property ("threshold",
gh_cons (space,
gh_double2scm (infinity_f)));
- dynamic_cast<Item*>(me)->column_l ()->set_elt_property ("contains-grace", SCM_BOOL_T);
+ dynamic_cast<Item*>(me)->column_l ()->set_grob_property ("contains-grace", SCM_BOOL_T);
return SCM_UNSPECIFIED;
}
void
-Grace_align_item::set_interface (Score_element*me)
+Grace_align_item::set_interface (Grob*me)
{
me->set_interface (ly_symbol2scm ("grace-align-interface"));
- me->set_elt_property ("stacking-dir", gh_int2scm (RIGHT));
+ me->set_grob_property ("stacking-dir", gh_int2scm (RIGHT));
Align_interface::set_interface(me);
Align_interface::set_axis (me,X_AXIS);
}
bool
-Grace_align_item::has_interface (Score_element*m)
+Grace_align_item::has_interface (Grob*m)
{
return m&& m->has_interface (ly_symbol2scm ("grace-align-interface"));
}
#include "grace-engraver-group.hh"
#include "lily-guile.hh"
-#include "score-element.hh"
+#include "grob.hh"
#include "musical-request.hh"
-#include "warn.hh"
void
Grace_engraver_group::start ()
removal_processing (); // ugr. We'd want to have this done by our parents.
for (int i=0; i < announce_to_top_.size (); i++)
{
- Engraver::announce_element (announce_to_top_[i]);
+ Engraver::announce_grob (announce_to_top_[i]);
}
for (int i=0; i < typeset_us_.size (); i++)
{
- Engraver::typeset_element (typeset_us_[i]);
+ Engraver::typeset_grob (typeset_us_[i]);
}
typeset_us_.clear ();
calling_self_b_ = false;
}
void
-Grace_engraver_group::announce_element (Score_element_info inf)
+Grace_engraver_group::announce_grob (Grob_info inf)
{
announce_info_arr_.push (inf);
// do not propagate to top
announce_to_top_.push (inf);
- inf.elem_l_->set_elt_property ("grace", SCM_BOOL_T);
+ inf.elem_l_->set_grob_property ("grace", SCM_BOOL_T);
}
void
-Grace_engraver_group::typeset_element (Score_element*e)
+Grace_engraver_group::typeset_grob (Grob*e)
{
- if (!e)
- programming_error ("Grace_engraver_group: empty elt\n");
- else
-
typeset_us_.push (e);
}
Grace_engraver_group::process ()
{
calling_self_b_ = true;
-
- //process_music (); -- used to do implicit creation processing ()
- // possibly post_move_processing ()?
- do_creation_processing ();
- post_move_processing ();
-
-
+ //process_music ();
announces();
pre_move_processing();
check_removal();
don't let the commands trickle up.
*/
bool
-Grace_engraver_group::do_try_music (Music *m)
+Grace_engraver_group::try_music (Music *m)
{
bool hebbes_b = try_music_on_nongroup_children (m);
return false;
}
+void
+Grace_engraver_group::do_creation_processing ()
+{
+ calling_self_b_ = true;
+ Engraver_group_engraver::do_creation_processing ();
+ calling_self_b_ = false;
+}
// do not propagate to top
announce_to_top_.push (info);
- //inf.elem_l_->set_elt_property ("grace", SCM_BOOL_T);
+ //inf.elem_l_->set_grob_property ("grace", SCM_BOOL_T);
info.elem_l_->grace_b_ = true;
}
don't let the commands trickle up.
*/
bool
-Grace_performer_group::do_try_music (Music *m)
+Grace_performer_group::try_music (Music *m)
{
return try_music_on_nongroup_children (m);
}
Paper_column *last_musical_col_l_;
protected:
VIRTUAL_COPY_CONS(Translator);
- virtual void acknowledge_element (Score_element_info);
- virtual void process_acknowledged ();
- virtual void do_post_move_processing ();
- virtual void do_pre_move_processing ();
+ virtual void acknowledge_grob (Grob_info);
+ virtual void create_grobs ();
+ virtual void start_translation_timestep ();
+ virtual void stop_translation_timestep ();
Item*align_l_;
Link_array<Item> support_;
public:
}
void
-Grace_position_engraver::acknowledge_element (Score_element_info i)
+Grace_position_engraver::acknowledge_grob (Grob_info i)
{
Item *item = dynamic_cast<Item*> (i.elem_l_);
if (item && Grace_align_item::has_interface (i.elem_l_))
}
else if (item && Note_head::has_interface (i.elem_l_))
{
- if (!to_boolean (item->get_elt_property ("grace")))
+ if (!to_boolean (item->get_grob_property ("grace")))
support_.push (item);
}
else if (item && Local_key_item::has_interface (i.elem_l_))
{
- if (!to_boolean (item->get_elt_property ("grace")))
+ if (!to_boolean (item->get_grob_property ("grace")))
support_.push (item);
else if (align_l_)
item->add_dependency (align_l_);
}
void
-Grace_position_engraver::process_acknowledged ()
+Grace_position_engraver::create_grobs ()
{
if (align_l_)
{
}
void
-Grace_position_engraver::do_pre_move_processing ()
+Grace_position_engraver::stop_translation_timestep ()
{
if (align_l_ && !Side_position::supported_b (align_l_))
{
*/
- Score_element * elt = align_l_->parent_l (X_AXIS);
+ Grob * elt = align_l_->parent_l (X_AXIS);
if (elt)
return;
}
void
-Grace_position_engraver::do_post_move_processing ()
+Grace_position_engraver::start_translation_timestep ()
{
support_.clear ();
align_l_ =0;
Link_array<Audio_note> notes_;
VIRTUAL_COPY_CONS (Translator);
- virtual void acknowledge_element (Audio_element_info);
- virtual void process_acknowledged ();
- virtual void do_post_move_processing ();
+ virtual void acknowledge_grob (Audio_element_info);
+ virtual void create_grobs ();
+ virtual void start_translation_timestep ();
Global_translator* global_translator_l ();
};
}
void
-Grace_position_performer::acknowledge_element (Audio_element_info i)
+Grace_position_performer::acknowledge_grob (Audio_element_info i)
{
if (Audio_note * n = dynamic_cast <Audio_note*> (i.elem_l_))
{
}
void
-Grace_position_performer::process_acknowledged ()
+Grace_position_performer::create_grobs ()
{
if (graces_.size ())
{
void
-Grace_position_performer::do_post_move_processing ()
+Grace_position_performer::start_translation_timestep ()
{
graces_.clear ();
notes_.clear ();
--- /dev/null
+#if 0
+/*
+ grob-callback.cc -- implement Callback smob.
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "grob-callback.hh"
+
+static SCM callback_tag;
+
+static
+SCM mark_smob (SCM)
+{
+ return SCM_EOL;
+}
+
+static int
+print_smob (SCM, SCM port, scm_print_state *)
+{
+ scm_puts ("#<Callback>", port);
+ return 1;
+}
+
+static
+scm_sizet free_smob (SCM)
+{
+ return 0;
+}
+
+static
+void start_callback_smobs()
+{
+ callback_tag = scm_make_smob_type_mfpe ("callback", 0,
+ mark_smob, free_smob,
+ print_smob, 0);
+}
+
+
+SCM
+smobify_callback (Grob_callback cb )
+{
+ SCM z;
+
+ SCM_NEWCELL(z);
+ SCM_SETCDR (z, (SCM)cb);
+ SCM_SETCAR (z, (SCM)callback_tag);
+
+ return z;
+}
+
+ADD_SCM_INIT_FUNC(callback, start_callback_smobs);
+#endif
--- /dev/null
+/*
+ grob-info.cc -- implement Grob_info
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "grob-info.hh"
+#include "request.hh"
+#include "translator.hh"
+#include "translator-group.hh"
+
+Grob_info::Grob_info (Grob*s_l, Music *r_l)
+{
+ elem_l_ = s_l;
+ req_l_ = r_l;
+ origin_trans_l_ = 0;
+}
+
+
+Grob_info::Grob_info()
+{
+ elem_l_ = 0;
+ req_l_ = 0;
+ origin_trans_l_ = 0;
+}
+
+
+Link_array<Translator>
+Grob_info::origin_trans_l_arr (Translator* end) const
+{
+ Translator * t = origin_trans_l_;
+ Link_array<Translator> r;
+ do {
+ r.push (t);
+ t = t->daddy_trans_l_;
+ } while (t && t != end->daddy_trans_l_);
+
+ return r;
+}
+
--- /dev/null
+/*
+ score-elem.cc -- implement Grob
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#include <string.h>
+#include <math.h>
+
+#include "input-smob.hh"
+#include "libc-extension.hh"
+#include "group-interface.hh"
+#include "misc.hh"
+#include "paper-score.hh"
+#include "paper-def.hh"
+#include "molecule.hh"
+#include "grob.hh"
+#include "debug.hh"
+#include "spanner.hh"
+#include "line-of-score.hh"
+#include "item.hh"
+#include "paper-column.hh"
+#include "molecule.hh"
+#include "misc.hh"
+#include "paper-outputter.hh"
+#include "dimension-cache.hh"
+#include "side-position-interface.hh"
+#include "item.hh"
+
+#include "ly-smobs.icc"
+
+/*
+TODO:
+
+remove dynamic_cast<Spanner,Item> and put this code into respective
+ subclass.
+*/
+
+
+#define INFINITY_MSG "Infinity or NaN encountered"
+
+Grob::Grob(SCM basicprops)
+{
+ /*
+ fixme: default should be no callback.
+ */
+
+ pscore_l_=0;
+ status_i_ = 0;
+ original_l_ = 0;
+ immutable_property_alist_ = basicprops;
+ mutable_property_alist_ = SCM_EOL;
+
+ smobify_self ();
+
+ char const*onames[] = {"X-offset-callbacks", "Y-offset-callbacks"};
+ char const*enames[] = {"X-extent-callback", "Y-extent-callback"};
+
+ for (int a = X_AXIS; a <= Y_AXIS; a++){
+ SCM l = get_grob_property (onames[a]);
+
+ if (scm_ilength (l) >=0)
+ {
+ dim_cache_[a].offset_callbacks_ = l;
+ dim_cache_[a].offsets_left_ = scm_ilength (l);
+ }
+ else
+ {
+ programming_error ("[XY]-offset-callbacks must be a list");
+ }
+
+ SCM cb = get_grob_property (enames[a]);
+
+ /*
+ Should change default to be empty?
+ */
+ if (!gh_procedure_p (cb) && !gh_pair_p (cb))
+ cb = molecule_extent_proc;
+
+ dim_cache_[a].dimension_ = cb;
+ }
+
+ SCM meta = get_grob_property ("meta");
+ SCM ifs = scm_assoc (ly_symbol2scm ("interfaces"), meta);
+
+ set_grob_property ("interfaces",gh_cdr (ifs));
+}
+
+
+Grob::Grob (Grob const&s)
+ : dim_cache_ (s.dim_cache_)
+{
+ original_l_ =(Grob*) &s;
+ immutable_property_alist_ = s.immutable_property_alist_;
+ mutable_property_alist_ = SCM_EOL;
+
+ status_i_ = s.status_i_;
+ pscore_l_ = s.pscore_l_;
+
+ smobify_self ();
+}
+
+Grob::~Grob()
+{
+ /*
+ do nothing scm-ish and no unprotecting here.
+ */
+}
+
+
+SCM
+Grob::get_grob_property (const char *nm) const
+{
+ SCM sym = ly_symbol2scm (nm);
+ return get_grob_property (sym);
+}
+
+SCM
+Grob::get_grob_property (SCM sym) const
+{
+ SCM s = scm_sloppy_assq(sym, mutable_property_alist_);
+ if (s != SCM_BOOL_F)
+ return gh_cdr (s);
+
+ s = scm_sloppy_assq (sym, immutable_property_alist_);
+ return (s == SCM_BOOL_F) ? SCM_EOL : gh_cdr (s);
+}
+
+/*
+ Remove the value associated with KEY, and return it. The result is
+ that a next call will yield SCM_UNDEFINED (and not the underlying
+ `basic' property.
+*/
+SCM
+Grob::remove_grob_property (const char* key)
+{
+ SCM val = get_grob_property (key);
+ if (val != SCM_EOL)
+ set_grob_property (key, SCM_EOL);
+ return val;
+}
+
+void
+Grob::set_grob_property (const char* k, SCM v)
+{
+ SCM s = ly_symbol2scm (k);
+ set_grob_property (s, v);
+}
+
+/*
+ Puts the k, v in the immutable_property_alist_, which is convenient for
+ storing variables that are needed during the breaking process. (eg.
+ Line_of_score::rank : int )
+ */
+void
+Grob::set_immutable_grob_property (const char*k, SCM v)
+{
+ SCM s = ly_symbol2scm (k);
+ set_immutable_grob_property (s, v);
+}
+
+void
+Grob::set_immutable_grob_property (SCM s, SCM v)
+{
+ immutable_property_alist_ = gh_cons (gh_cons (s,v), mutable_property_alist_);
+ mutable_property_alist_ = scm_assq_remove_x (mutable_property_alist_, s);
+}
+void
+Grob::set_grob_property (SCM s, SCM v)
+{
+ mutable_property_alist_ = scm_assq_set_x (mutable_property_alist_, s, v);
+}
+
+
+MAKE_SCHEME_CALLBACK(Grob,molecule_extent,2);
+SCM
+Grob::molecule_extent (SCM element_smob, SCM scm_axis)
+{
+ Grob *s = unsmob_element (element_smob);
+ Axis a = (Axis) gh_scm2int (scm_axis);
+
+ Molecule *m = s->get_molecule ();
+ Interval e ;
+ if (m)
+ e = m->extent(a);
+ return ly_interval2scm ( e);
+}
+
+MAKE_SCHEME_CALLBACK(Grob,preset_extent,2);
+
+SCM
+Grob::preset_extent (SCM element_smob, SCM scm_axis)
+{
+ Grob *s = unsmob_element (element_smob);
+ Axis a = (Axis) gh_scm2int (scm_axis);
+
+ SCM ext = s->get_grob_property ((a == X_AXIS)
+ ? "extent-X"
+ : "extent-Y");
+
+ if (gh_pair_p (ext))
+ {
+ Real l = gh_scm2double (gh_car (ext));
+ Real r = gh_scm2double (gh_cdr (ext));
+ return ly_interval2scm (Interval (l, r));
+ }
+
+ return ly_interval2scm ( Interval ());
+}
+
+
+
+Paper_def*
+Grob::paper_l () const
+{
+ return pscore_l_ ? pscore_l_->paper_l_ : 0;
+}
+
+void
+Grob::calculate_dependencies (int final, int busy, SCM funcname)
+{
+ assert (status_i_ >=0);
+
+ if (status_i_ >= final)
+ return;
+
+ if (status_i_== busy)
+ {
+ programming_error ("Element is busy, come back later");
+ return;
+ }
+
+ status_i_= busy;
+
+ for (SCM d= get_grob_property ("dependencies"); gh_pair_p (d); d = gh_cdr (d))
+ {
+ unsmob_element (gh_car (d))
+ ->calculate_dependencies (final, busy, funcname);
+ }
+
+ // ughugh.
+ String s = ly_symbol2string (funcname);
+ SCM proc = get_grob_property (s.ch_C());
+ if (gh_procedure_p (proc))
+ gh_call1 (proc, this->self_scm ());
+
+ status_i_= final;
+
+}
+
+Molecule *
+Grob::get_molecule () const
+{
+ SCM mol = get_grob_property ("molecule");
+ if (unsmob_molecule (mol))
+ return unsmob_molecule (mol);
+
+ SCM proc = get_grob_property ("molecule-callback");
+
+ mol = SCM_EOL;
+ if (gh_procedure_p (proc))
+ mol = gh_apply (proc, gh_list (this->self_scm (), SCM_UNDEFINED));
+
+
+ Molecule *m = unsmob_molecule (mol);
+
+ if (unsmob_molecule (mol))
+ {
+ /*
+ TODO: add option for not copying origin info.
+ */
+ SCM origin =get_grob_property ("origin");
+ if (!unsmob_input (origin))
+ origin =ly_symbol2scm ("no-origin");
+
+
+ // ugr.
+
+ mol = Molecule (m->extent_box (),
+ gh_list (origin, m->get_expr (), SCM_UNDEFINED)
+ ). smobbed_copy ();
+
+ m = unsmob_molecule (mol);
+ }
+
+
+
+ /*
+ transparent retains dimensions of element.
+ */
+ if (m && to_boolean (get_grob_property ("transparent")))
+ mol = Molecule (m->extent_box (), SCM_EOL).smobbed_copy ();
+
+ Grob *me = (Grob*)this;
+ me->set_grob_property ("molecule", mol);
+
+ m = unsmob_molecule (mol);
+ return m;
+}
+
+
+/*
+
+ VIRTUAL STUBS
+
+ */
+void
+Grob::do_break_processing()
+{
+}
+
+
+
+
+
+
+Line_of_score *
+Grob::line_l() const
+{
+ return 0;
+}
+
+void
+Grob::add_dependency (Grob*e)
+{
+ if (e)
+ {
+ Pointer_group_interface ::add_element (this, "dependencies",e);
+
+ }
+ else
+ programming_error ("Null dependency added");
+}
+
+
+
+
+/**
+ Do break substitution in S, using CRITERION. Return new value.
+ CRITERION is either a SMOB pointer to the desired line, or a number
+ representing the break direction. Do not modify SRC.
+*/
+SCM
+Grob::handle_broken_smobs (SCM src, SCM criterion)
+{
+ again:
+ Grob *sc = unsmob_element (src);
+ if (sc)
+ {
+ if (gh_number_p (criterion))
+ {
+ Item * i = dynamic_cast<Item*> (sc);
+ Direction d = to_dir (criterion);
+ if (i && i->break_status_dir () != d)
+ {
+ Item *br = i->find_prebroken_piece (d);
+ return (br) ? br->self_scm () : SCM_UNDEFINED;
+ }
+ }
+ else
+ {
+ Line_of_score * line
+ = dynamic_cast<Line_of_score*> (unsmob_element (criterion));
+ if (sc->line_l () != line)
+ {
+ sc = sc->find_broken_piece (line);
+
+ }
+
+ /* now: !sc || (sc && sc->line_l () == line) */
+ if (!sc)
+ return SCM_UNDEFINED;
+
+ /* now: sc && sc->line_l () == line */
+ if (!line
+ || (sc->common_refpoint (line, X_AXIS)
+ && sc->common_refpoint (line, Y_AXIS)))
+ {
+ return sc->self_scm ();
+ }
+ return SCM_UNDEFINED;
+ }
+ }
+ else if (gh_pair_p (src))
+ {
+ SCM oldcar =gh_car (src);
+ /*
+ UGH! breaks on circular lists.
+ */
+ SCM newcar = handle_broken_smobs (oldcar, criterion);
+ SCM oldcdr = gh_cdr (src);
+
+ if (newcar == SCM_UNDEFINED
+ && (gh_pair_p (oldcdr) || oldcdr == SCM_EOL))
+ {
+ /*
+ This is tail-recursion, ie.
+
+ return handle_broken_smobs (cdr, criterion);
+
+ We don't want to rely on the compiler to do this. Without
+ tail-recursion, this easily crashes with a stack overflow. */
+ src = oldcdr;
+ goto again;
+ }
+
+ SCM newcdr = handle_broken_smobs (oldcdr, criterion);
+ return gh_cons (newcar, newcdr);
+ }
+ else
+ return src;
+
+ return src;
+}
+
+void
+Grob::handle_broken_dependencies()
+{
+ Spanner * s= dynamic_cast<Spanner*> (this);
+ if (original_l_ && s)
+ return;
+
+ if (s)
+ {
+ for (int i = 0; i< s->broken_into_l_arr_ .size (); i++)
+ {
+ Grob * sc = s->broken_into_l_arr_[i];
+ Line_of_score * l = sc->line_l ();
+ sc->mutable_property_alist_ =
+ handle_broken_smobs (mutable_property_alist_,
+ l ? l->self_scm () : SCM_UNDEFINED);
+ }
+ }
+
+
+ Line_of_score *line = line_l();
+
+ if (line && common_refpoint (line, X_AXIS) && common_refpoint (line, Y_AXIS))
+ {
+ mutable_property_alist_
+ = handle_broken_smobs (mutable_property_alist_,
+ line ? line->self_scm () : SCM_UNDEFINED);
+ }
+ else if (dynamic_cast <Line_of_score*> (this))
+ {
+ mutable_property_alist_ = handle_broken_smobs (mutable_property_alist_,
+ SCM_UNDEFINED);
+ }
+ else
+ {
+ /*
+ This element is `invalid'; it has been removed from all
+ dependencies, so let's junk the element itself.
+
+ do not do this for Line_of_score, since that would remove
+ references to the originals of score-elts, which get then GC'd
+ (a bad thing.)
+ */
+ suicide();
+ }
+}
+
+/*
+ Note that we still want references to this element to be
+ rearranged, and not silently thrown away, so we keep pointers
+ like {broken_into_{drul,array}, original}
+*/
+void
+Grob::suicide ()
+{
+ mutable_property_alist_ = SCM_EOL;
+ immutable_property_alist_ = SCM_EOL;
+
+ set_extent_callback (SCM_EOL, Y_AXIS);
+ set_extent_callback (SCM_EOL, X_AXIS);
+
+ for (int a= X_AXIS; a <= Y_AXIS; a++)
+ {
+ dim_cache_[a].offset_callbacks_ = SCM_EOL;
+ dim_cache_[a].offsets_left_ = 0;
+ }
+}
+
+void
+Grob::handle_prebroken_dependencies()
+{
+}
+
+Grob*
+Grob::find_broken_piece (Line_of_score*) const
+{
+ return 0;
+}
+
+void
+Grob::translate_axis (Real y, Axis a)
+{
+ if (isinf (y) || isnan (y))
+ programming_error (_(INFINITY_MSG));
+ else
+ {
+ dim_cache_[a].offset_ += y;
+ }
+}
+
+Real
+Grob::relative_coordinate (Grob const*refp, Axis a) const
+{
+ if (refp == this)
+ return 0.0;
+
+ /*
+ We catch PARENT_L_ == nil case with this, but we crash if we did
+ not ask for the absolute coordinate (ie. REFP == nil.)
+
+ */
+ if (refp == dim_cache_[a].parent_l_)
+ return get_offset (a);
+ else
+ return get_offset (a) + dim_cache_[a].parent_l_->relative_coordinate (refp, a);
+}
+
+Real
+Grob::get_offset (Axis a) const
+{
+ Grob *me = (Grob*) this;
+ while (dim_cache_[a].offsets_left_)
+ {
+ int l = --me->dim_cache_[a].offsets_left_;
+ SCM cb = scm_list_ref (dim_cache_[a].offset_callbacks_, gh_int2scm (l));
+ SCM retval = gh_call2 (cb, self_scm (), gh_int2scm (a));
+
+ Real r = gh_scm2double (retval);
+ if (isinf (r) || isnan (r))
+ {
+ programming_error (INFINITY_MSG);
+ r = 0.0;
+ }
+ me->dim_cache_[a].offset_ +=r;
+ }
+ return dim_cache_[a].offset_;
+}
+
+
+MAKE_SCHEME_CALLBACK(Grob,point_dimension_callback,2);
+SCM
+Grob::point_dimension_callback (SCM , SCM )
+{
+ return ly_interval2scm ( Interval (0,0));
+}
+
+bool
+Grob::empty_b (Axis a)const
+{
+ return ! (gh_pair_p (dim_cache_[a].dimension_ ) ||
+ gh_procedure_p (dim_cache_[a].dimension_ ));
+}
+
+/*
+ TODO: add
+
+ Grob *refpoint
+
+ to arguments?
+ */
+Interval
+Grob::extent (Grob * refp, Axis a) const
+{
+ Real x = relative_coordinate (refp, a);
+
+
+ Dimension_cache * d = (Dimension_cache *)&dim_cache_[a];
+ Interval ext ;
+ if (gh_pair_p (d->dimension_))
+ ;
+ else if (gh_procedure_p (d->dimension_))
+ {
+ /*
+ FIXME: add doco on types, and should typecheck maybe?
+ */
+ d->dimension_= gh_call2 (d->dimension_, self_scm(), gh_int2scm (a));
+ }
+ else
+ return ext;
+
+ if (!gh_pair_p (d->dimension_))
+ return ext;
+
+ ext = ly_scm2interval (d->dimension_);
+
+ SCM extra = get_grob_property (a == X_AXIS
+ ? "extra-extent-X"
+ : "extra-extent-Y");
+
+ /*
+ signs ?
+ */
+ if (gh_pair_p (extra))
+ {
+ ext[BIGGER] += gh_scm2double (gh_cdr (extra));
+ ext[SMALLER] += gh_scm2double (gh_car (extra));
+ }
+
+ extra = get_grob_property (a == X_AXIS
+ ? "minimum-extent-X"
+ : "minimum-extent-Y");
+ if (gh_pair_p (extra))
+ {
+ ext.unite (Interval (gh_scm2double (gh_car (extra)),
+ gh_scm2double (gh_cdr (extra))));
+ }
+
+ ext.translate (x);
+
+ return ext;
+}
+
+
+Grob*
+Grob::parent_l (Axis a) const
+{
+ return dim_cache_[a].parent_l_;
+}
+
+Grob *
+Grob::common_refpoint (Grob const* s, Axis a) const
+{
+ /*
+ I don't like the quadratic aspect of this code, but I see no other
+ way. The largest chain of parents might be 10 high or so, so
+ it shouldn't be a real issue. */
+ for (Grob const *c = this; c; c = c->dim_cache_[a].parent_l_)
+ for (Grob const * d = s; d; d = d->dim_cache_[a].parent_l_)
+ if (d == c)
+ return (Grob*)d;
+
+ return 0;
+}
+
+
+Grob *
+Grob::common_refpoint (SCM elist, Axis a) const
+{
+ Grob * common = (Grob*) this;
+ for (; gh_pair_p (elist); elist = gh_cdr (elist))
+ {
+ Grob * s = unsmob_element (gh_car (elist));
+ if (s)
+ common = common->common_refpoint (s, a);
+ }
+
+ return common;
+}
+
+String
+Grob::name () const
+{
+ SCM meta = get_grob_property ("meta");
+ SCM nm = scm_assoc (ly_symbol2scm ("name"), meta);
+ nm = (gh_pair_p (nm)) ? gh_cdr (nm) : SCM_EOL;
+ return gh_string_p (nm) ?ly_scm2string (nm) : classname (this);
+}
+
+void
+Grob::add_offset_callback (SCM cb, Axis a)
+{
+ if (!has_offset_callback_b (cb, a))
+ {
+ dim_cache_[a].offset_callbacks_ = gh_cons (cb, dim_cache_[a].offset_callbacks_ );
+ dim_cache_[a].offsets_left_ ++;
+ }
+}
+
+bool
+Grob::has_extent_callback_b (SCM cb, Axis a)const
+{
+ return scm_equal_p (cb, dim_cache_[a].dimension_);
+}
+
+
+bool
+Grob::has_extent_callback_b (Axis a) const
+{
+ return gh_procedure_p (dim_cache_[a].dimension_);
+}
+
+bool
+Grob::has_offset_callback_b (SCM cb, Axis a)const
+{
+ return scm_memq (cb, dim_cache_[a].offset_callbacks_) != SCM_BOOL_F;
+}
+
+void
+Grob::set_extent_callback (SCM dc, Axis a)
+{
+ dim_cache_[a].dimension_ =dc;
+}
+
+void
+Grob::set_parent (Grob *g, Axis a)
+{
+ dim_cache_[a].parent_l_ = g;
+}
+
+MAKE_SCHEME_CALLBACK(Grob,fixup_refpoint,1);
+SCM
+Grob::fixup_refpoint (SCM smob)
+{
+ Grob *me = unsmob_element (smob);
+ for (int a = X_AXIS; a < NO_AXES; a ++)
+ {
+ Axis ax = (Axis)a;
+ Grob * parent = me->parent_l (ax);
+
+ if (!parent)
+ continue;
+
+ if (parent->line_l () != me->line_l () && me->line_l ())
+ {
+ Grob * newparent = parent->find_broken_piece (me->line_l ());
+ me->set_parent (newparent, ax);
+ }
+
+ if (Item * i = dynamic_cast<Item*> (me))
+ {
+ Item *parenti = dynamic_cast<Item*> (parent);
+
+ if (parenti && i)
+ {
+ Direction my_dir = i->break_status_dir () ;
+ if (my_dir!= parenti->break_status_dir())
+ {
+ Item *newparent = parenti->find_prebroken_piece (my_dir);
+ me->set_parent (newparent, ax);
+ }
+ }
+ }
+ }
+ return smob;
+}
+
+
+
+/****************************************************
+ SMOB funcs
+ ****************************************************/
+
+
+IMPLEMENT_UNSMOB(Grob, element);
+IMPLEMENT_SMOBS(Grob);
+IMPLEMENT_DEFAULT_EQUAL_P(Grob);
+
+SCM
+Grob::mark_smob (SCM ses)
+{
+ Grob * s = (Grob*) SCM_CELL_WORD_1(ses);
+ scm_gc_mark (s->immutable_property_alist_);
+ scm_gc_mark (s->mutable_property_alist_);
+
+ for (int a =0 ; a < 2; a++)
+ {
+ scm_gc_mark (s->dim_cache_[a].offset_callbacks_);
+ scm_gc_mark (s->dim_cache_[a].dimension_);
+ }
+
+ if (s->parent_l (Y_AXIS))
+ scm_gc_mark (s->parent_l (Y_AXIS)->self_scm ());
+ if (s->parent_l (X_AXIS))
+ scm_gc_mark (s->parent_l (X_AXIS)->self_scm ());
+
+ if (s->original_l_)
+ scm_gc_mark (s->original_l_->self_scm ());
+ return s->do_derived_mark ();
+}
+
+int
+Grob::print_smob (SCM s, SCM port, scm_print_state *)
+{
+ Grob *sc = (Grob *) gh_cdr (s);
+
+ scm_puts ("#<Grob ", port);
+ scm_puts ((char *)sc->name ().ch_C(), port);
+
+ /*
+ don't try to print properties, that is too much hassle.
+ */
+ scm_puts (" >", port);
+ return 1;
+}
+
+SCM
+Grob::do_derived_mark ()
+{
+ return SCM_EOL;
+}
+
+
+SCM
+ly_set_grob_property (SCM elt, SCM sym, SCM val)
+{
+ Grob * sc = unsmob_element (elt);
+
+ if (!gh_symbol_p (sym))
+ {
+ error ("Not a symbol");
+ ly_display_scm (sym);
+ return SCM_UNSPECIFIED;
+ }
+
+ if (sc)
+ {
+ sc->set_grob_property (sym, val);
+ }
+ else
+ {
+ error ("Not a score element");
+ ly_display_scm (elt);
+ }
+
+ return SCM_UNSPECIFIED;
+}
+
+
+SCM
+ly_get_grob_property (SCM elt, SCM sym)
+{
+ Grob * sc = unsmob_element (elt);
+
+ if (sc)
+ {
+ return sc->get_grob_property (sym);
+ }
+ else
+ {
+ error ("Not a score element");
+ ly_display_scm (elt);
+ }
+ return SCM_UNSPECIFIED;
+}
+
+
+void
+Grob::discretionary_processing()
+{
+}
+
+
+
+SCM
+spanner_get_bound (SCM slur, SCM dir)
+{
+ return dynamic_cast<Spanner*> (unsmob_element (slur))->get_bound (to_dir (dir))->self_scm ();
+}
+
+
+
+static SCM interfaces_sym;
+static void
+init_functions ()
+{
+ interfaces_sym = scm_permanent_object (ly_symbol2scm ("interfaces"));
+
+ scm_make_gsubr ("ly-get-elt-property", 2, 0, 0, (Scheme_function_unknown)ly_get_grob_property);
+ scm_make_gsubr ("ly-set-elt-property", 3, 0, 0, (Scheme_function_unknown)ly_set_grob_property);
+ scm_make_gsubr ("ly-get-spanner-bound", 2 , 0, 0, (Scheme_function_unknown) spanner_get_bound);
+}
+
+bool
+Grob::has_interface (SCM k)
+{
+ SCM ifs = get_grob_property (interfaces_sym);
+
+ return scm_memq (k, ifs) != SCM_BOOL_F;
+}
+
+void
+Grob::set_interface (SCM k)
+{
+ if (has_interface (k))
+ return ;
+ else
+ {
+ set_grob_property (interfaces_sym,
+ gh_cons (k, get_grob_property (interfaces_sym)));
+ }
+}
+
+
+ADD_SCM_INIT_FUNC(scoreelt, init_functions);
+IMPLEMENT_TYPE_P(Grob, "ly-grob?");
*/
#include "group-interface.hh"
-#include "score-element.hh"
+#include "grob.hh"
void
-Group_interface::add_thing (Score_element*me, String name, SCM s)
+Group_interface::add_thing (Grob*me, String name, SCM s)
{
- me->set_elt_property (name.ch_C (),
- gh_cons (s, me->get_elt_property (name.ch_C())));
+ me->set_grob_property (name.ch_C (),
+ gh_cons (s, me->get_grob_property (name.ch_C())));
}
int
-Group_interface::count (Score_element *me, String name)
+Group_interface::count (Grob *me, String name)
{
- return scm_ilength (me->get_elt_property (name.ch_C()));
+ return scm_ilength (me->get_grob_property (name.ch_C()));
}
void
-Pointer_group_interface::add_element (Score_element*me, String name, Score_element*p)
+Pointer_group_interface::add_element (Grob*me, String name, Grob*p)
{
Group_interface::add_thing (me, name, p->self_scm());
}
SCM
Hara_kiri_group_spanner::y_extent (SCM element_smob, SCM scm_axis)
{
- Score_element *me = unsmob_element (element_smob);
+ Grob *me = unsmob_element (element_smob);
Axis a = (Axis) gh_scm2int (scm_axis);
assert (a == Y_AXIS);
void
-Hara_kiri_group_spanner::consider_suicide(Score_element*me)
+Hara_kiri_group_spanner::consider_suicide(Grob*me)
{
- SCM worth = me->get_elt_property ("items-worth-living");
+ SCM worth = me->get_grob_property ("items-worth-living");
if (gh_pair_p (worth))
return ;
- Link_array<Score_element> childs = Axis_group_interface::get_children (me);
+ Link_array<Grob> childs = Axis_group_interface::get_children (me);
for (int i = 0; i < childs.size (); i++)
childs[i]->suicide ();
SCM
Hara_kiri_group_spanner::force_hara_kiri_callback (SCM element_smob, SCM axis)
{
- Score_element *me = unsmob_element (element_smob);
+ Grob *me = unsmob_element (element_smob);
Axis a = (Axis) gh_scm2int (axis);
assert (a == Y_AXIS);
consider_suicide (me);
SCM
Hara_kiri_group_spanner::force_hara_kiri_in_parent_callback (SCM element_smob, SCM axis)
{
- Score_element *daughter = unsmob_element (element_smob);
+ Grob *daughter = unsmob_element (element_smob);
Axis a = (Axis) gh_scm2int (axis);
assert (a == Y_AXIS);
force_hara_kiri_callback (daughter->parent_l (a)->self_scm (), axis);
}
void
-Hara_kiri_group_spanner::add_element (Score_element * me, Score_element *e)
+Hara_kiri_group_spanner::add_element (Grob * me, Grob *e)
{
// e->add_offset_callback (force_hara_kiri_in_parent_callback, Y_AXIS);
Axis_group_interface::add_element (me, e);
void
-Hara_kiri_group_spanner::set_interface (Score_element*me)
+Hara_kiri_group_spanner::set_interface (Grob*me)
{
me->set_interface (ly_symbol2scm ("hara-kiri-group-interface"));
}
bool
-Hara_kiri_group_spanner::has_interface (Score_element*me)
+Hara_kiri_group_spanner::has_interface (Grob*me)
{
return me->has_interface (ly_symbol2scm ("hara-kiri-group-interface"));
}
void
-Hara_kiri_group_spanner::add_interesting_item (Score_element* me,Score_element* n)
+Hara_kiri_group_spanner::add_interesting_item (Grob* me,Grob* n)
{
me->add_dependency (n);
Pointer_group_interface::add_element (me, "items-worth-living",n);
then. */
class Hyphen_engraver : public Engraver
{
- Score_element *last_lyric_l_;
- Score_element *current_lyric_l_;
+ Grob *last_lyric_l_;
+ Grob *current_lyric_l_;
Hyphen_req* req_l_;
Spanner* hyphen_p_;
public:
VIRTUAL_COPY_CONS (Translator);
protected:
- virtual void acknowledge_element (Score_element_info);
+ virtual void acknowledge_grob (Grob_info);
virtual void do_removal_processing();
void deprecated_process_music();
- virtual bool do_try_music (Music*);
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing ();
- virtual void process_acknowledged ();
+ virtual bool try_music (Music*);
+ virtual void stop_translation_timestep();
+ virtual void start_translation_timestep ();
+ virtual void create_grobs ();
private:
};
}
void
-Hyphen_engraver::acknowledge_element (Score_element_info i)
+Hyphen_engraver::acknowledge_grob (Grob_info i)
{
// -> text-item
if (i.elem_l_->has_interface (ly_symbol2scm ("lyric-syllable-interface")))
bool
-Hyphen_engraver::do_try_music (Music* r)
+Hyphen_engraver::try_music (Music* r)
{
if (Hyphen_req* p = dynamic_cast <Hyphen_req *> (r))
{
}
void
-Hyphen_engraver::process_acknowledged ()
+Hyphen_engraver::create_grobs ()
{
deprecated_process_music ();
}
hyphen_p_ = new Spanner (get_property ("LyricHyphen"));
Hyphen_spanner (hyphen_p_).set_textitem (LEFT, last_lyric_l_);
- announce_element (hyphen_p_, req_l_);
+ announce_grob (hyphen_p_, req_l_);
}
}
void
-Hyphen_engraver::do_pre_move_processing ()
+Hyphen_engraver::stop_translation_timestep ()
{
if (hyphen_p_)
{
- typeset_element (hyphen_p_);
+ typeset_grob (hyphen_p_);
hyphen_p_ = 0;
}
}
void
-Hyphen_engraver::do_post_move_processing ()
+Hyphen_engraver::start_translation_timestep ()
{
req_l_ = 0;
}
{
Spanner * sp = dynamic_cast<Spanner*> (unsmob_element (smob));
- Score_element * common = sp;
+ Grob * common = sp;
Direction d = LEFT;
do
{
while (flip (&d) != LEFT);
Real lt = sp->paper_l ()->get_var ("stafflinethickness");
- Real th = gh_scm2double (sp->get_elt_property ("thickness")) * lt ;
- Real h = gh_scm2double (sp->get_elt_property ("height"));
- Real l = gh_scm2double (sp->get_elt_property ("minimum-length"));
+ Real th = gh_scm2double (sp->get_grob_property ("thickness")) * lt ;
+ Real h = gh_scm2double (sp->get_grob_property ("height"));
+ Real l = gh_scm2double (sp->get_grob_property ("minimum-length"));
// The hyphen can exist in the word space of the left lyric ...
- SCM space = sp->get_bound (LEFT)->get_elt_property ("word-space");
+ SCM space = sp->get_bound (LEFT)->get_grob_property ("word-space");
if (gh_number_p (space))
{
bounds[LEFT] -= gh_scm2double (space);
}
void
-Hyphen_spanner::set_textitem (Direction d, Score_element* b)
+Hyphen_spanner::set_textitem (Direction d, Grob* b)
{
elt_l_->set_bound (d, b);
elt_l_->add_dependency (b);
struct Align_interface {
DECLARE_SCHEME_CALLBACK(alignment_callback, (SCM element, SCM axis));
- static void do_side_processing (Score_element*,Axis a);
- static void set_axis (Score_element*,Axis);
- static Axis axis (Score_element*) ;
- static void add_element (Score_element*,Score_element*);
- static int get_count (Score_element*,Score_element*);
- static void set_interface (Score_element*);
- static bool has_interface (Score_element*);
+ static void do_side_processing (Grob*,Axis a);
+ static void set_axis (Grob*,Axis);
+ static Axis axis (Grob*) ;
+ static void add_element (Grob*,Grob*);
+ static int get_count (Grob*,Grob*);
+ static void set_interface (Grob*);
+ static bool has_interface (Grob*);
DECLARE_SCHEME_CALLBACK(center_on_element, (SCM element, SCM axis));
};
public:
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
DECLARE_SCHEME_CALLBACK(width_callback, (SCM,SCM));
- static bool has_interface (Score_element*);
+ static bool has_interface (Grob*);
};
#endif /* ARPEGGIO_HH */
struct Axis_group_interface
{
DECLARE_SCHEME_CALLBACK(group_extent_callback, (SCM smob, SCM axis));
- static Interval relative_group_extent (Axis, Score_element * common, SCM list);
+ static Interval relative_group_extent (Axis, Grob * common, SCM list);
- static void add_element (Score_element* me, Score_element*);
- static void set_axes (Score_element*,Axis,Axis);
- static bool axis_b (Score_element*,Axis);
- static Link_array<Score_element> get_children (Score_element*);
- static bool has_interface (Score_element*);
- static void set_interface (Score_element*);
+ static void add_element (Grob* me, Grob*);
+ static void set_axes (Grob*,Axis,Axis);
+ static bool axis_b (Grob*,Axis);
+ static Link_array<Grob> get_children (Grob*);
+ static bool has_interface (Grob*);
+ static void set_interface (Grob*);
};
Bar_req* bar_req_l_;
public:
VIRTUAL_COPY_CONS(Translator);
- void do_post_move_processing ();
- bool do_try_music (Music *);
+ void start_translation_timestep ();
+ bool try_music (Music *);
};
class Bar
{
public:
- static bool has_interface (Score_element*);
- static void set_interface (Score_element*);
- static Molecule compound_barline (Score_element*, String, Real height) ;
- static Molecule simple_barline (Score_element*, Real wid, Real height) ;
+ static bool has_interface (Grob*);
+ static void set_interface (Grob*);
+ static Molecule compound_barline (Grob*, String, Real height) ;
+ static Molecule simple_barline (Grob*, Real wid, Real height) ;
DECLARE_SCHEME_CALLBACK(get_staff_bar_size, (SCM ));
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM ));
class Beam
{
public:
- static int visible_stem_count (Score_element*);
- static Item* first_visible_stem (Score_element*);
- static Item* last_visible_stem (Score_element*);
- static bool has_interface (Score_element*);
- static void set_interface (Score_element*);
+ static int visible_stem_count (Grob*);
+ static Item* first_visible_stem (Grob*);
+ static Item* last_visible_stem (Grob*);
+ static bool has_interface (Grob*);
+ static void set_interface (Grob*);
DECLARE_SCHEME_CALLBACK(rest_collision_callback, (SCM element, SCM axis));
Beam (SCM);
- static void add_stem (Score_element*,Score_element*);
- static void set_beaming (Score_element*,Beaming_info_list *);
- static void set_stemlens (Score_element*);
- static int get_multiplicity (Score_element*me);
+ static void add_stem (Grob*,Grob*);
+ static void set_beaming (Grob*,Beaming_info_list *);
+ static void set_stemlens (Grob*);
+ static int get_multiplicity (Grob*me);
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM ));
DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM ));
- static Molecule stem_beams (Score_element*,Item *here, Item *next, Item *prev);
+ static Molecule stem_beams (Grob*,Item *here, Item *next, Item *prev);
private:
- static Direction get_default_dir (Score_element*);
- static void set_stem_directions (Score_element*);
- static void auto_knees (Score_element*);
- static bool auto_knee (Score_element*,String gap_str, bool interstaff_b);
- static void set_stem_shorten (Score_element*);
- static void calc_default_position_and_height (Score_element*,Real* y, Real* dy);
- static bool suspect_slope_b (Score_element*, Real y, Real dy);
- static Real calc_slope_damping_f (Score_element*, Real dy);
- static Real calc_stem_y_f (Score_element*, Item* s, Real y, Real dy);
- static Real check_stem_length_f (Score_element*, Real y, Real dy);
- static void set_stem_length (Score_element*, Real y, Real dy);
- static Real quantise_dy_f (Score_element*, Real dy);
- static Real quantise_y_f (Score_element*, Real y, Real dy, int quant_dir);
- static int forced_stem_count (Score_element*);
+ static Direction get_default_dir (Grob*);
+ static void set_stem_directions (Grob*);
+ static void auto_knees (Grob*);
+ static bool auto_knee (Grob*,String gap_str, bool interstaff_b);
+ static void set_stem_shorten (Grob*);
+ static void calc_default_position_and_height (Grob*,Real* y, Real* dy);
+ static bool suspect_slope_b (Grob*, Real y, Real dy);
+ static Real calc_slope_damping_f (Grob*, Real dy);
+ static Real calc_stem_y_f (Grob*, Item* s, Real y, Real dy);
+ static Real check_stem_length_f (Grob*, Real y, Real dy);
+ static void set_stem_length (Grob*, Real y, Real dy);
+ static Real quantise_dy_f (Grob*, Real dy);
+ static Real quantise_y_f (Grob*, Real y, Real dy, int quant_dir);
+ static int forced_stem_count (Grob*);
};
#endif // BEAM_HH
Real linewidth_f_;
/// search all pcols which are breakable.
- Link_array<Score_element> find_breaks() const;
+ Link_array<Grob> find_breaks() const;
Array<int> find_break_indices() const;
void solve_line (Column_x_positions*) const;
/// does curline fit on the paper?
- bool feasible (Link_array<Score_element>) const;
+ bool feasible (Link_array<Grob>) const;
- Simple_spacer* generate_spacing_problem (Link_array<Score_element>, Interval) const;
+ Simple_spacer* generate_spacing_problem (Link_array<Grob>, Interval) const;
virtual Array<Column_x_positions> do_solve() const=0;
{
public:
DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM ));
- static void do_alignment (Score_element*);
- static void set_interface (Score_element*);
- static bool has_interface (Score_element*);
- static void add_element (Score_element*me, Score_element*add);
+ static void do_alignment (Grob*);
+ static void set_interface (Grob*);
+ static bool has_interface (Grob*);
+ static void add_element (Grob*me, Grob*add);
DECLARE_SCHEME_CALLBACK(alignment_callback, (SCM element, SCM axis));
DECLARE_SCHEME_CALLBACK(self_align_callback, (SCM element, SCM axis));
};
public:
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
DECLARE_SCHEME_CALLBACK(offset_callback, (SCM element, SCM axis));
- static void set_interface (Score_element*);
- static bool has_interface (Score_element*);
+ static void set_interface (Grob*);
+ static bool has_interface (Grob*);
};
#endif // BREATHING_SIGN_HH
{
DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM ));
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
- static bool has_interface (Score_element*);
- static void set_interface (Score_element*);
+ static bool has_interface (Grob*);
+ static void set_interface (Grob*);
};
class Collision // interface
{
public:
- static SCM automatic_shift (Score_element*);
- static SCM forced_shift (Score_element*);
+ static SCM automatic_shift (Grob*);
+ static SCM forced_shift (Grob*);
DECLARE_SCHEME_CALLBACK(force_shift_callback, (SCM element, SCM axis));
- static void do_shifts (Score_element*);
- static void add_column (Score_element*me,Score_element*ncol_l);
+ static void do_shifts (Grob*);
+ static void add_column (Grob*me,Grob*ncol_l);
};
#endif // COLLISION_HH
struct Column_x_positions
{
- Link_array<Score_element> cols_;
+ Link_array<Grob> cols_;
Array<Real> config_;
Real force_f_;
bool satisfies_constraints_b_;
{
public:
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
- static bool has_interface (Score_element*);
+ static bool has_interface (Grob*);
};
#endif // CRESCENDO_HH
struct Custos
{
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
- static bool has_interface (Score_element*);
+ static bool has_interface (Grob*);
};
#endif // CUSTOS_HH
#define DIMENSION_CACHE_CALLBACK_HH
-typedef Interval (*Dim_cache_callback)(Score_element *,Axis);
-typedef Real (*Offset_callback)(Score_element *,Axis);
+typedef Interval (*Dim_cache_callback)(Grob *,Axis);
+typedef Real (*Offset_callback)(Grob *,Axis);
#endif /* DIMENSION_CACHE_CALLBACK_HH */
/**
What to call to find extent. Nil means empty.
*/
- Score_element * parent_l_;
+ Grob * parent_l_;
Dimension_cache(Dimension_cache const&);
Dimension_cache ();
#ifndef DIRECTIONAL_ELEMENT_HH
#define DIRECTIONAL_ELEMENT_HH
-#include "score-element.hh"
+#include "grob.hh"
struct Directional_element_interface
{
public:
static SCM direction_sym ;
- static void set (Score_element*,Direction d);
- static Direction get (Score_element*) ;
- static bool has_interface (Score_element*) ;
+ static void set (Grob*,Direction d);
+ static Direction get (Grob*) ;
+ static bool has_interface (Grob*) ;
};
class Dot_column // interface
{
public:
- static int compare (Score_element * const&,Score_element * const&);
- static void add_head (Score_element * dotcol, Score_element* rh );
- static void set_interface (Score_element*);
- static bool has_interface (Score_element*);
+ static int compare (Grob * const&,Grob * const&);
+ static void add_head (Grob * dotcol, Grob* rh );
+ static void set_interface (Grob*);
+ static bool has_interface (Grob*);
DECLARE_SCHEME_CALLBACK(force_shift_callback, (SCM ,SCM));
static SCM do_shifts (SCM dotlist);
};
#include "lily-proto.hh"
#include "parray.hh"
-#include "score-element-info.hh"
+#include "grob-info.hh"
#include "engraver.hh"
#include "translator-group.hh"
public virtual Translator_group
{
protected:
- Array<Score_element_info> announce_info_arr_;
+ Array<Grob_info> announce_info_arr_;
VIRTUAL_COPY_CONS(Translator);
virtual void do_announces();
- virtual void announce_element (Score_element_info);
-
+ virtual void announce_grob (Grob_info);
+ virtual void process_music ();
private:
- void process_acknowledged ();
- void acknowledge_elements ();
+ void create_grobs ();
+ void acknowledge_grobs ();
};
#endif // ENGRAVERGROUP_HH
#include "lily-proto.hh"
#include "array.hh"
#include "request.hh"
-#include "score-element-info.hh"
+#include "grob-info.hh"
#include "translator.hh"
/**
- a struct which processes requests, and creates the #Score_element#s.
+ a struct which processes requests, and creates the #Grob#s.
It may use derived classes.
*/
class Engraver : public virtual Translator {
friend class Engraver_group_engraver;
protected:
/// utility
- Paper_def * paper_l() const;
+ // Paper_def * paper_l() const;
/*
Call this last thing.
*/
- virtual void typeset_element (Score_element*elem_p);
+ virtual void typeset_grob (Grob*elem_p);
/*
take note of item/spanner
put item in spanner. Adjust local key; etc.
Default: ignore the info
*/
- virtual void acknowledge_element (Score_element_info) {}
+ virtual void acknowledge_grob (Grob_info) {}
- /** Do things with stuff found in acknowledge_element. Ugh. Should
- be looped with acknowledge_element.
+ /** Do things with stuff found in acknowledge_grob. Ugh. Should
+ be looped with acknowledge_grob.
*/
- virtual void process_acknowledged () {}
+ virtual void create_grobs () {}
/**
Announce element. Default: pass on to daddy. Utility
*/
- virtual void announce_element (Score_element*, Music*);
- virtual void announce_element (Score_element_info);
+ virtual void announce_grob (Grob*, Music*);
+ virtual void announce_grob (Grob_info);
+ virtual void process_music ();
public:
VIRTUAL_COPY_CONS(Translator);
Engraver_group_engraver * daddy_grav_l() const;
struct Font_interface
{
- static SCM font_alist_chain (Score_element*);
- static Font_metric * get_font (Score_element*, SCM alist_chain);
- static Font_metric * get_default_font (Score_element*);
- static SCM add_style (Score_element*, SCM style, SCM alist_chain);
+ static SCM font_alist_chain (Grob*);
+ static Font_metric * get_font (Grob*, SCM alist_chain);
+ static Font_metric * get_default_font (Grob*);
+ static SCM add_style (Grob*, SCM style, SCM alist_chain);
DECLARE_SCHEME_CALLBACK(properties_to_font_name, (SCM,SCM));
};
class Grace_align_item
{
public:
- static void set_interface (Score_element*);
- static bool has_interface (Score_element*);
+ static void set_interface (Grob*);
+ static bool has_interface (Grob*);
DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM ));
};
#endif /* GRACE_ALIGN_ITEM_HH */
class Grace_engraver_group : public Engraver_group_engraver, public Global_translator
{
- Link_array<Score_element> typeset_us_;
- Array<Score_element_info> announce_to_top_;
+ Link_array<Grob> typeset_us_;
+ Array<Grob_info> announce_to_top_;
bool calling_self_b_;
bool pass_to_top_b (Music *) const;
public:
VIRTUAL_COPY_CONS(Translator);
Grace_engraver_group ();
protected:
- virtual void announce_element (Score_element_info);
+ virtual void do_creation_processing ();
+ virtual void announce_grob (Grob_info);
virtual void start ();
virtual void finish ();
virtual void process ();
virtual void each (Method_pointer);
virtual void do_removal_processing () ;
- virtual void typeset_element (Score_element*);
- virtual bool do_try_music (Music *m);
+ virtual void typeset_grob (Grob*);
+ virtual bool try_music (Music *m);
};
virtual void each (Method_pointer);
virtual void do_removal_processing () ;
virtual void play_element (Audio_element*);
- virtual bool do_try_music (Music *m);
+ virtual bool try_music (Music *m);
};
--- /dev/null
+/*
+ grob-info.hh -- declare Grob_info
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#ifndef STAFFELEMINFO_HH
+#define STAFFELEMINFO_HH
+
+#include "lily-proto.hh"
+#include "parray.hh"
+
+/**
+ Data container for broadcasts.
+
+ TODO: Store this in element info!
+ */
+struct Grob_info {
+ Translator * origin_trans_l_;
+ friend Engraver;
+public:
+ Link_array<Translator> origin_trans_l_arr (Translator*) const;
+ Grob * elem_l_;
+ Music *req_l_;
+
+
+ Grob_info (Grob*, Music*);
+ Grob_info();
+};
+
+
+#endif // STAFFELEMINFO_HH
--- /dev/null
+/*
+ grob.hh -- declare Grob
+
+ (c) 1996-1999--2000 Han-Wen Nienhuys
+*/
+
+#ifndef STAFFELEM_HH
+#define STAFFELEM_HH
+
+#include "parray.hh"
+#include "virtual-methods.hh"
+#include "lily-guile.hh"
+#include "lily-proto.hh"
+#include "smobs.hh"
+#include "dimension-cache.hh"
+
+/**
+ for administration of what was done already
+ */
+enum Grob_status {
+ ORPHAN=0, // not yet added to Paper_score
+ VIRGIN,
+ PRECALCING,
+ PRECALCED, // calcs before spacing done
+ POSTCALCING, // busy calculating. This is used to trap cyclic deps.
+ POSTCALCED, // after spacing calcs done
+};
+
+typedef void (Grob::*Grob_method_pointer) (void);
+
+/*
+ Basic output object.
+*/
+class Grob {
+public:
+ SCM immutable_property_alist_;
+
+ // rename me to ``property_alist_''
+ SCM mutable_property_alist_;
+
+ Grob *original_l_;
+
+ /**
+ Administration: Where are we?. This is mainly used by Super_element and
+ Grob::calcalute_dependencies ()
+
+ 0 means ORPHAN,
+ */
+ char status_i_;
+ String name () const;
+
+ /*
+ IDEA: make this a global variable. This is the same for all
+ elements, I think it is safe to assume that we will not have
+ scores being formatted multithreadedly.
+ */
+ Paper_score *pscore_l_;
+
+ Grob (SCM basic_props);
+ Grob (Grob const&);
+
+ /*
+ properties
+ */
+ SCM get_grob_property (const char*) const;
+ SCM get_grob_property (SCM) const;
+ void set_grob_property (const char * , SCM val);
+ void set_immutable_grob_property (const char * , SCM val);
+ void set_immutable_grob_property (SCM key, SCM val);
+ void set_grob_property (SCM , SCM val);
+ void set_elt_pointer (const char*, SCM val);
+ friend class Property_engraver; // UGHUGHUGH.
+ SCM remove_grob_property (const char* nm);
+
+ /*
+ related classes.
+ */
+ Paper_def *paper_l () const;
+
+ /**
+ add a dependency. It may be the 0 pointer, in which case, it is ignored.
+ */
+ void add_dependency (Grob*);
+ virtual Line_of_score * line_l () const;
+ bool linked_b () const;
+
+
+ VIRTUAL_COPY_CONS(Grob);
+
+ /**
+ Recursively track all dependencies of this Grob. The
+ status_i_ field is used as a mark-field. It is marked with
+ #busy# during execution of this function, and marked with #final#
+ when finished.
+
+ #funcptr# is the function to call to update this element.
+ */
+ void calculate_dependencies (int final, int busy, SCM funcname);
+ static SCM handle_broken_smobs (SCM, SCM criterion);
+
+ virtual void do_break_processing ();
+ virtual Grob *find_broken_piece (Line_of_score*) const;
+ virtual void discretionary_processing ();
+ virtual SCM do_derived_mark ();
+
+ Molecule * get_molecule () const;
+ void suicide ();
+
+ DECLARE_SCHEME_CALLBACK(preset_extent, (SCM smob, SCM axis));
+ DECLARE_SCHEME_CALLBACK(point_dimension_callback, (SCM smob, SCM axis));
+ DECLARE_SCHEME_CALLBACK(molecule_extent, (SCM smob, SCM axis));
+
+
+ static SCM ly_set_grob_property (SCM, SCM,SCM);
+ static SCM ly_get_grob_property (SCM, SCM);
+
+ bool has_interface (SCM intf);
+ void set_interface (SCM intf);
+
+ virtual void handle_broken_dependencies ();
+ virtual void handle_prebroken_dependencies ();
+
+
+ DECLARE_SMOBS(Grob,foo);
+
+ void init ();
+
+ Dimension_cache dim_cache_[NO_AXES];
+
+public:
+ bool empty_b (Axis a) const;
+
+ Interval extent (Grob * refpoint, Axis) const;
+
+ /**
+ translate in one direction
+ */
+
+ void translate_axis (Real, Axis);
+
+ /**
+ Find the offset relative to D. If D equals THIS, then it is 0.
+ Otherwise, it recursively defd as
+
+ OFFSET_ + PARENT_L_->relative_coordinate (D)
+ */
+ Real relative_coordinate (Grob const* refp, Axis) const;
+ /**
+ Find the group-element which has both #this# and #s#
+ */
+ Grob*common_refpoint (Grob const* s, Axis a) const;
+ Grob*common_refpoint (SCM elt_list, Axis a) const;
+
+ // duh. slim down interface here. (todo)
+ bool has_offset_callback_b (SCM callback, Axis)const;
+ void add_offset_callback (SCM callback, Axis);
+ bool has_extent_callback_b (SCM, Axis)const;
+ void set_extent_callback (SCM , Axis);
+ bool has_extent_callback_b (Axis) const;
+
+
+ /**
+ Invoke callbacks to get offset relative to parent.
+ */
+ Real get_offset (Axis a) const;
+ /**
+ Set the parent refpoint of THIS to E
+ */
+ void set_parent (Grob* e, Axis);
+
+ Grob *parent_l (Axis a) const;
+ DECLARE_SCHEME_CALLBACK(fixup_refpoint, (SCM));
+};
+
+Grob * unsmob_element (SCM);
+
+#endif // STAFFELEM_HH
+
/**
Look at Score element ELT as thing which has a list property called
- NAME_. Normally the list would contain Score_elements, but
+ NAME_. Normally the list would contain Grobs, but
sometimes it can be different things.
todo: reename as list_interface?
struct Group_interface
{
public:
- static int count (Score_element* , String);
- static void add_thing (Score_element*, String nm, SCM);
+ static int count (Grob* , String);
+ static void add_thing (Grob*, String nm, SCM);
};
struct Pointer_group_interface : public Group_interface {
public:
- static void add_element (Score_element*, String nm, Score_element*e);
+ static void add_element (Grob*, String nm, Grob*e);
};
/**
Put all score elements of ELT's property called NAME into an array,
and return it. */
template<class T>
Link_array<T>
-Pointer_group_interface__extract_elements (Score_element const *elt, T *, const char* name)
+Pointer_group_interface__extract_elements (Grob const *elt, T *, const char* name)
{
Link_array<T> arr;
- for (SCM s = elt->get_elt_property (name); gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = elt->get_grob_property (name); gh_pair_p (s); s = gh_cdr (s))
{
SCM e = gh_car (s);
arr.push (dynamic_cast<T*> (unsmob_element (e)));
DECLARE_SCHEME_CALLBACK(force_hara_kiri_callback, (SCM ,SCM));
DECLARE_SCHEME_CALLBACK(y_extent, (SCM smob, SCM axis));
DECLARE_SCHEME_CALLBACK(force_hara_kiri_in_parent_callback, (SCM ,SCM));
- static void add_element (Score_element *me, Score_element *e);
- static void set_interface (Score_element*me);
- static bool has_interface (Score_element*);
- static void consider_suicide (Score_element*me);
- static void add_interesting_item (Score_element * me , Score_element* n);
+ static void add_element (Grob *me, Grob *e);
+ static void set_interface (Grob*me);
+ static bool has_interface (Grob*);
+ static void consider_suicide (Grob*me);
+ static void add_interesting_item (Grob * me , Grob* n);
};
protected:
virtual void create_line_spanner ();
- void typeset_element (Score_element*);
+ void typeset_grob (Grob*);
};
public:
Spanner* elt_l_;
Hyphen_spanner (Spanner*);
- void set_textitem (Direction, Score_element*);
+ void set_textitem (Direction, Grob*);
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
};
#include "box.hh"
-#include "score-element.hh"
+#include "grob.hh"
#include "drul-array.hh"
#include "protected-scm.hh"
before the spacing is calculated
*/
-class Item : public Score_element
+class Item : public Grob
{
Drul_array<Item*> broken_to_drul_;
public:
- VIRTUAL_COPY_CONS(Score_element);
+ VIRTUAL_COPY_CONS(Grob);
Item (SCM);
Item (Item const &);
- static bool breakable_b (Score_element*me);
+ static bool breakable_b (Grob*me);
bool broken_b () const;
Direction break_status_dir () const;
Item * find_prebroken_piece (Direction) const;
- Score_element * find_broken_piece (Line_of_score*) const;
+ Grob * find_broken_piece (Line_of_score*) const;
virtual Line_of_score * line_l() const;
virtual Paper_column * column_l () const;
struct Key_item
{
- static int calculate_position(Score_element*,SCM pair) ;
- static void set_interface (Score_element*);
- static bool has_interface (Score_element*);
+ static int calculate_position(Grob*,SCM pair) ;
+ static void set_interface (Grob*);
+ static bool has_interface (Grob*);
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
};
SCM ly_parse_scm (char const* s, int* n);
SCM ly_quote_scm (SCM s);
SCM ly_type (SCM);
+bool type_check_assignment (SCM val, SCM sym, SCM type_symbol) ;
/*
display and print newline.
class Scheme_hash_table;
class Scope;
class Score;
-class Score_element;
+class Grob;
class Score_engraver;
class Score_performer;
class Script_req;
virtual void create_line_spanner ();
virtual void do_creation_processing();
virtual void do_removal_processing();
- virtual void typeset_element (Score_element*);
+ virtual void typeset_grob (Grob*);
public:
VIRTUAL_COPY_CONS(Translator);
void output_lines ();
Link_array<Item> broken_col_range (Item const*, Item const*) const;
- Link_array<Score_element> column_l_arr () const;
+ Link_array<Grob> column_l_arr () const;
void add_column (Paper_column*);
- void typeset_element (Score_element*);
+ void typeset_grob (Grob*);
void output_molecule (SCM, Offset);
void output_scheme (SCM);
void pre_processing ();
protected:
- VIRTUAL_COPY_CONS(Score_element);
+ VIRTUAL_COPY_CONS(Grob);
};
#endif
class Local_key_item
{
- static Molecule parenthesize (Score_element*me, Molecule) ;
+ static Molecule parenthesize (Grob*me, Molecule) ;
public:
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
- static void add_pitch (Score_element*me, Pitch, bool cautionary, bool natural);
- static bool has_interface (Score_element*);
- static void set_interface (Score_element*);
+ static void add_pitch (Grob*me, Pitch, bool cautionary, bool natural);
+ static bool has_interface (Grob*);
+ static void set_interface (Grob*);
};
class Lyric_engraver : public Engraver
{
protected:
- virtual void do_pre_move_processing();
- virtual bool do_try_music (Music*);
+ virtual void stop_translation_timestep();
+ virtual bool try_music (Music*);
void deprecated_process_music();
- virtual void do_post_move_processing ();
+ virtual void start_translation_timestep ();
public:
Lyric_engraver ();
VIRTUAL_COPY_CONS (Translator);
public:
Spanner*elt_l_;
Lyric_extender (Spanner*);
- void set_textitem (Direction, Score_element*);
+ void set_textitem (Direction, Grob*);
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
};
class Lyric_phrasing_engraver : public Engraver
{
protected:
- virtual void acknowledge_element(Score_element_info);
- virtual void process_acknowledged ();
- virtual void do_pre_move_processing();
+ virtual void acknowledge_grob(Grob_info);
+ virtual void create_grobs ();
+ virtual void stop_translation_timestep();
virtual void do_removal_processing ();
private:
- void record_notehead(const String &context_id, Score_element * notehead);
- void record_lyric(const String &context_id, Score_element * lyric);
+ void record_notehead(const String &context_id, Grob * notehead);
+ void record_lyric(const String &context_id, Grob * lyric);
void record_melisma(const String &context_id);
- void record_extender(const String &context_id, Score_element * extender);
+ void record_extender(const String &context_id, Grob * extender);
Syllable_group * lookup_context_id(const String &context_id);
public:
/** association list of Syllable_group smobs
*/
Protected_scm voice_alist_;
- Score_element * any_notehead_l_;
+ Grob * any_notehead_l_;
};
class Syllable_group
{
bool first_in_phrase_b_;
- Score_element * notehead_l_;
- Link_array<Score_element> lyric_list_;
- Score_element * longest_lyric_l_;
- Score_element * shortest_lyric_l_;
+ Grob * notehead_l_;
+ Link_array<Grob> lyric_list_;
+ Grob * longest_lyric_l_;
+ Grob * shortest_lyric_l_;
int alignment_i_;
bool melisma_b_;
Real group_translation_f_;
public:
static SCM make_entry();
void set_first_in_phrase(bool f);
- void set_notehead(Score_element * notehead);
- void add_lyric(Score_element * lyric);
- void add_extender(Score_element * extender);
+ void set_notehead(Grob * notehead);
+ void add_lyric(Grob * lyric);
+ void add_extender(Grob * extender);
void set_melisma() { melisma_b_ = true; }
bool get_melisma() { return melisma_b_; }
int lyric_count() { return lyric_list_.size(); }
void clear();
bool is_empty();
- bool set_lyric_align(const char *punc, Score_element *default_notehead_l);
+ bool set_lyric_align(const char *punc, Grob *default_notehead_l);
void adjust_melisma_align();
int appropriate_alignment(const char *punc);
Real amount_to_translate();
class Multi_measure_rest
{
public:
- static void set_interface (Score_element*);
- static bool has_interface (Score_element*);
+ static void set_interface (Grob*);
+ static bool has_interface (Grob*);
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
- static void add_column (Score_element*,Item*);
+ static void add_column (Grob*,Item*);
DECLARE_SCHEME_CALLBACK(set_spacing_rods, (SCM ));
};
/*
- score-element-callback.hh -- declare Score_element callbacks
+ grob-callback.hh -- declare Grob callbacks
source file of the GNU LilyPond music typesetter
class Note_column
{
public:
- static int shift_compare (Score_element *const &, Score_element*const&);
+ static int shift_compare (Grob *const &, Grob*const&);
/** The relative position of the "voice" containing this
chord. Normally this would be the same as the stem direction,
JUNKME.
*/
- static Direction dir (Score_element*me);
- static Slice head_positions_interval(Score_element* me);
- static Direction static_dir (Score_element*);
- static void translate_rests(Score_element*me,int dy);
- static Score_element * first_head (Score_element*me);
- static void set_stem (Score_element*me,Score_element*);
- static void set_dotcol (Score_element*me,Score_element*);
- static void add_head (Score_element*me,Score_element*);
- static bool rest_b (Score_element*me);
- static bool has_interface (Score_element*);
- static void set_interface (Score_element*);
- static Item *stem_l(Score_element*);
+ static Direction dir (Grob*me);
+ static Slice head_positions_interval(Grob* me);
+ static Direction static_dir (Grob*);
+ static void translate_rests(Grob*me,int dy);
+ static Grob * first_head (Grob*me);
+ static void set_stem (Grob*me,Grob*);
+ static void set_dotcol (Grob*me,Grob*);
+ static void add_head (Grob*me,Grob*);
+ static bool rest_b (Grob*me);
+ static bool has_interface (Grob*);
+ static void set_interface (Grob*);
+ static Item *stem_l(Grob*);
};
#endif // NOTE_COLUMN_HH
{
public:
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
- static Molecule ledger_line (Interval, Score_element*) ;
- static bool has_interface (Score_element*);
+ static Molecule ledger_line (Interval, Grob*) ;
+ static bool has_interface (Grob*);
};
#endif // NOTEHEAD_HH
class Paper_column : public Item
{
public:
- VIRTUAL_COPY_CONS(Score_element);
+ VIRTUAL_COPY_CONS(Grob);
/*
Not (yet) in scm, because of messy effects when a column commits suicide.
Line_of_score *line_l_;
/// which one (left =0)
- static int rank_i(Score_element*);
+ static int rank_i(Grob*);
Paper_column (SCM);
bool musical_b () const;
- static Moment when_mom (Score_element*);
+ static Moment when_mom (Grob*);
- static bool used_b (Score_element*) ;
+ static bool used_b (Grob*) ;
void set_rank (int);
};
#include "protected-scm.hh"
/**
- Abstract interface for a Score_element to output itself.
+ Abstract interface for a Grob to output itself.
*/
class Paper_outputter
{
Array<Audio_element_info> announce_info_arr_;
private:
- void process_acknowledged ();
- void acknowledge_elements ();
+ void create_grobs ();
+ void acknowledge_grobs ();
};
#endif // PERFORMER_GROUP_PERFORMER_HH
#include "audio-element-info.hh"
#include "array.hh"
#include "request.hh"
-#include "score-element-info.hh"
+#include "grob-info.hh"
#include "translator.hh"
/**
protected:
virtual void announce_element (Audio_element_info);
- virtual void acknowledge_element (Audio_element_info);
- virtual void process_acknowledged ();
+ virtual void acknowledge_grob (Audio_element_info);
+ virtual void create_grobs ();
virtual int get_tempo_i() const;
virtual void play_element (Audio_element * elem_p );
};
class Rest_collision
{
public:
- static void add_column (Score_element*me,Score_element*);
- static void set_interface (Score_element*me);
- static bool has_interface (Score_element*);
+ static void add_column (Grob*me,Grob*);
+ static void set_interface (Grob*me);
+ static bool has_interface (Grob*);
DECLARE_SCHEME_CALLBACK(force_shift_callback, (SCM element, SCM axis));
- static SCM do_shift (Score_element*,SCM);
+ static SCM do_shift (Grob*,SCM);
};
#endif // REST_COLLISION_HH
{
public:
DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM ));
- static bool has_interface (Score_element*);
+ static bool has_interface (Grob*);
+ static SCM brew_internal_molecule (SCM);
+ DECLARE_SCHEME_CALLBACK(extent_callback, (SCM,SCM));
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
};
#endif // REST_HH
class Rhythmic_head
{
public:
- static int balltype_i (Score_element*) ;
- static void set_dots (Score_element*,Item *);
- static Item * stem_l (Score_element*) ;
- static Item * dots_l (Score_element*) ;
- static int dot_count (Score_element*) ;
+ static int balltype_i (Grob*) ;
+ static void set_dots (Grob*,Item *);
+ static Item * stem_l (Grob*) ;
+ static Item * dots_l (Grob*) ;
+ static int dot_count (Grob*) ;
DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM ));
- static bool has_interface (Score_element*);
- static void set_interface (Score_element*);
+ static bool has_interface (Grob*);
+ static void set_interface (Grob*);
};
#endif // RHYTHMIC_HEAD_HH
+++ /dev/null
-/*
- score-element-info.hh -- declare Score_element_info
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef STAFFELEMINFO_HH
-#define STAFFELEMINFO_HH
-
-#include "lily-proto.hh"
-#include "parray.hh"
-
-/**
- Data container for broadcasts.
-
- TODO: Store this in element info!
- */
-struct Score_element_info {
- Translator * origin_trans_l_;
- friend Engraver;
-public:
- Link_array<Translator> origin_trans_l_arr (Translator*) const;
- Score_element * elem_l_;
- Music *req_l_;
-
-
- Score_element_info (Score_element*, Music*);
- Score_element_info();
-};
-
-
-#endif // STAFFELEMINFO_HH
+++ /dev/null
-/*
- score-element.hh -- declare Score_element
-
- (c) 1996-1999--2000 Han-Wen Nienhuys
-*/
-
-#ifndef STAFFELEM_HH
-#define STAFFELEM_HH
-
-#include "parray.hh"
-#include "virtual-methods.hh"
-#include "lily-guile.hh"
-#include "lily-proto.hh"
-#include "smobs.hh"
-#include "dimension-cache.hh"
-
-/**
- for administration of what was done already
- */
-enum Score_element_status {
- ORPHAN=0, // not yet added to Paper_score
- VIRGIN,
- PRECALCING,
- PRECALCED, // calcs before spacing done
- POSTCALCING, // busy calculating. This is used to trap cyclic deps.
- POSTCALCED, // after spacing calcs done
-};
-
-typedef void (Score_element::*Score_element_method_pointer) (void);
-
-/*
- Basic output object.
-*/
-class Score_element {
-public:
- SCM immutable_property_alist_;
-
- // rename me to ``property_alist_''
- SCM mutable_property_alist_;
-
- Score_element *original_l_;
-
- /**
- Administration: Where are we?. This is mainly used by Super_element and
- Score_element::calcalute_dependencies ()
-
- 0 means ORPHAN,
- */
- char status_i_;
- String name () const;
-
- /*
- IDEA: make this a global variable. This is the same for all
- elements, I think it is safe to assume that we will not have
- scores being formatted multithreadedly.
- */
- Paper_score *pscore_l_;
-
- Score_element (SCM basic_props);
- Score_element (Score_element const&);
-
- /*
- properties
- */
- SCM get_elt_property (const char*) const;
- SCM get_elt_property (SCM) const;
- void set_elt_property (const char * , SCM val);
- void set_immutable_elt_property (const char * , SCM val);
- void set_immutable_elt_property (SCM key, SCM val);
- void set_elt_property (SCM , SCM val);
- void set_elt_pointer (const char*, SCM val);
- friend class Property_engraver; // UGHUGHUGH.
- SCM remove_elt_property (const char* nm);
-
- /*
- related classes.
- */
- Paper_def *paper_l () const;
-
- /**
- add a dependency. It may be the 0 pointer, in which case, it is ignored.
- */
- void add_dependency (Score_element*);
- virtual Line_of_score * line_l () const;
- bool linked_b () const;
-
-
- VIRTUAL_COPY_CONS(Score_element);
-
- /**
- Recursively track all dependencies of this Score_element. The
- status_i_ field is used as a mark-field. It is marked with
- #busy# during execution of this function, and marked with #final#
- when finished.
-
- #funcptr# is the function to call to update this element.
- */
- void calculate_dependencies (int final, int busy, SCM funcname);
- static SCM handle_broken_smobs (SCM, SCM criterion);
-
- virtual void do_break_processing ();
- virtual Score_element *find_broken_piece (Line_of_score*) const;
- virtual void discretionary_processing ();
- virtual SCM do_derived_mark ();
-
- Molecule * get_molecule () const;
- void suicide ();
-
- DECLARE_SCHEME_CALLBACK(preset_extent, (SCM smob, SCM axis));
- DECLARE_SCHEME_CALLBACK(point_dimension_callback, (SCM smob, SCM axis));
- DECLARE_SCHEME_CALLBACK(molecule_extent, (SCM smob, SCM axis));
-
-
- static SCM ly_set_elt_property (SCM, SCM,SCM);
- static SCM ly_get_elt_property (SCM, SCM);
-
- bool has_interface (SCM intf);
- void set_interface (SCM intf);
-
- virtual void handle_broken_dependencies ();
- virtual void handle_prebroken_dependencies ();
-
-
- DECLARE_SMOBS(Score_element,foo);
-
- void init ();
-
- Dimension_cache dim_cache_[NO_AXES];
-
-public:
- bool empty_b (Axis a) const;
-
- Interval extent (Score_element * refpoint, Axis) const;
-
- /**
- translate in one direction
- */
-
- void translate_axis (Real, Axis);
-
- /**
- Find the offset relative to D. If D equals THIS, then it is 0.
- Otherwise, it recursively defd as
-
- OFFSET_ + PARENT_L_->relative_coordinate (D)
- */
- Real relative_coordinate (Score_element const* refp, Axis) const;
- /**
- Find the group-element which has both #this# and #s#
- */
- Score_element*common_refpoint (Score_element const* s, Axis a) const;
- Score_element*common_refpoint (SCM elt_list, Axis a) const;
-
- // duh. slim down interface here. (todo)
- bool has_offset_callback_b (SCM callback, Axis)const;
- void add_offset_callback (SCM callback, Axis);
- bool has_extent_callback_b (SCM, Axis)const;
- void set_extent_callback (SCM , Axis);
- bool has_extent_callback_b (Axis) const;
-
-
- /**
- Invoke callbacks to get offset relative to parent.
- */
- Real get_offset (Axis a) const;
- /**
- Set the parent refpoint of THIS to E
- */
- void set_parent (Score_element* e, Axis);
-
- Score_element *parent_l (Axis a) const;
- DECLARE_SCHEME_CALLBACK(fixup_refpoint, (SCM));
-};
-
-Score_element * unsmob_element (SCM);
-
-#endif // STAFFELEM_HH
-
Line_of_score * scoreline_l_;
int breaks_i_;
- Link_array<Score_element> elem_p_arr_;
+ Link_array<Grob> elem_p_arr_;
Paper_column* command_column_l_;
Paper_column* musical_column_l_;
-
+ void make_columns (Moment);
void set_columns (Paper_column*,Paper_column*);
void typeset_all();
protected:
/* Engraver_group_engraver interface */
- virtual bool do_try_music (Music*);
+ virtual bool try_music (Music*);
virtual void do_creation_processing();
virtual void do_removal_processing();
- virtual void announce_element (Score_element_info);
+ virtual void announce_grob (Grob_info);
virtual void do_announces();
- virtual void typeset_element (Score_element*elem_p);
+ virtual void typeset_grob (Grob*elem_p);
- virtual void do_pre_move_processing();
+ virtual void stop_translation_timestep();
virtual void do_add_processing ();
};
class Script_column
{
public:
- static void add_staff_sided (Score_element*, Item*);
+ static void add_staff_sided (Grob*, Item*);
DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM ));
};
class Script
{
public:
- static Molecule get_molecule (Score_element*,Direction d);
- static void set_interface (Score_element*);
- static bool has_interface (Score_element*);
+ static Molecule get_molecule (Grob*,Direction d);
+ static void set_interface (Grob*);
+ static bool has_interface (Grob*);
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM ));
};
class Separating_group_spanner
{
public:
- static void add_spacing_unit (Score_element*me, Item*);
- static void set_interface (Score_element*);
+ static void add_spacing_unit (Grob*me, Item*);
+ static void set_interface (Grob*);
DECLARE_SCHEME_CALLBACK(set_spacing_rods, (SCM ));
};
*/
struct Separation_item
{
- static void set_interface (Score_element*);
- static bool has_interface (Score_element*);
- static Interval my_width (Score_element*) ;
- static void add_item (Score_element*,Item*);
+ static void set_interface (Grob*);
+ static bool has_interface (Grob*);
+ static Interval my_width (Grob*) ;
+ static void add_item (Grob*,Item*);
};
#endif /* SINGLE_MALT_GROUPING_ITEM_HH */
DECLARE_SCHEME_CALLBACK(aligned_side, (SCM element, SCM axis));
DECLARE_SCHEME_CALLBACK(quantised_position, (SCM element, SCM axis));
DECLARE_SCHEME_CALLBACK(centered_on_parent, (SCM element, SCM axis));
- static void set_axis (Score_element*,Axis);
- static void set_minimum_space (Score_element*,Real);
- static void set_padding (Score_element*,Real);
- static Axis get_axis (Score_element*) ;
- static bool supported_b (Score_element*) ;
- static bool has_interface (Score_element*) ;
- static void add_support (Score_element*,Score_element*);
- static void add_staff_support (Score_element*);
- static Direction get_direction (Score_element*);
- static void set_direction (Score_element*,Direction);
+ static void set_axis (Grob*,Axis);
+ static void set_minimum_space (Grob*,Real);
+ static void set_padding (Grob*,Real);
+ static Axis get_axis (Grob*) ;
+ static bool supported_b (Grob*) ;
+ static bool has_interface (Grob*) ;
+ static void add_support (Grob*,Grob*);
+ static void add_staff_support (Grob*);
+ static Direction get_direction (Grob*);
+ static void set_direction (Grob*,Direction);
};
Simple_spacer ();
void solve (Column_x_positions *) const;
- void add_columns (Link_array<Score_element>);
+ void add_columns (Link_array<Grob>);
void my_solve_linelen ();
void my_solve_natural_len ();
Real active_springs_stiffness () const;
class Slur
{
public:
- static void add_column (Score_element *me, Score_element *col);
+ static void add_column (Grob *me, Grob *col);
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
- static void set_interface (Score_element*);
- static bool has_interface (Score_element*);
- static Array<Offset> get_encompass_offset_arr (Score_element *me);
- static Bezier get_curve (Score_element *me);
- static Direction get_default_dir (Score_element *me);
+ static void set_interface (Grob*);
+ static bool has_interface (Grob*);
+ static Array<Offset> get_encompass_offset_arr (Grob *me);
+ static Bezier get_curve (Grob *me);
+ static Direction get_default_dir (Grob *me);
DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM ));
private:
- static Real get_first_notecolumn_y (Score_element *me, Direction dir);
- static Offset broken_trend_offset (Score_element *me, Direction dir);
- static Offset get_attachment (Score_element *me,Direction dir, Score_element **common);
- static void de_uglyfy (Score_element *me,Slur_bezier_bow* bb, Real default_height);
- static void set_extremities (Score_element *me);
- static void set_control_points (Score_element *me);
- static void check_slope (Score_element *me);
- static Offset encompass_offset (Score_element *me, Score_element *col, Score_element **common);
+ static Real get_first_notecolumn_y (Grob *me, Direction dir);
+ static Offset broken_trend_offset (Grob *me, Direction dir);
+ static Offset get_attachment (Grob *me,Direction dir, Grob **common);
+ static void de_uglyfy (Grob *me,Slur_bezier_bow* bb, Real default_height);
+ static void set_extremities (Grob *me);
+ static void set_control_points (Grob *me);
+ static void check_slope (Grob *me);
+ static Offset encompass_offset (Grob *me, Grob *col, Grob **common);
};
#endif // SLUR_HH
struct Spaceable_element
{
/// set a minimum distance
- static void add_rod (Score_element*me, Score_element * to, Real distance);
- static void add_spring (Score_element*me,Score_element * to, Real dist, Real strength);
- static void set_interface (Score_element*);
- static void remove_interface (Score_element*);
- static SCM get_minimum_distances (Score_element*);
- static SCM get_ideal_distances (Score_element*);
+ static void add_rod (Grob*me, Grob * to, Real distance);
+ static void add_spring (Grob*me,Grob * to, Real dist, Real strength);
+ static void set_interface (Grob*);
+ static void remove_interface (Grob*);
+ static SCM get_minimum_distances (Grob*);
+ static SCM get_ideal_distances (Grob*);
};
#endif /* SPACEABLE_ELEMENT_HH */
class Spacing_spanner
{
public:
- static void set_interface (Score_element*);
- static void do_measure (Score_element*,Link_array<Score_element>) ;
+ static void set_interface (Grob*);
+ static void do_measure (Grob*,Link_array<Grob>) ;
DECLARE_SCHEME_CALLBACK(set_springs, (SCM ));
- static Real stem_dir_correction (Score_element*,Score_element*,Score_element*) ;
- static Real default_bar_spacing (Score_element*,Score_element*,Score_element*,Moment) ;
- static Real note_spacing (Score_element*,Score_element*,Score_element*,Moment) ;
- static Real get_duration_space (Score_element*,Moment dur, Moment shortest) ;
+ static Real stem_dir_correction (Grob*,Grob*,Grob*) ;
+ static Real default_bar_spacing (Grob*,Grob*,Grob*,Moment) ;
+ static Real note_spacing (Grob*,Grob*,Grob*,Moment) ;
+ static Real get_duration_space (Grob*,Moment dur, Moment shortest) ;
};
#endif /* SPACING_SPANNER_HH */
class Span_bar
{
public:
- static void set_interface (Score_element*);
- static bool has_interface (Score_element*);
- static Interval get_spanned_interval (Score_element*);
- static void add_bar (Score_element*,Score_element*);
- static void evaluate_glyph (Score_element*);
- static void evaluate_empty (Score_element*);
+ static void set_interface (Grob*);
+ static bool has_interface (Grob*);
+ static Interval get_spanned_interval (Grob*);
+ static void add_bar (Grob*,Grob*);
+ static void evaluate_glyph (Grob*);
+ static void evaluate_empty (Grob*);
DECLARE_SCHEME_CALLBACK(width_callback, (SCM smob, SCM axis));
DECLARE_SCHEME_CALLBACK(get_bar_size, (SCM ));
DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM ));
VIRTUAL_COPY_CONS (Translator);
virtual Span_bar * get_span_bar_p () const;
- virtual void acknowledge_element (Score_element_info);
+ virtual void acknowledge_grob (Grob_info);
};
#endif // SPAN_SCORE_BAR_GRAV_HH
#define SPANNER_HH
#include "lily-proto.hh"
-#include "score-element.hh"
+#include "grob.hh"
#include "drul-array.hh"
#include "rod.hh"
length of stems of notes they encompass.
*/
-class Spanner : public Score_element {
+class Spanner : public Grob {
Drul_array<Item*> spanned_drul_;
public:
// TODO: make virtual and do this for Items as well.
Interval_t<int> spanned_rank_iv ();
- void set_bound (Direction d, Score_element*);
+ void set_bound (Direction d, Grob*);
Item *get_bound (Direction d) const;
Spanner (SCM);
Real spanner_length () const;
static int compare (Spanner * const &,Spanner * const &);
- virtual Score_element* find_broken_piece (Line_of_score*) const;
+ virtual Grob* find_broken_piece (Line_of_score*) const;
virtual SCM do_derived_mark ();
protected:
void set_my_columns ();
- VIRTUAL_COPY_CONS(Score_element);
+ VIRTUAL_COPY_CONS(Grob);
virtual void do_break_processing ();
virtual Line_of_score*line_l () const;
};
void add_bound_item (Spanner*, Item* n);
-void extend_spanner_over_elements (Score_element* span);
+void extend_spanner_over_elements (Grob* span);
#endif
#ifndef STAFF_SYMBOL_REFERENCER_HH
#define STAFF_SYMBOL_REFERENCER_HH
-#include "score-element.hh"
+#include "grob.hh"
/**
class Staff_symbol_referencer
{
public:
- static void set_interface (Score_element*);
- static bool has_interface (Score_element*);
- static void set_position (Score_element*,Real);
+ static void set_interface (Grob*);
+ static bool has_interface (Grob*);
+ static void set_position (Grob*,Real);
DECLARE_SCHEME_CALLBACK(callback, (SCM element, SCM axis));
/**
typeface. ie. leading is vertical space.
*/
- static Real staff_space (Score_element*);
- static Score_element * staff_symbol_l (Score_element*);
- static bool on_staffline (Score_element*);
- static bool on_staffline (Score_element*,int);
- static int line_count (Score_element*);
- static Real position_f (Score_element*);
- static Real staff_radius (Score_element*);
+ static Real staff_space (Grob*);
+ static Grob * staff_symbol_l (Grob*);
+ static bool on_staffline (Grob*);
+ static bool on_staffline (Grob*,int);
+ static int line_count (Grob*);
+ static Real position_f (Grob*);
+ static Real staff_radius (Grob*);
};
-int compare_position (Score_element *const&,Score_element *const&);
+int compare_position (Grob *const&,Grob *const&);
#endif /* STAFF_SYMBOL_REFERENCER_HH */
class Staff_symbol
{
public:
- static Real staff_space (Score_element*) ;
- static int steps_i(Score_element*) ;
- static int line_count (Score_element*);
+ static Real staff_space (Grob*) ;
+ static int steps_i(Grob*) ;
+ static int line_count (Grob*);
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
- static bool has_interface (Score_element*);
- static void set_interface (Score_element*);
+ static bool has_interface (Grob*);
+ static void set_interface (Grob*);
};
#endif // STAFFSYM_HH
class Stem_tremolo
{
public:
- static void set_interface (Score_element*);
- static bool has_interface (Score_element*);
+ static void set_interface (Grob*);
+ static bool has_interface (Grob*);
DECLARE_SCHEME_CALLBACK(dim_callback, (SCM smob, SCM axis));
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
- static void set_stem (Score_element*me, Score_element *st);
+ static void set_stem (Grob*me, Grob *st);
};
#endif /* ABBREV_HH */
public:
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
- static int flag_i (Score_element*) ;
- static int beam_count (Score_element*,Direction) ;
- static void set_beaming (Score_element*,int, Direction d);
- static Score_element * beam_l (Score_element*);
- static Score_element * first_head (Score_element*) ;
- static Drul_array<Score_element*> extremal_heads (Score_element*);
- static Score_element * support_head (Score_element*) ;
- static void add_head (Score_element*me, Score_element*n);
- static Stem_info calc_stem_info (Score_element *) ;
- static Real chord_start_f (Score_element *) ;
- static Direction get_direction (Score_element*) ;
- static int type_i (Score_element *) ;
- static void set_stemend (Score_element *,Real);
- static Direction get_default_dir(Score_element *) ;
- static int get_center_distance(Score_element *,Direction) ;
- static int heads_i (Score_element *) ;
- static bool invisible_b(Score_element *) ;
- static Interval head_positions(Score_element *) ;
- static Real get_default_stem_end_position (Score_element*me) ;
- static void position_noteheads(Score_element*);
- static Real stem_end_position (Score_element*) ;
+ static int flag_i (Grob*) ;
+ static int beam_count (Grob*,Direction) ;
+ static void set_beaming (Grob*,int, Direction d);
+ static Grob * beam_l (Grob*);
+ static Grob * first_head (Grob*) ;
+ static Drul_array<Grob*> extremal_heads (Grob*);
+ static Grob * support_head (Grob*) ;
+ static void add_head (Grob*me, Grob*n);
+ static Stem_info calc_stem_info (Grob *) ;
+ static Real chord_start_f (Grob *) ;
+ static Direction get_direction (Grob*) ;
+ static int type_i (Grob *) ;
+ static void set_stemend (Grob *,Real);
+ static Direction get_default_dir(Grob *) ;
+ static int get_center_distance(Grob *,Direction) ;
+ static int heads_i (Grob *) ;
+ static bool invisible_b(Grob *) ;
+ static Interval head_positions(Grob *) ;
+ static Real get_default_stem_end_position (Grob*me) ;
+ static void position_noteheads(Grob*);
+ static Real stem_end_position (Grob*) ;
DECLARE_SCHEME_CALLBACK(off_callback, (SCM element, SCM axis));
- static Molecule flag (Score_element*);
+ static Molecule flag (Grob*);
DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM ));
DECLARE_SCHEME_CALLBACK(dim_callback, (SCM smob, SCM axis));
- static bool has_interface (Score_element*);
- static void set_interface (Score_element*);
+ static bool has_interface (Grob*);
+ static void set_interface (Grob*);
- static void set_spacing_hints (Score_element*me) ;
+ static void set_spacing_hints (Grob*me) ;
};
#endif
*/
class Swallow_engraver : public Engraver {
protected:
- bool do_try_music (Music*) ;
+ bool try_music (Music*) ;
public:
VIRTUAL_COPY_CONS(Translator);
VIRTUAL_COPY_CONS(Translator);
protected:
- virtual bool do_try_music (Music*) { return true; }
+ virtual bool try_music (Music*) { return true; }
};
#endif // SWALLOW_PERF_HH
public:
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
- static void set_interface (Score_element*me);
- static bool has_interface (Score_element*);
+ static void set_interface (Grob*me);
+ static bool has_interface (Grob*);
DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM ));
- static void try_collapse (Score_element*);
- static Molecule staff_bracket (Score_element*,Real) ;
- static Molecule staff_brace (Score_element*,Real) ;
- static Molecule simple_bar (Score_element*,Real) ;
+ static void try_collapse (Grob*);
+ static Molecule staff_bracket (Grob*,Real) ;
+ static Molecule staff_brace (Grob*,Real) ;
+ static Molecule simple_bar (Grob*,Real) ;
};
#endif /* SYSTEM_START_DELIMITER_HH */
{
public:
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
- static Molecule text2molecule (Score_element *me, SCM text, SCM properties);
- static Molecule string2molecule (Score_element *me, SCM text, SCM properties);
- static Molecule markup_sentence2molecule (Score_element *me, SCM markup_sentence, SCM properties);
+ static Molecule text2molecule (Grob *me, SCM text, SCM properties);
+ static Molecule string2molecule (Grob *me, SCM text, SCM properties);
+ static Molecule markup_sentence2molecule (Grob *me, SCM markup_sentence, SCM properties);
private:
- static Molecule lookup_character (Score_element *me, Font_metric*, SCM char_name);
- static Molecule lookup_text (Score_element *me, Font_metric*, SCM text);
+ static Molecule lookup_character (Grob *me, Font_metric*, SCM char_name);
+ static Molecule lookup_text (Grob *me, Font_metric*, SCM text);
};
#endif /* TEXT_ITEM */
{
public:
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
- static bool has_interface (Score_element*);
+ static bool has_interface (Grob*);
};
#endif /* TEXT_SPANNER_HH */
class Tie_column
{
public:
- static void set_interface (Score_element*me);
- static bool has_interface (Score_element*);
- static void add_tie (Score_element*me,Score_element*);
+ static void set_interface (Grob*me);
+ static bool has_interface (Grob*);
+ static void add_tie (Grob*me,Grob*);
DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM ));
- static void set_directions (Score_element*me);
+ static void set_directions (Grob*me);
};
#endif /* TIE_COLUMN_HH */
class Tie
{
public:
- static void set_head (Score_element*,Direction, Item*head_l);
- static void set_interface (Score_element*);
- static bool has_interface (Score_element*);
- static Score_element * head (Score_element*,Direction) ;
- static Real position_f (Score_element*) ;
+ static void set_head (Grob*,Direction, Item*head_l);
+ static void set_interface (Grob*);
+ static bool has_interface (Grob*);
+ static Grob * head (Grob*,Direction) ;
+ static Real position_f (Grob*) ;
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
- static Direction get_default_dir(Score_element*) ;
+ static Direction get_default_dir(Grob*) ;
static SCM get_control_points (SCM);
DECLARE_SCHEME_CALLBACK(set_spacing_rods, (SCM ));
};
*/
struct Time_signature
{
- static Molecule special_time_signature (Score_element*,String,int,int) ;
- static Molecule time_signature (Score_element*,int, int);
+ static Molecule special_time_signature (Grob*,String,int,int) ;
+ static Molecule time_signature (Grob*,int, int);
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
};
#endif // METER_HH
protected:
virtual void do_creation_processing ();
- virtual bool do_try_music (Music *req_l);
+ virtual bool try_music (Music *req_l);
void deprecated_process_music();
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing();
+ virtual void stop_translation_timestep();
+ virtual void start_translation_timestep();
public:
Moment measure_position () const;
virtual void do_announces ();
virtual void do_add_processing ();
- virtual bool do_try_music (Music* req_l);
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing();
+ virtual bool try_music (Music* req_l);
+ virtual void stop_translation_timestep();
+ virtual void start_translation_timestep();
virtual void do_creation_processing();
virtual void do_removal_processing();
virtual void each (Method_pointer);
Translator_group * daddy_trans_l_ ;
-
- /**
- try to fit the request in this engraver
-
- @return
- false: not noted, not taken.
-
- true: request swallowed. Don't try to put the request elsewhere.
-
- */
- bool try_music (Music*);
void pre_move_processing();
void add_processing ();
void announces();
public:
virtual void do_add_processing ();
- virtual bool do_try_music (Music *req_l);
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing();
+ /**
+ try to fit the request in this engraver
+
+ @return
+ false: not noted, not taken.
+
+ true: request swallowed. Don't try to put the request elsewhere.
+
+ */
+ virtual bool try_music (Music *req_l);
+ virtual void stop_translation_timestep();
+ virtual void start_translation_timestep();
virtual void do_announces () ;
virtual void do_creation_processing() ;
virtual void do_removal_processing();
{
public:
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
- static void set_interface (Score_element*);
- static bool has_interface (Score_element*);
+ static void set_interface (Grob*);
+ static bool has_interface (Grob*);
- static void add_column (Score_element*me,Item*);
- static void add_beam (Score_element*me,Score_element*);
+ static void add_column (Grob*me,Item*);
+ static void add_beam (Grob*me,Grob*);
- static void calc_dy (Score_element*,Real *) ;
- static void calc_position_and_height (Score_element*,Real*,Real *dy);
+ static void calc_dy (Grob*,Real *) ;
+ static void calc_position_and_height (Grob*,Real*,Real *dy);
DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM ));
- static Direction get_default_dir (Score_element*);
+ static Direction get_default_dir (Grob*);
};
#endif // Tuplet_spanner_HH
{
protected:
String swallow_str_;
- bool do_try_music (Music*);
+ bool try_music (Music*);
public:
VIRTUAL_COPY_CONS(Translator);
};
class Volta_spanner
{
public:
- static void set_interface (Score_element*);
- static bool has_interface (Score_element*);
+ static void set_interface (Grob*);
+ static bool has_interface (Grob*);
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
- static void add_column (Score_element*, Score_element*col);
- static void add_bar (Score_element*me, Item*bar);
+ static void add_column (Grob*, Grob*col);
+ static void add_bar (Grob*me, Item*bar);
};
#endif // VOLTA_SPANNER_HH
class Instrument_name_engraver : public Engraver
{
Item *text_;
- Score_element * delim_ ;
+ Grob * delim_ ;
void create_text (SCM s);
public:
VIRTUAL_COPY_CONS(Translator);
Instrument_name_engraver ();
- virtual void acknowledge_element (Score_element_info);
- virtual void do_pre_move_processing ();
+ virtual void acknowledge_grob (Grob_info);
+ virtual void stop_translation_timestep ();
};
ADD_THIS_TRANSLATOR(Instrument_name_engraver);
void
-Instrument_name_engraver::do_pre_move_processing ()
+Instrument_name_engraver::stop_translation_timestep ()
{
if (text_)
{
- typeset_element (text_);
+ typeset_grob (text_);
text_ = 0;
}
}
if(!text_)
{
text_ = new Item (get_property ("InstrumentName"));
- text_->set_elt_property ("text", txt);
+ text_->set_grob_property ("text", txt);
if (delim_)
text_->set_parent (delim_, Y_AXIS);
- announce_element (text_,0);
+ announce_grob (text_,0);
}
}
void
-Instrument_name_engraver::acknowledge_element (Score_element_info i)
+Instrument_name_engraver::acknowledge_grob (Grob_info i)
{
SCM s = get_property ("instrument");
#include "line-of-score.hh"
Item::Item (SCM s)
- : Score_element (s)
+ : Grob (s)
{
broken_to_drul_[LEFT] = broken_to_drul_[RIGHT]=0;
}
Item copy ctor. Copy nothing: everything should be a elt property
or a special purpose pointer (such as broken_to_drul_[]) */
Item::Item (Item const &s)
- : Score_element (s)
+ : Grob (s)
{
broken_to_drul_[LEFT] = broken_to_drul_[RIGHT] =0;
}
bool
-Item::breakable_b (Score_element*me)
+Item::breakable_b (Grob*me)
{
if (me->original_l_)
return false;
programming_error ("only items can be breakable.");
Item * i =dynamic_cast<Item*> (me->parent_l (X_AXIS));
- return (i) ? Item::breakable_b (i) : to_boolean (me->get_elt_property ("breakable"));
+ return (i) ? Item::breakable_b (i) : to_boolean (me->get_grob_property ("breakable"));
}
Paper_column *
Line_of_score *
Item::line_l() const
{
- Score_element *g = parent_l (X_AXIS);
+ Grob *g = parent_l (X_AXIS);
return g ? g->line_l () : 0;
}
Direction i=LEFT;
do
{
- Score_element * dolly = clone();
+ Grob * dolly = clone();
Item * item_p = dynamic_cast<Item*>(dolly);
- pscore_l_->line_l_->typeset_element (item_p);
+ pscore_l_->line_l_->typeset_grob (item_p);
new_copies[i] =item_p;
}
while (flip(&i) != LEFT);
copy_breakable_items();
}
-Score_element*
+Grob*
Item::find_broken_piece (Line_of_score*l) const
{
if (line_l() == l)
Direction d = LEFT;
do {
- Score_element *s = broken_to_drul_[d];
+ Grob *s = broken_to_drul_[d];
if (s && s->line_l () == l)
return s;
}
the function can do more complicated things.
*/
- SCM vis = get_elt_property ("visibility-lambda");
+ SCM vis = get_grob_property ("visibility-lambda");
if (gh_procedure_p (vis))
{
SCM args = scm_listify (gh_int2scm (break_status_dir ()), SCM_UNDEFINED);
set_extent_callback (SCM_EOL, Y_AXIS);
}
else if (trans)
- set_elt_property ("molecule-callback", SCM_BOOL_T);
+ set_grob_property ("molecule-callback", SCM_BOOL_T);
}
}
protected:
virtual void do_creation_processing();
virtual void do_removal_processing ();
- virtual bool do_try_music (Music *req_l);
+ virtual bool try_music (Music *req_l);
void deprecated_process_music();
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing();
- virtual void process_acknowledged ();
- virtual void acknowledge_element (Score_element_info);
+ virtual void stop_translation_timestep();
+ virtual void start_translation_timestep();
+ virtual void create_grobs ();
+ virtual void acknowledge_grob (Grob_info);
};
{
item_p_ = new Item (get_property ("KeySignature"));
- item_p_->set_elt_property ("c0-position", gh_int2scm (0));
+ item_p_->set_grob_property ("c0-position", gh_int2scm (0));
// todo: put this in basic props.
- item_p_->set_elt_property ("old-accidentals", old_accs_);
- item_p_->set_elt_property ("new-accidentals", get_property ("keySignature"));
+ item_p_->set_grob_property ("old-accidentals", old_accs_);
+ item_p_->set_grob_property ("new-accidentals", get_property ("keySignature"));
Staff_symbol_referencer::set_interface (item_p_);
Key_item::set_interface (item_p_);
bool multi = to_boolean (prop);
if (multi)
- item_p_->set_elt_property ("multi-octave", gh_bool2scm (multi));
+ item_p_->set_grob_property ("multi-octave", gh_bool2scm (multi));
- announce_element (item_p_,keyreq_l_);
+ announce_grob (item_p_,keyreq_l_);
}
{
SCM vis = get_property ("explicitKeySignatureVisibility");
if (gh_procedure_p (vis))
- item_p_->set_elt_property ("visibility-lambda",vis);
+ item_p_->set_grob_property ("visibility-lambda",vis);
}
}
bool
-Key_engraver::do_try_music (Music * req_l)
+Key_engraver::try_music (Music * req_l)
{
if (Key_change_req *kc = dynamic_cast <Key_change_req *> (req_l))
{
}
void
-Key_engraver::acknowledge_element (Score_element_info info)
+Key_engraver::acknowledge_grob (Grob_info info)
{
if (Clef::has_interface (info.elem_l_))
{
}
void
-Key_engraver::process_acknowledged ()
+Key_engraver::create_grobs ()
{
deprecated_process_music ();
}
}
void
-Key_engraver::do_pre_move_processing ()
+Key_engraver::stop_translation_timestep ()
{
if (item_p_)
{
- typeset_element (item_p_);
+ typeset_grob (item_p_);
item_p_ = 0;
}
}
}
void
-Key_engraver::do_post_move_processing ()
+Key_engraver::start_translation_timestep ()
{
keyreq_l_ = 0;
old_accs_ = get_property ("keySignature");
the thinking to other parties.
*/
int
-Key_item::calculate_position(Score_element *ki, SCM pair)
+Key_item::calculate_position(Grob *ki, SCM pair)
{
int p = gh_scm2int (gh_car (pair));
int a = gh_scm2int (gh_cdr (pair));
- int c0p = gh_scm2int (ki->get_elt_property ("c0-position"));
- if (to_boolean (ki->get_elt_property ("multi-octave")))
+ int c0p = gh_scm2int (ki->get_grob_property ("c0-position"));
+ if (to_boolean (ki->get_grob_property ("multi-octave")))
{
return p + c0p;
}
SCM
Key_item::brew_molecule (SCM smob)
{
- Score_element*me =unsmob_element (smob);
+ Grob*me =unsmob_element (smob);
Real inter = Staff_symbol_referencer::staff_space (me)/2.0;
- SCM newas = me->get_elt_property ("new-accidentals");
+ SCM newas = me->get_grob_property ("new-accidentals");
Molecule mol;
/*
SCM lists are stacks, so we work from right to left, ending with
Item *it = dynamic_cast<Item*> (me) ;
if (it->break_status_dir () != RIGHT)
{
- SCM old = me->get_elt_property ("old-accidentals");
+ SCM old = me->get_grob_property ("old-accidentals");
/*
Add half a space between cancellation and key sig.
bool
-Key_item::has_interface (Score_element*m)
+Key_item::has_interface (Grob*m)
{
return m && m->has_interface (ly_symbol2scm ("key-signature-interface"));
}
void
-Key_item::set_interface (Score_element*m)
+Key_item::set_interface (Grob*m)
{
m->set_interface (ly_symbol2scm ("key-signature-interface"));
}
~Key_performer();
protected:
- virtual bool do_try_music (Music* req_l);
- virtual void process_acknowledged ();
- virtual void do_pre_move_processing ();
+ virtual bool try_music (Music* req_l);
+ virtual void create_grobs ();
+ virtual void stop_translation_timestep ();
private:
Key_change_req* key_req_l_;
}
void
-Key_performer::process_acknowledged ()
+Key_performer::create_grobs ()
{
if (key_req_l_ &&
gh_list_p (key_req_l_->get_mus_property ("pitch-alist")))
}
void
-Key_performer::do_pre_move_processing ()
+Key_performer::stop_translation_timestep ()
{
if (audio_p_)
{
}
bool
-Key_performer::do_try_music (Music* req_l)
+Key_performer::try_music (Music* req_l)
{
if (Key_change_req *kc = dynamic_cast <Key_change_req *> (req_l))
{
void
-Line_group_engraver_group::typeset_element (Score_element *elem)
+Line_group_engraver_group::typeset_grob (Grob *elem)
{
if (!elem->parent_l (Y_AXIS))
Axis_group_interface::add_element (staffline_p_, elem);
- Engraver_group_engraver::typeset_element (elem);
+ Engraver_group_engraver::typeset_grob (elem);
}
Line_group_engraver_group::do_removal_processing()
{
Engraver_group_engraver::do_removal_processing ();
- Score_element * it
+ Grob * it
= unsmob_element (get_property (ly_symbol2scm ("currentCommandColumn")));
staffline_p_->set_bound(RIGHT,it);
- Engraver_group_engraver::typeset_element (staffline_p_);
+ Engraver_group_engraver::typeset_grob (staffline_p_);
staffline_p_ = 0;
}
Line_group_engraver_group::do_creation_processing()
{
create_line_spanner ();
- Score_element * it
+ Grob * it
= unsmob_element (get_property (ly_symbol2scm ("currentCommandColumn")));
staffline_p_->set_bound(LEFT,it);
- Engraver::announce_element (staffline_p_,0);
+ Engraver::announce_grob (staffline_p_,0);
}
void
{
for (; gh_pair_p (s); s = gh_cdr (s))
{
- Score_element::fixup_refpoint (gh_car (s));
+ Grob::fixup_refpoint (gh_car (s));
}
}
int
Line_of_score::element_count () const
{
- return scm_ilength ( get_elt_property ("all-elements"));
+ return scm_ilength ( get_grob_property ("all-elements"));
}
void
-Line_of_score::typeset_element (Score_element * elem_p)
+Line_of_score::typeset_grob (Grob * elem_p)
{
elem_p->pscore_l_ = pscore_l_;
Pointer_group_interface::add_element (this, "all-elements",elem_p);
void
Line_of_score::output_lines ()
{
- for (SCM s = get_elt_property ("all-elements");
+ for (SCM s = get_grob_property ("all-elements");
gh_pair_p (s); s = gh_cdr (s))
{
unsmob_element (gh_car (s))->do_break_processing ();
int count = 0;
for (int i=0; i < broken_into_l_arr_.size (); i++)
{
- Score_element *se = broken_into_l_arr_[i];
- SCM all = se->get_elt_property ("all-elements");
+ Grob *se = broken_into_l_arr_[i];
+ SCM all = se->get_grob_property ("all-elements");
for (SCM s = all; gh_pair_p (s); s = gh_cdr (s))
{
fixup_refpoint (gh_car (s));
/*
needed for doing items.
*/
- fixup_refpoints (get_elt_property ("all-elements"));
+ fixup_refpoints (get_grob_property ("all-elements"));
- for (SCM s = get_elt_property ("all-elements");
+ for (SCM s = get_grob_property ("all-elements");
gh_pair_p (s); s = gh_cdr (s))
{
unsmob_element (gh_car (s))->handle_broken_dependencies ();
if (i < broken_into_l_arr_.size () - 1)
{
- SCM lastcol = gh_car (line_l->get_elt_property ("columns"));
- Score_element* e = unsmob_element (lastcol);
- SCM inter = e->get_elt_property ("between-system-string");
+ SCM lastcol = gh_car (line_l->get_grob_property ("columns"));
+ Grob* e = unsmob_element (lastcol);
+ SCM inter = e->get_grob_property ("between-system-string");
if (gh_string_p (inter))
{
pscore_l_->outputter_l_->output_string (inter);
{
Line_of_score *line_l = dynamic_cast <Line_of_score*> (clone());
line_l->rank_i_ = i;
- // line_l->set_immutable_elt_property ("rank", gh_int2scm( i));
- Link_array<Score_element> c (breaking[i].cols_);
+ // line_l->set_immutable_grob_property ("rank", gh_int2scm( i));
+ Link_array<Grob> c (breaking[i].cols_);
pscore_l_->typeset_line (line_l);
line_l->set_bound(LEFT,c[0]);
void
Line_of_score::add_column (Paper_column*p)
{
- Score_element *me = this;
- SCM cs = me->get_elt_property ("columns");
- Score_element * prev = gh_pair_p (cs) ? unsmob_element (gh_car (cs)) : 0;
+ Grob *me = this;
+ SCM cs = me->get_grob_property ("columns");
+ Grob * prev = gh_pair_p (cs) ? unsmob_element (gh_car (cs)) : 0;
p->rank_i_ = prev ? Paper_column::rank_i (prev) + 1 : 0;
- me->set_elt_property ("columns", gh_cons (p->self_scm (), cs));
+ me->set_grob_property ("columns", gh_cons (p->self_scm (), cs));
Axis_group_interface::add_element (me, p);
}
void
Line_of_score::pre_processing ()
{
- for (SCM s = get_elt_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
unsmob_element (gh_car (s))->discretionary_processing ();
if(verbose_global_b)
progress_indication ( _f("Element count %d ", element_count ()));
- for (SCM s = get_elt_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
unsmob_element (gh_car (s))->handle_prebroken_dependencies ();
- fixup_refpoints (get_elt_property ("all-elements"));
+ fixup_refpoints (get_grob_property ("all-elements"));
- for (SCM s = get_elt_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
{
- Score_element* sc = unsmob_element (gh_car (s));
+ Grob* sc = unsmob_element (gh_car (s));
sc->calculate_dependencies (PRECALCED, PRECALCING, ly_symbol2scm ("before-line-breaking-callback"));
}
progress_indication ("\n" + _ ("Calculating column positions...") + " " );
- for (SCM s = get_elt_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
{
- Score_element * e = unsmob_element (gh_car (s));
- SCM proc = e->get_elt_property ("spacing-procedure");
+ Grob * e = unsmob_element (gh_car (s));
+ SCM proc = e->get_grob_property ("spacing-procedure");
if (gh_procedure_p (proc))
gh_call1 (proc, e->self_scm ());
}
void
Line_of_score::post_processing (bool last_line)
{
- for (SCM s = get_elt_property ("all-elements");
+ for (SCM s = get_grob_property ("all-elements");
gh_pair_p (s); s = gh_cdr (s))
{
- Score_element* sc = unsmob_element (gh_car (s));
+ Grob* sc = unsmob_element (gh_car (s));
sc->calculate_dependencies (POSTCALCED, POSTCALCING,
ly_symbol2scm ("after-line-breaking-callback"));
}
generate all molecules to trigger all font loads.
(ugh. This is not very memory efficient.) */
- for (SCM s = get_elt_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
{
unsmob_element (gh_car (s))->get_molecule ();
}
/*
all elements.
*/
- for (SCM s = get_elt_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
{
- Score_element *sc = unsmob_element (gh_car (s));
+ Grob *sc = unsmob_element (gh_car (s));
Molecule *m = sc->get_molecule ();
if (!m)
continue;
Offset o (sc->relative_coordinate (this, X_AXIS),
sc->relative_coordinate (this, Y_AXIS));
- SCM e = sc->get_elt_property ("extra-offset");
+ SCM e = sc->get_grob_property ("extra-offset");
if (gh_pair_p (e))
{
o[X_AXIS] += gh_scm2double (gh_car (e));
l = l->column_l ();
r = r->column_l ();
- SCM s = get_elt_property ("columns");
+ SCM s = get_grob_property ("columns");
while (gh_pair_p (s) && gh_car (s) != r->self_scm ())
s = gh_cdr (s);
Return all columns, but filter out any unused columns , since they might
disrupt the spacing problem.
*/
-Link_array<Score_element>
+Link_array<Grob>
Line_of_score::column_l_arr ()const
{
- Link_array<Score_element> acs
- = Pointer_group_interface__extract_elements (this, (Score_element*) 0, "columns");
+ Link_array<Grob> acs
+ = Pointer_group_interface__extract_elements (this, (Grob*) 0, "columns");
bool bfound = false;
for (int i= acs.size (); i -- ; )
{
protected:
VIRTUAL_COPY_CONS(Translator);
void deprecated_process_music();
- virtual void acknowledge_element (Score_element_info);
- virtual void do_pre_move_processing();
+ virtual void acknowledge_grob (Grob_info);
+ virtual void stop_translation_timestep();
virtual void do_creation_processing ();
- virtual void process_acknowledged ();
+ virtual void create_grobs ();
virtual void do_removal_processing ();
public:
Urgh. Since the accidentals depend on lots of variables, we have to
store all information before we can really create the accidentals.
*/
- Link_array<Score_element> arpeggios_;
+ Link_array<Grob> arpeggios_;
Link_array<Note_req> mel_l_arr_;
- Link_array<Score_element> support_l_arr_;
+ Link_array<Grob> support_l_arr_;
Link_array<Item> forced_l_arr_;
- Link_array<Score_element> tied_l_arr_;
+ Link_array<Grob> tied_l_arr_;
Local_key_engraver();
Item * grace_align_l_;
}
void
-Local_key_engraver::process_acknowledged ()
+Local_key_engraver::create_grobs ()
{
deprecated_process_music ();
for (int i=0; i < mel_l_arr_.size(); i++)
{
- Score_element * support_l = support_l_arr_[i];
+ Grob * support_l = support_l_arr_[i];
Note_req * note_l = mel_l_arr_[i];
int n = unsmob_pitch (note_l->get_mus_property ("pitch"))->notename_i_;
Staff_symbol_referencer::set_interface (key_item_p_);
- announce_element (key_item_p_, 0);
+ announce_grob (key_item_p_, 0);
}
}
void
-Local_key_engraver::do_pre_move_processing()
+Local_key_engraver::stop_translation_timestep()
{
if (key_item_p_)
{
for (int i=0; i < support_l_arr_.size(); i++)
Side_position::add_support (key_item_p_,support_l_arr_[i]);
- typeset_element (key_item_p_);
+ typeset_grob (key_item_p_);
key_item_p_ =0;
}
}
void
-Local_key_engraver::acknowledge_element (Score_element_info info)
+Local_key_engraver::acknowledge_grob (Grob_info info)
{
SCM wg= get_property ("weAreGraceContext");
bool selfgr = gh_boolean_p (wg) &&gh_scm2bool (wg);
- bool he_gr = to_boolean (info.elem_l_->get_elt_property ("grace"));
+ bool he_gr = to_boolean (info.elem_l_->get_grob_property ("grace"));
Item * item = dynamic_cast<Item*> (info.elem_l_);
if (he_gr && !selfgr && item && Grace_align_item::has_interface (item))
void
-Local_key_item::add_pitch (Score_element*me, Pitch p, bool cautionary, bool natural)
+Local_key_item::add_pitch (Grob*me, Pitch p, bool cautionary, bool natural)
{
- SCM acs = me->get_elt_property ("accidentals");
+ SCM acs = me->get_grob_property ("accidentals");
SCM pitch = p.smobbed_copy ();
SCM opts = SCM_EOL;
if (cautionary)
pitch = gh_cons (pitch, opts);
acs = scm_merge_x (acs, gh_cons (pitch, SCM_EOL), pitch_less_proc);
- me->set_elt_property ("accidentals", acs);
+ me->set_grob_property ("accidentals", acs);
}
Molecule
-Local_key_item::parenthesize (Score_element*me, Molecule m)
+Local_key_item::parenthesize (Grob*me, Molecule m)
{
Molecule open = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-("));
Molecule close = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-)"));
SCM
Local_key_item::brew_molecule (SCM smob)
{
- Score_element* me = unsmob_element (smob);
+ Grob* me = unsmob_element (smob);
Molecule mol;
bool oct_b = false;
int lastoct = -100;
- SCM accs = me->get_elt_property ("accidentals");
+ SCM accs = me->get_grob_property ("accidentals");
for (SCM s = accs;
gh_pair_p (s); s = gh_cdr (s))
{
lastoct = p.octave_i () ;
- SCM c0 = me->get_elt_property ("c0-position");
+ SCM c0 = me->get_grob_property ("c0-position");
Real dy = (gh_number_p (c0) ? gh_scm2int (c0) : 0 + p.notename_i_)
* note_distance;
/*
Use a cons?
*/
- pads[RIGHT] = me->get_elt_property ("right-padding");
- pads[LEFT] = me->get_elt_property ("left-padding");
+ pads[RIGHT] = me->get_grob_property ("right-padding");
+ pads[LEFT] = me->get_grob_property ("left-padding");
// unused ?
}
bool
-Local_key_item::has_interface (Score_element*m)
+Local_key_item::has_interface (Grob*m)
{
return m && m->has_interface (ly_symbol2scm ("accidentals-interface"));
}
void
-Local_key_item::set_interface (Score_element*m)
+Local_key_item::set_interface (Grob*m)
{
m->set_interface (ly_symbol2scm ("accidentals-interface"));
}
}
bool
-Lyric_engraver::do_try_music (Music*r)
+Lyric_engraver::try_music (Music*r)
{
if (Lyric_req* l = dynamic_cast <Lyric_req *> (r))
{
{
text_p_= new Item (get_property ("LyricText"));
- text_p_->set_elt_property ("text", req_l_->get_mus_property ("text"));
+ text_p_->set_grob_property ("text", req_l_->get_mus_property ("text"));
/*
We can't reach the notehead where we're centered from here. So
text_p_->translate_axis (0.66, X_AXIS);
- announce_element (text_p_, req_l_);
+ announce_grob (text_p_, req_l_);
req_l_ = 0;
}
}
void
-Lyric_engraver::do_pre_move_processing()
+Lyric_engraver::stop_translation_timestep()
{
if (text_p_)
{
- typeset_element (text_p_);
+ typeset_grob (text_p_);
text_p_ =0;
}
}
void
-Lyric_engraver::do_post_move_processing ()
+Lyric_engraver::start_translation_timestep ()
{
req_l_ =0;
}
Real ss = 1.0;
Real sl = sp->paper_l ()->get_var ("stafflinethickness");
Real righttrim = 0.5; // default to half a space gap on the right
- SCM righttrim_scm = sp->get_elt_property("right-trim-amount");
+ SCM righttrim_scm = sp->get_grob_property("right-trim-amount");
if (gh_number_p (righttrim_scm)) {
righttrim = gh_scm2double (righttrim_scm);
}
// The extender can exist in the word space of the left lyric ...
- SCM space = sp->get_bound (LEFT)->get_elt_property ("word-space");
+ SCM space = sp->get_bound (LEFT)->get_grob_property ("word-space");
if (gh_number_p (space))
{
leftext -= gh_scm2double (space)*ss;
}
Real w = sp->spanner_length () - leftext - righttrim*ss;
- Real h = sl * gh_scm2double (sp->get_elt_property ("height"));
+ Real h = sl * gh_scm2double (sp->get_grob_property ("height"));
Molecule mol (Lookup::filledbox ( Box (Interval (0,w), Interval (0,h))));
mol.translate (Offset (leftext, 0));
return mol.smobbed_copy();
}
void
-Lyric_extender::set_textitem (Direction d, Score_element*s)
+Lyric_extender::set_textitem (Direction d, Grob*s)
{
elt_l_->set_bound (d, s);
elt_l_->add_dependency (s);
protected:
- virtual bool do_try_music (Music* req_l);
- virtual void do_pre_move_processing ();
- virtual void process_acknowledged ();
+ virtual bool try_music (Music* req_l);
+ virtual void stop_translation_timestep ();
+ virtual void create_grobs ();
private:
Link_array<Lyric_req> lreq_arr_;
void
-Lyric_performer::process_acknowledged ()
+Lyric_performer::create_grobs ()
{
// FIXME: won't work with fancy lyrics
if (lreq_arr_.size ()
}
void
-Lyric_performer::do_pre_move_processing ()
+Lyric_performer::stop_translation_timestep ()
{
if (audio_p_)
{
}
bool
-Lyric_performer::do_try_music (Music* req_l)
+Lyric_performer::try_music (Music* req_l)
{
if (Lyric_req *lr = dynamic_cast <Lyric_req *> (req_l))
{
void
Lyric_phrasing_engraver::record_notehead(const String &context_id,
- Score_element * notehead)
+ Grob * notehead)
{
Syllable_group * v = lookup_context_id(context_id);
v->set_notehead(notehead);
}
void
-Lyric_phrasing_engraver::record_lyric(const String &context_id, Score_element * lyric)
+Lyric_phrasing_engraver::record_lyric(const String &context_id, Grob * lyric)
{
Syllable_group * v = lookup_context_id(context_id);
v->add_lyric(lyric);
}
void
-Lyric_phrasing_engraver::record_extender(const String &context_id, Score_element * extender)
+Lyric_phrasing_engraver::record_extender(const String &context_id, Grob * extender)
{
SCM key = ly_str02scm(context_id.ch_C());
if( ! gh_null_p(voice_alist_) ) {
}
void
-Lyric_phrasing_engraver::acknowledge_element(Score_element_info i)
+Lyric_phrasing_engraver::acknowledge_grob(Grob_info i)
{
SCM p = get_property("automaticPhrasing");
if(!to_boolean(p))
return;
- Score_element *h = i.elem_l_;
+ Grob *h = i.elem_l_;
if (Note_head::has_interface(h)) {
/* caught a note head ... do something with it */
/* ... but not if it's a grace note ... */
- bool grace= to_boolean (i.elem_l_->get_elt_property ("grace"));
+ bool grace= to_boolean (i.elem_l_->get_grob_property ("grace"));
SCM wg = get_property ("weAreGraceContext");
bool wgb = to_boolean (wg);
if (grace != wgb)
}
-void Lyric_phrasing_engraver::process_acknowledged ()
+void Lyric_phrasing_engraver::create_grobs ()
{
/* iterate through entries in voice_alist_
for each, call set_lyric_align(alignment). Issue a warning if this returns false.
void
-Lyric_phrasing_engraver::do_pre_move_processing ()
+Lyric_phrasing_engraver::stop_translation_timestep ()
{
for(SCM v=voice_alist_; gh_pair_p(v); v = gh_cdr(v)) {
SCM entry_scm = gh_cdar(v);
Item* text_p_;
protected:
- virtual void do_pre_move_processing ();
- virtual void acknowledge_element (Score_element_info);
+ virtual void stop_translation_timestep ();
+ virtual void acknowledge_grob (Grob_info);
void create_items(Request*);
- virtual bool do_try_music (Music *req_l);
+ virtual bool try_music (Music *req_l);
void deprecated_process_music ();
- virtual void do_post_move_processing ();
+ virtual void start_translation_timestep ();
virtual void do_creation_processing ();
- virtual void process_acknowledged ();
+ virtual void create_grobs ();
private:
Mark_req * mark_req_l_;
void
-Mark_engraver::acknowledge_element (Score_element_info inf)
+Mark_engraver::acknowledge_grob (Grob_info inf)
{
- Score_element * s = inf.elem_l_;
+ Grob * s = inf.elem_l_;
if (Staff_symbol::has_interface (s)
- || to_boolean (s->get_elt_property ("invisible-staff")))
+ || to_boolean (s->get_grob_property ("invisible-staff")))
{
SCM sts = get_property ("staffsFound");
SCM thisstaff = inf.elem_l_->self_scm ();
}
void
-Mark_engraver::do_pre_move_processing ()
+Mark_engraver::stop_translation_timestep ()
{
if (text_p_)
{
- text_p_->set_elt_property("side-support-elements" , get_property ("staffsFound"));
- typeset_element (text_p_);
+ text_p_->set_grob_property("side-support-elements" , get_property ("staffsFound"));
+ typeset_grob (text_p_);
text_p_ =0;
}
}
Side_position::set_axis (text_p_, Y_AXIS);
- announce_element (text_p_, rq);
+ announce_grob (text_p_, rq);
}
void
-Mark_engraver::do_post_move_processing ()
+Mark_engraver::start_translation_timestep ()
{
mark_req_l_ = 0;
}
bool
-Mark_engraver::do_try_music (Music* r_l)
+Mark_engraver::try_music (Music* r_l)
{
if (Mark_req *mr = dynamic_cast <Mark_req *> (r_l))
{
}
void
-Mark_engraver::process_acknowledged ()
+Mark_engraver::create_grobs ()
{
deprecated_process_music ();
}
daddy_trans_l_->set_property ("rehearsalMark", m);
- text_p_->set_elt_property ("text",
+ text_p_->set_grob_property ("text",
ly_str02scm ( t.ch_C()));
String style = "mark";
break;
}
}
- SCM st = ly_str02scm (style.ch_C());
- text_p_->set_elt_property ("style", st);
+ SCM st = ly_symbol2scm (style.ch_C());
+ text_p_->set_grob_property ("style", st);
}
}
#include "engraver.hh"
#include "musical-request.hh"
-#include "score-element.hh"
+#include "grob.hh"
#include "translator-group.hh"
/**
{
public:
VIRTUAL_COPY_CONS(Translator);
- bool do_try_music (Music *);
+ bool try_music (Music *);
};
ADD_THIS_TRANSLATOR(Melisma_engraver);
bool
-Melisma_engraver::do_try_music (Music *m )
+Melisma_engraver::try_music (Music *m )
{
if (dynamic_cast<Melisma_playing_req*>(m))
{
Multi_measure_rest_engraver ();
protected:
- virtual void acknowledge_element (Score_element_info i);
+ virtual void acknowledge_grob (Grob_info i);
void deprecated_process_music ();
- virtual bool do_try_music (Music*);
- virtual void do_pre_move_processing ();
- virtual void do_post_move_processing ();
+ virtual bool try_music (Music*);
+ virtual void stop_translation_timestep ();
+ virtual void start_translation_timestep ();
virtual void do_removal_processing ();
- virtual void process_acknowledged ();
+ virtual void create_grobs ();
private:
Span_req * new_req_l_;
}
void
-Multi_measure_rest_engraver::acknowledge_element (Score_element_info i)
+Multi_measure_rest_engraver::acknowledge_grob (Grob_info i)
{
Item * item = dynamic_cast<Item*> (i.elem_l_);
if (item && Bar::has_interface (item))
}
bool
-Multi_measure_rest_engraver::do_try_music (Music* req_l)
+Multi_measure_rest_engraver::try_music (Music* req_l)
{
if (Span_req * sp = dynamic_cast<Span_req*> (req_l))
{
}
void
-Multi_measure_rest_engraver::process_acknowledged ()
+Multi_measure_rest_engraver::create_grobs ()
{
deprecated_process_music ();
}
Multi_measure_rest::set_interface (mmrest_p_);
Staff_symbol_referencer::set_interface (mmrest_p_);
- announce_element (mmrest_p_, busy_span_req_l_);
+ announce_grob (mmrest_p_, busy_span_req_l_);
start_measure_i_
= gh_scm2int (get_property ("currentBarNumber"));
}
}
void
-Multi_measure_rest_engraver::do_pre_move_processing ()
+Multi_measure_rest_engraver::stop_translation_timestep ()
{
SCM smp = get_property ("measurePosition");
Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
if (mmrest_p_ && (now_mom () >= start_moment_)
&& !mp
- && (scm_ilength (mmrest_p_->get_elt_property ("columns")) >= 2))
+ && (scm_ilength (mmrest_p_->get_grob_property ("columns")) >= 2))
{
- typeset_element (mmrest_p_);
+ typeset_grob (mmrest_p_);
/*
must keep mmrest_p_ around to set measures_i_
*/
}
if (lastrest_p_)
{
- typeset_element (lastrest_p_);
+ typeset_grob (lastrest_p_);
lastrest_p_ = 0;
}
}
void
-Multi_measure_rest_engraver::do_post_move_processing ()
+Multi_measure_rest_engraver::start_translation_timestep ()
{
SCM smp = get_property ("measurePosition");
Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
{
lastrest_p_ = mmrest_p_;
int cur = gh_scm2int (get_property ("currentBarNumber"));
- lastrest_p_->set_elt_property ("measure-count",
+ lastrest_p_->set_grob_property ("measure-count",
gh_int2scm (cur - start_measure_i_));
mmrest_p_ = 0;
}
Multi_measure_rest_engraver::do_removal_processing ()
{
if (mmrest_p_)
- typeset_element (mmrest_p_);
+ typeset_grob (mmrest_p_);
if (lastrest_p_)
- typeset_element (lastrest_p_);
+ typeset_grob (lastrest_p_);
}
#include "text-item.hh"
void
-Multi_measure_rest::set_interface (Score_element*me)
+Multi_measure_rest::set_interface (Grob*me)
{
me->set_interface (ly_symbol2scm ("multi-measure-rest-interface"));
}
bool
-Multi_measure_rest::has_interface (Score_element*me)
+Multi_measure_rest::has_interface (Grob*me)
{
return me->has_interface (ly_symbol2scm ("multi-measure-rest-interface"));
}
SCM
Multi_measure_rest::brew_molecule (SCM smob)
{
- Score_element *me = unsmob_element (smob);
+ Grob *me = unsmob_element (smob);
Spanner * sp = dynamic_cast<Spanner*> (me);
SCM alist_chain = Font_interface::font_alist_chain (me);
Molecule s;
int measures = 1;
- SCM m (me->get_elt_property ("measure-count"));
+ SCM m (me->get_grob_property ("measure-count"));
if (gh_number_p (m))
{
measures = gh_scm2int (m);
}
- SCM limit = me->get_elt_property ("expand-limit");
+ SCM limit = me->get_grob_property ("expand-limit");
if (measures <= gh_scm2int (limit))
{
/*
}
Real pad = s.empty_b ()
- ? 0.0 : gh_scm2double (me->get_elt_property ("padding")) * staff_space;
+ ? 0.0 : gh_scm2double (me->get_grob_property ("padding")) * staff_space;
Molecule r (musfont->find_by_name ("rests-" + to_str (k)));
if (k == 0)
UGH. JUNKME elt prop "columns" isn't really needed.
*/
void
-Multi_measure_rest::add_column (Score_element*me,Item* c)
+Multi_measure_rest::add_column (Grob*me,Item* c)
{
Pointer_group_interface::add_element (me, "columns",c);
SCM
Multi_measure_rest::set_spacing_rods (SCM smob)
{
- Score_element*me = unsmob_element (smob);
+ Grob*me = unsmob_element (smob);
Spanner*sp = dynamic_cast<Spanner*> (me);
if (!(sp->get_bound (LEFT) && sp->get_bound (RIGHT)))
should do something more advanced.
*/
rod.distance_f_ = l->extent (l, X_AXIS)[BIGGER] - r->extent (r, X_AXIS)[SMALLER]
- + gh_scm2double (me->get_elt_property ("minimum-width")) * staff_space;
+ + gh_scm2double (me->get_grob_property ("minimum-width")) * staff_space;
rod.add_to_cols ();
}
/*
- score-element-callback.cc -- implement Callback smob.
+ grob-callback.cc -- implement Callback smob.
source file of the GNU LilyPond music typesetter
#include "note-head.hh"
bool
-Note_column::rest_b (Score_element*me)
+Note_column::rest_b (Grob*me)
{
- return unsmob_element (me->get_elt_property ("rest"));
+ return unsmob_element (me->get_grob_property ("rest"));
}
int
-Note_column::shift_compare (Score_element *const &p1, Score_element *const&p2)
+Note_column::shift_compare (Grob *const &p1, Grob *const&p2)
{
- SCM s1 = p1->get_elt_property ("horizontal-shift");
- SCM s2 = p2->get_elt_property ("horizontal-shift");
+ SCM s1 = p1->get_grob_property ("horizontal-shift");
+ SCM s2 = p2->get_grob_property ("horizontal-shift");
int h1 = (gh_number_p (s1))? gh_scm2int (s1) :0;
int h2 = (gh_number_p (s2)) ? gh_scm2int (s2):0;
}
void
-Note_column::set_interface (Score_element* me)
+Note_column::set_interface (Grob* me)
{
- me->set_elt_property ("note-heads", SCM_EOL);
+ me->set_grob_property ("note-heads", SCM_EOL);
me->set_interface (ly_symbol2scm ("note-column-interface"));
Axis_group_interface::set_interface (me);
}
Item *
-Note_column::stem_l (Score_element*me)
+Note_column::stem_l (Grob*me)
{
- SCM s = me->get_elt_property ("stem");
+ SCM s = me->get_grob_property ("stem");
return dynamic_cast<Item*>(unsmob_element (s));
}
Slice
-Note_column::head_positions_interval(Score_element *me)
+Note_column::head_positions_interval(Grob *me)
{
Slice iv;
iv.set_empty ();
- SCM h = me->get_elt_property ("note-heads");
+ SCM h = me->get_grob_property ("note-heads");
for (; gh_pair_p (h); h = gh_cdr (h))
{
- Score_element *se = unsmob_element (gh_car (h));
+ Grob *se = unsmob_element (gh_car (h));
int j = int (Staff_symbol_referencer::position_f (se));
iv.unite (Slice (j,j));
}
Direction
-Note_column::dir (Score_element* me)
+Note_column::dir (Grob* me)
{
- Score_element *stem = unsmob_element (me->get_elt_property ("stem"));
+ Grob *stem = unsmob_element (me->get_grob_property ("stem"));
if (stem && Stem::has_interface (stem))
return Stem::get_direction (stem);
- else if (gh_pair_p (me->get_elt_property ("note-heads")))
+ else if (gh_pair_p (me->get_grob_property ("note-heads")))
return (Direction)sign (head_positions_interval (me).center ());
programming_error ("Note column without heads and stem!");
void
-Note_column::set_stem (Score_element*me,Score_element * stem_l)
+Note_column::set_stem (Grob*me,Grob * stem_l)
{
- me->set_elt_property ("stem", stem_l->self_scm ());
+ me->set_grob_property ("stem", stem_l->self_scm ());
me->add_dependency (stem_l);
Axis_group_interface::add_element (me, stem_l);
}
void
-Note_column::add_head (Score_element*me,Score_element *h)
+Note_column::add_head (Grob*me,Grob *h)
{
if (Rest::has_interface (h))
{
- me->set_elt_property ("rest", h->self_scm ());
+ me->set_grob_property ("rest", h->self_scm ());
}
else if (Note_head::has_interface (h))
{
translate the rest symbols vertically by amount DY_I.
*/
void
-Note_column::translate_rests (Score_element*me,int dy_i)
+Note_column::translate_rests (Grob*me,int dy_i)
{
- Score_element * r = unsmob_element (me->get_elt_property ("rest"));
+ Grob * r = unsmob_element (me->get_grob_property ("rest"));
if (r)
{
r->translate_axis (dy_i * Staff_symbol_referencer::staff_space (r)/2.0, Y_AXIS);
void
-Note_column::set_dotcol (Score_element*me,Score_element *d)
+Note_column::set_dotcol (Grob*me,Grob *d)
{
Axis_group_interface::add_element (me, d);
}
-Score_element*
-Note_column::first_head (Score_element*me)
+Grob*
+Note_column::first_head (Grob*me)
{
- Score_element * st = stem_l (me);
+ Grob * st = stem_l (me);
return st? Stem::first_head (st): 0;
}
bool
-Note_column::has_interface (Score_element*me)
+Note_column::has_interface (Grob*me)
{
return me && me->has_interface (ly_symbol2scm ("note-column-interface"));
}
build a ledger line for small pieces.
*/
Molecule
-Note_head::ledger_line (Interval xwid, Score_element *me)
+Note_head::ledger_line (Interval xwid, Grob *me)
{
Drul_array<Molecule> endings;
endings[LEFT] = Font_interface::get_default_font (me)->find_by_name ("noteheads-ledgerending");
SCM
Note_head::brew_molecule (SCM smob)
{
- Score_element *me = unsmob_element (smob);
+ Grob *me = unsmob_element (smob);
Real inter_f = Staff_symbol_referencer::staff_space (me)/2;
? 0
: (abs(p) - sz) /2;
- SCM style = me->get_elt_property ("style");
+ SCM style = me->get_grob_property ("style");
if (!gh_symbol_p (style))
{
return SCM_EOL;
// ugh: use gh_call ()
Molecule out = Font_interface::get_default_font (me)->find_by_name (String ("noteheads-") +
ly_scm2string (scm_eval2 (gh_list (ly_symbol2scm("find-notehead-symbol"),
- me->get_elt_property ("duration-log"),
+ me->get_grob_property ("duration-log"),
ly_quote_scm(style),
SCM_UNDEFINED),
SCM_EOL)));
}
bool
-Note_head::has_interface (Score_element*m)
+Note_head::has_interface (Grob*m)
{
return m&& m->has_interface (ly_symbol2scm ("note-head-interface"));
}
Note_heads_engraver();
protected:
- virtual void do_post_move_processing ();
- virtual bool do_try_music (Music *req_l) ;
- virtual void process_acknowledged ();
- virtual void acknowledge_element (Score_element_info) ;
+ virtual void start_translation_timestep ();
+ virtual bool try_music (Music *req_l) ;
+ virtual void create_grobs ();
+ virtual void acknowledge_grob (Grob_info) ;
void deprecated_process_music();
- virtual void do_pre_move_processing();
+ virtual void stop_translation_timestep();
};
}
bool
-Note_heads_engraver::do_try_music (Music *m)
+Note_heads_engraver::try_music (Music *m)
{
if (Note_req * n =dynamic_cast <Note_req *> (m))
{
}
void
-Note_heads_engraver::process_acknowledged ()
+Note_heads_engraver::create_grobs ()
{
deprecated_process_music ();
}
void
-Note_heads_engraver::acknowledge_element (Score_element_info)
+Note_heads_engraver::acknowledge_grob (Grob_info)
{
//deprecated_process_music ();
}
Music * req = note_req_l_arr_[i];
Duration dur = *unsmob_duration (req->get_mus_property ("duration"));
- note_p->set_elt_property ("duration-log",
+ note_p->set_grob_property ("duration-log",
gh_int2scm (dur.duration_log () <? 2));
if (dur.dot_count ())
Rhythmic_head::set_dots (note_p, d);
if (dur.dot_count ()
- != gh_scm2int (d->get_elt_property ("dot-count")))
- d->set_elt_property ("dot-count", gh_int2scm (dur.dot_count ()));
+ != gh_scm2int (d->get_grob_property ("dot-count")))
+ d->set_grob_property ("dot-count", gh_int2scm (dur.dot_count ()));
d->set_parent (note_p, Y_AXIS);
- announce_element (d,0);
+ announce_grob (d,0);
dot_p_arr_.push (d);
}
- note_p->set_elt_property("staff-position", gh_int2scm (unsmob_pitch (req->get_mus_property ("pitch"))->steps ()));
+ note_p->set_grob_property("staff-position", gh_int2scm (unsmob_pitch (req->get_mus_property ("pitch"))->steps ()));
- announce_element (note_p,req);
+ announce_grob (note_p,req);
note_p_arr_.push (note_p);
}
}
void
-Note_heads_engraver::do_pre_move_processing()
+Note_heads_engraver::stop_translation_timestep()
{
for (int i=0; i < note_p_arr_.size (); i++)
{
- typeset_element (note_p_arr_[i]);
+ typeset_grob (note_p_arr_[i]);
}
note_p_arr_.clear ();
for (int i=0; i < dot_p_arr_.size (); i++)
{
- typeset_element (dot_p_arr_[i]);
+ typeset_grob (dot_p_arr_[i]);
}
dot_p_arr_.clear ();
}
void
-Note_heads_engraver::do_post_move_processing ()
+Note_heads_engraver::start_translation_timestep ()
{
/* TODO:make this settable?
*/
VIRTUAL_COPY_CONS(Translator);
Link_array<Note_req> req_l_arr_;
Link_array<Item> texts_;
- virtual bool do_try_music (Music*m);
+ virtual bool try_music (Music*m);
void deprecated_process_music ();
- virtual void do_pre_move_processing ();
+ virtual void stop_translation_timestep ();
};
bool
-Note_name_engraver::do_try_music (Music *m)
+Note_name_engraver::try_music (Music *m)
{
if (Note_req *r = dynamic_cast<Note_req* > (m))
{
if (s.length_i())
{
Item * t = new Item (get_property ("NoteName"));
- t->set_elt_property ("text", ly_str02scm ( s.ch_C()));
- announce_element (t, req_l_arr_[0]);
+ t->set_grob_property ("text", ly_str02scm ( s.ch_C()));
+ announce_grob (t, req_l_arr_[0]);
texts_.push (t);
}
}
void
-Note_name_engraver::do_pre_move_processing ()
+Note_name_engraver::stop_translation_timestep ()
{
for (int i=0; i < texts_.size (); i++)
{
- typeset_element (texts_[i]);
+ typeset_grob (texts_[i]);
}
texts_.clear() ;
req_l_arr_.clear ();
VIRTUAL_COPY_CONS(Translator);
protected:
- virtual bool do_try_music (Music *req_l) ;
+ virtual bool try_music (Music *req_l) ;
- virtual void do_pre_move_processing ();
- virtual void process_acknowledged ();
+ virtual void stop_translation_timestep ();
+ virtual void create_grobs ();
Global_translator* global_translator_l ();
private:
ADD_THIS_TRANSLATOR (Note_performer);
void
-Note_performer::process_acknowledged ()
+Note_performer::create_grobs ()
{
if (note_req_l_arr_.size ())
{
void
-Note_performer::do_pre_move_processing ()
+Note_performer::stop_translation_timestep ()
{
// why don't grace notes show up here?
}
bool
-Note_performer::do_try_music (Music* req_l)
+Note_performer::try_music (Music* req_l)
{
if (Note_req *nr = dynamic_cast <Note_req *> (req_l))
{
*/
#include "engraver.hh"
-#include "score-element.hh"
+#include "grob.hh"
#include "output-property-music-iterator.hh"
class Output_property_engraver : public Engraver
\property Voice.outputProperties \push #pred = #modifier
where both MODIFIER and PRED are functions taking a
- score-element.
+ grob.
*/
Link_array<Music> props_;
- virtual void do_pre_move_processing ();
- virtual void acknowledge_element (Score_element_info);
- virtual bool do_try_music (Music*);
+ virtual void stop_translation_timestep ();
+ virtual void acknowledge_grob (Grob_info);
+ virtual bool try_music (Music*);
};
bool
-Output_property_engraver::do_try_music (Music* m)
+Output_property_engraver::try_music (Music* m)
{
if (m->get_mus_property ("type") ==
Output_property_music_iterator::constructor_cxx_function)
}
void
-Output_property_engraver::acknowledge_element (Score_element_info inf)
+Output_property_engraver::acknowledge_grob (Grob_info inf)
{
for (int i=props_.size (); i--; )
{
{
SCM sym = o->get_mus_property ("symbol");
SCM val = o->get_mus_property ("value");
- inf.elem_l_->set_elt_property (sym, val);
+ inf.elem_l_->set_grob_property (sym, val);
}
}
}
void
-Output_property_engraver::do_pre_move_processing ()
+Output_property_engraver::stop_translation_timestep ()
{
props_.clear ();
}
}
int
-Paper_column::rank_i(Score_element*me)
+Paper_column::rank_i(Grob*me)
{
return dynamic_cast<Paper_column*> (me)->rank_i_;
}
}
Moment
-Paper_column::when_mom (Score_element*me)
+Paper_column::when_mom (Grob*me)
{
- SCM m = me->get_elt_property ("when");
+ SCM m = me->get_grob_property ("when");
Moment s (0);
if (unsmob_moment (m))
{
bool
Paper_column::musical_b () const
{
- SCM m = get_elt_property ("shortest-starter-duration");
+ SCM m = get_grob_property ("shortest-starter-duration");
Moment s (0);
if (unsmob_moment (m))
{
}
bool
-Paper_column::used_b (Score_element*me )
+Paper_column::used_b (Grob*me )
{
- return gh_pair_p (me->get_elt_property ("elements")) || Item::breakable_b (me)
- || gh_pair_p (me->get_elt_property ("bounded-by-me"))
+ return gh_pair_p (me->get_grob_property ("elements")) || Item::breakable_b (me)
+ || gh_pair_p (me->get_grob_property ("bounded-by-me"))
;
}
/*
Be sure to set breakability on first & last column.
*/
- Link_array<Score_element> pc (line_l_->column_l_arr ());
+ Link_array<Grob> pc (line_l_->column_l_arr ());
- pc[0]->set_elt_property ("breakable", SCM_BOOL_T);
- pc.top ()->set_elt_property ("breakable", SCM_BOOL_T);
+ pc[0]->set_grob_property ("breakable", SCM_BOOL_T);
+ pc.top ()->set_grob_property ("breakable", SCM_BOOL_T);
line_l_->pre_processing ();
void
-Performer_group_performer::process_acknowledged ()
+Performer_group_performer::create_grobs ()
{
for (SCM p = simple_trans_list_; gh_pair_p (p); p = gh_cdr ( p))
{
Translator * t = unsmob_translator (gh_car (p));
Performer * eng = dynamic_cast<Performer*> (t);
if (eng)
- eng->process_acknowledged ();
+ eng->create_grobs ();
}
}
void
-Performer_group_performer::acknowledge_elements ()
+Performer_group_performer::acknowledge_grobs ()
{
for (int j =0; j < announce_info_arr_.size(); j++)
{
Translator * t = unsmob_translator (gh_car (p));
Performer * eng = dynamic_cast<Performer*> (t);
if (eng && eng!= info.origin_trans_l_)
- eng->acknowledge_element (info);
+ eng->acknowledge_grob (info);
}
}
}
}
- process_acknowledged ();
+ create_grobs ();
// debug
int i = 0;
while (announce_info_arr_.size () && i++ < 5)
{
- acknowledge_elements ();
+ acknowledge_grobs ();
announce_info_arr_.clear ();
- process_acknowledged ();
+ create_grobs ();
}
if (announce_info_arr_.size ())
}
void
-Performer::acknowledge_element (Audio_element_info)
+Performer::acknowledge_grob (Audio_element_info)
{
}
void
-Performer::process_acknowledged ()
+Performer::create_grobs ()
{
}
#include "engraver.hh"
#include "musical-request.hh"
-#include "score-element.hh"
+#include "grob.hh"
#include "item.hh"
#include "lily-guile.hh"
#include "rhythmic-head.hh"
~Piano_pedal_engraver ();
protected:
virtual void do_creation_processing ();
- virtual bool do_try_music (Music*);
- virtual void do_pre_move_processing ();
- virtual void do_post_move_processing ();
- virtual void acknowledge_element (Score_element_info);
- virtual void process_acknowledged ();
+ virtual bool try_music (Music*);
+ virtual void stop_translation_timestep ();
+ virtual void start_translation_timestep ();
+ virtual void acknowledge_grob (Grob_info);
+ virtual void create_grobs ();
private:
struct Pedal_info
I'm a script
*/
void
-Piano_pedal_engraver::acknowledge_element (Score_element_info info)
+Piano_pedal_engraver::acknowledge_grob (Grob_info info)
{
for (Pedal_info*p = info_list_; p && p->name_; p ++)
{
}
bool
-Piano_pedal_engraver::do_try_music (Music *m)
+Piano_pedal_engraver::try_music (Music *m)
{
if (Span_req * s = dynamic_cast<Span_req*>(m))
{
}
void
-Piano_pedal_engraver::process_acknowledged ()
+Piano_pedal_engraver::create_grobs ()
{
for (Pedal_info*p = info_list_; p && p->name_; p ++)
{
{
String propname = String (p->name_) + "Pedal";
p->item_p_ = new Item (get_property (propname.ch_C()));
- p->item_p_->set_elt_property ("text", s);
+ p->item_p_->set_grob_property ("text", s);
- announce_element (p->item_p_,
+ announce_grob (p->item_p_,
p->req_l_drul_[START]
? p->req_l_drul_[START]
: p->req_l_drul_[STOP]);
}
void
-Piano_pedal_engraver::do_pre_move_processing ()
+Piano_pedal_engraver::stop_translation_timestep ()
{
Item * sustain = 0;
for (Pedal_info*p = info_list_; p->name_; p ++)
Side_position::add_support (p->item_p_,sustain);
}
}
- typeset_element (p->item_p_);
+ typeset_grob (p->item_p_);
}
p->item_p_ = 0;
}
}
void
-Piano_pedal_engraver::do_post_move_processing ()
+Piano_pedal_engraver::start_translation_timestep ()
{
for (Pedal_info*p = info_list_; p->name_; p ++)
{
protected:
virtual void do_creation_processing ();
- virtual bool do_try_music (Music*);
- virtual void process_acknowledged ();
- virtual void do_pre_move_processing ();
- virtual void do_post_move_processing ();
+ virtual bool try_music (Music*);
+ virtual void create_grobs ();
+ virtual void stop_translation_timestep ();
+ virtual void start_translation_timestep ();
private:
Link_array<Audio_piano_pedal> audio_p_arr_;
}
void
-Piano_pedal_performer::process_acknowledged ()
+Piano_pedal_performer::create_grobs ()
{
for (Pedal_info*p = info_alist_; p && p->name_; p ++)
}
void
-Piano_pedal_performer::do_pre_move_processing ()
+Piano_pedal_performer::stop_translation_timestep ()
{
for (int i=0; i< audio_p_arr_.size (); i++)
play_element (audio_p_arr_[i]);
}
void
-Piano_pedal_performer::do_post_move_processing ()
+Piano_pedal_performer::start_translation_timestep ()
{
for (Pedal_info*p = info_alist_; p && p->name_; p ++)
{
}
bool
-Piano_pedal_performer::do_try_music (Music* r)
+Piano_pedal_performer::try_music (Music* r)
{
if (Span_req * s = dynamic_cast<Span_req*>(r))
{
class Pitch_squash_engraver : public Engraver {
public:
VIRTUAL_COPY_CONS (Translator);
- virtual void acknowledge_element (Score_element_info);
+ virtual void acknowledge_grob (Grob_info);
};
void
-Pitch_squash_engraver::acknowledge_element (Score_element_info i)
+Pitch_squash_engraver::acknowledge_grob (Grob_info i)
{
SCM newpos = get_property ("squashedPosition");
if (Note_head::has_interface (i.elem_l_))
{
- i.elem_l_->set_elt_property ("staff-position", newpos);
+ i.elem_l_->set_grob_property ("staff-position", newpos);
}
}
*/
#include "group-interface.hh"
-#include "score-element.hh"
+#include "grob.hh"
#include "lily-guile.hh"
#include "engraver.hh"
#include "dictionary.hh"
-#include "score-element.hh"
+#include "grob.hh"
#include "scm-hash.hh"
#include "translator-group.hh"
UGH. Junk Dictionary
*/
Scheme_hash_table *prop_dict_; // junkme
- void apply_properties (SCM, Score_element*, Translator_group *origin);
+ void apply_properties (SCM, Grob*, Translator_group *origin);
protected:
- virtual void acknowledge_element (Score_element_info ei);
+ virtual void acknowledge_grob (Grob_info ei);
virtual void do_creation_processing ();
virtual void do_removal_processing ();
public:
}
void
-Property_engraver::acknowledge_element (Score_element_info i)
+Property_engraver::acknowledge_grob (Grob_info i)
{
/////////
return;
- SCM ifs = i.elem_l_->get_elt_property ("interfaces");
+ SCM ifs = i.elem_l_->get_grob_property ("interfaces");
SCM props;
for (; gh_pair_p (ifs); ifs = gh_cdr (ifs))
{
void
-Property_engraver::apply_properties (SCM p, Score_element *e, Translator_group*origin)
+Property_engraver::apply_properties (SCM p, Grob *e, Translator_group*origin)
{
for (; gh_pair_p (p); p = gh_cdr (p))
{
else if (gh_apply (type_p, scm_listify (val, SCM_UNDEFINED))
== SCM_BOOL_T) // defined and right type: do it
{
- e->set_elt_property (elt_prop_sym, val);
+ e->set_grob_property (elt_prop_sym, val);
SCM errport = scm_current_error_port ();
scm_display (prop_sym, errport);
scm_puts (origin->type_str_.ch_C(), errport);
scm_puts (".", errport);
- SCM name = e->get_elt_property ("meta");
+ SCM name = e->get_grob_property ("meta");
name = scm_assoc (ly_symbol2scm ("name"), name);
scm_display (gh_cdr(name), errport);
scm_puts(" \\push #'",errport);
{
SCM sym = music_l_->get_mus_property ("symbol");
if (gh_symbol_p(sym))
- report_to_l ()->set_property (sym, music_l_->get_mus_property ("value"));
+ {
+ SCM val = music_l_->get_mus_property ("value");
+ bool ok= true;
+ if (val != SCM_EOL)
+ ok = type_check_assignment (val, sym, ly_symbol2scm ("translation-type?"));
+ if (ok)
+ report_to_l ()->set_property (sym, val);
+ }
Simple_music_iterator::process (m);
}
public:
VIRTUAL_COPY_CONS (Translator);
Repeat_acknowledge_engraver();
-
- virtual void do_post_move_processing ();
- void deprecated_process_music ();
+
+ virtual void start_translation_timestep ();
+ virtual void process_music ();
virtual void do_creation_processing ();
+
+ bool first_b_;
};
void
Repeat_acknowledge_engraver::do_creation_processing ()
{
+ first_b_ = true;
daddy_trans_l_->set_property ("repeatCommands", SCM_EOL);
}
}
void
-Repeat_acknowledge_engraver::do_post_move_processing ()
+Repeat_acknowledge_engraver::start_translation_timestep ()
{
+ first_b_ = true;
Translator_group * tr = daddy_trans_l_->where_defined (ly_symbol2scm ("repeatCommands"));
if (!tr)
tr = daddy_trans_l_;
}
void
-Repeat_acknowledge_engraver::deprecated_process_music ()
+Repeat_acknowledge_engraver::process_music ()
{
/*
At the start of a piece, we don't print any repeat bars.
cs = gh_cdr (cs);
}
- if ( start && end )
+ if (start && end )
s = ":|:";
else if (start)
s = "|:";
}
}
-
ADD_THIS_TRANSLATOR(Repeat_acknowledge_engraver);
{
Item* rest_collision_p_;
- Link_array<Score_element> note_column_l_arr_;
+ Link_array<Grob> note_column_l_arr_;
protected:
- virtual void acknowledge_element (Score_element_info);
- virtual void process_acknowledged ();
- virtual void do_pre_move_processing();
+ virtual void acknowledge_grob (Grob_info);
+ virtual void create_grobs ();
+ virtual void stop_translation_timestep();
public:
VIRTUAL_COPY_CONS(Translator);
Rest_collision_engraver();
}
void
-Rest_collision_engraver::process_acknowledged ()
+Rest_collision_engraver::create_grobs ()
{
if (rest_collision_p_ || note_column_l_arr_.size () < 2)
return;
rest_collision_p_ = new Item (get_property ("RestCollision"));
Rest_collision::set_interface (rest_collision_p_);
- announce_element (rest_collision_p_, 0);
+ announce_grob (rest_collision_p_, 0);
for (int i=0; i< note_column_l_arr_.size (); i++)
Rest_collision::add_column ( rest_collision_p_,note_column_l_arr_[i]);
}
void
-Rest_collision_engraver::acknowledge_element (Score_element_info i)
+Rest_collision_engraver::acknowledge_grob (Grob_info i)
{
if (Note_column::has_interface (i.elem_l_))
note_column_l_arr_.push (i.elem_l_);
}
void
-Rest_collision_engraver::do_pre_move_processing()
+Rest_collision_engraver::stop_translation_timestep()
{
if (rest_collision_p_)
{
- typeset_element (rest_collision_p_);
+ typeset_grob (rest_collision_p_);
rest_collision_p_ = 0;
}
note_column_l_arr_.clear ();
SCM
Rest_collision::force_shift_callback (SCM element_smob, SCM axis)
{
- Score_element *them = unsmob_element (element_smob);
+ Grob *them = unsmob_element (element_smob);
Axis a = (Axis) gh_scm2int (axis);
assert (a == Y_AXIS);
- Score_element * rc = unsmob_element (them->get_elt_property ("rest-collision"));
+ Grob * rc = unsmob_element (them->get_grob_property ("rest-collision"));
if (rc)
{
/*
Done: destruct pointers, so we do the shift only once.
*/
- SCM elts = rc->get_elt_property ("elements");
- rc->set_elt_property ("elements", SCM_EOL);
+ SCM elts = rc->get_grob_property ("elements");
+ rc->set_grob_property ("elements", SCM_EOL);
do_shift (rc, elts);
}
}
void
-Rest_collision::add_column (Score_element*me,Score_element *p)
+Rest_collision::add_column (Grob*me,Grob *p)
{
me->add_dependency (p);
Pointer_group_interface::add_element (me, "elements", p);
- p->add_offset_callback (Rest_collision::force_shift_callback_proc, Y_AXIS);
- p->set_elt_property ("rest-collision", me->self_scm ());
+ /*
+ only add callback for the rests, since we don't move anything else.
+
+ (not?)
+ */
+ p->add_offset_callback (Rest_collision::force_shift_callback_proc, Y_AXIS);
+ p->set_grob_property ("rest-collision", me->self_scm ());
}
Combination of dot-count and duration-log.
*/
static SCM
-head_characteristic (Score_element * col)
+head_characteristic (Grob * col)
{
- Score_element * s = unsmob_element (col->get_elt_property ("rest"));
+ Grob * s = unsmob_element (col->get_grob_property ("rest"));
if (!s)
return SCM_BOOL_F;
else
- return gh_cons (s->get_elt_property ("duration-log"),
+ return gh_cons (s->get_grob_property ("duration-log"),
gh_int2scm (Rhythmic_head::dot_count (s)));
}
TODO: fixme, fucks up if called twice on the same set of rests.
*/
SCM
-Rest_collision::do_shift (Score_element *me, SCM elts)
+Rest_collision::do_shift (Grob *me, SCM elts)
{
/*
ugh. -> score elt type
*/
- Link_array<Score_element> rests;
- Link_array<Score_element> notes;
- Score_element * commony = 0;
+ Link_array<Grob> rests;
+ Link_array<Grob> notes;
+ Grob * commony = 0;
for (SCM s = elts; gh_pair_p (s); s = gh_cdr (s))
{
- Score_element * e = unsmob_element (gh_car (s));
+ Grob * e = unsmob_element (gh_car (s));
if (!e)
continue;
else
commony= commony->common_refpoint (e, Y_AXIS);
- if (unsmob_element (e->get_elt_property ("rest")))
+ if (unsmob_element (e->get_grob_property ("rest")))
rests.push (e);
else
notes.push (e);
(urg: all 3 of them, currently).
*/
int display_count;
- SCM s = me->get_elt_property ("maximum-rest-count");
+ SCM s = me->get_grob_property ("maximum-rest-count");
if (i == rests.size ()
&& gh_number_p (s) && gh_scm2int (s) < rests.size ())
{
display_count = gh_scm2int (s);
for (; i > display_count; i--)
{
- Score_element* r = unsmob_element (rests[i-1]->get_elt_property ("rest"));
+ Grob* r = unsmob_element (rests[i-1]->get_grob_property ("rest"));
if (r)
r->suicide ();
rests[i-1]->suicide ();
{
warning (_("too many notes for rest collision"));
}
- Score_element * rcol = rests[0];
+ Grob * rcol = rests[0];
// try to be opposite of noteheads.
Direction dir = - Note_column::dir (notes[0]);
- Score_element * r = unsmob_element (rcol->get_elt_property ("rest"));
+ Grob * r = unsmob_element (rcol->get_grob_property ("rest"));
Interval restdim = r->extent (r, Y_AXIS); // ??
if (restdim.empty_b ())
// FIXME: staff ref'd?
Real staff_space = 1.0;
- Real minimum_dist = gh_scm2double (me->get_elt_property ("minimum-distance")) * staff_space;
+ Real minimum_dist = gh_scm2double (me->get_grob_property ("minimum-distance")) * staff_space;
/*
assumption: ref points are the same.
Interval notedim;
for (int i = 0; i < notes.size(); i++)
{
- Score_element * stem = Note_column::stem_l (notes[i]);
- Score_element * head = Stem::first_head (stem);
+ Grob * stem = Note_column::stem_l (notes[i]);
+ Grob * head = Stem::first_head (stem);
notedim.unite (head->extent (commony, Y_AXIS));
}
}
void
-Rest_collision::set_interface (Score_element*me)
+Rest_collision::set_interface (Grob*me)
{
me->set_extent_callback (SCM_EOL, X_AXIS);
me->set_extent_callback (SCM_EOL, Y_AXIS);
{
Rest_req *rest_req_l_;
Item * dot_p_;
- Score_element* rest_p_;
+ Grob* rest_p_;
protected:
- virtual bool do_try_music (Music *);
- virtual void do_pre_move_processing ();
- virtual void do_post_move_processing ();
+ virtual bool try_music (Music *);
+ virtual void stop_translation_timestep ();
+ virtual void start_translation_timestep ();
void deprecated_process_music ();
public:
}
void
-Rest_engraver::do_post_move_processing ()
+Rest_engraver::start_translation_timestep ()
{
rest_req_l_ =0;
}
void
-Rest_engraver::do_pre_move_processing ()
+Rest_engraver::stop_translation_timestep ()
{
if (rest_p_)
{
- typeset_element (rest_p_);
+ typeset_grob (rest_p_);
rest_p_ =0;
}
if (dot_p_)
{
- typeset_element (dot_p_);
+ typeset_grob (dot_p_);
dot_p_ =0;
}
}
int durlog = unsmob_duration (rest_req_l_->get_mus_property ("duration"))-> duration_log ();
- rest_p_->set_elt_property ("duration-log",
+ rest_p_->set_grob_property ("duration-log",
gh_int2scm (durlog));
int dots =unsmob_duration (rest_req_l_->get_mus_property ("duration"))->dot_count ();
Rhythmic_head::set_dots (rest_p_, dot_p_);
dot_p_->set_parent (rest_p_, Y_AXIS);
- dot_p_->set_elt_property ("dot-count", gh_int2scm (dots));
- announce_element (dot_p_,0);
+ dot_p_->set_grob_property ("dot-count", gh_int2scm (dots));
+ announce_grob (dot_p_,0);
}
- announce_element (rest_p_, rest_req_l_);
+ announce_grob (rest_p_, rest_req_l_);
}
}
bool
-Rest_engraver::do_try_music (Music *m)
+Rest_engraver::try_music (Music *m)
{
if (Rest_req *r = dynamic_cast <Rest_req *> (m))
{
SCM
Rest::after_line_breaking (SCM smob)
{
- Score_element *me = unsmob_element (smob);
- int bt = gh_scm2int (me->get_elt_property ("duration-log"));
+ Grob *me = unsmob_element (smob);
+ int bt = gh_scm2int (me->get_grob_property ("duration-log"));
if (bt == 0)
{
me->translate_axis (Staff_symbol_referencer::staff_space (me) , Y_AXIS);
}
- Score_element * d = unsmob_element (me->get_elt_property ("dot"));
+ Grob * d = unsmob_element (me->get_grob_property ("dot"));
if (d && bt > 4) // UGH.
{
- d->set_elt_property ("staff-position",
+ d->set_grob_property ("staff-position",
gh_int2scm ((bt == 7) ? 4 : 3));
}
}
-MAKE_SCHEME_CALLBACK(Rest,brew_molecule,1)
-SCM
-Rest::brew_molecule (SCM smob)
+MAKE_SCHEME_CALLBACK(Rest,brew_molecule,1);
+
+SCM
+Rest::brew_internal_molecule (SCM smob)
{
- Score_element* me = unsmob_element (smob);
+ Grob* me = unsmob_element (smob);
bool ledger_b =false;
- SCM balltype = me->get_elt_property ("duration-log");
+ SCM balltype = me->get_grob_property ("duration-log");
if (balltype == gh_int2scm (0) || balltype == gh_int2scm (1))
{
}
String style;
- SCM style_sym =me->get_elt_property ("style");
- if (gh_scm2int (balltype) >= 2 && gh_string_p (style_sym))
+ SCM style_sym =me->get_grob_property ("style");
+ if (gh_scm2int (balltype) >= 2 && gh_symbol_p (style_sym))
{
- style = ly_scm2string (style_sym);
+ style = ly_scm2string (scm_symbol_to_string (style_sym));
}
String idx = ("rests-") + to_str (gh_scm2int (balltype))
return Font_interface::get_default_font (me)->find_by_name (idx).smobbed_copy();
}
+SCM
+Rest::brew_molecule (SCM smob)
+{
+ return brew_internal_molecule (smob);
+}
+MAKE_SCHEME_CALLBACK(Rest,extent_callback,2);
+/*
+ We need the callback. The real molecule has ledgers depending on
+ Y-position. The Y-position is known only after line breaking. */
+SCM
+Rest::extent_callback (SCM smob, SCM ax)
+{
+ Axis a = (Axis) gh_scm2int (ax);
+ SCM m = brew_internal_molecule (smob);
+ return ly_interval2scm (unsmob_molecule (m)->extent (a));
+}
bool
-Rest::has_interface (Score_element*m)
+Rest::has_interface (Grob*m)
{
return m && m->has_interface (ly_symbol2scm ("rest-interface"));
}
class Rhythmic_column_engraver :public Engraver
{
- Link_array<Score_element> rhead_l_arr_;
- Link_array<Score_element> grace_slur_endings_;
- Score_element * stem_l_;
- Score_element *ncol_p_;
- Score_element *dotcol_l_;
+ Link_array<Grob> rhead_l_arr_;
+ Link_array<Grob> grace_slur_endings_;
+ Grob * stem_l_;
+ Grob *ncol_p_;
+ Grob *dotcol_l_;
protected:
VIRTUAL_COPY_CONS(Translator);
- virtual void acknowledge_element (Score_element_info);
- virtual void process_acknowledged ();
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing();
+ virtual void acknowledge_grob (Grob_info);
+ virtual void create_grobs ();
+ virtual void stop_translation_timestep();
+ virtual void start_translation_timestep();
public:
Rhythmic_column_engraver();
void
-Rhythmic_column_engraver::process_acknowledged ()
+Rhythmic_column_engraver::create_grobs ()
{
if (rhead_l_arr_.size ())
{
{
ncol_p_ = new Item (get_property("NoteColumn"));
Note_column::set_interface (ncol_p_);
- announce_element (ncol_p_, 0);
+ announce_grob (ncol_p_, 0);
}
for (int i=0; i < rhead_l_arr_.size (); i++)
}
void
-Rhythmic_column_engraver::acknowledge_element (Score_element_info i)
+Rhythmic_column_engraver::acknowledge_grob (Grob_info i)
{
SCM wg = get_property ("weAreGraceContext");
bool wegrace = to_boolean (wg);
- if (wegrace != to_boolean (i.elem_l_->get_elt_property ("grace"))
+ if (wegrace != to_boolean (i.elem_l_->get_grob_property ("grace"))
&& !Slur::has_interface (i.elem_l_))
return ;
end slurs starting on grace notes
*/
- if (to_boolean (i.elem_l_->get_elt_property ("grace")))
+ if (to_boolean (i.elem_l_->get_grob_property ("grace")))
grace_slur_endings_.push (i.elem_l_);
}
}
void
-Rhythmic_column_engraver::do_pre_move_processing()
+Rhythmic_column_engraver::stop_translation_timestep()
{
if (ncol_p_)
{
- typeset_element (ncol_p_);
+ typeset_grob (ncol_p_);
ncol_p_ =0;
}
}
void
-Rhythmic_column_engraver::do_post_move_processing()
+Rhythmic_column_engraver::start_translation_timestep()
{
grace_slur_endings_.clear ();
dotcol_l_ =0;
Item*
-Rhythmic_head::dots_l (Score_element*me)
+Rhythmic_head::dots_l (Grob*me)
{
- SCM s = me->get_elt_property ("dot");
+ SCM s = me->get_grob_property ("dot");
return dynamic_cast<Item*> (unsmob_element (s));
}
int
-Rhythmic_head::balltype_i (Score_element*me)
+Rhythmic_head::balltype_i (Grob*me)
{
- SCM s = me->get_elt_property ("duration-log");
+ SCM s = me->get_grob_property ("duration-log");
return gh_number_p (s) ? gh_scm2int (s) : 0;
}
Item*
-Rhythmic_head::stem_l (Score_element*me)
+Rhythmic_head::stem_l (Grob*me)
{
- SCM s = me->get_elt_property ("stem");
+ SCM s = me->get_grob_property ("stem");
return dynamic_cast<Item*> (unsmob_element (s));
}
int
-Rhythmic_head::dot_count (Score_element*me)
+Rhythmic_head::dot_count (Grob*me)
{
return dots_l (me)
- ? gh_scm2int (dots_l (me)->get_elt_property ("dot-count")) : 0;
+ ? gh_scm2int (dots_l (me)->get_grob_property ("dot-count")) : 0;
}
void
-Rhythmic_head::set_dots (Score_element*me,Item *dot_l)
+Rhythmic_head::set_dots (Grob*me,Item *dot_l)
{
- me->set_elt_property ("dot", dot_l->self_scm ());
+ me->set_grob_property ("dot", dot_l->self_scm ());
}
void
-Rhythmic_head::set_interface (Score_element*me)
+Rhythmic_head::set_interface (Grob*me)
{
me->set_interface (ly_symbol2scm ("rhythmic-head-interface"));
}
bool
-Rhythmic_head::has_interface (Score_element*me)
+Rhythmic_head::has_interface (Grob*me)
{
return me && me->has_interface (ly_symbol2scm ("rhythmic-head-interface"));
}
+++ /dev/null
-#if 0
-/*
- score-element-callback.cc -- implement Callback smob.
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-
-#include "score-element-callback.hh"
-
-static SCM callback_tag;
-
-static
-SCM mark_smob (SCM)
-{
- return SCM_EOL;
-}
-
-static int
-print_smob (SCM, SCM port, scm_print_state *)
-{
- scm_puts ("#<Callback>", port);
- return 1;
-}
-
-static
-scm_sizet free_smob (SCM)
-{
- return 0;
-}
-
-static
-void start_callback_smobs()
-{
- callback_tag = scm_make_smob_type_mfpe ("callback", 0,
- mark_smob, free_smob,
- print_smob, 0);
-}
-
-
-SCM
-smobify_callback (Score_element_callback cb )
-{
- SCM z;
-
- SCM_NEWCELL(z);
- SCM_SETCDR (z, (SCM)cb);
- SCM_SETCAR (z, (SCM)callback_tag);
-
- return z;
-}
-
-ADD_SCM_INIT_FUNC(callback, start_callback_smobs);
-#endif
+++ /dev/null
-/*
- score-element-info.cc -- implement Score_element_info
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "score-element-info.hh"
-#include "request.hh"
-#include "translator.hh"
-#include "translator-group.hh"
-
-Score_element_info::Score_element_info (Score_element*s_l, Music *r_l)
-{
- elem_l_ = s_l;
- req_l_ = r_l;
- origin_trans_l_ = 0;
-}
-
-
-Score_element_info::Score_element_info()
-{
- elem_l_ = 0;
- req_l_ = 0;
- origin_trans_l_ = 0;
-}
-
-
-Link_array<Translator>
-Score_element_info::origin_trans_l_arr (Translator* end) const
-{
- Translator * t = origin_trans_l_;
- Link_array<Translator> r;
- do {
- r.push (t);
- t = t->daddy_trans_l_;
- } while (t && t != end->daddy_trans_l_);
-
- return r;
-}
-
+++ /dev/null
-/*
- score-elem.cc -- implement Score_element
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#include <string.h>
-#include <math.h>
-
-#include "input-smob.hh"
-#include "libc-extension.hh"
-#include "group-interface.hh"
-#include "misc.hh"
-#include "paper-score.hh"
-#include "paper-def.hh"
-#include "molecule.hh"
-#include "score-element.hh"
-#include "debug.hh"
-#include "spanner.hh"
-#include "line-of-score.hh"
-#include "item.hh"
-#include "paper-column.hh"
-#include "molecule.hh"
-#include "misc.hh"
-#include "paper-outputter.hh"
-#include "dimension-cache.hh"
-#include "side-position-interface.hh"
-#include "item.hh"
-
-#include "ly-smobs.icc"
-
-/*
-TODO:
-
-remove dynamic_cast<Spanner,Item> and put this code into respective
- subclass.
-*/
-
-
-#define INFINITY_MSG "Infinity or NaN encountered"
-
-Score_element::Score_element(SCM basicprops)
-{
- /*
- fixme: default should be no callback.
- */
-
- pscore_l_=0;
- status_i_ = 0;
- original_l_ = 0;
- immutable_property_alist_ = basicprops;
- mutable_property_alist_ = SCM_EOL;
-
- smobify_self ();
-
- char const*onames[] = {"X-offset-callbacks", "Y-offset-callbacks"};
- char const*enames[] = {"X-extent-callback", "Y-extent-callback"};
-
- for (int a = X_AXIS; a <= Y_AXIS; a++){
- SCM l = get_elt_property (onames[a]);
-
- if (scm_ilength (l) >=0)
- {
- dim_cache_[a].offset_callbacks_ = l;
- dim_cache_[a].offsets_left_ = scm_ilength (l);
- }
- else
- {
- programming_error ("[XY]-offset-callbacks must be a list");
- }
-
- SCM cb = get_elt_property (enames[a]);
-
- /*
- Should change default to be empty?
- */
- if (!gh_procedure_p (cb) && !gh_pair_p (cb))
- cb = molecule_extent_proc;
-
- dim_cache_[a].dimension_ = cb;
- }
-
- SCM meta = get_elt_property ("meta");
- SCM ifs = scm_assoc (ly_symbol2scm ("interfaces"), meta);
-
- set_elt_property ("interfaces",gh_cdr (ifs));
-}
-
-
-Score_element::Score_element (Score_element const&s)
- : dim_cache_ (s.dim_cache_)
-{
- original_l_ =(Score_element*) &s;
- immutable_property_alist_ = s.immutable_property_alist_;
- mutable_property_alist_ = SCM_EOL;
-
- status_i_ = s.status_i_;
- pscore_l_ = s.pscore_l_;
-
- smobify_self ();
-}
-
-Score_element::~Score_element()
-{
- /*
- do nothing scm-ish and no unprotecting here.
- */
-}
-
-
-SCM
-Score_element::get_elt_property (const char *nm) const
-{
- SCM sym = ly_symbol2scm (nm);
- return get_elt_property (sym);
-}
-
-SCM
-Score_element::get_elt_property (SCM sym) const
-{
- SCM s = scm_sloppy_assq(sym, mutable_property_alist_);
- if (s != SCM_BOOL_F)
- return gh_cdr (s);
-
- s = scm_sloppy_assq (sym, immutable_property_alist_);
- return (s == SCM_BOOL_F) ? SCM_EOL : gh_cdr (s);
-}
-
-/*
- Remove the value associated with KEY, and return it. The result is
- that a next call will yield SCM_UNDEFINED (and not the underlying
- `basic' property.
-*/
-SCM
-Score_element::remove_elt_property (const char* key)
-{
- SCM val = get_elt_property (key);
- if (val != SCM_EOL)
- set_elt_property (key, SCM_EOL);
- return val;
-}
-
-void
-Score_element::set_elt_property (const char* k, SCM v)
-{
- SCM s = ly_symbol2scm (k);
- set_elt_property (s, v);
-}
-
-/*
- Puts the k, v in the immutable_property_alist_, which is convenient for
- storing variables that are needed during the breaking process. (eg.
- Line_of_score::rank : int )
- */
-void
-Score_element::set_immutable_elt_property (const char*k, SCM v)
-{
- SCM s = ly_symbol2scm (k);
- set_immutable_elt_property (s, v);
-}
-
-void
-Score_element::set_immutable_elt_property (SCM s, SCM v)
-{
- immutable_property_alist_ = gh_cons (gh_cons (s,v), mutable_property_alist_);
- mutable_property_alist_ = scm_assq_remove_x (mutable_property_alist_, s);
-}
-void
-Score_element::set_elt_property (SCM s, SCM v)
-{
- mutable_property_alist_ = scm_assq_set_x (mutable_property_alist_, s, v);
-}
-
-
-MAKE_SCHEME_CALLBACK(Score_element,molecule_extent,2);
-SCM
-Score_element::molecule_extent (SCM element_smob, SCM scm_axis)
-{
- Score_element *s = unsmob_element (element_smob);
- Axis a = (Axis) gh_scm2int (scm_axis);
-
- Molecule *m = s->get_molecule ();
- Interval e ;
- if (m)
- e = m->extent(a);
- return ly_interval2scm ( e);
-}
-
-MAKE_SCHEME_CALLBACK(Score_element,preset_extent,2);
-
-SCM
-Score_element::preset_extent (SCM element_smob, SCM scm_axis)
-{
- Score_element *s = unsmob_element (element_smob);
- Axis a = (Axis) gh_scm2int (scm_axis);
-
- SCM ext = s->get_elt_property ((a == X_AXIS)
- ? "extent-X"
- : "extent-Y");
-
- if (gh_pair_p (ext))
- {
- Real l = gh_scm2double (gh_car (ext));
- Real r = gh_scm2double (gh_cdr (ext));
- return ly_interval2scm (Interval (l, r));
- }
-
- return ly_interval2scm ( Interval ());
-}
-
-
-
-Paper_def*
-Score_element::paper_l () const
-{
- return pscore_l_ ? pscore_l_->paper_l_ : 0;
-}
-
-void
-Score_element::calculate_dependencies (int final, int busy, SCM funcname)
-{
- assert (status_i_ >=0);
-
- if (status_i_ >= final)
- return;
-
- if (status_i_== busy)
- {
- programming_error ("Element is busy, come back later");
- return;
- }
-
- status_i_= busy;
-
- for (SCM d= get_elt_property ("dependencies"); gh_pair_p (d); d = gh_cdr (d))
- {
- unsmob_element (gh_car (d))
- ->calculate_dependencies (final, busy, funcname);
- }
-
- // ughugh.
- String s = ly_symbol2string (funcname);
- SCM proc = get_elt_property (s.ch_C());
- if (gh_procedure_p (proc))
- gh_call1 (proc, this->self_scm ());
-
- status_i_= final;
-
-}
-
-Molecule *
-Score_element::get_molecule () const
-{
- SCM mol = get_elt_property ("molecule");
- if (unsmob_molecule (mol))
- return unsmob_molecule (mol);
-
- SCM proc = get_elt_property ("molecule-callback");
-
- mol = SCM_EOL;
- if (gh_procedure_p (proc))
- mol = gh_apply (proc, gh_list (this->self_scm (), SCM_UNDEFINED));
-
-
- /*
- TODO: add option for not copying origin info.
- */
- SCM origin =get_elt_property ("origin");
- if (!unsmob_input (origin))
- origin =ly_symbol2scm ("no-origin");
-
- if (gh_pair_p (mol))
- {
- // ugr.
- mol = gh_cons (gh_list (origin, gh_car (mol), SCM_UNDEFINED), gh_cdr (mol));
- }
-
- Molecule *m = unsmob_molecule (mol);
-
-
- /*
- transparent retains dimensions of element.
- */
- if (m && to_boolean (get_elt_property ("transparent")))
- mol = Molecule (m->extent_box (), SCM_EOL).smobbed_copy ();
-
- Score_element *me = (Score_element*)this;
- me->set_elt_property ("molecule", mol);
-
- m = unsmob_molecule (mol);
- return m;
-}
-
-
-/*
-
- VIRTUAL STUBS
-
- */
-void
-Score_element::do_break_processing()
-{
-}
-
-
-
-
-
-
-Line_of_score *
-Score_element::line_l() const
-{
- return 0;
-}
-
-void
-Score_element::add_dependency (Score_element*e)
-{
- if (e)
- {
- Pointer_group_interface ::add_element (this, "dependencies",e);
-
- }
- else
- programming_error ("Null dependency added");
-}
-
-
-
-
-/**
- Do break substitution in S, using CRITERION. Return new value.
- CRITERION is either a SMOB pointer to the desired line, or a number
- representing the break direction. Do not modify SRC.
-*/
-SCM
-Score_element::handle_broken_smobs (SCM src, SCM criterion)
-{
- again:
- Score_element *sc = unsmob_element (src);
- if (sc)
- {
- if (gh_number_p (criterion))
- {
- Item * i = dynamic_cast<Item*> (sc);
- Direction d = to_dir (criterion);
- if (i && i->break_status_dir () != d)
- {
- Item *br = i->find_prebroken_piece (d);
- return (br) ? br->self_scm () : SCM_UNDEFINED;
- }
- }
- else
- {
- Line_of_score * line
- = dynamic_cast<Line_of_score*> (unsmob_element (criterion));
- if (sc->line_l () != line)
- {
- sc = sc->find_broken_piece (line);
-
- }
-
- /* now: !sc || (sc && sc->line_l () == line) */
- if (!sc)
- return SCM_UNDEFINED;
-
- /* now: sc && sc->line_l () == line */
- if (!line
- || (sc->common_refpoint (line, X_AXIS)
- && sc->common_refpoint (line, Y_AXIS)))
- {
- return sc->self_scm ();
- }
- return SCM_UNDEFINED;
- }
- }
- else if (gh_pair_p (src))
- {
- SCM oldcar =gh_car (src);
- /*
- UGH! breaks on circular lists.
- */
- SCM newcar = handle_broken_smobs (oldcar, criterion);
- SCM oldcdr = gh_cdr (src);
-
- if (newcar == SCM_UNDEFINED
- && (gh_pair_p (oldcdr) || oldcdr == SCM_EOL))
- {
- /*
- This is tail-recursion, ie.
-
- return handle_broken_smobs (cdr, criterion);
-
- We don't want to rely on the compiler to do this. Without
- tail-recursion, this easily crashes with a stack overflow. */
- src = oldcdr;
- goto again;
- }
-
- SCM newcdr = handle_broken_smobs (oldcdr, criterion);
- return gh_cons (newcar, newcdr);
- }
- else
- return src;
-
- return src;
-}
-
-void
-Score_element::handle_broken_dependencies()
-{
- Spanner * s= dynamic_cast<Spanner*> (this);
- if (original_l_ && s)
- return;
-
- if (s)
- {
- for (int i = 0; i< s->broken_into_l_arr_ .size (); i++)
- {
- Score_element * sc = s->broken_into_l_arr_[i];
- Line_of_score * l = sc->line_l ();
- sc->mutable_property_alist_ =
- handle_broken_smobs (mutable_property_alist_,
- l ? l->self_scm () : SCM_UNDEFINED);
- }
- }
-
-
- Line_of_score *line = line_l();
-
- if (line && common_refpoint (line, X_AXIS) && common_refpoint (line, Y_AXIS))
- {
- mutable_property_alist_
- = handle_broken_smobs (mutable_property_alist_,
- line ? line->self_scm () : SCM_UNDEFINED);
- }
- else if (dynamic_cast <Line_of_score*> (this))
- {
- mutable_property_alist_ = handle_broken_smobs (mutable_property_alist_,
- SCM_UNDEFINED);
- }
- else
- {
- /*
- This element is `invalid'; it has been removed from all
- dependencies, so let's junk the element itself.
-
- do not do this for Line_of_score, since that would remove
- references to the originals of score-elts, which get then GC'd
- (a bad thing.)
- */
- suicide();
- }
-}
-
-/*
- Note that we still want references to this element to be
- rearranged, and not silently thrown away, so we keep pointers
- like {broken_into_{drul,array}, original}
-*/
-void
-Score_element::suicide ()
-{
- mutable_property_alist_ = SCM_EOL;
- immutable_property_alist_ = SCM_EOL;
-
- set_extent_callback (SCM_EOL, Y_AXIS);
- set_extent_callback (SCM_EOL, X_AXIS);
-
- for (int a= X_AXIS; a <= Y_AXIS; a++)
- {
- dim_cache_[a].offset_callbacks_ = SCM_EOL;
- dim_cache_[a].offsets_left_ = 0;
- }
-}
-
-void
-Score_element::handle_prebroken_dependencies()
-{
-}
-
-Score_element*
-Score_element::find_broken_piece (Line_of_score*) const
-{
- return 0;
-}
-
-void
-Score_element::translate_axis (Real y, Axis a)
-{
- if (isinf (y) || isnan (y))
- programming_error (_(INFINITY_MSG));
- else
- {
- dim_cache_[a].offset_ += y;
- }
-}
-
-Real
-Score_element::relative_coordinate (Score_element const*refp, Axis a) const
-{
- if (refp == this)
- return 0.0;
-
- /*
- We catch PARENT_L_ == nil case with this, but we crash if we did
- not ask for the absolute coordinate (ie. REFP == nil.)
-
- */
- if (refp == dim_cache_[a].parent_l_)
- return get_offset (a);
- else
- return get_offset (a) + dim_cache_[a].parent_l_->relative_coordinate (refp, a);
-}
-
-Real
-Score_element::get_offset (Axis a) const
-{
- Score_element *me = (Score_element*) this;
- while (dim_cache_[a].offsets_left_)
- {
- int l = --me->dim_cache_[a].offsets_left_;
- SCM cb = scm_list_ref (dim_cache_[a].offset_callbacks_, gh_int2scm (l));
- SCM retval = gh_call2 (cb, self_scm (), gh_int2scm (a));
-
- Real r = gh_scm2double (retval);
- if (isinf (r) || isnan (r))
- {
- programming_error (INFINITY_MSG);
- r = 0.0;
- }
- me->dim_cache_[a].offset_ +=r;
- }
- return dim_cache_[a].offset_;
-}
-
-
-MAKE_SCHEME_CALLBACK(Score_element,point_dimension_callback,2);
-SCM
-Score_element::point_dimension_callback (SCM , SCM )
-{
- return ly_interval2scm ( Interval (0,0));
-}
-
-bool
-Score_element::empty_b (Axis a)const
-{
- return ! (gh_pair_p (dim_cache_[a].dimension_ ) ||
- gh_procedure_p (dim_cache_[a].dimension_ ));
-}
-
-/*
- TODO: add
-
- Score_element *refpoint
-
- to arguments?
- */
-Interval
-Score_element::extent (Score_element * refp, Axis a) const
-{
- Real x = relative_coordinate (refp, a);
-
-
- Dimension_cache * d = (Dimension_cache *)&dim_cache_[a];
- Interval ext ;
- if (gh_pair_p (d->dimension_))
- ;
- else if (gh_procedure_p (d->dimension_))
- {
- /*
- FIXME: add doco on types, and should typecheck maybe?
- */
- d->dimension_= gh_call2 (d->dimension_, self_scm(), gh_int2scm (a));
- }
- else
- return ext;
-
- if (!gh_pair_p (d->dimension_))
- return ext;
-
- ext = ly_scm2interval (d->dimension_);
-
- SCM extra = get_elt_property (a == X_AXIS
- ? "extra-extent-X"
- : "extra-extent-Y");
-
- /*
- signs ?
- */
- if (gh_pair_p (extra))
- {
- ext[BIGGER] += gh_scm2double (gh_cdr (extra));
- ext[SMALLER] += gh_scm2double (gh_car (extra));
- }
-
- extra = get_elt_property (a == X_AXIS
- ? "minimum-extent-X"
- : "minimum-extent-Y");
- if (gh_pair_p (extra))
- {
- ext.unite (Interval (gh_scm2double (gh_car (extra)),
- gh_scm2double (gh_cdr (extra))));
- }
-
- ext.translate (x);
-
- return ext;
-}
-
-
-Score_element*
-Score_element::parent_l (Axis a) const
-{
- return dim_cache_[a].parent_l_;
-}
-
-Score_element *
-Score_element::common_refpoint (Score_element const* s, Axis a) const
-{
- /*
- I don't like the quadratic aspect of this code, but I see no other
- way. The largest chain of parents might be 10 high or so, so
- it shouldn't be a real issue. */
- for (Score_element const *c = this; c; c = c->dim_cache_[a].parent_l_)
- for (Score_element const * d = s; d; d = d->dim_cache_[a].parent_l_)
- if (d == c)
- return (Score_element*)d;
-
- return 0;
-}
-
-
-Score_element *
-Score_element::common_refpoint (SCM elist, Axis a) const
-{
- Score_element * common = (Score_element*) this;
- for (; gh_pair_p (elist); elist = gh_cdr (elist))
- {
- Score_element * s = unsmob_element (gh_car (elist));
- if (s)
- common = common->common_refpoint (s, a);
- }
-
- return common;
-}
-
-String
-Score_element::name () const
-{
- SCM meta = get_elt_property ("meta");
- SCM nm = scm_assoc (ly_symbol2scm ("name"), meta);
- nm = (gh_pair_p (nm)) ? gh_cdr (nm) : SCM_EOL;
- return gh_string_p (nm) ?ly_scm2string (nm) : classname (this);
-}
-
-void
-Score_element::add_offset_callback (SCM cb, Axis a)
-{
- if (!has_offset_callback_b (cb, a))
- {
- dim_cache_[a].offset_callbacks_ = gh_cons (cb, dim_cache_[a].offset_callbacks_ );
- dim_cache_[a].offsets_left_ ++;
- }
-}
-
-bool
-Score_element::has_extent_callback_b (SCM cb, Axis a)const
-{
- return scm_equal_p (cb, dim_cache_[a].dimension_);
-}
-
-
-bool
-Score_element::has_extent_callback_b (Axis a) const
-{
- return gh_procedure_p (dim_cache_[a].dimension_);
-}
-
-bool
-Score_element::has_offset_callback_b (SCM cb, Axis a)const
-{
- return scm_memq (cb, dim_cache_[a].offset_callbacks_) != SCM_BOOL_F;
-}
-
-void
-Score_element::set_extent_callback (SCM dc, Axis a)
-{
- dim_cache_[a].dimension_ =dc;
-}
-
-void
-Score_element::set_parent (Score_element *g, Axis a)
-{
- dim_cache_[a].parent_l_ = g;
-}
-
-MAKE_SCHEME_CALLBACK(Score_element,fixup_refpoint,1);
-SCM
-Score_element::fixup_refpoint (SCM smob)
-{
- Score_element *me = unsmob_element (smob);
- for (int a = X_AXIS; a < NO_AXES; a ++)
- {
- Axis ax = (Axis)a;
- Score_element * parent = me->parent_l (ax);
-
- if (!parent)
- continue;
-
- if (parent->line_l () != me->line_l () && me->line_l ())
- {
- Score_element * newparent = parent->find_broken_piece (me->line_l ());
- me->set_parent (newparent, ax);
- }
-
- if (Item * i = dynamic_cast<Item*> (me))
- {
- Item *parenti = dynamic_cast<Item*> (parent);
-
- if (parenti && i)
- {
- Direction my_dir = i->break_status_dir () ;
- if (my_dir!= parenti->break_status_dir())
- {
- Item *newparent = parenti->find_prebroken_piece (my_dir);
- me->set_parent (newparent, ax);
- }
- }
- }
- }
- return smob;
-}
-
-
-
-/****************************************************
- SMOB funcs
- ****************************************************/
-
-
-IMPLEMENT_UNSMOB(Score_element, element);
-IMPLEMENT_SMOBS(Score_element);
-IMPLEMENT_DEFAULT_EQUAL_P(Score_element);
-
-SCM
-Score_element::mark_smob (SCM ses)
-{
- Score_element * s = (Score_element*) SCM_CELL_WORD_1(ses);
- scm_gc_mark (s->immutable_property_alist_);
- scm_gc_mark (s->mutable_property_alist_);
-
- for (int a =0 ; a < 2; a++)
- {
- scm_gc_mark (s->dim_cache_[a].offset_callbacks_);
- scm_gc_mark (s->dim_cache_[a].dimension_);
- }
-
- if (s->parent_l (Y_AXIS))
- scm_gc_mark (s->parent_l (Y_AXIS)->self_scm ());
- if (s->parent_l (X_AXIS))
- scm_gc_mark (s->parent_l (X_AXIS)->self_scm ());
-
- if (s->original_l_)
- scm_gc_mark (s->original_l_->self_scm ());
- return s->do_derived_mark ();
-}
-
-int
-Score_element::print_smob (SCM s, SCM port, scm_print_state *)
-{
- Score_element *sc = (Score_element *) gh_cdr (s);
-
- scm_puts ("#<Score_element ", port);
- scm_puts ((char *)sc->name ().ch_C(), port);
-
- /*
- don't try to print properties, that is too much hassle.
- */
- scm_puts (" >", port);
- return 1;
-}
-
-SCM
-Score_element::do_derived_mark ()
-{
- return SCM_EOL;
-}
-
-
-SCM
-ly_set_elt_property (SCM elt, SCM sym, SCM val)
-{
- Score_element * sc = unsmob_element (elt);
-
- if (!gh_symbol_p (sym))
- {
- error ("Not a symbol");
- ly_display_scm (sym);
- return SCM_UNSPECIFIED;
- }
-
- if (sc)
- {
- sc->set_elt_property (sym, val);
- }
- else
- {
- error ("Not a score element");
- ly_display_scm (elt);
- }
-
- return SCM_UNSPECIFIED;
-}
-
-
-SCM
-ly_get_elt_property (SCM elt, SCM sym)
-{
- Score_element * sc = unsmob_element (elt);
-
- if (sc)
- {
- return sc->get_elt_property (sym);
- }
- else
- {
- error ("Not a score element");
- ly_display_scm (elt);
- }
- return SCM_UNSPECIFIED;
-}
-
-
-void
-Score_element::discretionary_processing()
-{
-}
-
-
-
-SCM
-spanner_get_bound (SCM slur, SCM dir)
-{
- return dynamic_cast<Spanner*> (unsmob_element (slur))->get_bound (to_dir (dir))->self_scm ();
-}
-
-
-
-static SCM interfaces_sym;
-static void
-init_functions ()
-{
- interfaces_sym = scm_permanent_object (ly_symbol2scm ("interfaces"));
-
- scm_make_gsubr ("ly-get-elt-property", 2, 0, 0, (Scheme_function_unknown)ly_get_elt_property);
- scm_make_gsubr ("ly-set-elt-property", 3, 0, 0, (Scheme_function_unknown)ly_set_elt_property);
- scm_make_gsubr ("ly-get-spanner-bound", 2 , 0, 0, (Scheme_function_unknown) spanner_get_bound);
-}
-
-bool
-Score_element::has_interface (SCM k)
-{
- SCM ifs = get_elt_property (interfaces_sym);
-
- return scm_memq (k, ifs) != SCM_BOOL_F;
-}
-
-void
-Score_element::set_interface (SCM k)
-{
- if (has_interface (k))
- return ;
- else
- {
- set_elt_property (interfaces_sym,
- gh_cons (k, get_elt_property (interfaces_sym)));
- }
-}
-
-
-ADD_SCM_INIT_FUNC(scoreelt, init_functions);
-IMPLEMENT_TYPE_P(Score_element, "ly-element?");
#include "paper-def.hh"
#include "axis-group-interface.hh"
+
Score_engraver::Score_engraver()
{
scoreline_l_ =0;
breaks_i_ =0;
pscore_p_ = 0;
}
-
+
void
-Score_engraver::prepare (Moment w)
+Score_engraver::make_columns (Moment w)
{
- Global_translator::prepare (w);
-
-
/*
ugh.
*/
if (!command_column_l_
- || *unsmob_moment (command_column_l_->get_elt_property ("when")) != w)
+ || *unsmob_moment (command_column_l_->get_grob_property ("when")) != w)
{
set_columns (new Paper_column (get_property (ly_symbol2scm ("NonMusicalPaperColumn"))),
new Paper_column (get_property (ly_symbol2scm ("PaperColumn"))));
- command_column_l_->set_elt_property ("when", w.smobbed_copy());
- musical_column_l_->set_elt_property ("when", w.smobbed_copy());
- command_column_l_->set_elt_property ("breakable", SCM_BOOL_T);
+ command_column_l_->set_grob_property ("when", w.smobbed_copy());
+ musical_column_l_->set_grob_property ("when", w.smobbed_copy());
+ command_column_l_->set_grob_property ("breakable", SCM_BOOL_T);
- Score_element_info i1(command_column_l_, 0), i2 (musical_column_l_,0);
+ Grob_info i1(command_column_l_, 0), i2 (musical_column_l_,0);
i1.origin_trans_l_ = this;
i2.origin_trans_l_ = this;
- announce_element (i1);
- announce_element (i2);
+ announce_grob (i1);
+ announce_grob (i2);
}
+}
+
+void
+Score_engraver::prepare (Moment w)
+{
+ Global_translator::prepare (w);
+ make_columns (w);
+
post_move_processing();
}
void
Score_engraver::do_creation_processing ()
{
- prepare (Moment (0));
+ make_columns (Moment (0));
scoreline_l_ = pscore_p_->line_l_;
scoreline_l_->set_bound(LEFT, command_column_l_);
- command_column_l_->set_elt_property ("breakable", SCM_BOOL_T);
+ command_column_l_->set_grob_property ("breakable", SCM_BOOL_T);
Engraver_group_engraver::do_creation_processing();
}
{
Engraver_group_engraver::do_removal_processing();
scoreline_l_->set_bound(RIGHT,command_column_l_);
- command_column_l_->set_elt_property ("breakable", SCM_BOOL_T);
+ command_column_l_->set_grob_property ("breakable", SCM_BOOL_T);
typeset_all ();
void
Score_engraver::process()
{
- //process_music();
+ process_music();
+
announces();
pre_move_processing();
check_removal();
}
void
-Score_engraver::announce_element (Score_element_info info)
+Score_engraver::announce_grob (Grob_info info)
{
announce_info_arr_.push (info);
- pscore_p_->line_l_->typeset_element (info.elem_l_);
+ pscore_p_->line_l_->typeset_grob (info.elem_l_);
}
/* All elements are propagated to the top upon announcement. If
void
-Score_engraver::typeset_element (Score_element *elem_p)
+Score_engraver::typeset_grob (Grob *elem_p)
{
if (!elem_p)
programming_error ("Score_engraver: empty elt\n");
{
for (int i =0; i < elem_p_arr_.size(); i++)
{
- Score_element * elem_p = elem_p_arr_[i];
+ Grob * elem_p = elem_p_arr_[i];
if (Spanner *s = dynamic_cast <Spanner *> (elem_p))
{
{
if (!elem_p->parent_l (X_AXIS))
{
- bool br = to_boolean (elem_p->get_elt_property ("breakable"));
+ bool br = to_boolean (elem_p->get_grob_property ("breakable"));
Axis_group_interface::add_element (br ? command_column_l_ : musical_column_l_, elem_p);
}
}
void
-Score_engraver::do_pre_move_processing()
+Score_engraver::stop_translation_timestep()
{
// this generates all items.
- Engraver_group_engraver::do_pre_move_processing();
+ Engraver_group_engraver::stop_translation_timestep();
typeset_all();
- if (to_boolean (command_column_l_->get_elt_property ("breakable")))
+ if (to_boolean (command_column_l_->get_grob_property ("breakable")))
{
breaks_i_ ++;
if (! (breaks_i_%8))
}
bool
-Score_engraver::do_try_music (Music*r)
+Score_engraver::try_music (Music*r)
{
- bool gotcha = Engraver_group_engraver::do_try_music (r);
+ bool gotcha = Engraver_group_engraver::try_music (r);
if (!gotcha)
{
gotcha = true;
- SCM pen = command_column_l_->get_elt_property ("penalty");
+ SCM pen = command_column_l_->get_grob_property ("penalty");
Real total_penalty = gh_number_p (pen)
? gh_scm2double(pen)
: 0.0;
if (total_penalty > 10000.0) // ugh. arbitrary.
forbid_breaks ();
- command_column_l_->set_elt_property ("penalty",
+ command_column_l_->set_grob_property ("penalty",
gh_double2scm (total_penalty));
}
}
return gotcha;
}
+/*
+ TODO: use property Score.breakForbidden = #t
+ */
+
void
Score_engraver::forbid_breaks ()
{
/*
result is junked.
*/
- command_column_l_->remove_elt_property ("breakable");
+ command_column_l_->remove_grob_property ("breakable");
}
ADD_THIS_TRANSLATOR(Score_engraver);
Script_column, that will fix the collisions. */
class Script_column_engraver : public Engraver
{
- Score_element *scol_p_;
+ Grob *scol_p_;
Link_array<Item> script_l_arr_;
public:
Script_column_engraver ();
VIRTUAL_COPY_CONS(Translator);
protected:
- virtual void acknowledge_element (Score_element_info);
- virtual void process_acknowledged ();
- virtual void do_pre_move_processing ();
- virtual void do_post_move_processing ();
+ virtual void acknowledge_grob (Grob_info);
+ virtual void create_grobs ();
+ virtual void stop_translation_timestep ();
+ virtual void start_translation_timestep ();
};
}
void
-Script_column_engraver::do_pre_move_processing ()
+Script_column_engraver::stop_translation_timestep ()
{
if (scol_p_)
{
- typeset_element (scol_p_);
+ typeset_grob (scol_p_);
scol_p_ =0;
}
}
void
-Script_column_engraver::do_post_move_processing ()
+Script_column_engraver::start_translation_timestep ()
{
script_l_arr_.clear ();
}
void
-Script_column_engraver::acknowledge_element(Score_element_info inf)
+Script_column_engraver::acknowledge_grob(Grob_info inf)
{
Item *thing = dynamic_cast<Item*> (inf.elem_l_);
if (thing && Side_position::has_interface (inf.elem_l_)) // ugh FIXME
}
void
-Script_column_engraver::process_acknowledged ()
+Script_column_engraver::create_grobs ()
{
if (!scol_p_ && script_l_arr_.size () > 1)
{
scol_p_ = new Item (get_property ("ScriptColumn"));
- announce_element (scol_p_, 0);
+ announce_grob (scol_p_, 0);
}
if (scol_p_)
#include "group-interface.hh"
void
-Script_column::add_staff_sided (Score_element *me, Item *i)
+Script_column::add_staff_sided (Grob *me, Item *i)
{
- SCM p = i->get_elt_property ("script-priority");
+ SCM p = i->get_grob_property ("script-priority");
if (!gh_number_p (p))
return;
}
static int
-staff_side_compare (Score_element * const &i1,
- Score_element * const &i2)
+staff_side_compare (Grob * const &i1,
+ Grob * const &i2)
{
- SCM p1 = i1->get_elt_property ("script-priority");
- SCM p2 = i2->get_elt_property ("script-priority");
+ SCM p1 = i1->get_grob_property ("script-priority");
+ SCM p2 = i2->get_grob_property ("script-priority");
return gh_scm2int (p1) - gh_scm2int (p2);
}
SCM
Script_column::before_line_breaking (SCM smob)
{
- Score_element* me = unsmob_element (smob);
- Drul_array<Link_array<Score_element> > arrs;
- Link_array<Score_element> staff_sided
- = Pointer_group_interface__extract_elements (me, (Score_element*)0, "scripts");
+ Grob* me = unsmob_element (smob);
+ Drul_array<Link_array<Grob> > arrs;
+ Link_array<Grob> staff_sided
+ = Pointer_group_interface__extract_elements (me, (Grob*)0, "scripts");
for (int i=0; i < staff_sided.size (); i++)
Direction d = DOWN;
do {
- Link_array<Score_element> &arr(arrs[d]);
+ Link_array<Grob> &arr(arrs[d]);
arr.sort (staff_side_compare);
- Score_element * last = 0;
+ Grob * last = 0;
for (int i=0; i < arr.size (); i++)
{
if (last)
Side_position::add_support( arr[i],last);
- arr[i]->remove_elt_property ("script-priority");
+ arr[i]->remove_grob_property ("script-priority");
last = arr[i];
}
#include "engraver.hh"
class Script_engraver : public Engraver {
- Link_array<Score_element> script_p_arr_;
+ Link_array<Grob> script_p_arr_;
Link_array<Articulation_req> script_req_l_arr_;
public:
Script_engraver();
protected:
- virtual bool do_try_music (Music*);
+ virtual bool try_music (Music*);
void deprecated_process_music ();
- virtual void do_pre_move_processing ();
- virtual void do_post_move_processing ();
- virtual void process_acknowledged ();
- virtual void acknowledge_element (Score_element_info);
+ virtual void stop_translation_timestep ();
+ virtual void start_translation_timestep ();
+ virtual void create_grobs ();
+ virtual void acknowledge_grob (Grob_info);
};
Script_engraver::Script_engraver()
{
- do_post_move_processing();
+ start_translation_timestep();
}
bool
-Script_engraver::do_try_music (Music *r_l)
+Script_engraver::try_music (Music *r_l)
{
if (Articulation_req *mr = dynamic_cast <Articulation_req *> (r_l))
{
}
void
-Script_engraver::process_acknowledged ()
+Script_engraver::create_grobs ()
{
deprecated_process_music ();
}
continue;
}
// todo -> use result of articulation-to-scriptdef directly as basic prop list.
- Score_element *p =new Item (get_property ("Script"));
+ Grob *p =new Item (get_property ("Script"));
list = gh_cdr (list);
- p->set_elt_property ("molecule",
+ p->set_grob_property ("molecule",
gh_car (list));
list = gh_cdr(list);
if (!isdir_b (force_dir)
&& to_dir (relative_stem_dir))
- p->set_elt_property ("side-relative-direction", relative_stem_dir);
+ p->set_grob_property ("side-relative-direction", relative_stem_dir);
else
- p->set_elt_property ("direction", force_dir);
+ p->set_grob_property ("direction", force_dir);
/*
FIXME: should figure this out in relation with basic props!
Side_position::set_axis (p, xaxis ? X_AXIS : Y_AXIS);
if (!follow_staff && ! xaxis)
- p->set_elt_property ("staff-support", SCM_BOOL_T);
+ p->set_grob_property ("staff-support", SCM_BOOL_T);
if (!xaxis && follow_staff)
p->add_offset_callback (Side_position::quantised_position_proc, Y_AXIS);
- p->set_elt_property ("script-priority", priority);
+ p->set_grob_property ("script-priority", priority);
script_p_arr_.push (p);
- announce_element (p, l);
+ announce_grob (p, l);
}
script_req_l_arr_.clear ();
}
void
-Script_engraver::acknowledge_element (Score_element_info inf)
+Script_engraver::acknowledge_grob (Grob_info inf)
{
- bool them_grace = to_boolean (inf.elem_l_->get_elt_property ("grace"));
+ bool them_grace = to_boolean (inf.elem_l_->get_grob_property ("grace"));
bool us_grace = to_boolean (get_property ("weAreGraceContext"));
if (us_grace != them_grace)
{
for (int i=0; i < script_p_arr_.size(); i++)
{
- Score_element*e = script_p_arr_[i];
+ Grob*e = script_p_arr_[i];
- e->set_elt_property ("direction-source", inf.elem_l_->self_scm ());
+ e->set_grob_property ("direction-source", inf.elem_l_->self_scm ());
Side_position::add_support (e, inf.elem_l_);
}
}
{
for (int i=0; i < script_p_arr_.size(); i++)
{
- Score_element *e = script_p_arr_[i];
+ Grob *e = script_p_arr_[i];
if (!e->parent_l (X_AXIS))
{
}
void
-Script_engraver::do_pre_move_processing()
+Script_engraver::stop_translation_timestep()
{
for (int i=0; i < script_p_arr_.size(); i++)
{
- Score_element * sc = script_p_arr_[i];
- if (to_boolean (sc->get_elt_property ("staff-support")))
+ Grob * sc = script_p_arr_[i];
+ if (to_boolean (sc->get_grob_property ("staff-support")))
{
Side_position::add_staff_support (sc);
}
- typeset_element (sc);
+ typeset_grob (sc);
}
script_p_arr_.clear();
}
void
-Script_engraver::do_post_move_processing()
+Script_engraver::start_translation_timestep()
{
script_req_l_arr_.clear();
}
#include "lookup.hh"
Molecule
-Script::get_molecule(Score_element * me, Direction d)
+Script::get_molecule(Grob * me, Direction d)
{
- SCM s = me->get_elt_property ("molecule");
+ SCM s = me->get_grob_property ("molecule");
assert (gh_pair_p (s));
SCM key = gh_car (s);
SCM
Script::after_line_breaking (SCM smob)
{
- Score_element * me = unsmob_element (smob);
+ Grob * me = unsmob_element (smob);
Direction d = Side_position::get_direction (me);
Side_position::set_direction (me,d);
SCM
Script::brew_molecule (SCM smob)
{
- Score_element *me= unsmob_element (smob);
+ Grob *me= unsmob_element (smob);
#if 0
Direction dir = DOWN;
- SCM d = me->get_elt_property ("direction");
+ SCM d = me->get_grob_property ("direction");
if (isdir_b (d))
dir = to_dir (d);
#endif
}
bool
-Script::has_interface (Score_element*me)
+Script::has_interface (Grob*me)
{
return me->has_interface (ly_symbol2scm ("script-interface"));
}
void
-Script::set_interface (Score_element*me)
+Script::set_interface (Grob*me)
{
return me->set_interface (ly_symbol2scm ("script-interface"));
}
SCM
Separating_group_spanner::set_spacing_rods (SCM smob)
{
- Score_element*me = unsmob_element (smob);
+ Grob*me = unsmob_element (smob);
- for (SCM s = me->get_elt_property ("elements"); gh_pair_p (s) && gh_pair_p (gh_cdr (s)); s = gh_cdr (s))
+ for (SCM s = me->get_grob_property ("elements"); gh_pair_p (s) && gh_pair_p (gh_cdr (s)); s = gh_cdr (s))
{
/*
Order of elements is reversed!
/*
We've done our job, so we get lost.
*/
- for (SCM s = me->get_elt_property ("elements"); gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = me->get_grob_property ("elements"); gh_pair_p (s); s = gh_cdr (s))
{
Item * it =dynamic_cast<Item*>(unsmob_element (gh_car (s)));
if (it && it->broken_b ())
}
void
-Separating_group_spanner::add_spacing_unit (Score_element* me ,Item*i)
+Separating_group_spanner::add_spacing_unit (Grob* me ,Item*i)
{
Pointer_group_interface::add_element (me, "elements",i);
me->add_dependency (i);
void
-Separating_group_spanner::set_interface (Score_element*)
+Separating_group_spanner::set_interface (Grob*)
{
}
Item * nobreak_malt_p_;
Spanner * sep_span_p_;
- virtual void acknowledge_element (Score_element_info);
+ virtual void acknowledge_grob (Grob_info);
virtual void do_creation_processing ();
virtual void do_removal_processing ();
- virtual void do_pre_move_processing ();
+ virtual void stop_translation_timestep ();
public:
Separating_line_group_engraver ();
VIRTUAL_COPY_CONS (Translator);
{
sep_span_p_ = new Spanner (get_property ("SeparatingGroupSpanner"));
Separating_group_spanner::set_interface (sep_span_p_);
- announce_element (sep_span_p_, 0);
+ announce_grob (sep_span_p_, 0);
sep_span_p_->set_bound (LEFT, unsmob_element (get_property ("currentCommandColumn")));
}
Separating_line_group_engraver::do_removal_processing ()
{
sep_span_p_->set_bound (RIGHT, unsmob_element (get_property ("currentCommandColumn")));
- typeset_element (sep_span_p_);
+ typeset_grob (sep_span_p_);
sep_span_p_ =0;
}
void
-Separating_line_group_engraver::acknowledge_element (Score_element_info i)
+Separating_line_group_engraver::acknowledge_grob (Grob_info i)
{
Item * it = dynamic_cast <Item *> (i.elem_l_);
if (it && !it->parent_l (X_AXIS))
(get_property ("SeparationItem"));
if (ib)
- p_ref_->set_elt_property ("breakable", SCM_BOOL_T);
- announce_element (p_ref_, 0);
+ p_ref_->set_grob_property ("breakable", SCM_BOOL_T);
+ announce_grob (p_ref_, 0);
}
Separation_item::add_item (p_ref_,it);
}
}
void
-Separating_line_group_engraver::do_pre_move_processing ()
+Separating_line_group_engraver::stop_translation_timestep ()
{
if (break_malt_p_)
{
Separating_group_spanner::add_spacing_unit (sep_span_p_, break_malt_p_);
- typeset_element (break_malt_p_);
+ typeset_grob (break_malt_p_);
break_malt_p_ =0;
}
if (nobreak_malt_p_)
{
Separating_group_spanner::add_spacing_unit (sep_span_p_, nobreak_malt_p_);
- typeset_element (nobreak_malt_p_);
+ typeset_grob (nobreak_malt_p_);
nobreak_malt_p_ =0;
}
}
#include "group-interface.hh"
void
-Separation_item::set_interface (Score_element*s)
+Separation_item::set_interface (Grob*s)
{
s->set_extent_callback (SCM_EOL, X_AXIS);
s->set_extent_callback (SCM_EOL, Y_AXIS);
}
void
-Separation_item::add_item (Score_element*s,Item* i)
+Separation_item::add_item (Grob*s,Item* i)
{
assert (i);
Pointer_group_interface::add_element (s,"elements",i);
}
Interval
-Separation_item::my_width (Score_element *me)
+Separation_item::my_width (Grob *me)
{
Item *item = dynamic_cast<Item*> (me);
Paper_column * pc = item->column_l ();
Interval w;
- for (SCM s = me->get_elt_property ("elements"); gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = me->get_grob_property ("elements"); gh_pair_p (s); s = gh_cdr (s))
{
SCM elt = gh_car (s);
if (!unsmob_element (elt))
continue; /*UGH UGH*/
}
- if (to_boolean (il->get_elt_property ("no-spacing-rods")))
+ if (to_boolean (il->get_grob_property ("no-spacing-rods")))
{
continue;
}
#include "group-interface.hh"
void
-Side_position::add_support (Score_element*me, Score_element*e)
+Side_position::add_support (Grob*me, Grob*e)
{
Pointer_group_interface::add_element (me, "side-support-elements",e);
}
Direction
-Side_position::get_direction (Score_element*me)
+Side_position::get_direction (Grob*me)
{
- SCM d = me->get_elt_property ("direction");
+ SCM d = me->get_grob_property ("direction");
if (isdir_b (d))
return to_dir (d) ? to_dir (d) : DOWN;
Direction relative_dir = UP;
- SCM reldir = me->get_elt_property ("side-relative-direction"); // should use a lambda.
+ SCM reldir = me->get_grob_property ("side-relative-direction"); // should use a lambda.
if (isdir_b (reldir))
{
relative_dir = to_dir (reldir);
}
- SCM other_elt = me->get_elt_property ("direction-source");
- Score_element * e = unsmob_element(other_elt);
+ SCM other_elt = me->get_grob_property ("direction-source");
+ Grob * e = unsmob_element(other_elt);
if (e)
{
return (Direction)(relative_dir * Side_position::get_direction (e));
SCM
Side_position::side_position (SCM element_smob, SCM axis)
{
- Score_element *me = unsmob_element (element_smob);
+ Grob *me = unsmob_element (element_smob);
Axis a = (Axis) gh_scm2int (axis);
- Score_element *common = me->parent_l (a);
- SCM support = me->get_elt_property ("side-support-elements");
+ Grob *common = me->parent_l (a);
+ SCM support = me->get_grob_property ("side-support-elements");
for (SCM s = support; s != SCM_EOL; s = gh_cdr (s))
{
- Score_element * e = unsmob_element (gh_car (s));
+ Grob * e = unsmob_element (gh_car (s));
if (e)
common = common->common_refpoint (e, a);
}
for (SCM s = support; s != SCM_EOL; s = gh_cdr (s))
{
- Score_element * e = unsmob_element ( gh_car (s));
+ Grob * e = unsmob_element ( gh_car (s));
if (e)
{
dim.unite (e->extent (common, a));
Direction dir = Side_position::get_direction (me);
Real off = me->parent_l (a)->relative_coordinate (common, a);
- SCM minimum = me->remove_elt_property ("minimum-space");
+ SCM minimum = me->remove_grob_property ("minimum-space");
Real total_off = dim[dir] + off;
- SCM padding = me->remove_elt_property ("padding");
+ SCM padding = me->remove_grob_property ("padding");
if (gh_number_p (padding))
{
total_off += gh_scm2double (padding) * dir;
SCM
Side_position::aligned_on_self (SCM element_smob, SCM axis)
{
- Score_element *me = unsmob_element (element_smob);
+ Grob *me = unsmob_element (element_smob);
Axis a = (Axis) gh_scm2int (axis);
String s ("self-alignment-");
s += (a == X_AXIS) ? "X" : "Y";
- SCM align (me->get_elt_property (s.ch_C()));
+ SCM align (me->get_grob_property (s.ch_C()));
if (gh_number_p (align))
{
Interval ext(me->extent (me,a));
SCM
Side_position::quantised_position (SCM element_smob, SCM )
{
- Score_element *me = unsmob_element (element_smob);
+ Grob *me = unsmob_element (element_smob);
Direction d = Side_position::get_direction (me);
SCM
Side_position::aligned_side (SCM element_smob, SCM axis)
{
- Score_element *me = unsmob_element (element_smob);
+ Grob *me = unsmob_element (element_smob);
Axis a = (Axis) gh_scm2int (axis);
Direction d = Side_position::get_direction (me);
{
o += - iv[-d];
- SCM pad = me->get_elt_property ("padding");
+ SCM pad = me->get_grob_property ("padding");
if (gh_number_p (pad))
o += d *gh_scm2double (pad) ;
}
SCM
Side_position::centered_on_parent (SCM element_smob, SCM axis)
{
- Score_element *me = unsmob_element (element_smob);
+ Grob *me = unsmob_element (element_smob);
Axis a = (Axis) gh_scm2int (axis);
- Score_element *him = me->parent_l (a);
+ Grob *him = me->parent_l (a);
return gh_double2scm (him->extent (him,a).center ());
}
void
-Side_position::add_staff_support (Score_element*me)
+Side_position::add_staff_support (Grob*me)
{
- Score_element* st = Staff_symbol_referencer::staff_symbol_l (me);
+ Grob* st = Staff_symbol_referencer::staff_symbol_l (me);
if (st)
{
add_support (me,st);
}
void
-Side_position::set_axis (Score_element*me, Axis a)
+Side_position::set_axis (Grob*me, Axis a)
{
me->add_offset_callback (Side_position::aligned_side_proc, a);
}
// ugh. doesn't cactch all variants.
Axis
-Side_position::get_axis (Score_element*me)
+Side_position::get_axis (Grob*me)
{
if (me->has_offset_callback_b (Side_position::aligned_side_proc, X_AXIS)
|| me->has_offset_callback_b (Side_position::aligned_side_proc , X_AXIS))
}
void
-Side_position::set_direction (Score_element*me, Direction d)
+Side_position::set_direction (Grob*me, Direction d)
{
- me->set_elt_property ("direction", gh_int2scm (d));
+ me->set_grob_property ("direction", gh_int2scm (d));
}
void
-Side_position::set_minimum_space (Score_element*me, Real m)
+Side_position::set_minimum_space (Grob*me, Real m)
{
- me->set_elt_property ("minimum-space", gh_double2scm (m));
+ me->set_grob_property ("minimum-space", gh_double2scm (m));
}
void
-Side_position::set_padding (Score_element*me, Real p)
+Side_position::set_padding (Grob*me, Real p)
{
- me->set_elt_property ("padding", gh_double2scm (p));
+ me->set_grob_property ("padding", gh_double2scm (p));
}
bool
-Side_position::has_interface (Score_element*me)
+Side_position::has_interface (Grob*me)
{
return me->has_interface (ly_symbol2scm ("side-position-interface"));
}
bool
-Side_position::supported_b (Score_element*me)
+Side_position::supported_b (Grob*me)
{
- SCM s = me->get_elt_property ("side-support-elements");
+ SCM s = me->get_grob_property ("side-support-elements");
return gh_pair_p(s);
}
}
void
-Simple_spacer::add_columns (Link_array<Score_element> cols)
+Simple_spacer::add_columns (Link_array<Grob> cols)
{
for (int i=0; i < cols.size () - 1; i++)
{
spring_params == SCM_UNDEFINED && gh_pair_p (s);
s = gh_cdr (s))
{
- Score_element *other = unsmob_element (gh_caar (s));
+ Grob *other = unsmob_element (gh_caar (s));
if (other != cols[i+1])
continue;
for (SCM s = Spaceable_element::get_minimum_distances (cols[i]);
gh_pair_p (s); s = gh_cdr (s))
{
- Score_element * other = unsmob_element (gh_caar (s));
+ Grob * other = unsmob_element (gh_caar (s));
int oi = cols.find_i (other);
if (oi >= 0)
{
{
Link_array<Span_req> requests_arr_;
Link_array<Span_req> new_slur_req_l_arr_;
- Link_array<Score_element> slur_l_stack_;
- Link_array<Score_element> end_slur_l_arr_;
+ Link_array<Grob> slur_l_stack_;
+ Link_array<Grob> end_slur_l_arr_;
Moment last_start_;
void set_melisma (bool);
protected:
- virtual bool do_try_music (Music*);
+ virtual bool try_music (Music*);
void deprecated_process_music ();
- virtual void acknowledge_element (Score_element_info);
- virtual void do_pre_move_processing ();
- virtual void do_post_move_processing ();
+ virtual void acknowledge_grob (Grob_info);
+ virtual void stop_translation_timestep ();
+ virtual void start_translation_timestep ();
virtual void do_removal_processing ();
- virtual void process_acknowledged ();
+ virtual void create_grobs ();
public:
VIRTUAL_COPY_CONS (Translator);
}
bool
-Slur_engraver::do_try_music (Music *req_l)
+Slur_engraver::try_music (Music *req_l)
{
if (Span_req *sl = dynamic_cast <Span_req *> (req_l))
{
}
void
-Slur_engraver::process_acknowledged ()
+Slur_engraver::create_grobs ()
{
deprecated_process_music ();
}
}
void
-Slur_engraver::acknowledge_element (Score_element_info info)
+Slur_engraver::acknowledge_grob (Grob_info info)
{
if (Note_column::has_interface (info.elem_l_))
{
- Score_element *e =info.elem_l_;
+ Grob *e =info.elem_l_;
for (int i = 0; i < slur_l_stack_.size (); i++)
Slur::add_column (slur_l_stack_[i], e);
for (int i = 0; i < end_slur_l_arr_.size (); i++)
for (int i = 0; i < slur_l_stack_.size (); i++)
{
#if 0
- typeset_element (slur_l_stack_[i]);
+ typeset_grob (slur_l_stack_[i]);
#else
/*
Let's not typeset unterminated stuff
void
Slur_engraver::deprecated_process_music ()
{
- Link_array<Score_element> start_slur_l_arr;
+ Link_array<Grob> start_slur_l_arr;
for (int i=0; i< new_slur_req_l_arr_.size (); i++)
{
Span_req* slur_req_l = new_slur_req_l_arr_[i];
slur_req_l->origin ()->warning (_f ("can't find start of slur"));
else
{
- Score_element* slur = slur_l_stack_.pop ();
+ Grob* slur = slur_l_stack_.pop ();
SCM s = get_property ("slurEndAttachment");
if (gh_symbol_p (s))
{
- index_set_cell (slur->get_elt_property ("attachment"), STOP, s);
+ index_set_cell (slur->get_grob_property ("attachment"), STOP, s);
}
end_slur_l_arr_.push (slur);
requests_arr_.pop ();
{
// push a new slur onto stack.
// (use temp. array to wait for all slur STOPs)
- Score_element* slur = new Spanner (get_property ("Slur"));
+ Grob* slur = new Spanner (get_property ("Slur"));
Slur::set_interface (slur);
SCM s = get_property ("slurBeginAttachment");
if (gh_symbol_p (s))
{
- index_set_cell (slur->get_elt_property ("attachment"), START, s);
+ index_set_cell (slur->get_grob_property ("attachment"), START, s);
}
start_slur_l_arr.push (slur);
requests_arr_.push (slur_req_l);
- announce_element (slur, slur_req_l);
+ announce_grob (slur, slur_req_l);
}
}
for (int i=0; i < start_slur_l_arr.size (); i++)
}
void
-Slur_engraver::do_pre_move_processing ()
+Slur_engraver::stop_translation_timestep ()
{
for (int i = 0; i < end_slur_l_arr_.size (); i++)
{
- typeset_element (end_slur_l_arr_[i]);
+ typeset_grob (end_slur_l_arr_[i]);
}
end_slur_l_arr_.clear ();
}
void
-Slur_engraver::do_post_move_processing ()
+Slur_engraver::start_translation_timestep ()
{
new_slur_req_l_arr_.clear ();
SCM m = get_property ("automaticMelismata");
void
-Slur::set_interface (Score_element*me)
+Slur::set_interface (Grob*me)
{
- me->set_elt_property ("attachment", gh_cons (SCM_BOOL_F, SCM_BOOL_F));
+ me->set_grob_property ("attachment", gh_cons (SCM_BOOL_F, SCM_BOOL_F));
me->set_interface (ly_symbol2scm ("slur-interface"));
}
void
-Slur::add_column (Score_element*me, Score_element*n)
+Slur::add_column (Grob*me, Grob*n)
{
- if (!gh_pair_p (n->get_elt_property ("note-heads")))
+ if (!gh_pair_p (n->get_grob_property ("note-heads")))
warning (_ ("Putting slur over rest. Ignoring."));
else
{
}
void
-Slur::de_uglyfy (Score_element*me, Slur_bezier_bow* bb, Real default_height)
+Slur::de_uglyfy (Grob*me, Slur_bezier_bow* bb, Real default_height)
{
Real length = bb->curve_.control_[3][X_AXIS] ;
Real ff = bb->fit_factor ();
Real h = bb->curve_.control_[i][Y_AXIS] * ff / length;
Real f = default_height / length;
- SCM up = me->get_elt_property ("de-uglify-parameters");
+ SCM up = me->get_grob_property ("de-uglify-parameters");
Real c1 = gh_scm2double (gh_car (up));
Real c2 = gh_scm2double (gh_cadr (up));
}
Direction
-Slur::get_default_dir (Score_element*me)
+Slur::get_default_dir (Grob*me)
{
- Link_array<Score_element> encompass_arr =
- Pointer_group_interface__extract_elements (me, (Score_element*)0, "note-columns");
+ Link_array<Grob> encompass_arr =
+ Pointer_group_interface__extract_elements (me, (Grob*)0, "note-columns");
Direction d = DOWN;
for (int i=0; i < encompass_arr.size (); i ++)
SCM
Slur::after_line_breaking (SCM smob)
{
- Score_element *me = unsmob_element (smob);
- if (!scm_ilength (me->get_elt_property ("note-columns")))
+ Grob *me = unsmob_element (smob);
+ if (!scm_ilength (me->get_grob_property ("note-columns")))
{
me->suicide ();
return SCM_UNSPECIFIED;
void
-Slur::check_slope (Score_element *me)
+Slur::check_slope (Grob *me)
{
/*
Avoid too steep slurs.
*/
- SCM s = me->get_elt_property ("slope-limit");
+ SCM s = me->get_grob_property ("slope-limit");
if (gh_number_p (s))
{
Array<Offset> encompass = get_encompass_offset_arr (me);
if (slope > limit)
{
- Real staff_space = Staff_symbol_referencer::staff_space ((Score_element*)me);
- Direction dir = (Direction)gh_scm2int (me->get_elt_property ("direction"));
+ Real staff_space = Staff_symbol_referencer::staff_space ((Grob*)me);
+ Direction dir = (Direction)gh_scm2int (me->get_grob_property ("direction"));
Direction d = (Direction)(- dir * (sign (dy)));
- SCM a = me->get_elt_property ("attachment-offset");
+ SCM a = me->get_grob_property ("attachment-offset");
Drul_array<Offset> o;
o[LEFT] = ly_scm2offset (index_cell (a, LEFT));
o[RIGHT] = ly_scm2offset (index_cell (a, RIGHT));
o[d][Y_AXIS] -= (limit - slope) * dx * dir / staff_space;
//o[d][Y_AXIS] = attachment[-d][Y_AXIS] + (dx * limit * dir / staff_space);
- me->set_elt_property ("attachment-offset",
+ me->set_grob_property ("attachment-offset",
gh_cons (ly_offset2scm (o[LEFT]),
ly_offset2scm (o[RIGHT])));
}
}
void
-Slur::set_extremities (Score_element *me)
+Slur::set_extremities (Grob *me)
{
if (!Directional_element_interface::get (me))
Directional_element_interface::set (me, get_default_dir (me));
Direction dir = LEFT;
do
{
- if (!gh_symbol_p (index_cell (me->get_elt_property ("attachment"), dir)))
+ if (!gh_symbol_p (index_cell (me->get_grob_property ("attachment"), dir)))
{
- for (SCM s = me->get_elt_property ("extremity-rules");
+ for (SCM s = me->get_grob_property ("extremity-rules");
s != SCM_EOL; s = gh_cdr (s))
{
SCM r = gh_call2 (gh_caar (s), me->self_scm (),
gh_int2scm ((int)dir));
if (r != SCM_BOOL_F)
{
- index_set_cell (me->get_elt_property ("attachment"), dir,
+ index_set_cell (me->get_grob_property ("attachment"), dir,
gh_cdar (s));
break;
}
Real
-Slur::get_first_notecolumn_y (Score_element *me, Direction dir)
+Slur::get_first_notecolumn_y (Grob *me, Direction dir)
{
- Score_element *col = dir == LEFT
- ? unsmob_element (gh_car (scm_reverse (me->get_elt_property
+ Grob *col = dir == LEFT
+ ? unsmob_element (gh_car (scm_reverse (me->get_grob_property
("note-columns"))))
: unsmob_element
- (gh_car (me->get_elt_property ("note-columns")));
+ (gh_car (me->get_grob_property ("note-columns")));
- Score_element *common[] =
+ Grob *common[] =
{
0,
me->common_refpoint (col, Y_AXIS)
}
Offset
-Slur::broken_trend_offset (Score_element *me, Direction dir)
+Slur::broken_trend_offset (Grob *me, Direction dir)
{
/*
A broken slur should maintain the same vertical trend
{
if (mother->broken_into_l_arr_[i - dir] == me)
{
- Score_element *neighbour = mother->broken_into_l_arr_[i];
+ Grob *neighbour = mother->broken_into_l_arr_[i];
if (dir == RIGHT)
- neighbour->set_elt_property ("direction",
- me->get_elt_property ("direction"));
+ neighbour->set_grob_property ("direction",
+ me->get_grob_property ("direction"));
Real neighbour_y = get_first_notecolumn_y (neighbour, dir);
Real y = get_first_notecolumn_y (me, -dir);
- int neighbour_cols = scm_ilength (neighbour->get_elt_property ("note-columns"));
- int cols = scm_ilength (me->get_elt_property ("note-columns"));
+ int neighbour_cols = scm_ilength (neighbour->get_grob_property ("note-columns"));
+ int cols = scm_ilength (me->get_grob_property ("note-columns"));
o = Offset (0, (y*neighbour_cols + neighbour_y*cols) /
(cols + neighbour_cols));
break;
}
Offset
-Slur::get_attachment (Score_element *me, Direction dir,
- Score_element **common)
+Slur::get_attachment (Grob *me, Direction dir,
+ Grob **common)
{
- SCM s = me->get_elt_property ("attachment");
+ SCM s = me->get_grob_property ("attachment");
if (!gh_symbol_p (index_cell (s, dir)))
{
set_extremities (me);
- s = me->get_elt_property ("attachment");
+ s = me->get_grob_property ("attachment");
}
SCM a = dir == LEFT ? gh_car (s) : gh_cdr (s);
Spanner*sp = dynamic_cast<Spanner*>(me);
String str = ly_symbol2string (a);
- Real staff_space = Staff_symbol_referencer::staff_space ((Score_element*)me);
+ Real staff_space = Staff_symbol_referencer::staff_space ((Grob*)me);
Real hs = staff_space / 2.0;
Offset o;
- Score_element *stem = 0;
+ Grob *stem = 0;
if (Note_column::has_interface (sp->get_bound (dir)))
{
- Score_element * n =sp->get_bound (dir);
+ Grob * n =sp->get_bound (dir);
if ((stem = Note_column::stem_l (n)))
{
}
- SCM alist = me->get_elt_property ("extremity-offset-alist");
+ SCM alist = me->get_grob_property ("extremity-offset-alist");
int stemdir = stem ? Stem::get_direction (stem) : 1;
- int slurdir = gh_scm2int (me->get_elt_property ("direction"));
+ int slurdir = gh_scm2int (me->get_grob_property ("direction"));
SCM l = scm_assoc
(scm_listify (a,
gh_int2scm (stemdir * dir),
- me->relative_coordinate (common[Y_AXIS], Y_AXIS);
}
- o += ly_scm2offset (index_cell (me->get_elt_property ("attachment-offset"),
+ o += ly_scm2offset (index_cell (me->get_grob_property ("attachment-offset"),
dir)) * staff_space;
return o;
}
Offset
-Slur::encompass_offset (Score_element*me,
- Score_element* col,
- Score_element **common)
+Slur::encompass_offset (Grob*me,
+ Grob* col,
+ Grob **common)
{
Offset o;
- Score_element* stem_l = unsmob_element (col->get_elt_property ("stem"));
+ Grob* stem_l = unsmob_element (col->get_grob_property ("stem"));
Direction dir = Directional_element_interface::get (me);
/*
leave a gap: slur mustn't touch head/stem
*/
- o[Y_AXIS] += dir * gh_scm2double (me->get_elt_property ("y-free")) *
+ o[Y_AXIS] += dir * gh_scm2double (me->get_grob_property ("y-free")) *
1.0;
return o;
}
Array<Offset>
-Slur::get_encompass_offset_arr (Score_element *me)
+Slur::get_encompass_offset_arr (Grob *me)
{
Spanner*sp = dynamic_cast<Spanner*>(me);
- SCM eltlist = me->get_elt_property ("note-columns");
- Score_element *common[] = {me->common_refpoint (eltlist, X_AXIS),
+ SCM eltlist = me->get_grob_property ("note-columns");
+ Grob *common[] = {me->common_refpoint (eltlist, X_AXIS),
me->common_refpoint (eltlist, Y_AXIS)};
common[X_AXIS] = common[X_AXIS]->common_refpoint (sp->get_bound (RIGHT), X_AXIS);
common[X_AXIS] = common[X_AXIS]->common_refpoint (sp->get_bound (LEFT), X_AXIS);
- Link_array<Score_element> encompass_arr;
+ Link_array<Grob> encompass_arr;
while (gh_pair_p (eltlist))
{
encompass_arr.push (unsmob_element (gh_car (eltlist)));
SCM
Slur::set_spacing_rods (SCM smob)
{
- Score_element*me = unsmob_element (smob);
+ Grob*me = unsmob_element (smob);
Rod r;
Spanner*sp = dynamic_cast<Spanner*>(me);
r.item_l_drul_[LEFT] = sp->get_bound (LEFT);
r.item_l_drul_[RIGHT] = sp->get_bound (RIGHT);
r.distance_f_ =
- gh_scm2double (me->get_elt_property ("minimum-length"))
+ gh_scm2double (me->get_grob_property ("minimum-length"))
* 1.0;
r.add_to_cols ();
SCM
Slur::brew_molecule (SCM smob)
{
- Score_element * me = unsmob_element (smob);
- if (!scm_ilength (me->get_elt_property ("note-columns")))
+ Grob * me = unsmob_element (smob);
+ if (!scm_ilength (me->get_grob_property ("note-columns")))
{
me->suicide ();
return SCM_EOL;
}
Real thick = me->paper_l ()->get_var ("stafflinethickness") *
- gh_scm2double (me->get_elt_property ("thickness"));
+ gh_scm2double (me->get_grob_property ("thickness"));
Bezier one = get_curve (me);
// get_curve may suicide
- if (!scm_ilength (me->get_elt_property ("note-columns")))
+ if (!scm_ilength (me->get_grob_property ("note-columns")))
return SCM_EOL;
Molecule a;
- SCM d = me->get_elt_property ("dashed");
+ SCM d = me->get_grob_property ("dashed");
if (gh_number_p (d))
a = Lookup::dashed_slur (one, thick, thick * gh_scm2double (d));
else
}
void
-Slur::set_control_points (Score_element*me)
+Slur::set_control_points (Grob*me)
{
- Real staff_space = Staff_symbol_referencer::staff_space ((Score_element*)me);
+ Real staff_space = Staff_symbol_referencer::staff_space ((Grob*)me);
- SCM details = me->get_elt_property ("details");
+ SCM details = me->get_grob_property ("details");
SCM h_inf_scm = scm_assq (ly_symbol2scm ("height-limit"), details);
SCM r_0_scm = scm_assq (ly_symbol2scm ("ratio"), details);
Real length = bb.curve_.control_[3][X_AXIS];
Real default_height = slur_height (length, h_inf, r_0);
- SCM ssb = me->get_elt_property ("beautiful");
+ SCM ssb = me->get_grob_property ("beautiful");
Real sb = 0;
if (gh_number_p (ssb))
sb = gh_scm2double (ssb);
}
}
- me->set_elt_property ("control-points", controls);
+ me->set_grob_property ("control-points", controls);
}
Bezier
-Slur::get_curve (Score_element*me)
+Slur::get_curve (Grob*me)
{
Bezier b;
int i = 0;
if (!Directional_element_interface::get (me)
- || ! gh_symbol_p (index_cell (me->get_elt_property ("attachment"), LEFT))
- || ! gh_symbol_p (index_cell (me->get_elt_property ("attachment"), RIGHT)))
+ || ! gh_symbol_p (index_cell (me->get_grob_property ("attachment"), LEFT))
+ || ! gh_symbol_p (index_cell (me->get_grob_property ("attachment"), RIGHT)))
set_extremities (me);
- if (!gh_pair_p (me->get_elt_property ("control-points")))
+ if (!gh_pair_p (me->get_grob_property ("control-points")))
set_control_points (me);
// set_control_points may suicide
- if (!scm_ilength (me->get_elt_property ("note-columns")))
+ if (!scm_ilength (me->get_grob_property ("note-columns")))
return b;
- for (SCM s= me->get_elt_property ("control-points"); s != SCM_EOL; s = gh_cdr (s))
+ for (SCM s= me->get_grob_property ("control-points"); s != SCM_EOL; s = gh_cdr (s))
{
b.control_[i] = ly_scm2offset (gh_car (s));
i++;
bool
-Slur::has_interface (Score_element*me)
+Slur::has_interface (Grob*me)
{
return me->has_interface (ly_symbol2scm ("slur-interface"));
}
*/
#include "spaceable-element.hh"
-#include "score-element.hh"
+#include "grob.hh"
#include "warn.hh"
SCM
-Spaceable_element::get_minimum_distances ( Score_element*me)
+Spaceable_element::get_minimum_distances ( Grob*me)
{
- return me->get_elt_property ("minimum-distances");
+ return me->get_grob_property ("minimum-distances");
}
/*todo: merge code of spring & rod?
*/
void
-Spaceable_element::add_rod (Score_element *me , Score_element * p, Real d)
+Spaceable_element::add_rod (Grob *me , Grob * p, Real d)
{
SCM mins = get_minimum_distances (me);
SCM newdist = gh_double2scm (d);
}
mins = gh_cons (gh_cons (p->self_scm (), newdist), mins);
- me->set_elt_property ("minimum-distances", mins);
+ me->set_grob_property ("minimum-distances", mins);
}
void
-Spaceable_element::add_spring (Score_element*me, Score_element * p, Real d, Real strength)
+Spaceable_element::add_spring (Grob*me, Grob * p, Real d, Real strength)
{
SCM mins = get_ideal_distances (me);
SCM newdist= gh_double2scm (d);
SCM newstrength= gh_double2scm (strength);
mins = gh_cons (gh_cons (p->self_scm (), gh_cons (newdist, newstrength)), mins);
- me->set_elt_property ("ideal-distances", mins);
+ me->set_grob_property ("ideal-distances", mins);
}
SCM
-Spaceable_element::get_ideal_distances (Score_element*me)
+Spaceable_element::get_ideal_distances (Grob*me)
{
- return me->get_elt_property ("ideal-distances");
+ return me->get_grob_property ("ideal-distances");
}
void
-Spaceable_element::remove_interface (Score_element*me)
+Spaceable_element::remove_interface (Grob*me)
{
- me->remove_elt_property ("minimum-distances");
- me->remove_elt_property ("ideal-distances");
- me->remove_elt_property ("dir-list");
+ me->remove_grob_property ("minimum-distances");
+ me->remove_grob_property ("ideal-distances");
+ me->remove_grob_property ("dir-list");
}
void
-Spaceable_element::set_interface (Score_element*me)
+Spaceable_element::set_interface (Grob*me)
{
me->set_interface (ly_symbol2scm ("spaceable-element-interface"));
}
struct Rhythmic_tuple
{
- Score_element_info info_;
+ Grob_info info_;
Moment end_;
Rhythmic_tuple ()
{
}
- Rhythmic_tuple (Score_element_info i, Moment m )
+ Rhythmic_tuple (Grob_info i, Moment m )
{
info_ = i;
end_ = m;
Spanner * spacing_p_;
protected:
VIRTUAL_COPY_CONS(Translator);
- virtual void acknowledge_element (Score_element_info);
- virtual void do_post_move_processing ();
- virtual void do_pre_move_processing ();
+ virtual void acknowledge_grob (Grob_info);
+ virtual void start_translation_timestep ();
+ virtual void stop_translation_timestep ();
virtual void do_creation_processing ();
virtual void do_removal_processing ();
public:
spacing_p_ =new Spanner (get_property ("SpacingSpanner"));
Spacing_spanner::set_interface (spacing_p_);
spacing_p_->set_bound (LEFT, unsmob_element (get_property ("currentCommandColumn")));
- announce_element (spacing_p_, 0);
+ announce_grob (spacing_p_, 0);
}
void
Spacing_engraver::do_removal_processing ()
{
- Score_element * p = unsmob_element (get_property ("currentCommandColumn"));
+ Grob * p = unsmob_element (get_property ("currentCommandColumn"));
spacing_p_->set_bound (RIGHT, p);
- typeset_element (spacing_p_);
+ typeset_grob (spacing_p_);
spacing_p_ =0;
}
void
-Spacing_engraver::acknowledge_element (Score_element_info i)
+Spacing_engraver::acknowledge_grob (Grob_info i)
{
- if (to_boolean (i.elem_l_->get_elt_property ("grace")))
+ if (to_boolean (i.elem_l_->get_grob_property ("grace")))
return;
- if (to_boolean (i.elem_l_->get_elt_property ("non-rhythmic")))
+ if (to_boolean (i.elem_l_->get_grob_property ("non-rhythmic")))
return;
if (Rhythmic_req * r = dynamic_cast<Rhythmic_req*>(i.req_l_))
}
void
-Spacing_engraver::do_pre_move_processing ()
+Spacing_engraver::stop_translation_timestep ()
{
Moment shortest_playing;
shortest_playing.set_infinite (1);
SCM sh = shortest_playing.smobbed_copy( );
SCM st = starter.smobbed_copy();
- sc->set_elt_property ("shortest-playing-duration", sh);
- sc->set_elt_property ("shortest-starter-duration", st);
+ sc->set_grob_property ("shortest-playing-duration", sh);
+ sc->set_grob_property ("shortest-starter-duration", st);
}
void
-Spacing_engraver::do_post_move_processing ()
+Spacing_engraver::start_translation_timestep ()
{
Moment now = now_mom ();
stopped_durations_.clear ();
#include "misc.hh"
void
-Spacing_spanner::set_interface (Score_element*me)
+Spacing_spanner::set_interface (Grob*me)
{
me->set_extent_callback (SCM_EOL, X_AXIS);
me->set_extent_callback (SCM_EOL, Y_AXIS) ;
*/
void
-Spacing_spanner::do_measure (Score_element*me, Link_array<Score_element> cols)
+Spacing_spanner::do_measure (Grob*me, Link_array<Grob> cols)
{
Moment shortest;
Moment mean_shortest;
/*
space as if this duration is present.
*/
- Moment base_shortest_duration = *unsmob_moment (me->get_elt_property ("maximum-duration-for-spacing"));
+ Moment base_shortest_duration = *unsmob_moment (me->get_grob_property ("maximum-duration-for-spacing"));
shortest.set_infinite (1);
int n = 0;
{
if (dynamic_cast<Paper_column*> (cols[i])->musical_b ())
{
- SCM st = cols[i]->get_elt_property ("shortest-starter-duration");
+ SCM st = cols[i]->get_grob_property ("shortest-starter-duration");
Moment this_shortest = *unsmob_moment(st);
shortest = shortest <? this_shortest;
if (!mean_shortest.infty_b ())
s.item_l_drul_[LEFT] = lc;
s.item_l_drul_[RIGHT] = rc;
- SCM hint = lc->get_elt_property ("extra-space");
- SCM next_hint = rc->get_elt_property ("extra-space");
- SCM stretch_hint = lc->get_elt_property ("stretch-distance");
- SCM next_stretch_hint = rc->get_elt_property ("stretch-distance");
+ SCM hint = lc->get_grob_property ("extra-space");
+ SCM next_hint = rc->get_grob_property ("extra-space");
+ SCM stretch_hint = lc->get_grob_property ("stretch-distance");
+ SCM next_stretch_hint = rc->get_grob_property ("stretch-distance");
Real left_distance;
if (gh_pair_p (hint))
We want the space before barline to be like the note
spacing in the measure.
*/
- SCM sfac =lc->get_elt_property ("space-factor");
+ SCM sfac =lc->get_grob_property ("space-factor");
if (Item::breakable_b (lc) || lc->original_l_)
{
s.strength_f_ =
- gh_scm2double (lc->get_elt_property ("column-space-strength"));
+ gh_scm2double (lc->get_grob_property ("column-space-strength"));
}
else if (gh_number_p (sfac))
left_distance *= gh_scm2double (sfac);
*/
if (rc->musical_b ())
{
- if (to_boolean (rc->get_elt_property ("contains-grace")))
- right_dist *= gh_scm2double (rc->get_elt_property ("before-grace-spacing-factor")); // fixme.
+ if (to_boolean (rc->get_grob_property ("contains-grace")))
+ right_dist *= gh_scm2double (rc->get_grob_property ("before-grace-spacing-factor")); // fixme.
else
- right_dist *= gh_scm2double (lc->get_elt_property ("before-musical-spacing-factor"));
+ right_dist *= gh_scm2double (lc->get_grob_property ("before-musical-spacing-factor"));
}
s.distance_f_ = left_distance + right_dist;
Do something if breakable column has no spacing hints set.
*/
Real
-Spacing_spanner::default_bar_spacing (Score_element*me, Score_element *lc, Score_element *rc,
+Spacing_spanner::default_bar_spacing (Grob*me, Grob *lc, Grob *rc,
Moment shortest)
{
Real symbol_distance = lc->extent (lc,X_AXIS)[RIGHT] ;
*/
Real
-Spacing_spanner::get_duration_space (Score_element*me, Moment d, Moment shortest)
+Spacing_spanner::get_duration_space (Grob*me, Moment d, Moment shortest)
{
Real log = log_2 (shortest);
- Real k = gh_scm2double (me->get_elt_property ("arithmetic-basicspace"))
+ Real k = gh_scm2double (me->get_grob_property ("arithmetic-basicspace"))
- log;
- return (log_2 (d) + k) * gh_scm2double (me->get_elt_property ("arithmetic-multiplier"));
+ return (log_2 (d) + k) * gh_scm2double (me->get_grob_property ("arithmetic-multiplier"));
}
Real
-Spacing_spanner::note_spacing (Score_element*me, Score_element *lc, Score_element *rc,
+Spacing_spanner::note_spacing (Grob*me, Grob *lc, Grob *rc,
Moment shortest)
{
Moment shortest_playing_len = 0;
- SCM s = lc->get_elt_property ("shortest-playing-duration");
+ SCM s = lc->get_grob_property ("shortest-playing-duration");
- // SCM s = lc->get_elt_property ("mean-playing-duration");
+ // SCM s = lc->get_grob_property ("mean-playing-duration");
if (unsmob_moment (s))
shortest_playing_len = *unsmob_moment(s);
This routine reads the DIR-LIST property of both its L and R arguments. */
Real
-Spacing_spanner::stem_dir_correction (Score_element*me, Score_element*l, Score_element*r)
+Spacing_spanner::stem_dir_correction (Grob*me, Grob*l, Grob*r)
{
- SCM dl = l->get_elt_property ("dir-list");
- SCM dr = r->get_elt_property ("dir-list");
+ SCM dl = l->get_grob_property ("dir-list");
+ SCM dr = r->get_grob_property ("dir-list");
if (scm_ilength (dl) != 1 || scm_ilength (dr) != 1)
return 0.;
Real correction = 0.0;
- Real ssc = gh_scm2double (me->get_elt_property("stem-spacing-correction"));
+ Real ssc = gh_scm2double (me->get_grob_property("stem-spacing-correction"));
if (d1 && d2 && d1 * d2 == -1)
{
SCM
Spacing_spanner::set_springs (SCM smob)
{
- Score_element *me = unsmob_element (smob);
- Link_array<Score_element> all (me->pscore_l_->line_l_->column_l_arr ()) ;
+ Grob *me = unsmob_element (smob);
+ Link_array<Grob> all (me->pscore_l_->line_l_->column_l_arr ()) ;
int j = 0;
for (int i = 1; i < all.size (); i++)
{
- Score_element *sc = all[i];
+ Grob *sc = all[i];
if (Item::breakable_b (sc))
{
- Link_array<Score_element> measure (all.slice (j, i+1));
+ Link_array<Grob> measure (all.slice (j, i+1));
do_measure (me, measure);
j = i;
}
Span_arpeggio_engraver ();
protected:
- virtual void acknowledge_element (Score_element_info);
- virtual void process_acknowledged ();
- virtual void do_pre_move_processing ();
+ virtual void acknowledge_grob (Grob_info);
+ virtual void create_grobs ();
+ virtual void stop_translation_timestep ();
private:
Item *span_arpeggio_;
- Link_array<Score_element> arpeggios_;
+ Link_array<Grob> arpeggios_;
};
}
void
-Span_arpeggio_engraver::acknowledge_element (Score_element_info info)
+Span_arpeggio_engraver::acknowledge_grob (Grob_info info)
{
if (info.origin_trans_l_arr (this).size ()
&& Arpeggio::has_interface (info.elem_l_))
}
void
-Span_arpeggio_engraver::process_acknowledged ()
+Span_arpeggio_engraver::create_grobs ()
{
/*
connectArpeggios is slightly brusque; we should really read a elt
&& to_boolean (get_property ("connectArpeggios")))
{
span_arpeggio_ = new Item (get_property ("Arpeggio"));
- announce_element (span_arpeggio_, 0);
+ announce_grob (span_arpeggio_, 0);
}
}
void
-Span_arpeggio_engraver::do_pre_move_processing ()
+Span_arpeggio_engraver::stop_translation_timestep ()
{
if (span_arpeggio_)
{
*/
for (int i=0; i < arpeggios_.size (); i ++)
{
- for (SCM s = arpeggios_[i]->get_elt_property ("stems");
+ for (SCM s = arpeggios_[i]->get_grob_property ("stems");
gh_pair_p (s); s = gh_cdr (s))
Group_interface::add_thing (span_arpeggio_, "stems", gh_car (s));
- for (SCM s = arpeggios_[i]->get_elt_property ("side-support-elements");
+ for (SCM s = arpeggios_[i]->get_grob_property ("side-support-elements");
gh_pair_p (s); s = gh_cdr (s))
Group_interface::add_thing (span_arpeggio_, "side-support-elements", gh_car (s));
we can't kill the children, since we don't want to the
previous note to bump into the span arpeggio; so we make
it transparent. */
- arpeggios_[i]->set_elt_property ("molecule-callback", SCM_BOOL_T);
+ arpeggios_[i]->set_grob_property ("molecule-callback", SCM_BOOL_T);
}
- typeset_element (span_arpeggio_);
+ typeset_grob (span_arpeggio_);
span_arpeggio_ = 0;
}
arpeggios_.clear ();
VIRTUAL_COPY_CONS(Translator);
Span_bar_engraver();
protected:
- virtual void acknowledge_element (Score_element_info);
- virtual void do_pre_move_processing();
+ virtual void acknowledge_grob (Grob_info);
+ virtual void stop_translation_timestep();
};
void
-Span_bar_engraver::acknowledge_element (Score_element_info i)
+Span_bar_engraver::acknowledge_grob (Grob_info i)
{
int depth = i.origin_trans_l_arr (this).size();
if (depth > 1
spanbar_p_->set_parent (bar_l_arr_[0], Y_AXIS);
spanbar_p_->set_parent (bar_l_arr_[0], X_AXIS);
- announce_element (spanbar_p_,0);
+ announce_grob (spanbar_p_,0);
}
}
}
void
-Span_bar_engraver::do_pre_move_processing()
+Span_bar_engraver::stop_translation_timestep()
{
if (spanbar_p_)
{
Span_bar::add_bar( spanbar_p_,bar_l_arr_[i]);
SCM vissym =ly_symbol2scm ("visibility-lambda");
- SCM vis = bar_l_arr_[0]->get_elt_property (vissym);
- if (scm_equal_p (spanbar_p_->get_elt_property (vissym), vis) != SCM_BOOL_T)
- spanbar_p_->set_elt_property (vissym, vis);
+ SCM vis = bar_l_arr_[0]->get_grob_property (vissym);
+ if (scm_equal_p (spanbar_p_->get_grob_property (vissym), vis) != SCM_BOOL_T)
+ spanbar_p_->set_grob_property (vissym, vis);
- typeset_element (spanbar_p_);
+ typeset_grob (spanbar_p_);
spanbar_p_ =0;
}
bar_l_arr_.set_size (0);
#include "warn.hh"
#include "axis-group-interface.hh"
#include "group-interface.hh"
-#include "score-element.hh"
+#include "grob.hh"
#include "bar.hh"
void
-Span_bar::add_bar (Score_element*me, Score_element*b)
+Span_bar::add_bar (Grob*me, Grob*b)
{
Pointer_group_interface::add_element (me,"elements", b);
SCM
Span_bar::width_callback (SCM element_smob, SCM scm_axis)
{
- Score_element *se = unsmob_element (element_smob);
+ Grob *se = unsmob_element (element_smob);
Axis a = (Axis) gh_scm2int (scm_axis);
assert (a == X_AXIS);
- String gl = ly_scm2string (se->get_elt_property ("glyph"));
+ String gl = ly_scm2string (se->get_grob_property ("glyph"));
/*
urg.
SCM
Span_bar::center_on_spanned_callback (SCM element_smob, SCM axis)
{
- Score_element *me = unsmob_element (element_smob);
+ Grob *me = unsmob_element (element_smob);
Axis a = (Axis) gh_scm2int (axis);
assert (a == Y_AXIS);
Interval i (get_spanned_interval (me));
}
void
-Span_bar::evaluate_empty (Score_element*me)
+Span_bar::evaluate_empty (Grob*me)
{
/*
TODO: filter all hara-kiried out of ELEMENS list, and then
center_on_spanned_callback() as well.
*/
- if (!gh_pair_p (me->get_elt_property ("elements")))
+ if (!gh_pair_p (me->get_grob_property ("elements")))
{
me->suicide ();
}
}
void
-Span_bar::evaluate_glyph (Score_element*me)
+Span_bar::evaluate_glyph (Grob*me)
{
- SCM elts = me->get_elt_property ("elements");
- Score_element * b = unsmob_element (gh_car (elts));
+ SCM elts = me->get_grob_property ("elements");
+ Grob * b = unsmob_element (gh_car (elts));
SCM glsym =ly_symbol2scm ("glyph");
- SCM gl =b ->get_elt_property (glsym);
+ SCM gl =b ->get_grob_property (glsym);
if (!gh_string_p (gl))
{
me->suicide ();
}
gl = ly_str02scm (type.ch_C());
- if (scm_equal_p (me->get_elt_property (glsym), gl) != SCM_BOOL_T)
- me->set_elt_property (glsym, gl);
+ if (scm_equal_p (me->get_grob_property (glsym), gl) != SCM_BOOL_T)
+ me->set_grob_property (glsym, gl);
}
Interval
-Span_bar::get_spanned_interval (Score_element*me)
+Span_bar::get_spanned_interval (Grob*me)
{
return ly_scm2interval (Axis_group_interface::group_extent_callback (me->self_scm(), gh_int2scm (Y_AXIS)));
}
SCM
Span_bar::get_bar_size (SCM smob)
{
- Score_element* me = unsmob_element (smob);
+ Grob* me = unsmob_element (smob);
Interval iv (get_spanned_interval (me));
if (iv.empty_b ())
{
}
void
-Span_bar::set_interface (Score_element *me)
+Span_bar::set_interface (Grob *me)
{
Bar::set_interface (me);
}
bool
-Span_bar::has_interface (Score_element*m)
+Span_bar::has_interface (Grob*m)
{
return m && m->has_interface (ly_symbol2scm ("span-bar-interface"));
}
Span_dynamic_performer ();
protected:
- virtual bool do_try_music (Music*);
- virtual void acknowledge_element (Audio_element_info);
- virtual void process_acknowledged ();
+ virtual bool try_music (Music*);
+ virtual void acknowledge_grob (Audio_element_info);
+ virtual void create_grobs ();
void deprecated_process_music ();
- virtual void do_pre_move_processing ();
- virtual void do_post_move_processing ();
+ virtual void stop_translation_timestep ();
+ virtual void start_translation_timestep ();
private:
Audio_dynamic* audio_p_;
}
void
-Span_dynamic_performer::acknowledge_element (Audio_element_info i)
+Span_dynamic_performer::acknowledge_grob (Audio_element_info i)
{
if (Audio_dynamic * d = dynamic_cast <Audio_dynamic*> (i.elem_l_))
{
}
void
-Span_dynamic_performer::process_acknowledged ()
+Span_dynamic_performer::create_grobs ()
{
deprecated_process_music ();
if (span_req_l_drul_[STOP])
}
void
-Span_dynamic_performer::do_pre_move_processing ()
+Span_dynamic_performer::stop_translation_timestep ()
{
if (finished_dynamic_tuple_arr_.size () > 1)
{
}
void
-Span_dynamic_performer::do_post_move_processing ()
+Span_dynamic_performer::start_translation_timestep ()
{
span_req_l_drul_[STOP] = 0;
span_req_l_drul_[START] = 0;
}
bool
-Span_dynamic_performer::do_try_music (Music* r)
+Span_dynamic_performer::try_music (Music* r)
{
if (Span_req * s = dynamic_cast<Span_req*>(r))
{
span_p->set_bound (RIGHT, bound);
assert (span_p->line_l ());
- span_p->line_l ()->typeset_element (span_p);
+ span_p->line_l ()->typeset_grob (span_p);
broken_into_l_arr_.push (span_p);
}
}
}
else
{
- bounds[LEFT]->line_l ()->typeset_element (span_p);
+ bounds[LEFT]->line_l ()->typeset_grob (span_p);
broken_into_l_arr_.push (span_p);
}
}
}
void
-Spanner::set_bound(Direction d, Score_element*s)
+Spanner::set_bound(Direction d, Grob*s)
{
Item * i = dynamic_cast<Item*> (s);
if (!i)
Spanner::Spanner (SCM s)
- : Score_element (s)
+ : Grob (s)
{
spanned_drul_[LEFT]=0;
spanned_drul_[RIGHT]=0;
}
Spanner::Spanner (Spanner const &s)
- : Score_element (s)
+ : Grob (s)
{
spanned_drul_[LEFT] = spanned_drul_[RIGHT] =0;
}
}
-Score_element*
+Grob*
Spanner::find_broken_piece (Line_of_score*l) const
{
int idx = binsearch_link_array (broken_into_l_arr_, (Spanner*)l, Spanner::compare);
a pointer to the staffsymbol in S
*/
void
-extend_spanner_over_elements (Score_element*s)
+extend_spanner_over_elements (Grob*s)
{
Spanner*sp = dynamic_cast<Spanner*> (s);
SCM pair = gh_cons (s1,s2);
extend_spanner_over_elements (sp->mutable_property_alist_, pair);
- Score_element *p1 = unsmob_element (gh_car (pair));
- Score_element* p2 = unsmob_element (gh_cdr (pair));
+ Grob *p1 = unsmob_element (gh_car (pair));
+ Grob* p2 = unsmob_element (gh_cdr (pair));
sp->set_bound (LEFT,p1);
sp->set_bound (RIGHT, p2);
virtual void play_element (Audio_element* p);
virtual void do_removal_processing ();
virtual void do_creation_processing ();
- virtual void process_acknowledged ();
- virtual void do_pre_move_processing ();
+ virtual void create_grobs ();
+ virtual void stop_translation_timestep ();
private:
Audio_staff* audio_staff_p_;
}
void
-Staff_performer::process_acknowledged ()
+Staff_performer::create_grobs ()
{
String str = new_instrument_str ();
if (str.length_i ())
}
void
-Staff_performer::do_pre_move_processing ()
+Staff_performer::stop_translation_timestep ()
{
if (name_p_)
{
play_element (instrument_p_);
instrument_p_ = 0;
}
- Performer_group_performer::do_pre_move_processing ();
+ Performer_group_performer::stop_translation_timestep ();
}
void
protected:
virtual ~Staff_symbol_engraver();
- virtual void acknowledge_element (Score_element_info);
+ virtual void acknowledge_grob (Grob_info);
virtual void do_removal_processing();
virtual void do_creation_processing();
};
span_p_->set_bound(LEFT, unsmob_element (get_property ("currentCommandColumn")));
- announce_element (span_p_, 0);
+ announce_grob (span_p_, 0);
}
void
Staff_symbol_engraver::do_removal_processing()
{
span_p_->set_bound(RIGHT,unsmob_element (get_property ("currentCommandColumn")));
- typeset_element (span_p_);
+ typeset_grob (span_p_);
span_p_ =0;
}
void
-Staff_symbol_engraver::acknowledge_element (Score_element_info s)
+Staff_symbol_engraver::acknowledge_grob (Grob_info s)
{
- s.elem_l_->set_elt_property ("staff-symbol", span_p_->self_scm ());
+ s.elem_l_->set_grob_property ("staff-symbol", span_p_->self_scm ());
// remove this. probly not necessary?
s.elem_l_->add_dependency (span_p_); // UGH. UGH. UGH
#include "paper-def.hh"
bool
-Staff_symbol_referencer::has_interface (Score_element*e)
+Staff_symbol_referencer::has_interface (Grob*e)
{
- return unsmob_element (e->get_elt_property ("staff-symbol"))
- || gh_number_p (e->get_elt_property ("staff-position"));
+ return unsmob_element (e->get_grob_property ("staff-symbol"))
+ || gh_number_p (e->get_grob_property ("staff-position"));
}
int
-Staff_symbol_referencer::line_count (Score_element*me)
+Staff_symbol_referencer::line_count (Grob*me)
{
- Score_element *st = staff_symbol_l (me);
+ Grob *st = staff_symbol_l (me);
return st ? Staff_symbol::line_count (st) : 0;
}
bool
-Staff_symbol_referencer::on_staffline (Score_element*me)
+Staff_symbol_referencer::on_staffline (Grob*me)
{
return on_staffline (me, (int) position_f (me));
}
bool
-Staff_symbol_referencer::on_staffline (Score_element*me, int pos)
+Staff_symbol_referencer::on_staffline (Grob*me, int pos)
{
int sz = line_count (me)-1;
return ((pos + sz) % 2) == 0;
}
-Score_element*
-Staff_symbol_referencer::staff_symbol_l (Score_element*me)
+Grob*
+Staff_symbol_referencer::staff_symbol_l (Grob*me)
{
- SCM st = me->get_elt_property ("staff-symbol");
+ SCM st = me->get_grob_property ("staff-symbol");
return unsmob_element(st);
}
Real
-Staff_symbol_referencer::staff_space (Score_element*me)
+Staff_symbol_referencer::staff_space (Grob*me)
{
- Score_element * st = staff_symbol_l (me);
+ Grob * st = staff_symbol_l (me);
if (st)
return Staff_symbol::staff_space (st);
Real
-Staff_symbol_referencer::position_f (Score_element*me)
+Staff_symbol_referencer::position_f (Grob*me)
{
Real p =0.0;
- Score_element * st = staff_symbol_l (me);
- Score_element * c = st ? me->common_refpoint (st, Y_AXIS) : 0;
+ Grob * st = staff_symbol_l (me);
+ Grob * c = st ? me->common_refpoint (st, Y_AXIS) : 0;
if (st && c)
{
Real y = me->relative_coordinate (c, Y_AXIS)
}
else
{
- SCM pos = me->get_elt_property ("staff-position");
+ SCM pos = me->get_grob_property ("staff-position");
if (gh_number_p (pos))
return gh_scm2double (pos);
}
SCM
Staff_symbol_referencer::callback (SCM element_smob, SCM )
{
- Score_element *me = unsmob_element (element_smob);
+ Grob *me = unsmob_element (element_smob);
- SCM pos = me->get_elt_property ("staff-position");
+ SCM pos = me->get_grob_property ("staff-position");
Real off =0.0;
if (gh_number_p (pos))
{
off = gh_scm2double (pos) * space/2.0;
}
- me->set_elt_property ("staff-position", gh_double2scm (0.0));
+ me->set_grob_property ("staff-position", gh_double2scm (0.0));
return gh_double2scm (off);
}
*/
void
-Staff_symbol_referencer::set_position (Score_element*me,Real p)
+Staff_symbol_referencer::set_position (Grob*me,Real p)
{
- Score_element * st = staff_symbol_l (me);
+ Grob * st = staff_symbol_l (me);
if (st && me->common_refpoint(st, Y_AXIS))
{
Real oldpos = position_f (me);
- me->set_elt_property ("staff-position", gh_double2scm (p - oldpos));
+ me->set_grob_property ("staff-position", gh_double2scm (p - oldpos));
}
else
{
- me->set_elt_property ("staff-position",
+ me->set_grob_property ("staff-position",
gh_double2scm (p));
}
half of the height, in staff space.
*/
Real
-Staff_symbol_referencer::staff_radius (Score_element*me)
+Staff_symbol_referencer::staff_radius (Grob*me)
{
return (line_count (me) -1) / 2;
}
int
-compare_position (Score_element *const &a, Score_element * const &b)
+compare_position (Grob *const &a, Grob * const &b)
{
- return sign (Staff_symbol_referencer::position_f((Score_element*)a) -
- Staff_symbol_referencer::position_f((Score_element*)b));
+ return sign (Staff_symbol_referencer::position_f((Grob*)a) -
+ Staff_symbol_referencer::position_f((Grob*)b));
}
void
-Staff_symbol_referencer::set_interface (Score_element * e)
+Staff_symbol_referencer::set_interface (Grob * e)
{
- if (!gh_number_p (e->get_elt_property ("staff-position")))
- e->set_elt_property ("staff-position", gh_double2scm (0.0));
+ if (!gh_number_p (e->get_grob_property ("staff-position")))
+ e->set_grob_property ("staff-position", gh_double2scm (0.0));
e->add_offset_callback (Staff_symbol_referencer::callback_proc, Y_AXIS);
}
SCM
Staff_symbol::brew_molecule (SCM smob)
{
- Score_element *me = unsmob_element (smob);
+ Grob *me = unsmob_element (smob);
Spanner* sp = dynamic_cast<Spanner*> (me);
- Score_element * common
+ Grob * common
= sp->get_bound (LEFT)->common_refpoint (sp->get_bound (RIGHT), X_AXIS);
Real width =
}
int
-Staff_symbol::steps_i(Score_element*me)
+Staff_symbol::steps_i(Grob*me)
{
return line_count (me) * 2;
}
int
-Staff_symbol::line_count (Score_element*me)
+Staff_symbol::line_count (Grob*me)
{
- SCM c = me->get_elt_property ("line-count");
+ SCM c = me->get_grob_property ("line-count");
if (gh_number_p (c))
return gh_scm2int (c);
else
}
Real
-Staff_symbol::staff_space (Score_element*me )
+Staff_symbol::staff_space (Grob*me )
{
Real ss = 1.0;
- SCM s = me->get_elt_property ("staff-space");
+ SCM s = me->get_grob_property ("staff-space");
if (gh_number_p (s))
ss *= gh_scm2double (s);
return ss;
}
bool
-Staff_symbol::has_interface (Score_element*m)
+Staff_symbol::has_interface (Grob*m)
{
return m && m->has_interface (ly_symbol2scm ("staff-symbol-interface"));
}
VIRTUAL_COPY_CONS(Translator);
Stanza_number_engraver ();
- virtual void acknowledge_element (Score_element_info);
- virtual void do_pre_move_processing ();
+ virtual void acknowledge_grob (Grob_info);
+ virtual void stop_translation_timestep ();
};
ADD_THIS_TRANSLATOR(Stanza_number_engraver);
}
void
-Stanza_number_engraver::acknowledge_element(Score_element_info i)
+Stanza_number_engraver::acknowledge_grob(Grob_info i)
{
SCM s = get_property ("stanza");
void
-Stanza_number_engraver::do_pre_move_processing ()
+Stanza_number_engraver::stop_translation_timestep ()
{
if (text_)
{
- typeset_element (text_);
+ typeset_grob (text_);
text_ = 0;
}
}
if(!text_)
{
text_ = new Item (get_property ("StanzaNumber"));
- text_->set_elt_property ("text", txt);
- announce_element (text_,0);
+ text_->set_grob_property ("text", txt);
+ announce_grob (text_,0);
}
}
Stem_engraver();
protected:
- virtual void acknowledge_element (Score_element_info);
- virtual void do_pre_move_processing ();
- virtual bool do_try_music (Music*);
+ virtual void acknowledge_grob (Grob_info);
+ virtual void stop_translation_timestep ();
+ virtual bool try_music (Music*);
private:
- Score_element *stem_p_;
- Score_element *tremolo_p_;
+ Grob *stem_p_;
+ Grob *tremolo_p_;
Rhythmic_req *rhythmic_req_l_;
Tremolo_req* tremolo_req_l_;
};
void
-Stem_engraver::acknowledge_element(Score_element_info i)
+Stem_engraver::acknowledge_grob(Grob_info i)
{
- Score_element* h = i.elem_l_;
+ Grob* h = i.elem_l_;
if (Rhythmic_head::has_interface (h))
{
if (Rhythmic_head::stem_l (h))
Staff_symbol_referencer::set_interface(stem_p_);
- stem_p_->set_elt_property ("duration-log", gh_int2scm (duration_log));
+ stem_p_->set_grob_property ("duration-log", gh_int2scm (duration_log));
if (tremolo_req_l_)
{
tremolo_p_ = new Item (get_property ("StemTremolo"));
Stem_tremolo::set_interface (tremolo_p_);
- announce_element (tremolo_p_, tremolo_req_l_);
+ announce_grob (tremolo_p_, tremolo_req_l_);
/*
The number of tremolo flags is the number of flags of
the tremolo-type minus the number of flags of the note
- (duration_log > 2 ? duration_log - 2 : 0);
if (tremolo_flags < 0)
tremolo_flags = 0;
- tremolo_p_->set_elt_property ("tremolo-flags",
+ tremolo_p_->set_grob_property ("tremolo-flags",
gh_int2scm (tremolo_flags));
}
}
- announce_element (stem_p_, i.req_l_);
+ announce_grob (stem_p_, i.req_l_);
}
if (Stem::flag_i (stem_p_) != duration_log)
}
void
-Stem_engraver::do_pre_move_processing()
+Stem_engraver::stop_translation_timestep()
{
if (tremolo_p_)
{
Stem_tremolo::set_stem (tremolo_p_, stem_p_);
- typeset_element (tremolo_p_);
+ typeset_grob (tremolo_p_);
tremolo_p_ = 0;
}
aargh: I don't get it. direction is being set (and then set
to forced), if we have a Chord_tremolo.
*/
- SCM dir = stem_p_->get_elt_property ("direction");
+ SCM dir = stem_p_->get_grob_property ("direction");
if (gh_number_p (dir) && to_dir(dir))
{
- stem_p_->set_elt_property ("dir-forced", SCM_BOOL_T);
+ stem_p_->set_grob_property ("dir-forced", SCM_BOOL_T);
}
- typeset_element(stem_p_);
+ typeset_grob(stem_p_);
stem_p_ = 0;
}
}
bool
-Stem_engraver::do_try_music (Music* r)
+Stem_engraver::try_music (Music* r)
{
if (Tremolo_req* a = dynamic_cast <Tremolo_req *> (r))
{
*/
void
-Stem_tremolo::set_interface (Score_element *me)
+Stem_tremolo::set_interface (Grob *me)
{
me->set_interface (ly_symbol2scm ("stem-tremolo"));
}
bool
-Stem_tremolo::has_interface (Score_element *me)
+Stem_tremolo::has_interface (Grob *me)
{
return me->has_interface (ly_symbol2scm ("stem-tremolo"));
}
SCM
Stem_tremolo::dim_callback (SCM e, SCM )
{
- Score_element * se = unsmob_element (e);
+ Grob * se = unsmob_element (e);
Real space = Staff_symbol_referencer::staff_space (se);
return ly_interval2scm ( Interval (-space, space));
SCM
Stem_tremolo::brew_molecule (SCM smob)
{
- Score_element *me= unsmob_element (smob);
- Score_element * stem = unsmob_element (me->get_elt_property ("stem"));
- Score_element * beam = Stem::beam_l (stem);
+ Grob *me= unsmob_element (smob);
+ Grob * stem = unsmob_element (me->get_grob_property ("stem"));
+ Grob * beam = Stem::beam_l (stem);
Real dydx;
if (beam)
{
Real dy = 0;
- SCM s = beam->get_elt_property ("height");
+ SCM s = beam->get_grob_property ("height");
if (gh_number_p (s))
dy = gh_scm2double (s);
Real dx = Beam::last_visible_stem (beam)->relative_coordinate (0, X_AXIS)
dydx = 0.25;
Real ss = Staff_symbol_referencer::staff_space (stem);
- Real thick = gh_scm2double (me->get_elt_property ("beam-thickness"));
- Real width = gh_scm2double (me->get_elt_property ("beam-width"));
+ Real thick = gh_scm2double (me->get_grob_property ("beam-thickness"));
+ Real width = gh_scm2double (me->get_grob_property ("beam-width"));
width *= ss;
thick *= ss;
a.translate (Offset (-width/2, width / 2 * dydx));
int tremolo_flags;
- SCM s = me->get_elt_property ("tremolo-flags");
+ SCM s = me->get_grob_property ("tremolo-flags");
if (gh_number_p (s))
tremolo_flags = gh_scm2int (s);
else
tremolo_flags = 1;
int mult = beam ? Beam::get_multiplicity (beam) : 0;
- SCM space_proc = me->get_elt_property ("beam-space-function");
+ SCM space_proc = me->get_grob_property ("beam-space-function");
SCM space = gh_call1 (space_proc, gh_int2scm (mult));
Real interbeam_f = gh_scm2double (space) * ss;
Real whole_note_correction;
if (Stem::invisible_b (stem ))
{
- Score_element *hed = Stem::support_head (stem );
+ Grob *hed = Stem::support_head (stem );
whole_note_correction = -Stem::get_direction (stem )
*hed->extent (hed, X_AXIS).length () / 2;
}
void
-Stem_tremolo::set_stem (Score_element*me,Score_element *s)
+Stem_tremolo::set_stem (Grob*me,Grob *s)
{
- me->set_elt_property ("stem", s->self_scm ());
+ me->set_grob_property ("stem", s->self_scm ());
}
void
-Stem::set_beaming (Score_element*me ,int i, Direction d )
+Stem::set_beaming (Grob*me ,int i, Direction d )
{
- SCM pair = me->get_elt_property ("beaming");
+ SCM pair = me->get_grob_property ("beaming");
if (!gh_pair_p (pair))
{
pair = gh_cons (gh_int2scm (0),gh_int2scm (0));
- me-> set_elt_property ("beaming", pair);
+ me-> set_grob_property ("beaming", pair);
}
index_set_cell (pair, d, gh_int2scm (i));
}
int
-Stem::beam_count (Score_element*me,Direction d)
+Stem::beam_count (Grob*me,Direction d)
{
- SCM p=me->get_elt_property ("beaming");
+ SCM p=me->get_grob_property ("beaming");
if (gh_pair_p (p))
return gh_scm2int (index_cell (p,d));
else
}
Interval
-Stem::head_positions (Score_element*me)
+Stem::head_positions (Grob*me)
{
if (!heads_i (me))
{
return iv;
}
- Drul_array<Score_element*> e (extremal_heads (me));
+ Drul_array<Grob*> e (extremal_heads (me));
return Interval (Staff_symbol_referencer::position_f (e[DOWN]),
Staff_symbol_referencer::position_f ( e[UP]));
Real
-Stem::chord_start_f (Score_element*me)
+Stem::chord_start_f (Grob*me)
{
return head_positions(me)[get_direction (me)]
* Staff_symbol_referencer::staff_space (me)/2.0;
}
Real
-Stem::stem_end_position (Score_element*me)
+Stem::stem_end_position (Grob*me)
{
- SCM p =me->get_elt_property ("stem-end-position");
+ SCM p =me->get_grob_property ("stem-end-position");
Real pos;
if (!gh_number_p (p))
{
pos = get_default_stem_end_position (me);
- me->set_elt_property ("stem-end-position", gh_double2scm (pos));
+ me->set_grob_property ("stem-end-position", gh_double2scm (pos));
}
else
pos = gh_scm2double (p);
}
Direction
-Stem::get_direction (Score_element*me)
+Stem::get_direction (Grob*me)
{
Direction d = Directional_element_interface::get (me);
void
-Stem::set_stemend (Score_element*me, Real se)
+Stem::set_stemend (Grob*me, Real se)
{
// todo: margins
Direction d= get_direction (me);
if (d && d * head_positions(me)[get_direction (me)] >= se*d)
warning (_ ("Weird stem size; check for narrow beams"));
- me->set_elt_property ("stem-end-position", gh_double2scm (se));
+ me->set_grob_property ("stem-end-position", gh_double2scm (se));
}
int
-Stem::type_i (Score_element*me)
+Stem::type_i (Grob*me)
{
return first_head (me) ? Rhythmic_head::balltype_i (first_head (me)) : 2;
}
/*
Note head that determines hshift for upstems
*/
-Score_element*
-Stem::support_head (Score_element*me)
+Grob*
+Stem::support_head (Grob*me)
{
- SCM h = me->get_elt_property ("support-head");
- Score_element * nh = unsmob_element (h);
+ SCM h = me->get_grob_property ("support-head");
+ Grob * nh = unsmob_element (h);
if (nh)
return nh;
else if (heads_i (me) == 1)
UGH.
*/
- return unsmob_element (gh_car (me->get_elt_property ("heads")));
+ return unsmob_element (gh_car (me->get_grob_property ("heads")));
}
else
return first_head (me);
int
-Stem::heads_i (Score_element*me)
+Stem::heads_i (Grob*me)
{
return Pointer_group_interface::count (me, "heads");
}
/*
The note head which forms one end of the stem.
*/
-Score_element*
-Stem::first_head (Score_element*me)
+Grob*
+Stem::first_head (Grob*me)
{
return extremal_heads (me)[-get_direction (me)];
}
/*
START is part where stem reaches `last' head.
*/
-Drul_array<Score_element*>
-Stem::extremal_heads (Score_element*me)
+Drul_array<Grob*>
+Stem::extremal_heads (Grob*me)
{
const int inf = 1000000;
Drul_array<int> extpos;
extpos[DOWN] = inf;
extpos[UP] = -inf;
- Drul_array<Score_element *> exthead;
+ Drul_array<Grob *> exthead;
exthead[LEFT] = exthead[RIGHT] =0;
- for (SCM s = me->get_elt_property ("heads"); gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = me->get_grob_property ("heads"); gh_pair_p (s); s = gh_cdr (s))
{
- Score_element * n = unsmob_element (gh_car (s));
+ Grob * n = unsmob_element (gh_car (s));
int p = int(Staff_symbol_referencer::position_f (n));
}
void
-Stem::add_head (Score_element*me, Score_element *n)
+Stem::add_head (Grob*me, Grob *n)
{
- n->set_elt_property ("stem", me->self_scm ());
+ n->set_grob_property ("stem", me->self_scm ());
n->add_dependency (me);
if (Note_head::has_interface (n))
}
else
{
- n->set_elt_property ("rest", n->self_scm ());
+ n->set_grob_property ("rest", n->self_scm ());
}
}
bool
-Stem::invisible_b (Score_element*me)
+Stem::invisible_b (Grob*me)
{
return !(heads_i (me) && Rhythmic_head::balltype_i (support_head (me)) >= 1);
}
int
-Stem::get_center_distance (Score_element*me, Direction d)
+Stem::get_center_distance (Grob*me, Direction d)
{
int staff_center = 0;
int distance = (int) (d*(head_positions(me)[d] - staff_center));
}
Direction
-Stem::get_default_dir (Score_element*me)
+Stem::get_default_dir (Grob*me)
{
int du = get_center_distance (me,UP);
int dd = get_center_distance (me,DOWN);
if (sign (dd - du))
return Direction (sign (dd -du));
- return to_dir (me->get_elt_property ("default-neutral-direction"));
+ return to_dir (me->get_grob_property ("default-neutral-direction"));
}
Real
-Stem::get_default_stem_end_position (Score_element*me)
+Stem::get_default_stem_end_position (Grob*me)
{
- bool grace_b = to_boolean (me->get_elt_property ("grace"));
+ bool grace_b = to_boolean (me->get_grob_property ("grace"));
SCM s;
Array<Real> a;
Real length_f = 0.;
- SCM scm_len = me->get_elt_property("length");
+ SCM scm_len = me->get_grob_property("length");
if (gh_number_p (scm_len))
{
length_f = gh_scm2double (scm_len);
}
else
{
- s = me->get_elt_property("lengths");
+ s = me->get_grob_property("lengths");
for (SCM q = s; q != SCM_EOL; q = gh_cdr (q))
a.push (gh_scm2double (gh_car (q)));
a.clear ();
- s = me->get_elt_property ("stem-shorten");
+ s = me->get_grob_property ("stem-shorten");
for (SCM q = s; gh_pair_p (q); q = gh_cdr (q))
a.push (gh_scm2double (gh_car (q)));
Real st = head_positions(me)[dir] + dir * length_f;
- bool no_extend_b = to_boolean (me->get_elt_property ("no-stem-extend"));
+ bool no_extend_b = to_boolean (me->get_grob_property ("no-stem-extend"));
if (!grace_b && !no_extend_b && dir * st < 0) // junkme?
st = 0.0;
Number of hooks on the flag, ie. the log of the duration.
*/
int
-Stem::flag_i (Score_element*me)
+Stem::flag_i (Grob*me)
{
- SCM s = me->get_elt_property ("duration-log");
+ SCM s = me->get_grob_property ("duration-log");
return (gh_number_p (s)) ? gh_scm2int (s) : 2;
}
void
-Stem::position_noteheads (Score_element*me)
+Stem::position_noteheads (Grob*me)
{
if (!heads_i (me))
return;
- Link_array<Score_element> heads =
- Pointer_group_interface__extract_elements (me, (Score_element*)0, "heads");
+ Link_array<Grob> heads =
+ Pointer_group_interface__extract_elements (me, (Grob*)0, "heads");
heads.sort (compare_position);
Direction dir =get_direction (me);
heads.reverse ();
- Score_element *hed = support_head (me);
+ Grob *hed = support_head (me);
Real w = hed->extent (hed, X_AXIS)[dir];
for (int i=0; i < heads.size (); i++)
{
SCM
Stem::before_line_breaking (SCM smob)
{
- Score_element*me = unsmob_element (smob);
+ Grob*me = unsmob_element (smob);
stem_end_position (me); // ugh. Trigger direction calc.
position_noteheads (me);
if (invisible_b (me))
{
- me->remove_elt_property ("molecule-callback");
+ me->remove_grob_property ("molecule-callback");
// suicide();
}
TODO: more advanced: supply height of noteheads as well, for more advanced spacing possibilities
*/
void
-Stem::set_spacing_hints (Score_element*me)
+Stem::set_spacing_hints (Grob*me)
{
if (!invisible_b (me))
{
Item* item = dynamic_cast<Item*> (me);
Item * col = item->column_l ();
- SCM dirlist =col->get_elt_property ("dir-list");
+ SCM dirlist =col->get_grob_property ("dir-list");
if (scm_sloppy_memq (scmdir, dirlist) == SCM_BOOL_F)
{
dirlist = gh_cons (scmdir, dirlist);
- col->set_elt_property ("dir-list", dirlist);
+ col->set_grob_property ("dir-list", dirlist);
}
}
}
Molecule
-Stem::flag (Score_element*me)
+Stem::flag (Grob*me)
{
String style;
- SCM st = me->get_elt_property ("flag-style");
+ SCM st = me->get_grob_property ("flag-style");
if ( gh_string_p (st))
{
style = ly_scm2string (st);
{
Axis a = (Axis) gh_scm2int (ax);
assert (a == X_AXIS);
- Score_element *se = unsmob_element (e);
+ Grob *se = unsmob_element (e);
Interval r (0, 0);
- if (unsmob_element (se->get_elt_property ("beam")) || abs (flag_i (se)) <= 2)
+ if (unsmob_element (se->get_grob_property ("beam")) || abs (flag_i (se)) <= 2)
; // TODO!
else
{
SCM
Stem::brew_molecule (SCM smob)
{
- Score_element*me = unsmob_element (smob);
+ Grob*me = unsmob_element (smob);
Molecule mol;
Direction d = get_direction (me);
Real dy = Staff_symbol_referencer::staff_space (me)/2.0;
Real head_wid = 0;
- if (Score_element *hed = support_head (me))
+ if (Grob *hed = support_head (me))
head_wid = hed->extent (hed,X_AXIS).length ();
stem_y[Direction(-d)] += d * head_wid * tan(ANGLE)/(2*dy);
if (!invisible_b (me))
{
- Real stem_width = gh_scm2double (me->get_elt_property ("thickness")) * me->paper_l ()->get_var ("stafflinethickness");
+ Real stem_width = gh_scm2double (me->get_grob_property ("thickness")) * me->paper_l ()->get_var ("stafflinethickness");
Molecule ss =Lookup::filledbox (Box (Interval (-stem_width/2, stem_width/2),
Interval (stem_y[DOWN]*dy, stem_y[UP]*dy)));
mol.add_molecule (ss);
SCM
Stem::off_callback (SCM element_smob, SCM )
{
- Score_element *me = unsmob_element (element_smob);
+ Grob *me = unsmob_element (element_smob);
Real r=0;
- if (Score_element * f = first_head (me))
+ if (Grob * f = first_head (me))
{
Interval head_wid(0, f->extent (f,X_AXIS).length ());
- if (to_boolean (me->get_elt_property ("stem-centered")))
+ if (to_boolean (me->get_grob_property ("stem-centered")))
return gh_double2scm ( head_wid.center ());
- Real rule_thick = gh_scm2double (me->get_elt_property ("thickness")) * me->paper_l ()->get_var ("stafflinethickness");
+ Real rule_thick = gh_scm2double (me->get_grob_property ("thickness")) * me->paper_l ()->get_var ("stafflinethickness");
Direction d = get_direction (me);
r = head_wid[d] - d * rule_thick ;
}
-Score_element*
-Stem::beam_l (Score_element*me)
+Grob*
+Stem::beam_l (Grob*me)
{
- SCM b= me->get_elt_property ("beam");
+ SCM b= me->get_grob_property ("beam");
return unsmob_element (b);
}
// ugh still very long.
Stem_info
-Stem::calc_stem_info (Score_element*me)
+Stem::calc_stem_info (Grob*me)
{
- Score_element * beam = beam_l (me);
+ Grob * beam = beam_l (me);
Direction beam_dir = Directional_element_interface::get (beam);
if (!beam_dir)
int multiplicity = Beam::get_multiplicity (beam);
- SCM space_proc = beam->get_elt_property ("space-function");
+ SCM space_proc = beam->get_grob_property ("space-function");
SCM space = gh_call1 (space_proc, gh_int2scm (multiplicity));
Real interbeam_f = gh_scm2double (space) * staff_space;
- Real thick = gh_scm2double (beam->get_elt_property ("thickness"));
+ Real thick = gh_scm2double (beam->get_grob_property ("thickness"));
Stem_info info;
info.idealy_f_ = chord_start_f (me);
// for simplicity, we calculate as if dir == UP
info.idealy_f_ *= beam_dir;
- SCM grace_prop = me->get_elt_property ("grace");
+ SCM grace_prop = me->get_grob_property ("grace");
bool grace_b = to_boolean (grace_prop);
Array<Real> a;
SCM s;
- s = me->get_elt_property("beamed-minimum-lengths");
+ s = me->get_grob_property("beamed-minimum-lengths");
a.clear ();
for (SCM q = s; q != SCM_EOL; q = gh_cdr (q))
a.push (gh_scm2double (gh_car (q)));
Real minimum_length = a[multiplicity <? (a.size () - 1)] * staff_space;
- s = me->get_elt_property ("beamed-lengths");
+ s = me->get_grob_property ("beamed-lengths");
a.clear();
for (SCM q = s; q != SCM_EOL; q = gh_cdr (q))
than middle staffline, just as normal stems.
*/
- bool no_extend_b = to_boolean (me->get_elt_property ("no-stem-extend"));
+ bool no_extend_b = to_boolean (me->get_grob_property ("no-stem-extend"));
if (!grace_b && !no_extend_b)
{
/* highest beam of (UP) beam must never be lower than middle
info.idealy_f_ = (info.maxy_f_ <? info.idealy_f_) >? info.miny_f_;
- s = beam->get_elt_property ("shorten");
+ s = beam->get_grob_property ("shorten");
if (gh_number_p (s))
info.idealy_f_ -= gh_scm2double (s);
}
bool
-Stem::has_interface (Score_element*m)
+Stem::has_interface (Grob*m)
{
return m && m->has_interface (ly_symbol2scm ("stem-interface"));
}
void
-Stem::set_interface (Score_element*me)
+Stem::set_interface (Grob*me)
{
me->set_interface (ly_symbol2scm ("stem-interface"));
}
(c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "score-element.hh"
+#include "grob.hh"
#include "molecule.hh"
#include "font-interface.hh"
#include "string.hh"
SCM
Sustain_pedal::brew_molecule (SCM smob)
{
- Score_element * e = unsmob_element (smob);
+ Grob * e = unsmob_element (smob);
Molecule mol;
- SCM glyph = e->get_elt_property ("text");
+ SCM glyph = e->get_grob_property ("text");
if (!gh_string_p (glyph))
return mol.smobbed_copy ();
String text = ly_scm2string (glyph);
bool
-Swallow_engraver::do_try_music (Music*)
+Swallow_engraver::try_music (Music*)
{
return true;
}
}
void
-Syllable_group::set_notehead(Score_element * notehead)
+Syllable_group::set_notehead(Grob * notehead)
{
if(!notehead_l_) {
/* there should only be a single notehead, so silently ignore any extras */
}
void
-Syllable_group::add_lyric(Score_element * lyric)
+Syllable_group::add_lyric(Grob * lyric)
{
lyric_list_.push(lyric);
/* record longest and shortest lyrics */
}
void
-Syllable_group::add_extender(Score_element * extender)
+Syllable_group::add_extender(Grob * extender)
{
if(notehead_l_ && melisma_b_) {
dynamic_cast<Spanner*>(extender)->set_bound (RIGHT, notehead_l_);
// Comments in lyric-extender.hh say left, but right looks better to me. GP.
// Left:
-// extender->set_elt_property("right-trim-amount", gh_double2scm(0.0));
+// extender->set_grob_property("right-trim-amount", gh_double2scm(0.0));
// Right:
Real ss = 1.0;
- extender->set_elt_property("right-trim-amount",
+ extender->set_grob_property("right-trim-amount",
gh_double2scm(-notehead_l_->extent(notehead_l_, X_AXIS).length()/ss));
}
}
bool
-Syllable_group::set_lyric_align(const char *punc, Score_element *default_notehead_l)
+Syllable_group::set_lyric_align(const char *punc, Grob *default_notehead_l)
{
if(lyric_list_.size()==0) {
// No lyrics: nothing to do.
return true;
}
- Score_element * lyric;
+ Grob * lyric;
alignment_i_ = appropriate_alignment(punc);
// If there was no notehead in the matching voice context, use the first
// set the x alignment of each lyric
for(int l = 0; l < lyric_list_.size(); l++) {
lyric = lyric_list_[l];
- lyric->set_elt_property("self-alignment-X", gh_int2scm(alignment_i_));
+ lyric->set_grob_property("self-alignment-X", gh_int2scm(alignment_i_));
// centre on notehead ... if we have one.
if(notehead_l_) {
lyric->set_parent(notehead_l_, X_AXIS);
if(first_in_phrase_b_)
return LEFT;
- Score_element * lyric;
+ Grob * lyric;
bool end_phrase = true;
for(int l = 0; l < lyric_list_.size() && end_phrase; l++) {
lyric = lyric_list_[l];
- SCM lyric_scm = lyric->get_elt_property("text");
+ SCM lyric_scm = lyric->get_grob_property("text");
String lyric_str = gh_string_p(lyric_scm)?ly_scm2string(lyric_scm):"";
char lastchar;
if(lyric_str.length_i()>0) {
protected:
Spanner * delim_;
- virtual void acknowledge_element (Score_element_info);
+ virtual void acknowledge_grob (Grob_info);
virtual void do_creation_processing ();
virtual void do_removal_processing ();
};
ADD_THIS_TRANSLATOR(System_start_delimiter_engraver);
void
-System_start_delimiter_engraver::acknowledge_element (Score_element_info inf)
+System_start_delimiter_engraver::acknowledge_grob (Grob_info inf)
{
if (Staff_symbol::has_interface (inf.elem_l_))
{
}
else if (System_start_delimiter::has_interface (inf.elem_l_))
{
- SCM gl = inf.elem_l_->get_elt_property ("glyph");
- SCM my_gl = delim_->get_elt_property ("glyph");
+ SCM gl = inf.elem_l_->get_grob_property ("glyph");
+ SCM my_gl = delim_->get_grob_property ("glyph");
/*
UGH UGH
delim_->set_bound (LEFT, unsmob_element (get_property ("currentCommandColumn")));
- announce_element (delim_,0);
+ announce_grob (delim_,0);
}
void
System_start_delimiter_engraver::do_removal_processing ()
{
delim_->set_bound (RIGHT, unsmob_element (get_property ("currentCommandColumn")));
- typeset_element (delim_);
+ typeset_grob (delim_);
}
#include "molecule.hh"
#include "font-interface.hh"
#include "all-font-metrics.hh"
-#include "score-element.hh"
+#include "grob.hh"
#include "lookup.hh"
Molecule
-System_start_delimiter::staff_bracket (Score_element*me,Real height)
+System_start_delimiter::staff_bracket (Grob*me,Real height)
{
- Real arc_height = gh_scm2double (me->get_elt_property("arch-height")) ;
+ Real arc_height = gh_scm2double (me->get_grob_property("arch-height")) ;
SCM at = gh_list (ly_symbol2scm ("bracket"),
- me->get_elt_property ("arch-angle"),
- me->get_elt_property ("arch-width"),
+ me->get_grob_property ("arch-angle"),
+ me->get_grob_property ("arch-width"),
gh_double2scm (arc_height),
- me->get_elt_property ("bracket-width"),
+ me->get_grob_property ("bracket-width"),
gh_double2scm (height),
- me->get_elt_property ("arch-thick"),
- me->get_elt_property ("bracket-thick"),
+ me->get_grob_property ("arch-thick"),
+ me->get_grob_property ("bracket-thick"),
SCM_UNDEFINED);
Real h = height + 2 * arc_height;
}
void
-System_start_delimiter::set_interface (Score_element*me)
+System_start_delimiter::set_interface (Grob*me)
{
me->set_interface (ly_symbol2scm ("system-start-delimiter-interface"));
}
bool
-System_start_delimiter::has_interface (Score_element*me)
+System_start_delimiter::has_interface (Grob*me)
{
return me->has_interface (ly_symbol2scm ("system-start-delimiter-interface"));
}
Molecule
-System_start_delimiter::simple_bar (Score_element*me,Real h)
+System_start_delimiter::simple_bar (Grob*me,Real h)
{
Real w = me->paper_l ()->get_var ("stafflinethickness") *
- gh_scm2double (me->get_elt_property ("thickness"));
+ gh_scm2double (me->get_grob_property ("thickness"));
return Lookup::filledbox (Box (Interval(0,w), Interval(-h/2, h/2)));
}
}
void
-System_start_delimiter::try_collapse (Score_element*me)
+System_start_delimiter::try_collapse (Grob*me)
{
- SCM gl = me->get_elt_property ("glyph");
+ SCM gl = me->get_grob_property ("glyph");
- if (scm_ilength (me->get_elt_property ("elements")) <= 1 && gl == ly_symbol2scm ("bar-line"))
+ if (scm_ilength (me->get_grob_property ("elements")) <= 1 && gl == ly_symbol2scm ("bar-line"))
{
me->suicide ();
}
SCM
System_start_delimiter::brew_molecule (SCM smob)
{
- Score_element * me = unsmob_element (smob);
+ Grob * me = unsmob_element (smob);
Interval ext = ly_scm2interval (Axis_group_interface::group_extent_callback (me->self_scm(), gh_int2scm (Y_AXIS)));
Real l = ext.length ();
Molecule m;
- SCM s = me->get_elt_property ("collapse-height");
+ SCM s = me->get_grob_property ("collapse-height");
if (gh_number_p (s) && l < gh_scm2double (s))
{
me->suicide();
return SCM_EOL;
}
- s = me->get_elt_property ("glyph");
+ s = me->get_grob_property ("glyph");
if (!gh_symbol_p(s))
return SCM_EOL;
}
Molecule
-System_start_delimiter::staff_brace (Score_element*me,Real y)
+System_start_delimiter::staff_brace (Grob*me,Real y)
{
int lo = 0;
int hi = 255;
protected:
- virtual bool do_try_music (Music* req_l);
- virtual void do_pre_move_processing ();
- virtual void process_acknowledged ();
+ virtual bool try_music (Music* req_l);
+ virtual void stop_translation_timestep ();
+ virtual void create_grobs ();
private:
Tempo_req* tempo_req_l_;
void
-Tempo_performer::process_acknowledged ()
+Tempo_performer::create_grobs ()
{
if (tempo_req_l_)
{
}
void
-Tempo_performer::do_pre_move_processing ()
+Tempo_performer::stop_translation_timestep ()
{
if (audio_p_)
{
}
bool
-Tempo_performer::do_try_music (Music* req_l)
+Tempo_performer::try_music (Music* req_l)
{
if (tempo_req_l_)
return false;
public:
VIRTUAL_COPY_CONS(Translator);
protected:
- virtual bool do_try_music (Music* m);
- virtual void do_pre_move_processing ();
- virtual void do_post_move_processing ();
- virtual void process_acknowledged ();
+ virtual bool try_music (Music* m);
+ virtual void stop_translation_timestep ();
+ virtual void start_translation_timestep ();
+ virtual void create_grobs ();
void deprecated_process_music ();
- virtual void acknowledge_element (Score_element_info);
+ virtual void acknowledge_grob (Grob_info);
};
bool
-Text_engraver::do_try_music (Music *m)
+Text_engraver::try_music (Music *m)
{
if (dynamic_cast<Text_script_req*> (m)
&& m->get_mus_property ("text-type") != ly_symbol2scm ("dynamic"))
}
void
-Text_engraver::acknowledge_element (Score_element_info inf)
+Text_engraver::acknowledge_grob (Grob_info inf)
{
if (Rhythmic_head::has_interface (inf.elem_l_))
{
for (int i=0; i < texts_.size (); i++)
{
- Score_element*t = texts_[i];
+ Grob*t = texts_[i];
Side_position::add_support (t,inf.elem_l_);
/*
}
void
-Text_engraver::process_acknowledged ()
+Text_engraver::create_grobs ()
{
deprecated_process_music ();
}
/*
make sure they're in order by adding i to the priority field.
*/
- text->set_elt_property ("script-priority",
+ text->set_grob_property ("script-priority",
gh_int2scm (200 + i));
if (r->get_direction ())
Side_position::set_direction (text, r->get_direction ());
- text->set_elt_property ("text", r->get_mus_property ("text"));
+ text->set_grob_property ("text", r->get_mus_property ("text"));
SCM nonempty = get_property ("textNonEmpty");
if (to_boolean (nonempty))
/*
empty text: signal that no rods should be applied.
*/
- text->set_elt_property ("no-spacing-rods" , SCM_BOOL_F);
+ text->set_grob_property ("no-spacing-rods" , SCM_BOOL_F);
- announce_element (text, r);
+ announce_grob (text, r);
texts_.push (text);
}
}
void
-Text_engraver::do_pre_move_processing ()
+Text_engraver::stop_translation_timestep ()
{
for (int i=0; i < texts_.size (); i++)
{
Item *ti = texts_[i];
Side_position::add_staff_support (ti);
- typeset_element (ti);
+ typeset_grob (ti);
}
texts_.clear ();
}
void
-Text_engraver::do_post_move_processing ()
+Text_engraver::start_translation_timestep ()
{
reqs_.clear ();
}
*/
Molecule
-Text_item::text2molecule (Score_element *me, SCM text, SCM alist_chain)
+Text_item::text2molecule (Grob *me, SCM text, SCM alist_chain)
{
if (gh_string_p (text))
return string2molecule (me, text, alist_chain);
}
Molecule
-Text_item::string2molecule (Score_element *me, SCM text, SCM alist_chain)
+Text_item::string2molecule (Grob *me, SCM text, SCM alist_chain)
{
SCM style = ly_assoc_chain (ly_symbol2scm ("font-style"),
alist_chain);
}
Molecule
-Text_item::lookup_character (Score_element *, Font_metric*fm, SCM char_name)
+Text_item::lookup_character (Grob *, Font_metric*fm, SCM char_name)
{
return fm->find_by_name (ly_scm2string (char_name));
}
Molecule
-Text_item::lookup_text (Score_element *me, Font_metric*fm, SCM text)
+Text_item::lookup_text (Grob *me, Font_metric*fm, SCM text)
{
#if 0
/*
Fixme; should be done differently, move to font-interface?
*/
- SCM magnification = me->get_elt_property ("font-magnification");
+ SCM magnification = me->get_grob_property ("font-magnification");
Font_metric* metric = 0;
if (gh_number_p (magnification))
}
Molecule
-Text_item::markup_sentence2molecule (Score_element *me, SCM markup_sentence,
+Text_item::markup_sentence2molecule (Grob *me, SCM markup_sentence,
SCM alist_chain)
{
/*
SCM
Text_item::brew_molecule (SCM smob)
{
- Score_element *me = unsmob_element (smob);
+ Grob *me = unsmob_element (smob);
- SCM text = me->get_elt_property ("text");
+ SCM text = me->get_grob_property ("text");
SCM properties = Font_interface::font_alist_chain (me);
Molecule mol = Text_item::text2molecule (me, text, properties);
- SCM space = me->get_elt_property ("word-space");
+ SCM space = me->get_grob_property ("word-space");
if (gh_number_p (space))
{
Molecule m;
protected:
virtual void do_removal_processing ();
- virtual void acknowledge_element (Score_element_info);
- virtual bool do_try_music (Music *);
+ virtual void acknowledge_grob (Grob_info);
+ virtual bool try_music (Music *);
void deprecated_process_music ();
- virtual void do_pre_move_processing ();
- virtual void do_post_move_processing ();
- virtual void process_acknowledged ();
+ virtual void stop_translation_timestep ();
+ virtual void start_translation_timestep ();
+ virtual void create_grobs ();
private:
Spanner *span_;
}
void
-Text_spanner_engraver::do_post_move_processing ()
+Text_spanner_engraver::start_translation_timestep ()
{
req_drul_[START] = 0;
req_drul_[STOP] = 0;
}
bool
-Text_spanner_engraver::do_try_music (Music *m)
+Text_spanner_engraver::try_music (Music *m)
{
if (Span_req *s = dynamic_cast <Span_req*> (m))
{
}
void
-Text_spanner_engraver::process_acknowledged ()
+Text_spanner_engraver::create_grobs ()
{
deprecated_process_music ();
}
else
{
assert (!finished_);
- Score_element* e = unsmob_element (get_property ("currentMusicalColumn"));
+ Grob* e = unsmob_element (get_property ("currentMusicalColumn"));
span_->set_bound (RIGHT, e);
finished_ = span_;
current_req_ = req_drul_[START];
span_ = new Spanner (get_property ("TextSpanner"));
Side_position::set_axis (span_, Y_AXIS);
- Score_element *e = unsmob_element (get_property ("currentMusicalColumn"));
+ Grob *e = unsmob_element (get_property ("currentMusicalColumn"));
span_->set_bound (LEFT, e);
- announce_element (span_, req_drul_[START]);
+ announce_grob (span_, req_drul_[START]);
}
}
}
void
-Text_spanner_engraver::acknowledge_element (Score_element_info info)
+Text_spanner_engraver::acknowledge_grob (Grob_info info)
{
if (span_ && Note_column::has_interface (info.elem_l_))
{
if (finished_)
{
Side_position::add_staff_support (finished_);
- typeset_element (finished_);
+ typeset_grob (finished_);
finished_ = 0;
}
}
void
-Text_spanner_engraver::do_pre_move_processing ()
+Text_spanner_engraver::stop_translation_timestep ()
{
typeset_all ();
}
SCM
Text_spanner::brew_molecule (SCM smob)
{
- Score_element *me= unsmob_element (smob);
+ Grob *me= unsmob_element (smob);
Spanner *spanner = dynamic_cast<Spanner*> (me);
Real staff_space = Staff_symbol_referencer::staff_space (me);
while (flip (&d) != LEFT);
#if 0
- SCM s = me->get_elt_property ("text-style");
+ SCM s = me->get_grob_property ("text-style");
String text_style = "italic";
if (gh_string_p (s))
SCM properties = Font_interface::font_alist_chain (me);
- SCM edge_text = me->get_elt_property ("edge-text");
+ SCM edge_text = me->get_grob_property ("edge-text");
Drul_array<Molecule> edge;
if (gh_pair_p (edge_text))
{
shorten[LEFT] = 0;
shorten[RIGHT] = 0;
- SCM s = me->get_elt_property ("shorten");
+ SCM s = me->get_grob_property ("shorten");
if (gh_pair_p (s))
{
shorten[LEFT] = gh_scm2double (gh_car (s)) * staff_space;
Real broken_left = spanner->get_broken_left_end_align ();
Real width = spanner->spanner_length ();
- Score_element *bnd = spanner->get_bound (RIGHT);
+ Grob *bnd = spanner->get_bound (RIGHT);
width += bnd->extent (bnd, X_AXIS).length ();
width -= broken_left;
width -= shorten[LEFT] + shorten[RIGHT];
String type = "dashed-line";
- s = me->get_elt_property ("type");
+ s = me->get_grob_property ("type");
if (gh_string_p (s))
type = ly_scm2string (s);
|| type == "dotted-line")
{
Real thick = thickness;
- s = me->get_elt_property ("line-thickness");
+ s = me->get_grob_property ("line-thickness");
if (gh_number_p (s))
thick *= gh_scm2double (s);
// maybe these should be in line-thickness?
Real length = staff_space;
- s = me->get_elt_property ("dash-length");
+ s = me->get_grob_property ("dash-length");
if (gh_number_p (s))
length = gh_scm2double (s) * staff_space;
Real period = 2 * length + thick;
- s = me->get_elt_property ("dash-period");
+ s = me->get_grob_property ("dash-period");
if (gh_number_p (s))
period = gh_scm2double (s) * staff_space;
Box b (Interval (0, width), Interval (-thick / 2, thick / 2));
line = Molecule (b, list);
- s = me->get_elt_property ("edge-height");
+ s = me->get_grob_property ("edge-height");
if (gh_pair_p (s))
{
Direction d = LEFT;
- int dir = to_dir (me->get_elt_property ("direction"));
+ int dir = to_dir (me->get_grob_property ("direction"));
do
{
Real dy = gh_scm2double (index_cell (s, d)) * - dir;
VIRTUAL_COPY_CONS (Translator);
protected:
- virtual void acknowledge_element (Score_element_info);
+ virtual void acknowledge_grob (Grob_info);
};
ADD_THIS_TRANSLATOR (Thread_devnull_engraver);
void
-Thread_devnull_engraver::acknowledge_element (Score_element_info i)
+Thread_devnull_engraver::acknowledge_grob (Grob_info i)
{
if (daddy_trans_l_->id_str_ == "two"
&& (to_boolean (get_property ("unison"))
void
-Tie_column::set_interface (Score_element*me)
+Tie_column::set_interface (Grob*me)
{
me->set_interface (ly_symbol2scm ("tie-column-interface"));
me->set_extent_callback (SCM_EOL, X_AXIS);
}
bool
-Tie_column::has_interface (Score_element*me)
+Tie_column::has_interface (Grob*me)
{
return me->has_interface (ly_symbol2scm ("tie-column-interface"));
}
*/
void
-Tie_column::add_tie (Score_element*me,Score_element *s)
+Tie_column::add_tie (Grob*me,Grob *s)
{
if (! Pointer_group_interface ::count (me, "ties"))
{
int
-tie_compare (Score_element* const & s1,
- Score_element* const & s2)
+tie_compare (Grob* const & s1,
+ Grob* const & s2)
{
return sign (Tie::position_f (s1) - Tie::position_f(s2));
}
Ross forgets about the tie that is *on* the middle staff line. We
assume it goes UP. (TODO: make me settable) */
void
-Tie_column::set_directions (Score_element*me)
+Tie_column::set_directions (Grob*me)
{
- Link_array<Score_element> ties =
- Pointer_group_interface__extract_elements (me, (Score_element*)0, "ties");
+ Link_array<Grob> ties =
+ Pointer_group_interface__extract_elements (me, (Grob*)0, "ties");
for (int i = ties.size (); i--; )
if (Directional_element_interface::get (ties[i]))
{
for (int i = ties.size (); i--;)
{
- Score_element * t = ties[i];
+ Grob * t = ties[i];
Directional_element_interface::set (t, d);
}
return;
if (ties.size () == 1)
{
- Score_element * t = ties[0];
+ Grob * t = ties[0];
Directional_element_interface::set (t,Tie::get_default_dir (t));
return;
}
Directional_element_interface ::set(ties.pop (), UP);
for (int i=ties.size(); i--; )
{
- Score_element * t = ties[i];
+ Grob * t = ties[i];
Real p = Tie::position_f (t);
Direction d = (Direction) sign (p);
if (!d)
struct CHead_melodic_tuple {
Melodic_req *req_l_ ;
- Score_element *head_l_;
+ Grob *head_l_;
Moment end_;
CHead_melodic_tuple ();
- CHead_melodic_tuple (Score_element*, Melodic_req*, Moment);
+ CHead_melodic_tuple (Grob*, Melodic_req*, Moment);
static int pitch_compare (CHead_melodic_tuple const &, CHead_melodic_tuple const &);
static int time_compare (CHead_melodic_tuple const &, CHead_melodic_tuple const &);
};
Tie_req *req_l_;
Array<CHead_melodic_tuple> now_heads_;
Array<CHead_melodic_tuple> stopped_heads_;
- Link_array<Score_element> tie_p_arr_;
+ Link_array<Grob> tie_p_arr_;
Spanner * tie_column_p_;
void set_melisma (bool);
protected:
- virtual void do_post_move_processing ();
- virtual void do_pre_move_processing ();
- virtual void acknowledge_element (Score_element_info);
- virtual bool do_try_music (Music*);
- virtual void process_acknowledged ();
- void typeset_tie (Score_element*);
+ virtual void start_translation_timestep ();
+ virtual void stop_translation_timestep ();
+ virtual void acknowledge_grob (Grob_info);
+ virtual bool try_music (Music*);
+ virtual void create_grobs ();
+ void typeset_tie (Grob*);
public:
VIRTUAL_COPY_CONS(Translator);
Tie_engraver();
bool
-Tie_engraver::do_try_music (Music *m)
+Tie_engraver::try_music (Music *m)
{
if (Tie_req * c = dynamic_cast<Tie_req*> (m))
{
}
void
-Tie_engraver::acknowledge_element (Score_element_info i)
+Tie_engraver::acknowledge_grob (Grob_info i)
{
if (Rhythmic_head::has_interface (i.elem_l_))
{
}
void
-Tie_engraver::process_acknowledged ()
+Tie_engraver::create_grobs ()
{
if (req_l_ && !done_)
{
Tie::set_head (p,RIGHT, dynamic_cast<Item*> (unsmob_element (gh_cdr (pair))));
tie_p_arr_.push (p);
- announce_element (p, req_l_);
+ announce_grob (p, req_l_);
}
else for (SCM s = head_list; gh_pair_p (s); s = gh_cdr (s))
{
- Score_element * p = new Spanner (basic);
+ Grob * p = new Spanner (basic);
Tie::set_interface (p);
Tie::set_head (p, LEFT, dynamic_cast<Item*> (unsmob_element (gh_caar (s))));
Tie::set_head (p, RIGHT, dynamic_cast<Item*> (unsmob_element (gh_cdar (s))));
tie_p_arr_.push (p);
- announce_element (p, req_l_);
+ announce_grob (p, req_l_);
}
if (!tie_p_arr_.size ())
Tie_column::set_interface (tie_column_p_);
for (int i = tie_p_arr_.size (); i--; )
Tie_column::add_tie (tie_column_p_,tie_p_arr_ [i]);
- announce_element (tie_column_p_, 0);
+ announce_grob (tie_column_p_, 0);
}
}
}
void
-Tie_engraver::do_pre_move_processing ()
+Tie_engraver::stop_translation_timestep ()
{
for (int i=0; i < now_heads_.size (); i++)
{
tie_p_arr_.clear ();
if (tie_column_p_)
{
- typeset_element (tie_column_p_);
+ typeset_grob (tie_column_p_);
tie_column_p_ =0;
}
}
void
-Tie_engraver::typeset_tie (Score_element *her)
+Tie_engraver::typeset_tie (Grob *her)
{
if (!(Tie::head (her,LEFT) && Tie::head (her,RIGHT)))
warning (_ ("lonely tie"));
Direction d = LEFT;
- Drul_array<Score_element *> new_head_drul;
+ Drul_array<Grob *> new_head_drul;
new_head_drul[LEFT] = Tie::head(her,LEFT);
new_head_drul[RIGHT] = Tie::head (her,RIGHT);
do {
new_head_drul[d] = Tie::head(her,(Direction)-d);
} while (flip(&d) != LEFT);
- index_set_cell (her->get_elt_property ("heads"), LEFT, new_head_drul[LEFT]->self_scm () );
- index_set_cell (her->get_elt_property ("heads"), RIGHT, new_head_drul[RIGHT]->self_scm () );
+ index_set_cell (her->get_grob_property ("heads"), LEFT, new_head_drul[LEFT]->self_scm () );
+ index_set_cell (her->get_grob_property ("heads"), RIGHT, new_head_drul[RIGHT]->self_scm () );
- typeset_element (her);
+ typeset_grob (her);
}
void
-Tie_engraver::do_post_move_processing ()
+Tie_engraver::start_translation_timestep ()
{
SCM m = get_property ("automaticMelismata");
if (to_boolean (m))
end_ = 0;
}
-CHead_melodic_tuple::CHead_melodic_tuple (Score_element *h, Melodic_req*m, Moment mom)
+CHead_melodic_tuple::CHead_melodic_tuple (Grob *h, Melodic_req*m, Moment mom)
{
head_l_ = h;
req_l_ = m;
Link_array<Audio_tie> tie_p_arr_;
protected:
- virtual void do_post_move_processing ();
- virtual void do_pre_move_processing ();
- virtual void acknowledge_element (Audio_element_info);
- virtual bool do_try_music (Music*);
- virtual void process_acknowledged ();
+ virtual void start_translation_timestep ();
+ virtual void stop_translation_timestep ();
+ virtual void acknowledge_grob (Audio_element_info);
+ virtual bool try_music (Music*);
+ virtual void create_grobs ();
};
ADD_THIS_TRANSLATOR (Tie_performer);
bool
-Tie_performer::do_try_music (Music *m)
+Tie_performer::try_music (Music *m)
{
if (!req_l_)
{
}
void
-Tie_performer::acknowledge_element (Audio_element_info i)
+Tie_performer::acknowledge_grob (Audio_element_info i)
{
if (Audio_note *nh = dynamic_cast<Audio_note *> (i.elem_l_))
{
}
void
-Tie_performer::process_acknowledged ()
+Tie_performer::create_grobs ()
{
if (req_l_ && ! done_)
{
}
void
-Tie_performer::do_pre_move_processing ()
+Tie_performer::stop_translation_timestep ()
{
for (int i=0; i < now_notes_.size (); i++)
{
}
void
-Tie_performer::do_post_move_processing ()
+Tie_performer::start_translation_timestep ()
{
req_l_ =0;
done_ = false;
void
-Tie::set_head (Score_element*me,Direction d, Item * head_l)
+Tie::set_head (Grob*me,Direction d, Item * head_l)
{
assert (!head (me,d));
- index_set_cell (me->get_elt_property ("heads"), d, head_l->self_scm ());
+ index_set_cell (me->get_grob_property ("heads"), d, head_l->self_scm ());
dynamic_cast<Spanner*> (me)->set_bound (d, head_l);
me->add_dependency (head_l);
}
void
-Tie::set_interface (Score_element*me)
+Tie::set_interface (Grob*me)
{
- me->set_elt_property ("heads", gh_cons (SCM_EOL, SCM_EOL));
+ me->set_grob_property ("heads", gh_cons (SCM_EOL, SCM_EOL));
me->set_interface (ly_symbol2scm ("tie-interface"));
}
bool
-Tie::has_interface (Score_element*me)
+Tie::has_interface (Grob*me)
{
return me->has_interface (ly_symbol2scm ("tie-interface"));
}
-Score_element*
-Tie::head (Score_element*me, Direction d)
+Grob*
+Tie::head (Grob*me, Direction d)
{
- SCM c = me->get_elt_property ("heads");
+ SCM c = me->get_grob_property ("heads");
c = index_cell (c, d);
return unsmob_element (c);
}
Real
-Tie::position_f (Score_element*me)
+Tie::position_f (Grob*me)
{
Direction d = head (me,LEFT) ? LEFT:RIGHT;
return Staff_symbol_referencer::position_f (head (me,d));
further).
*/
Direction
-Tie::get_default_dir (Score_element*me)
+Tie::get_default_dir (Grob*me)
{
Item * sl = head(me,LEFT) ? Rhythmic_head::stem_l (head (me,LEFT)) :0;
Item * sr = head(me,RIGHT) ? Rhythmic_head::stem_l (head (me,RIGHT)) :0;
Real staff_space = Staff_symbol_referencer::staff_space (me);
- Real x_gap_f = gh_scm2double (me->get_elt_property ("x-gap"));
+ Real x_gap_f = gh_scm2double (me->get_grob_property ("x-gap"));
- Score_element* l = me->get_bound (LEFT);
- Score_element* r = me->get_bound (RIGHT);
+ Grob* l = me->get_bound (LEFT);
+ Grob* r = me->get_bound (RIGHT);
- Score_element* commonx = me->common_refpoint (l, X_AXIS);
+ Grob* commonx = me->common_refpoint (l, X_AXIS);
commonx = me->common_refpoint (r, X_AXIS);
Real left_x;
Direction dir = Directional_element_interface::get(me);
- SCM details = me->get_elt_property ("details");
+ SCM details = me->get_grob_property ("details");
SCM lim // groetjes aan de chirurgendochter.
= scm_assq (ly_symbol2scm ("height-limit"),details);
Offset leave_dir = b.control_[1] - b.control_[0];
- Score_element *hed =head (me, headdir);
+ Grob *hed =head (me, headdir);
Real dx = (hed->extent (hed, X_AXIS).length () + x_gap_f)/2.0;
Real max_gap = leave_dir[Y_AXIS] * dx / leave_dir[X_AXIS];
Real diff = ry - y;
Real newy = y;
- Real clear = staff_space * gh_scm2double (me->get_elt_property ("staffline-clearance"));
+ Real clear = staff_space * gh_scm2double (me->get_grob_property ("staffline-clearance"));
if (fabs (y) <= Staff_symbol_referencer::staff_radius (me)
&& fabs (diff) < clear)
SCM
Tie::set_spacing_rods (SCM smob)
{
- Score_element*me = unsmob_element (smob);
+ Grob*me = unsmob_element (smob);
Spanner*sp = dynamic_cast<Spanner*> (me);
Rod r;
r.item_l_drul_ [RIGHT]=sp->get_bound (RIGHT);
r.distance_f_
- = gh_scm2double (me->get_elt_property ("minimum-length"))
+ = gh_scm2double (me->get_grob_property ("minimum-length"))
* 1.0;
r.add_to_cols ();
return SCM_UNSPECIFIED;
SCM
Tie::brew_molecule (SCM smob)
{
- Score_element*me = unsmob_element (smob);
+ Grob*me = unsmob_element (smob);
- SCM cp = me->get_elt_property ("control-points");
+ SCM cp = me->get_grob_property ("control-points");
if (cp == SCM_EOL)
{
cp = get_control_points (smob);
- me->set_elt_property ("control-points", cp);
+ me->set_grob_property ("control-points", cp);
}
Real thick =
- gh_scm2double (me->get_elt_property ("thickness"))
+ gh_scm2double (me->get_grob_property ("thickness"))
* me->paper_l ()->get_var ("stafflinethickness");
Bezier b;
*/
class Time_signature_engraver : public Engraver {
protected:
- virtual void do_pre_move_processing();
- virtual void process_acknowledged ();
+ virtual void stop_translation_timestep();
+ virtual void create_grobs ();
public:
VIRTUAL_COPY_CONS(Translator);
Item * time_signature_p_;
}
void
-Time_signature_engraver::process_acknowledged()
+Time_signature_engraver::create_grobs()
{
/*
not rigorously safe, since the value might get GC'd and
{
last_time_fraction_ = fr;
time_signature_p_ = new Item (get_property ("TimeSignature"));
- time_signature_p_->set_elt_property ("fraction",fr);
+ time_signature_p_->set_grob_property ("fraction",fr);
if (time_signature_p_)
- announce_element (time_signature_p_, 0);
+ announce_grob (time_signature_p_, 0);
}
}
void
-Time_signature_engraver::do_pre_move_processing()
+Time_signature_engraver::stop_translation_timestep()
{
if (time_signature_p_)
{
- typeset_element (time_signature_p_);
+ typeset_grob (time_signature_p_);
time_signature_p_ =0;
}
}
protected:
- virtual void do_pre_move_processing ();
- virtual void process_acknowledged ();
+ virtual void stop_translation_timestep ();
+ virtual void create_grobs ();
SCM prev_fraction_;
private:
void
-Time_signature_performer::process_acknowledged ()
+Time_signature_performer::create_grobs ()
{
SCM fr = get_property ("timeSignatureFraction");
if (gh_pair_p (fr)
}
void
-Time_signature_performer::do_pre_move_processing ()
+Time_signature_performer::stop_translation_timestep ()
{
if (audio_p_)
{
SCM
Time_signature::brew_molecule (SCM smob)
{
- Score_element * me = unsmob_element (smob);
- SCM st = me->get_elt_property ("style");
- SCM frac = me->get_elt_property ("fraction");
+ Grob * me = unsmob_element (smob);
+ SCM st = me->get_grob_property ("style");
+ SCM frac = me->get_grob_property ("fraction");
int n = 4;
int d = 4;
if (gh_pair_p (frac))
}
- if (gh_string_p (st))
+ if (gh_symbol_p (st))
{
- String style (ly_scm2string (st));
+ String style (ly_scm2string (scm_symbol_to_string (st)));
if (style[0]=='1')
{
return time_signature (me, n, 0).smobbed_copy ();
}
Molecule
-Time_signature::special_time_signature (Score_element*me, String s, int n, int d)
+Time_signature::special_time_signature (Grob*me, String s, int n, int d)
{
/*
Randomly probing the font sucks?
Molecule
-Time_signature::time_signature (Score_element*me,int num, int den)
+Time_signature::time_signature (Grob*me,int num, int den)
{
SCM chain = Font_interface::font_alist_chain (me);
#include "translator-group.hh"
#include "command-request.hh"
-#include "score-element-info.hh"
+#include "grob-info.hh"
#include "multi-measure-rest.hh"
#include "timing-translator.hh"
#include "engraver.hh"
class Timing_engraver : public Timing_translator, public Engraver
{
protected:
- virtual void do_post_move_processing ();
- virtual void do_pre_move_processing ();
+ virtual void start_translation_timestep ();
+ virtual void stop_translation_timestep ();
public:
VIRTUAL_COPY_CONS(Translator);
};
ADD_THIS_TRANSLATOR(Timing_engraver);
void
-Timing_engraver::do_post_move_processing( )
+Timing_engraver::start_translation_timestep( )
{
- Timing_translator::do_post_move_processing ();
+ Timing_translator::start_translation_timestep ();
SCM nonauto = get_property ("barNonAuto");
}
void
-Timing_engraver::do_pre_move_processing ()
+Timing_engraver::stop_translation_timestep ()
{
- Timing_translator::do_pre_move_processing ();
+ Timing_translator::stop_translation_timestep ();
daddy_trans_l_->set_property ("whichBar", SCM_EOL);
}
class declaration can go here. */
bool
-Timing_translator::do_try_music (Music*r)
+Timing_translator::try_music (Music*r)
{
if (dynamic_cast<Barcheck_req*> (r))
{
void
-Timing_translator::do_pre_move_processing()
+Timing_translator::stop_translation_timestep()
{
check_ = 0;
}
void
-Timing_translator::do_post_move_processing()
+Timing_translator::start_translation_timestep()
{
check_ =00;
Translator *t = this;
Translator_group::try_music_on_nongroup_children (Music *m)
{
bool hebbes_b =false;
-
for (SCM p = simple_trans_list_; !hebbes_b && gh_pair_p (p); p = gh_cdr (p))
{
}
bool
-Translator_group::do_try_music (Music* m)
+Translator_group::try_music (Music* m)
{
bool hebbes_b = try_music_on_nongroup_children (m);
if (gh_pair_p (prev) || prev == SCM_EOL)
{
- bool ok = true;
-
- SCM errport = scm_current_error_port ();
+ bool ok = type_check_assignment (val, eltprop, ly_symbol2scm ("backend-type?"));
- SCM meta = scm_assoc (ly_symbol2scm ("meta"), prev);
- /*
- We're probably in a performer.
- */
- if (!gh_pair_p (meta))
- return;
- SCM props = scm_assoc (ly_symbol2scm ("properties"), gh_cdr (meta));
- SCM type_p = scm_assoc (eltprop, gh_cdr (props));
- if (!gh_pair_p (type_p))
- {
- scm_puts (_("Couldn't find property description for #'").ch_C(),errport);
- scm_display (eltprop, errport);
-
- scm_puts (_(" in element description ").ch_C(),errport);
- scm_display (prop, errport);
-
- scm_puts (_(". Perhaps you made a typing error?\n").ch_C(),errport);
- }
- else
- {
- type_p = gh_cdr (type_p);
- if (val != SCM_EOL
- && gh_call1 (type_p, val) == SCM_BOOL_F)
- {
- ok = false;
- scm_puts (_("Failed typecheck for #'").ch_C (),errport);
- scm_display (eltprop,errport);
- scm_puts ( _(", value ").ch_C (), errport);
- scm_write (val, errport);
- scm_puts (_(" must be of type ").ch_C (), errport);
- SCM typefunc = scm_eval2 (ly_symbol2scm ("type-name"), SCM_EOL);
- scm_display (gh_call1 (typefunc, type_p), errport);
- scm_puts ("\n", errport);
- }
- }
-
if (ok)
{
prev = gh_cons (gh_cons (eltprop, val), prev);
STUBS
*/
void
-Translator_group::do_pre_move_processing ()
+Translator_group::stop_translation_timestep ()
{
each (&Translator::pre_move_processing);
}
void
-Translator_group::do_post_move_processing ()
+Translator_group::start_translation_timestep ()
{
each (&Translator::post_move_processing);
}
{
each (&Translator::removal_processing);
}
+
+
+bool
+type_check_assignment (SCM val, SCM sym, SCM type_symbol)
+{
+ bool ok = true;
+ SCM type_p = SCM_EOL;
+ SCM errport = scm_current_error_port ();
+
+ if (SCM_IMP(sym))
+ type_p = scm_object_property (sym, type_symbol);
+
+ if (type_p != SCM_EOL && !gh_procedure_p (type_p))
+ {
+ scm_puts (_("Couldn't find property type-check for `").ch_C(),errport);
+ scm_puts (String ("'").ch_C(), errport);
+ scm_display (sym, errport);
+
+ scm_puts (_(". Perhaps you made a typing error?\n").ch_C(),errport);
+ }
+ else
+ {
+ if (val != SCM_EOL
+ && gh_procedure_p (type_p)
+ && gh_call1 (type_p, val) == SCM_BOOL_F)
+ {
+ ok = false;
+ scm_puts (_("Failed typecheck for `").ch_C (),errport);
+ scm_display (sym,errport);
+ scm_puts ( _("', value `").ch_C (), errport);
+ scm_write (val, errport);
+ scm_puts (_("' must be of type ").ch_C (), errport);
+ SCM typefunc = scm_eval2 (ly_symbol2scm ("type-name"), SCM_EOL);
+ scm_display (gh_call1 (typefunc, type_p), errport);
+ scm_puts ("\n", errport);
+ }
+ }
+ return ok;
+}
}
bool
-Translator::do_try_music (Music *)
+Translator::try_music (Music *)
{
return false;
}
void
Translator::post_move_processing ()
{
- do_post_move_processing ();
+ start_translation_timestep ();
}
void
do_removal_processing ();
}
-bool
-Translator::try_music (Music * r)
-{
- return do_try_music (r);
-}
void
Translator::announces ()
void
Translator::pre_move_processing ()
{
- do_pre_move_processing ();
+ stop_translation_timestep ();
}
}
void
-Translator:: do_pre_move_processing ()
+Translator:: stop_translation_timestep ()
{
}
void
-Translator::do_post_move_processing ()
+Translator::start_translation_timestep ()
{
}
Link_array<Spanner> started_span_p_arr_;
virtual void do_removal_processing ();
- virtual void acknowledge_element (Score_element_info);
- virtual bool do_try_music (Music*r);
+ virtual void acknowledge_grob (Grob_info);
+ virtual bool try_music (Music*r);
void deprecated_process_music ();
- virtual void do_post_move_processing ();
- virtual void process_acknowledged ();
+ virtual void start_translation_timestep ();
+ virtual void create_grobs ();
};
bool
-Tuplet_engraver::do_try_music (Music *r)
+Tuplet_engraver::try_music (Music *r)
{
if (Time_scaled_music * c = dynamic_cast<Time_scaled_music *> (r))
{
}
void
-Tuplet_engraver::process_acknowledged ()
+Tuplet_engraver::create_grobs ()
{
deprecated_process_music ();
}
else
started_span_p_arr_[i] = glep;
- glep->set_elt_property ("text",
+ glep->set_grob_property ("text",
ly_str02scm (to_str (time_scaled_music_arr_[i]->den_i_).ch_C()));
- announce_element (glep, time_scaled_music_arr_ [i]);
+ announce_grob (glep, time_scaled_music_arr_ [i]);
}
}
void
-Tuplet_engraver::acknowledge_element (Score_element_info i)
+Tuplet_engraver::acknowledge_grob (Grob_info i)
{
- bool grace= to_boolean (i.elem_l_->get_elt_property ("grace"));
+ bool grace= to_boolean (i.elem_l_->get_grob_property ("grace"));
SCM wg = get_property ("weAreGraceContext");
bool wgb = to_boolean (wg);
if (grace != wgb)
}
void
-Tuplet_engraver::do_post_move_processing ()
+Tuplet_engraver::start_translation_timestep ()
{
Moment now = now_mom ();
{
if (started_span_p_arr_[i])
{
- typeset_element (started_span_p_arr_[i]);
+ typeset_grob (started_span_p_arr_[i]);
started_span_p_arr_[i] =0;
}
for (int i=0; i < started_span_p_arr_.size (); i++)
{
if (started_span_p_arr_[i])
- typeset_element (started_span_p_arr_[i]);
+ typeset_grob (started_span_p_arr_[i]);
}
}
#include "spanner.hh"
void
-Tuplet_spanner::set_interface (Score_element*me)
+Tuplet_spanner::set_interface (Grob*me)
{
me->set_interface (ly_symbol2scm ("tuplet-bracket"));
}
SCM
Tuplet_spanner::brew_molecule (SCM smob)
{
- Score_element *me= unsmob_element (smob);
+ Grob *me= unsmob_element (smob);
Molecule mol;
// Default behaviour: number always, bracket when no beam!
- bool par_beam = to_boolean (me->get_elt_property ("parallel-beam"));
+ bool par_beam = to_boolean (me->get_grob_property ("parallel-beam"));
bool bracket_visibility = !par_beam;
bool number_visibility = true;
- SCM bracket = me->get_elt_property ("tuplet-bracket-visibility");
+ SCM bracket = me->get_grob_property ("tuplet-bracket-visibility");
if (gh_boolean_p (bracket))
{
bracket_visibility = gh_scm2bool (bracket);
else if (bracket == ly_symbol2scm ("if-no-beam"))
bracket_visibility = !par_beam;
- SCM numb = me->get_elt_property ("tuplet-number-visibility");
+ SCM numb = me->get_grob_property ("tuplet-number-visibility");
if (gh_boolean_p (numb))
{
number_visibility = gh_scm2bool (numb);
else if (bracket == ly_symbol2scm ("if-no-beam"))
number_visibility = !par_beam;
- if (gh_pair_p (me->get_elt_property ("columns")))
+ if (gh_pair_p (me->get_grob_property ("columns")))
{
- Link_array<Score_element> column_arr=
- Pointer_group_interface__extract_elements (me, (Score_element*)0, "columns");
+ Link_array<Grob> column_arr=
+ Pointer_group_interface__extract_elements (me, (Grob*)0, "columns");
Real ncw = column_arr.top ()->extent(column_arr.top (), X_AXIS).length ();
Real w = dynamic_cast<Spanner*>(me)->spanner_length () + ncw;
Real staff_space = 1.0;
Direction dir = Directional_element_interface::get (me);
- Real dy = gh_scm2double (me->get_elt_property ("delta-y"));
- SCM number = me->get_elt_property ("text");
+ Real dy = gh_scm2double (me->get_grob_property ("delta-y"));
+ SCM number = me->get_grob_property ("text");
if (gh_string_p (number) && number_visibility)
{
SCM properties = Font_interface::font_alist_chain (me);
{
Real lt = me->paper_l ()->get_var ("stafflinethickness");
- SCM thick = me->get_elt_property ("thick");
- SCM gap = me->get_elt_property ("number-gap");
+ SCM thick = me->get_grob_property ("thick");
+ SCM gap = me->get_grob_property ("number-gap");
SCM at =gh_list(ly_symbol2scm ("tuplet"),
gh_double2scm (1.0),
use first -> last note for slope, and then correct for disturbing
notes in between. */
void
-Tuplet_spanner::calc_position_and_height (Score_element*me,Real *offset, Real * dy)
+Tuplet_spanner::calc_position_and_height (Grob*me,Real *offset, Real * dy)
{
- Link_array<Score_element> column_arr=
- Pointer_group_interface__extract_elements (me, (Score_element*)0, "columns");
+ Link_array<Grob> column_arr=
+ Pointer_group_interface__extract_elements (me, (Grob*)0, "columns");
- Score_element * commony = me->common_refpoint (me->get_elt_property ("columns"), Y_AXIS);
- Score_element * commonx = me->common_refpoint (me->get_elt_property ("columns"), X_AXIS);
+ Grob * commony = me->common_refpoint (me->get_grob_property ("columns"), Y_AXIS);
+ Grob * commonx = me->common_refpoint (me->get_grob_property ("columns"), X_AXIS);
Direction d = Directional_element_interface::get (me);
use first -> last note for slope,
*/
void
-Tuplet_spanner::calc_dy (Score_element*me,Real * dy)
+Tuplet_spanner::calc_dy (Grob*me,Real * dy)
{
- Link_array<Score_element> column_arr=
- Pointer_group_interface__extract_elements (me, (Score_element*)0, "columns");
+ Link_array<Grob> column_arr=
+ Pointer_group_interface__extract_elements (me, (Grob*)0, "columns");
/*
ugh. refps.
SCM
Tuplet_spanner::after_line_breaking (SCM smob)
{
- Score_element * me = unsmob_element (smob);
+ Grob * me = unsmob_element (smob);
Link_array<Note_column> column_arr=
Pointer_group_interface__extract_elements (me, (Note_column*)0, "columns");
Spanner *sp = dynamic_cast<Spanner*> (me);
calc_position_and_height (me,&offset,&dy);
- me->set_elt_property ("delta-y", gh_double2scm (dy));
+ me->set_grob_property ("delta-y", gh_double2scm (dy));
me->translate_axis (offset, Y_AXIS);
- if (scm_ilength (me->get_elt_property ("beams")) == 1)
+ if (scm_ilength (me->get_grob_property ("beams")) == 1)
{
- SCM bs = me->get_elt_property ("beams");
- Score_element *b = unsmob_element (gh_car (bs));
+ SCM bs = me->get_grob_property ("beams");
+ Grob *b = unsmob_element (gh_car (bs));
Spanner * beam_l = dynamic_cast<Spanner *> (b);
if (!sp->broken_b ()
&& sp->get_bound (LEFT)->column_l () == beam_l->get_bound (LEFT)->column_l ()
&& sp->get_bound (RIGHT)->column_l () == beam_l->get_bound (RIGHT)->column_l ())
- me->set_elt_property ("parallel-beam", SCM_BOOL_T);
+ me->set_grob_property ("parallel-beam", SCM_BOOL_T);
}
return SCM_UNSPECIFIED;
}
Direction
-Tuplet_spanner::get_default_dir (Score_element*me)
+Tuplet_spanner::get_default_dir (Grob*me)
{
Direction d = UP;
- SCM dir_sym =me->get_elt_property ("dir-forced");
+ SCM dir_sym =me->get_grob_property ("dir-forced");
if (isdir_b (dir_sym))
{
d= to_dir (dir_sym);
}
d = UP ;
- for (SCM s = me->get_elt_property ("columns"); gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = me->get_grob_property ("columns"); gh_pair_p (s); s = gh_cdr (s))
{
- Score_element * nc = unsmob_element (gh_car (s));
+ Grob * nc = unsmob_element (gh_car (s));
if (Note_column::dir (nc) < 0)
{
d = DOWN;
}
void
-Tuplet_spanner::add_beam (Score_element*me, Score_element *b)
+Tuplet_spanner::add_beam (Grob*me, Grob *b)
{
me->add_dependency (b);
Pointer_group_interface::add_element (me, "beams",b);
}
void
-Tuplet_spanner::add_column (Score_element*me, Item*n)
+Tuplet_spanner::add_column (Grob*me, Item*n)
{
Pointer_group_interface::add_element (me, "columns",n);
me->add_dependency (n);
bool
-Type_swallow_translator::do_try_music (Music*r)
+Type_swallow_translator::try_music (Music*r)
{
if (classname (r) == swallow_str_)
return true;
class Vertical_align_engraver : public Engraver
{
Spanner * valign_p_;
- bool qualifies_b (Score_element_info) const;
+ bool qualifies_b (Grob_info) const;
public:
VIRTUAL_COPY_CONS(Translator);
Vertical_align_engraver();
protected:
- virtual void acknowledge_element (Score_element_info);
+ virtual void acknowledge_grob (Grob_info);
virtual void do_creation_processing();
virtual void do_removal_processing();
};
{
valign_p_ =new Spanner (get_property ("VerticalAlignment"));
valign_p_->set_bound(LEFT,unsmob_element (get_property ("currentCommandColumn")));
- announce_element (valign_p_ , 0);
+ announce_grob (valign_p_ , 0);
}
void
Vertical_align_engraver::do_removal_processing()
{
valign_p_->set_bound(RIGHT,unsmob_element (get_property ("currentCommandColumn")));
- typeset_element (valign_p_);
+ typeset_grob (valign_p_);
valign_p_ =0;
}
bool
-Vertical_align_engraver::qualifies_b (Score_element_info i) const
+Vertical_align_engraver::qualifies_b (Grob_info i) const
{
int sz = i.origin_trans_l_arr ((Translator*)this).size() ;
}
void
-Vertical_align_engraver::acknowledge_element (Score_element_info i)
+Vertical_align_engraver::acknowledge_grob (Grob_info i)
{
if (qualifies_b (i))
{
VIRTUAL_COPY_CONS (Translator);
protected:
- virtual bool do_try_music (Music *m);
- virtual void acknowledge_element (Score_element_info);
+ virtual bool try_music (Music *m);
+ virtual void acknowledge_grob (Grob_info);
};
ADD_THIS_TRANSLATOR (Voice_devnull_engraver);
};
bool
-Voice_devnull_engraver::do_try_music (Music *m)
+Voice_devnull_engraver::try_music (Music *m)
{
if (daddy_trans_l_->id_str_ == "two"
&& (to_boolean (get_property ("unison"))
};
void
-Voice_devnull_engraver::acknowledge_element (Score_element_info i)
+Voice_devnull_engraver::acknowledge_grob (Grob_info i)
{
if (daddy_trans_l_->id_str_ == "two"
&& (to_boolean (get_property ("unison"))
VIRTUAL_COPY_CONS(Translator);
protected:
- virtual void acknowledge_element (Score_element_info);
+ virtual void start_translation_timestep ();
+ virtual void acknowledge_grob (Grob_info);
virtual void do_removal_processing ();
- virtual void do_pre_move_processing ();
+ virtual void stop_translation_timestep ();
void deprecated_process_music ();
- virtual void process_acknowledged ();
+ virtual void create_grobs ();
Moment started_mom_;
- Spanner * volta_span_p_;
- Spanner* end_volta_span_p_;
+ Spanner *volta_span_p_;
+ Spanner *end_volta_span_p_;
+
+ bool first_b_;
};
ADD_THIS_TRANSLATOR(Volta_engraver);
Volta_engraver::Volta_engraver ()
{
+ first_b_ = true;
volta_span_p_ = 0;
end_volta_span_p_ = 0;
}
void
-Volta_engraver::process_acknowledged ()
+Volta_engraver::create_grobs ()
{
- deprecated_process_music ();
+ if (first_b_)
+ {
+ deprecated_process_music ();
+ first_b_ = false;
+ }
}
void
volta_span_p_ =0;
/*
- maybe do typeset_element () directly?
+ maybe do typeset_grob () directly?
*/
if (!gh_string_p (str))
- end_volta_span_p_->set_elt_property ("last-volta", SCM_BOOL_T);
+ end_volta_span_p_->set_grob_property ("last-volta", SCM_BOOL_T);
}
if (gh_string_p (str))
volta_span_p_ = new Spanner (get_property ("VoltaBracket"));
Volta_spanner::set_interface (volta_span_p_);
- announce_element (volta_span_p_,0);
- volta_span_p_->set_elt_property ("text", str);
+ announce_grob (volta_span_p_,0);
+ volta_span_p_->set_grob_property ("text", str);
}
}
void
-Volta_engraver::acknowledge_element (Score_element_info i)
+Volta_engraver::acknowledge_grob (Grob_info i)
{
if (Item* item = dynamic_cast<Item*> (i.elem_l_))
{
{
if (volta_span_p_)
{
- typeset_element(volta_span_p_);
+ typeset_grob(volta_span_p_);
}
if (end_volta_span_p_)
{
- typeset_element (end_volta_span_p_);
+ typeset_grob (end_volta_span_p_);
}
}
+void
+Volta_engraver::start_translation_timestep ()
+{
+ first_b_ = true;
+}
+
void
-Volta_engraver::do_pre_move_processing ()
+Volta_engraver::stop_translation_timestep ()
{
if (end_volta_span_p_)
{
Side_position::add_staff_support (end_volta_span_p_);
- typeset_element (end_volta_span_p_ );
+ typeset_grob (end_volta_span_p_ );
end_volta_span_p_ =0;
}
}
void
-Volta_spanner::set_interface (Score_element*)
+Volta_spanner::set_interface (Grob*)
{
}
SCM
Volta_spanner::brew_molecule (SCM smob)
{
- Score_element *me = unsmob_element (smob);
+ Grob *me = unsmob_element (smob);
Link_array<Item> bar_arr
= Pointer_group_interface__extract_elements (me, (Item*)0, "bars");
return SCM_EOL;
bool no_vertical_start = false;
- bool no_vertical_end = to_boolean (me->get_elt_property ("last-volta"));
+ bool no_vertical_end = to_boolean (me->get_grob_property ("last-volta"));
Spanner *orig_span = dynamic_cast<Spanner*> (me->original_l_);
if (orig_span && (orig_span->broken_into_l_arr_[0] != (Spanner*)me))
no_vertical_start = true;
#if 0
// FIXME
- if (bar_arr.top ()->me->get_elt_property (type_str_.length_i () > 1)
+ if (bar_arr.top ()->me->get_grob_property (type_str_.length_i () > 1)
no_vertical_end = false;
#endif
*/
Real left = 0.0;
Real w = dynamic_cast<Spanner*>(me)->spanner_length () - left - half_space;
- Real h = gh_scm2double (me->get_elt_property ("height"));
- Real t = staff_thick * gh_scm2double (me->get_elt_property ("thickness"));
+ Real h = gh_scm2double (me->get_grob_property ("height"));
+ Real t = staff_thick * gh_scm2double (me->get_grob_property ("thickness"));
/*
ugh: should build from line segments.
Box b (Interval (0, w), Interval (0, h));
Molecule mol (b, at);
- SCM text = me->get_elt_property("text");
+ SCM text = me->get_grob_property("text");
SCM properties = gh_list (me->mutable_property_alist_, me->immutable_property_alist_,SCM_UNDEFINED);
Molecule num = Text_item::text2molecule (me, text, properties);
void
-Volta_spanner::add_bar (Score_element *me, Item* b)
+Volta_spanner::add_bar (Grob *me, Item* b)
{
Pointer_group_interface::add_element(me, "bars",b);
Side_position::add_support (me,b);
}
void
-Volta_spanner::add_column (Score_element*me, Score_element* c)
+Volta_spanner::add_column (Grob*me, Grob* c)
{
Side_position::add_support (me,c);
}
\consists "Tie_engraver";
\consists "Tuplet_engraver";
\consists "Grace_position_engraver";
- \consists "Skip_req_swallow_translator";
+% \consists "Skip_req_swallow_translator";
\accepts Thread; % bug if you leave out this!
\accepts Grace;
}
Begin3
Title: LilyPond
-Version: 1.3.108
-Entered-date: 15NOV00
+Version: 1.3.109
+Entered-date: 21NOV00
Description:
Keywords: music notation typesetting midi fonts engraving
Author: hanwen@cs.uu.nl (Han-Wen Nienhuys)
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.108.tar.gz
+ 1000k lilypond-1.3.109.tar.gz
Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 1000k lilypond-1.3.108.tar.gz
+ 1000k lilypond-1.3.109.tar.gz
Copying-policy: GPL
End
%define info yes
Name: lilypond
-Version: 1.3.108
+Version: 1.3.109
Release: 1
License: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.108.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.109.tar.gz
Summary: A program for printing sheet music.
URL: http://www.cs.uu.nl/~hanwen/lilypond
# Icon: lilypond-icon.gif
\include "global.ly"
\include "corni.ly"
+
\score{
\corniStaff
\include "coriolan-part-combine-paper.ly"
\property VoiceCombineStaff.midiInstrument = #"french horn"
\property VoiceCombineStaff.instrument = #"2 Corni\n(E\\textflat)"
\property VoiceCombineStaff.instr = #"Cor.\n(E\\textflat)"
+
% urg: can't; only My_midi_lexer:<non-static> () parses pitch?
%\property VoiceCombineStaff.transposing = "es"
\property VoiceCombineStaff.transposing = #3
;; alist of property descriptions
-(define (document-element-property property-def element-description only-doc-if-set)
- "
-"
+(define (backend-property->texi sym)
(let* (
- (handle (assoc (car property-def) element-description))
- (def-val-str (if (eq? handle #f)
- "not set"
- (scm->texi (cdr handle))))
-
- (name (symbol->string (car property-def)))
- (type (type-name (cadr property-def)))
- (desc (caddr property-def))
+ (name (symbol->string sym))
+ (type (object-property sym 'backend-type?))
+ (typename (type-name type))
+ (desc (object-property sym 'backend-doc))
)
- (if (and (eq? handle #f) only-doc-if-set)
- '("" . "")
- (cons (string-append "@code{" name "} "
- "(" type ")"
+ (cons (string-append "@code{" name "} "
+ "(" typename ")"
":" )
- (string-append desc
- "\nDefault value: "
- def-val-str))
+ desc)
+ ))
+
+(define (document-element-property sym element-description only-doc-if-set)
+ (let*
+ (
+ (handle (assoc sym element-description))
+ (defval (if (eq? handle #f)
+ ""
+ (scm->texi (cdr handle))
+ ))
+ (propdoc (backend-property->texi sym))
+ )
+
+ (if (and only-doc-if-set (eq? handle #f) )
+ '("" . "")
+ (cons (car propdoc) (string-append (cdr propdoc)
+ "\nDefault value: "
+ defval)))
))
- )
(define (document-interface where interface element-description)
"
(name (car interface))
(desc (cadr interface))
(props (caddr interface))
- (docfun (lambda (x)
+ (docfunc (lambda (x)
(document-element-property
x element-description (eq? where 'element))))
- (docs (map docfun props))
+ (docs (map docfunc props))
)
(string-append
(and (pair? x) (number? (car x)) (number? (cdr x))))
(define (ly-gulp-file x) "")
- (define (ly-element? x) #f)
+ (define (ly-grob? x) #f)
(define (ly-input-location? x) #f)
(define (dir? x) #f)
(define (moment? x) #f)
(use-modules (ice-9 string-fun))
(define interface-file-str (string-append (ly-gulp-file "interface.scm") "\n(define "))
+
(define (list-interface-names)
(let* ((text interface-file-str)
(r (make-regexp
(l (separate-fields-discarding-char #\ ugh list)))
(reverse (cdr (reverse l)))))
+
+
+
(eval (ly-gulp-file "interface.scm"))
(define interface-description-alist
(map (lambda (x) (cons (string->symbol x) (eval-string x)))
(list-interface-names)))
+(set! interface-description-alist (sort interface-description-alist alist<?))
+
(define (document-all-interfaces name)
(string-append
(texi-node-menu name (map (lambda (x) (cons (interface-name x) ""))
(map document-separate-interface
(map cdr interface-description-alist)))))
-
+(define (document-all-backend-properties name)
+ (let*
+ (
+ (ps (sort (map symbol->string all-backend-properties) string<?))
+ (descs (map (lambda (prop)
+ (backend-property->texi (string->symbol prop)))
+ ps))
+ (texi (description-list->texi descs))
+ )
+
+ (string-append
+ (node name)
+ (texi-section 1 name #f)
+ texi)
+ )
+ )
+
--- /dev/null
+(define all-backend-properties '())
+
+(define (elt-property-description symbol type? description)
+ (set-object-property! symbol 'backend-type? type?)
+ (set-object-property! symbol 'backend-doc description)
+ (set! all-backend-properties (cons symbol all-backend-properties))
+ )
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+(elt-property-description 'stems list? "list of stem objects, corresponding to the notes that the arpeggio has to be before.")
+(elt-property-description 'merge-differently-dotted boolean? " Merge noteheads in collisions, even if they have a different number of dots. This normal notation for some types of polyphonic music. The value of this setting is used by @ref{note-collision-interface} ")
+(elt-property-description 'note-width 'number? "unit for horizontal translation, measured in staff-space.")
+
+(elt-property-description 'style symbol? "a string determining what style of glyph is typeset. Valid choices depend on the function that is reading this property. ")
+(elt-property-description 'glyph symbol? "a string determining what style of glyph is typeset. Valid choices depend on the function that is reading this property. ")
+
+
+(elt-property-description 'dot-count integer? "number of dots")
+(elt-property-description 'font-style symbol? "a precooked set of font definitions, eg. finger volta timesig mark script large Large dynamic")
+(elt-property-description 'font-series symbol? "partial font definition: medium, bold")
+(elt-property-description 'font-shape symbol? "partial font definition: upright or italic")
+(elt-property-description 'font-family symbol? "partial font definition: music roman braces dynamic math ...")
+(elt-property-description 'font-name symbol? "partial font definition: base name of font file FIXME: should override other partials")
+(elt-property-description 'font-point-size number? "partial font definition: exact font size in points FIXME: should override font-relative-size")
+(elt-property-description 'font-relative-size number? "partial font definition: the relative size, 0 is style-sheet's normal size, -1 is smaller, +1 is bigger")
+(elt-property-description 'text markup? "
+Scheme markup text. It is defined as follows:
+
+@example
+
+TEXT : STRING | (MARKUP SENTENCE)
+MARKUP: PROPERTY | ABBREV
+SENTENCE: TEXT | SENTENCE TEXT
+PROPERTY: (key . value)
+ABBREV: rows lines roman music bold italic named super sub text, or any font-style
+
+@end example
+
+So, TEXT is either a string, or a list of which the CAR is a MARKUP.
+MARKUP is either a CONS: an element property '(key . value) or a symbol:
+a predefined abbreviation for a list of element properties.
+
+
+The following abbreviations are currently defined:
+@table @samp
+@item rows
+horizontal mode: set all text on one line (default)
+@item lines
+ vertical mode: set every text on new line
+@item roman
+ select roman font
+@item music
+ select feta font
+@item bold
+ select bold series
+@item italic
+ select italic shape
+@item named
+ lookup by character name
+@item text
+ plain text lookup (by character value)
+@item super
+ superscript
+@item sub
+ subscript
+@item any font-style
+ finger volta timesig mmrest mark script large Large dynamic
+@end table
+" )
+
+(elt-property-description 'maximum-duration-for-spacing moment? "space as if a duration of this type is available in this measure.")
+(elt-property-description 'arithmetic-basicspace number? "")
+(elt-property-description 'staff-space number? "Amount of line leading relative to global staffspace")
+(elt-property-description 'line-count integer? "Number of staff lines")
+(elt-property-description 'elements list? " -- list of items.")
+(elt-property-description 'collapse-height number? "")
+
+(elt-property-description 'bars list? "list of barline ptrs.")
+(elt-property-description 'thickness number? "thickness, measured in stafflinethickness")
+(elt-property-description 'height number? "in staffspace ")
+(elt-property-description 'arch-height number? "")
+(elt-property-description 'arch-angle number? "")
+(elt-property-description 'arch-thick number? "")
+(elt-property-description 'arch-width number? "")
+(elt-property-description 'bracket-thick number? "")
+(elt-property-description 'bracket-width number? "")
+(elt-property-description 'dash-period number? "the length of one dash + white space")
+(elt-property-description 'dash-length number? "the length of a dash")
+(elt-property-description 'line-thickness number? "the thickness[stafflinethickness] of the line")
+(elt-property-description 'edge-height pair? "a cons that specifies the heights of the vertical egdes '(LEFT-height . RIGHT-height)")
+(elt-property-description 'edge-text pair? "a cons that specifies the texts to be set at the edges '(LEFT-text . RIGHT-text)")
+(elt-property-description 'type string? "one of: line, dashed-line or dotted-line") ; SYMBOL!!?
+(elt-property-description 'staffline-clearance number? "don't get closer than this to stafflines.")
+(elt-property-description 'control-points list? "List of 4 offsets (number-pairs) controlling the tie shape")
+(elt-property-description 'heads pair? "pair of element pointers, pointing to the two heads of the tie. ")
+(elt-property-description 'details list? "alist of parameters for the curve shape")
+(elt-property-description 'x-gap number? "horizontal gap between notehead and tie")
+(elt-property-description 'direction dir? "up or down, left or right?")
+(elt-property-description 'minimum-length number? "minimum length in staffspace")
+
+(elt-property-description 'arithmetic-multiplier number? "see arithmetic-basicspace")
+(elt-property-description 'stem ly-grob? "pointer to the stem object.")
+(elt-property-description 'beam-width number? "width of the tremolo sign")
+(elt-property-description 'beam-thickness number? "thickness, measured in staffspace")
+(elt-property-description 'beam-space-function procedure? "function returning space given multiplicity")
+(elt-property-description 'beam-width number? "width of the tremolo sign")
+(elt-property-description 'beam-thickness number? "thickness, measured in staffspace")
+(elt-property-description 'beam-space-function procedure? "function returning space given multiplicity")
+(elt-property-description 'horizontal-space number? "amount of space to add after a note (in staff-space)")
+(elt-property-description 'items-worth-living list? "list of interesting items. If empty in a particular system, clear that system.")
+(elt-property-description 'align number? "the alignment of the text, 0 is horizontal, 1 is vertical")
+(elt-property-description 'lookup symbol? "lookup method: 'value for plain text, 'name for character-name")
+(elt-property-description 'raise number? "height for text to be raised (a negative value lowers the text")
+(elt-property-description 'kern number? "amount of extra white space to add before text. This is `relative'(?) to the current alignment.")
+(elt-property-description 'magnify number? "the magnification factor. FIXME: doesn't work for feta fonts")
+(elt-property-description 'minimum-distances list? "list of rods (ie. (OBJ . DIST) pairs)")
+(elt-property-description 'maximum-rest-count integer? "kill off rests so we don't more than this number left.")
+(elt-property-description 'minimum-distance number? "minimum distance between notes and rests.")
+(elt-property-description 'elements list? "list of elements (NoteColumn,
+generally) participating in the collision. The
+@code{rest-collision} property in @code{elements} is set
+to a pointer to the collision")
+(elt-property-description 'ideal-distances list? "(OBJ . (DIST . STRENGTH)) pairs")
+(elt-property-description 'script-priority number? "A sorting key that determines in what order a script is within a stack of scripts")
+(elt-property-description 'dir-list list? "list of stem directions, needed for optical spacing correction.")
+(elt-property-description 'columns list? "list of paper-columns")
+(elt-property-description 'expand-limit integer? "maximum number of measures expanded in church rests")
+(elt-property-description 'minimum-width number? "minimum-width of rest symbol, in staffspace")
+(elt-property-description 'padding number? "padding between number and rest. Measured in staffspace.")
+(elt-property-description 'column-space-strength number? "relative strength of space following breakable columns (eg. prefatory matter)")
+(elt-property-description 'before-musical-spacing-factor number?
+ "space before musical columns (eg. taken by accidentals) get this much
+stretched when they follow a musical column, in absence of grace
+notes. 0.0 means no extra space (accidentals are ignored)")
+(elt-property-description 'stem-spacing-correction number? "optical correction amount.")
+(elt-property-description 'before-grace-spacing-factor number? " stretch space this much if there are grace notes before the column")
+(elt-property-description 'when moment? "when does this column happen?")
+(elt-property-description 'bounded-by-me list? "list of spanners that have this
+column as start/begin point. Only columns that have elements or act as bounds are spaced.")
+(elt-property-description 'shortest-playing-duration moment? "duration of the shortest playing in that column.")
+(elt-property-description 'shortest-starter-duration moment? "duration of the shortest notes that starts exactly in this column.")
+(elt-property-description 'contains-grace boolean? "Used to widen entries for grace notes.")
+(elt-property-description 'extra-space number-pair? "pair of distances")
+(elt-property-description 'stretch-distance number-pair? "pair of distances")
+
+(elt-property-description 'barsize-procedure procedure? "how to compute the size of a bar line")
+(elt-property-description 'kern number? "space after a thick line")
+(elt-property-description 'thin-kern number? "space after a hair-line")
+(elt-property-description 'hair-thickness number? "thickness, measured in stafflinethickness")
+(elt-property-description 'thick-thickness number? "thickness, measured in stafflinethickness")
+(elt-property-description 'glyph string? "what kind barline? A concatenation of |, : and .")
+(elt-property-description 'bar-size number? "")
+(elt-property-description 'break-glyph-function procedure? "function taking glyph and break-direction, returning the glyph at a line break")
+(elt-property-description 'grow-direction dir? "crescendo or decrescendo?")
+(elt-property-description 'padding number? "horizontal padding. This is useful if a crescendo is set next to a text like `mf'")
+(elt-property-description 'c0-position integer? "integer indicating the position of central C")
+(elt-property-description 'old-accidentals list? "list of (pitch, accidental) pairs")
+(elt-property-description 'new-accidentals list? "list of (pitch, accidental) pairs")
+
+(elt-property-description 'minimum-length number? "try to make the hyphens at least this long. Also works as a scaling parameter for the length")
+(elt-property-description 'word-space number? "elongate left by this much (FIXME: cumbersome semantics)")
+(elt-property-description 'right-trim-amount number? "")
+
+(elt-property-description 'pitches list? "list of musical-pitch")
+(elt-property-description 'inversion list? " musical-pitch, optional")
+(elt-property-description 'bass list? " musical-pitch, optional")
+(elt-property-description 'fraction number-pair? "")
+(elt-property-description 'break-align-symbol symbol? "the index in the spacing table (symbol) of the to be aligned item.")
+(elt-property-description 'visibility-lambda procedure? "a function that takes the break direction and returns a cons of booleans containing (TRANSPARENT . EMPTY)")
+(elt-property-description 'breakable boolean? "boolean indicating if this is a breakable item (clef, barline, key sig, etc.)")
+(elt-property-description 'minimum-space number-pair? "(cons LEFT RIGHT)")
+(elt-property-description 'extra-space number-pair? "(cons LEFT RIGHT)")
+
+(elt-property-description 'stacking-dir dir? "stack contents of elements in which direction ?")
+(elt-property-description 'align-dir dir? "Which side to align? -1: left side, 0: around center of width, 1: right side")
+(elt-property-description 'threshold number-pair? "(cons MIN MAX), where MIN and MAX are dimensions in staffspace")
+(elt-property-description 'alignment-done boolean? "boolean to administrate whether we've done the alignment already (to ensure that the process is done only once)")
+(elt-property-description 'center-element ly-grob? "element which will be at the
+center of the group after aligning (when using
+Align_interface::center_on_element). ")
+(elt-property-description 'elements list? "to be aligned elements ")
+(elt-property-description 'axes list? "list of axis numbers. Should contain only one number.")
+
+(elt-property-description 'beams list? "list of beam ptrs.")
+(elt-property-description 'columns list? " list of note-columns.")
+(elt-property-description 'number-gap number? "")
+(elt-property-description 'delta-y number? "amount of ascension")
+(elt-property-description 'tuplet-bracket-visibility boolean-or-symbol? "
+This controls the visibility of the tuplet bracket.
+Setting it to false will prevent printing of the
+bracket. Setting the property to #'if-no-beam will make it
+print only if there is no beam associated with this tuplet bracket.")
+(elt-property-description 'tuplet-number-visibility boolean-or-symbol? "
+Like @code{tuplet-bracket-visibility}, but for the number.")
+(elt-property-description 'parallel-beam boolean? "internal: true if there is a beam just as wide as the bracket ")
+(elt-property-description 'thick number? "thickness, in stafflinethickness")
+(elt-property-description 'dot ly-grob? "reference to Dots object.")
+(elt-property-description 'stem ly-grob? "pointer to Stem object")
+(elt-property-description 'duration-log integer? "2-log of the notehead duration")
+(elt-property-description 'between-system-string string? "string
+ to dump between two systems. Useful for forcing pagebreaks")
+(elt-property-description 'spacing-procedure procedure? "procedure taking
+graphical element as argument. This is called after before-line-breaking-callback, but before the actual line breaking itself. Return value is ignored")
+(elt-property-description 'before-line-breaking-callback procedure?
+ "Procedure taking graphical element as argument.
+This procedure is called (using dependency resolution) before line breaking, but after generating discretionary items. Return value is ignored")
+(elt-property-description 'after-line-breaking-callback procedure?
+ "Procedure taking graphical element as argument.
+This procedure is called (using dependency resolution) after line breaking. Return value is ignored")
+(elt-property-description 'all-elements list? "list of all score elements in this line. Needed for protecting elements from GC.")
+(elt-property-description 'columns list? "list of all paper columns")
+(elt-property-description 'left-padding number? "space left of accs")
+(elt-property-description 'right-padding number? "space right of accs")
+(elt-property-description 'side-support list? "the support, a list of score elements")
+(elt-property-description 'direction-source ly-grob? "in case side-relative-direction is set, which element to get the direction from ")
+(elt-property-description 'side-relative-direction dir? "if set: get the direction from a different object, and multiply by this.")
+(elt-property-description 'minimum-space number? "minimum distance that the victim should move (after padding)")
+(elt-property-description 'padding number? "add this much extra space between victim and support")
+(elt-property-description 'self-alignment-X number? "real number: -1 =
+left aligned, 0 = center, 1 right-aligned in X direction.
+
+ Set to an element pointer, if you want that element to be the center.
+In this case, the center element should have this object as a
+reference point.
+")
+(elt-property-description 'self-alignment-Y number? "like self-alignment-X but for Y axis")
+
+(elt-property-description 'de-uglify-parameters list? "list of 3 real constants. They define the valid areas for the middle control points. Used in de_uglyfy. They are a bit empirical.")
+(elt-property-description 'details list? "alist containing contaning a few magic constants.")
+(elt-property-description 'attachment pair? "cons of symbols, '(LEFT-TYPE . RIGHT-TYPE), where both types may be alongside-stem, stem, head or loose-end")
+(elt-property-description 'attachment-offset pair? "cons of offsets, '(LEFT-offset . RIGHT-offset). This offset is added to the attachments to prevent ugly slurs.")
+(elt-property-description 'beautiful number? "number that dictates when a slur should be de-uglyfied. It correlates with the enclosed area between noteheads and slurs. A value of 0.1 yields only undisturbed slurs, a value of 5 will tolerate quite high blown slurs.")
+(elt-property-description 'y-free number? "minimal vertical gap between slur and noteheads or stems")
+(elt-property-description 'control-points list? "[internal] control points of bezier curve")
+(elt-property-description 'extremity-rules list? "an alist (procedure slur dir) -> attachment to determine the attachment (see above). If procedure returns #t, attachment is used. Otherwise, the next procedure is tried.")
+(elt-property-description 'extremity-offset-alist list? "an alist (attachment stem-dir*dir slur-dir*dir) -> offset. The offset adds to the centre of the notehead, or stem.")
+(elt-property-description 'dashed number? "[FIXME: use dash-period/dash length; see text-spanner] number representing the length of the dashes.")
+(elt-property-description 'non-default boolean? "not set because of existence of a bar?")
+(elt-property-description 'full-size-change boolean? "if set, don't make a change clef smaller.")
+(elt-property-description 'glyph string? "a string determining what glyph is typeset")
+(elt-property-description 'axes list? "list of axis (number) in which this group works")
+(elt-property-description 'horizontal-shift integer? "integer that identifies ranking of note-column for horizontal shifting. This is used by @ref{note-collision-interface}")
+(elt-property-description 'force-hshift number? "amount of collision_note_width that overides automatic collision settings. This is used by @ref{note-collision-interface}")
+(elt-property-description 'beamed-lengths list? "list of stem lengths given beam multiplicity ")
+(elt-property-description 'beamed-minimum-lengths list? "list of minimum stem lengths given beam multiplicity")
+(elt-property-description 'stem-centered boolean? "Center stems on note heads. Useful for mensural notation")
+(elt-property-description 'lengths list? "Stem length given multiplicity of flag")
+(elt-property-description 'beam ly-grob? "pointer to the beam, if applicable")
+(elt-property-description 'stem-shorten list? "shorten stems in forced directions given flag multiplicity")
+(elt-property-description 'duration-log integer? "log of the duration, ie. 0=whole note, 1 = half note, etc.")
+(elt-property-description 'beaming number-pair? "number of beams extending to left and right")
+(elt-property-description 'default-neutral-direction dir? "Where to go if we're in the middle of the staff")
+(elt-property-description 'stem-end-position number? "Where does the stem end (the end is opposite to the support-head")
+(elt-property-description 'support-head ly-grob? "the note head at
+one end of the stem")
+(elt-property-description 'heads list? "list of note heads")
+(elt-property-description 'stem-length number? "length of stem")
+(elt-property-description 'flag-style string? "") ; symbol!?
+(elt-property-description 'dir-forced boolean? "set if direction has been forced; read by Beam.")
+
+(elt-property-description 'y-position number? "position of left edge")
+(elt-property-description 'flag-width-function procedure? "")
+(elt-property-description 'damping integer? "amount of beam slope damping should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams ")
+(elt-property-description 'default-neutral-direction dir? "which
+direction to choose if we're in the middle of the staff ")
+(elt-property-description 'space-function procedure? "function of type multiplicity -> real (in staffspace)")
+(elt-property-description 'beamed-stem-shorten number? "shorten beamed stems in forced direction")
+(elt-property-description 'height-quants procedure? "function of type (beam staff-line-thickness) -> list of quants. Default value: default-beam-dy-quants.
+")
+(elt-property-description 'vertical-position-quant-function procedure? "
+function of type (beam multiplicity dy staff-line-thickness) -> real. Default value: default-beam-y-quants, also available: beam-traditional-y-quants.
+")
+(elt-property-description 'dir-function procedure? "function of type (count total)->direction. Default value: beam-dir-majority, also available: beam-dir-mean, beam-dir-median.")
+(elt-property-description 'damping number? "damping factor.")
+(elt-property-description 'outer-stem-length-limit number? "catch
+suspect beam slopes, set slope to zero if outer stem is lengthened
+more than this (in staffspace)")
+(elt-property-description 'slope-limit number? "set slope to zero if slope is running away steeper than this.")
+(elt-property-description 'X-offset-callbacks list? "list of functions, each taking an element and axis argument. The function determine the position relative to this element's parent. The last one in the list is called first")
+(elt-property-description 'Y-offset-callbacks list? "see @code{X-offset-callbacks}")
+(elt-property-description 'X-extent-callback procedure? "procedure taking an element and axis argument, returning a number-pair. The return value is the extent of the element.")
+(elt-property-description 'Y-extent-callback procedure? "see @code{X-extent-callback}")
+(elt-property-description 'font-relative-size integer? "")
+(elt-property-description 'extra-offset number-pair? "pair of reals (a cons) forcing an extra offset before outputting")
+(elt-property-description 'interfaces list? "list of symbols indicating the interfaces supported by this object. Is initialized from the @code{meta} field.")
+(elt-property-description 'dependencies list? "list of score-element pointers that indicate who to compute first for certain global passes")
+(elt-property-description 'no-spacing-rods boolean? "read from elements: boolean that makes Separation_item ignore this item (MOVE ME TO ITEM)")
+(elt-property-description 'extra-extent-X number-pair? "enlarge in X dimension by this much, measured in staff space")
+(elt-property-description 'extra-extent-Y number-pair? "see @code{extra-extent-Y}")
+(elt-property-description 'minimum-extent-X number-pair? "minimum size in X dimension, measured in staff space")
+(elt-property-description 'minimum-extent-Y number-pair? "see @code{minimum-extent-Y}")
+(elt-property-description 'origin ly-input-location? "location in input file of the definition")
+(elt-property-description 'transparent boolean? "This is almost the
+same as setting molecule-callback to #f, but this retains the
+dimensions of this element, which means that you can erase elements
+individually. ")
+(elt-property-description 'molecule-callback procedure? "Function taking graphical element as argument, returning a Scheme encoded Molecule.")
+
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; BEAMS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(uniqued-alist (cdr alist) (cons (car alist) acc)
))))
+
+(define (alist<? x y)
+ (string<? (symbol->string (car x))
+ (symbol->string (car y))))
+
(define (processing name)
(display (string-append "\nProcessing " name " ... ") (current-error-port)))
(height . 0.4)
(minimum-length . 0.5)
(molecule-callback . ,Hyphen_spanner::brew_molecule)
- (Y-extent-callback . ,Score_element::point_dimension_callback)
+ (Y-extent-callback . ,Grob::point_dimension_callback)
(meta . ,(element-description "LyricHyphen" lyric-hyphen-interface ))
))
(molecule-callback . ,Lyric_extender::brew_molecule)
(height . 0.8) ; stafflinethickness;
(right-trim-amount . 0.5)
- (Y-extent-callback . ,Score_element::point_dimension_callback)
+ (Y-extent-callback . ,Grob::point_dimension_callback)
(meta . ,(element-description "LyricExtender" lyric-extender-interface))
))
(Rest . (
(after-line-breaking-callback . ,Rest::after_line_breaking)
+ (X-extent-callback . ,Rest::extent_callback)
+ (Y-extent-callback . ,Rest::extent_callback)
(molecule-callback . ,Rest::brew_molecule)
(minimum-beam-collision-distance . 1.5)
(meta . ,(element-description "Rest"
rhythmic-head-interface
- rest-interface ))
+ rest-interface))
))
(RestCollision . (
(minimum-distance . 0.75)
;; sheets than 20
;;(font-point-size . 20)
;;(font-relative-size . #f)
- (meta . ,(element-description "SystemStartDelimiter" system-start-delimiter font-interface))
+ (meta . ,(element-description "SystemStartDelimiter" system-start-delimiter-interface font-interface))
))
(TextScript . (
(eval-string (ly-gulp-file "translator-description.scm"))
;; alist of translater descriptions
-(define (document-translator-property prop-desc)
+(define (document-translator-property sym)
(cons
(string-append
- "@code{" (car prop-desc) "} "
- "(" (type-name (cadr prop-desc)) "):")
- (caddr prop-desc)))
+ "@code{" (symbol->string sym) "} "
+ "(" (type-name (object-property sym 'translation-type?)) "):")
+ (object-property sym 'translation-doc)))
;; First level Engraver description and
;; second level Context description
(texi-section 2 (context-name name) #f)
doc)))
+
(define (document-paper name)
- (let* ((paper-alist (My_lily_parser::paper_description))
+ (let* ((paper-alist
+ (sort (My_lily_parser::paper_description)
+ (lambda (x y) (string<? (car x) (car y)))))
(names (sort (map car paper-alist) string<?))
(contexts (map cdr paper-alist))
(doc (apply string-append
names))
doc)))
+(define (document-all-engraver-properties name)
+ (let*
+ (
+ (ps (sort (map symbol->string all-translation-properties) string<?))
+ (sortedsyms (map string->symbol ps))
+ (propdescs (map document-translator-property sortedsyms))
+ (texi (description-list->texi propdescs))
+ )
+
+ (string-append
+ (node name)
+ (texi-section 1 name #f)
+ texi
+ )))
(let* ((doc (string-append
(document-paper "LilyPond interpretation contexts")
(document-all-engravers "LilyPond engravers")
+ (document-all-engraver-properties "LilyPond context properties")
(document-all-elements "LilyPond backend")
(document-all-interfaces "LilyPond interfaces")
+ (document-all-backend-properties "LilyPond backend properties")
)
)
(name "lilypond-internals")
"LilyPond internals" name "(lilypond.info)"
'(("LilyPond interpretation contexts" . "Hierarchy and grouping of Engravers")
("LilyPond engravers" . "Engravers create Elements")
+ ("LilyPond context properties" . "context properties")
("LilyPond backend" . "Detailed description of all Elements")
- ("LilyPond interfaces" . "Element Interfaces")))
+ ("LilyPond interfaces" . "Element Interfaces")
+ ("LilyPond backend properties" . "Element properties")))
+
+
doc
"\n@bye")
+
; should include default value?
;;; and `objects'.
-(define (elt-property-description symbol type? description)
- (list symbol type? description))
-
(define (lily-interface symbol description props)
(list symbol
description
)
)
-(define (boolean-or-symbol? x) (or boolean? x) (or symbol? x))
-
-(define (uniqued-alist alist acc)
- (if (null? alist) acc
- (if (assoc (caar alist) acc)
- (uniqued-alist (cdr alist) acc)
- (uniqued-alist (cdr alist) (cons (car alist) acc)
- ))))
(define (element-description name . interfaces)
(let* ((ifs (cons general-element-interface interfaces))
(props (map caddr ifs))
- (prop-typep-pairs (map (lambda (x) (cons (car x) (cadr x)))
- (apply append props)))
+; (prop-typep-pairs (map (lambda (x) (cons (car x) (cadr x)))
+; (apply append props)))
(syms (map car ifs))
)
(list (cons 'separator "\n\n\n") ;easy printing.
(cons 'interface-descriptions ifs)
; (cons 'interface-descriptions (cadr merged))
;; description of the element itself?
- (cons 'properties prop-typep-pairs)
+; (cons 'properties prop-typep-pairs)
)))
-
(define general-element-interface
(lily-interface
'general-element-interface
"All elements support this"
- (list
- (elt-property-description 'X-offset-callbacks list? "list of functions, each taking an element and axis argument. The function determine the position relative to this element's parent. The last one in the list is called first")
- (elt-property-description 'Y-offset-callbacks list? "see @code{X-offset-callbacks}")
- (elt-property-description 'X-extent-callback procedure? "procedure taking an element and axis argument, returning a number-pair. The return value is the extent of the element.")
- (elt-property-description 'Y-extent-callback procedure? "see @code{X-extent-callback}")
- (elt-property-description 'font-relative-size integer? "")
- (elt-property-description 'extra-offset number-pair? "pair of reals (a cons) forcing an extra offset before outputting")
- (elt-property-description 'interfaces list? "list of symbols indicating the interfaces supported by this object. Is initialized from the @code{meta} field.")
- (elt-property-description 'dependencies list? "list of score-element pointers that indicate who to compute first for certain global passes")
- (elt-property-description 'no-spacing-rods boolean? "read from elements: boolean that makes Separation_item ignore this item (MOVE ME TO ITEM)")
- (elt-property-description 'extra-extent-X number-pair? "enlarge in X dimension by this much, measured in staff space")
- (elt-property-description 'extra-extent-Y number-pair? "see @code{extra-extent-Y}")
- (elt-property-description 'minimum-extent-X number-pair? "minimum size in X dimension, measured in staff space")
- (elt-property-description 'minimum-extent-Y number-pair? "see @code{minimum-extent-Y}")
- (elt-property-description 'origin ly-input-location? "location in input file of the definition")
- (elt-property-description 'transparent boolean? "This is almost the
-same as setting molecule-callback to #f, but this retains the
-dimensions of this element, which means that you can erase elements
-individually. ")
- (elt-property-description 'molecule-callback procedure? "Function taking graphical element as argument, returning a Scheme encoded Molecule
-
-This function can be called more than once (for instance once for
-computing dimensions, and once for computing the output). Therefore,
-this function should have no side-effects on its argument.
-Caching of computed values is permissible, and generally useful, though.
-
-")
+ '(
+ X-offset-callbacks
+ Y-offset-callbacks
+ X-extent-callback
+ Y-extent-callback
+ font-relative-size
+ extra-offset
+ interfaces
+ dependencies
+ no-spacing-rods
+ extra-extent-X
+ extra-extent-Y
+ minimum-extent-X
+ minimum-extent-Y
+ origin
+ transparent
))
)
(define beam-interface
(lily-interface
'beam-interface
- "A beam. "
- (list
- (elt-property-description 'y-position number? "position of left edge")
- (elt-property-description 'height number? "dy")
- (elt-property-description 'flag-width-function procedure? "")
- (elt-property-description 'damping integer? "amount of beam slope damping should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams ")
- (elt-property-description 'default-neutral-direction dir? "which
-direction to choose if we're in the middle of the staff ")
- (elt-property-description 'thickness number? "weight of beams, in staffspace")
- (elt-property-description 'space-function procedure? "function of type multiplicity -> real (in staffspace)")
- (elt-property-description 'beamed-stem-shorten number? "shorten beamed stems in forced direction")
- (elt-property-description 'height-quants procedure? "function of type (beam staff-line-thickness) -> list of quants. Default value: default-beam-dy-quants.
-")
- (elt-property-description 'vertical-position-quant-function procedure? "
-function of type (beam multiplicity dy staff-line-thickness) -> real. Default value: default-beam-y-quants, also available: beam-traditional-y-quants.
-")
- (elt-property-description 'dir-function procedure? "function of type (count total)->direction. Default value: beam-dir-majority, also available: beam-dir-mean, beam-dir-median.")
- (elt-property-description 'damping number? "damping factor.")
- (elt-property-description 'outer-stem-length-limit number? "catch
-suspect beam slopes, set slope to zero if outer stem is lengthened
-more than this (in staffspace)")
- (elt-property-description 'slope-limit number? "set slope to zero if slope is running away steeper than this.")
+ "A beam.
+
+#'thickness= weight of beams, in staffspace
+ "
+ '(
+ y-position
+ height
+ flag-width-function
+ damping
+ default-neutral-direction
+ thickness
+ space-function
+ beamed-stem-shorten
+ height-quants
+ vertical-position-quant-function
+ damping
+ outer-stem-length-limit
+ slope-limit
)
))
-
(define clef-interface
(lily-interface
'clef-interface
"A clef sign"
- (list
- (elt-property-description 'non-default boolean? "not set because of existence of a bar?")
- (elt-property-description 'full-size-change boolean? "if set, don't make a change clef smaller.")
- (elt-property-description 'glyph string? "a string determining what glyph is typeset")
+ '(
+ non-default
+ full-size-change
+ glyph
))
)
(lily-interface
'axis-group-interface
"a group of coupled elements"
- (list
- (elt-property-description 'axes list? "list of axis (number) in which this group works")
+ '(
+ axes
)))
(define note-column-interface
(lily-interface
'note-column-interface
"Stem and noteheads combined"
- (list
- (elt-property-description 'horizontal-shift integer? "integer that identifies ranking of note-column for horizontal shifting. This is used by @ref{note-collision-interface}")
- (elt-property-description 'force-hshift number? "amount of collision_note_width that overides automatic collision settings. This is used by @ref{note-collision-interface}")
+ '(
+ horizontal-shift
+ force-hshift
))
)
(lily-interface
'stem-interface
"A stem"
- (list
- (elt-property-description 'thickness number? "thickness, measured in stafflinethickness")
- (elt-property-description 'beamed-lengths list? "list of stem lengths given beam multiplicity ")
- (elt-property-description 'beamed-minimum-lengths list? "list of minimum stem lengths given beam multiplicity")
- (elt-property-description 'stem-centered boolean? "Center stems on note heads. Useful for mensural notation")
- (elt-property-description 'lengths list? "Stem length given multiplicity of flag")
- (elt-property-description 'beam ly-element? "pointer to the beam, if applicable")
- (elt-property-description 'stem-shorten list? "shorten stems in forced directions given flag multiplicity")
- (elt-property-description 'duration-log integer? "log of the duration, ie. 0=whole note, 1 = half note, etc.")
- (elt-property-description 'beaming number-pair? "number of beams extending to left and right")
- (elt-property-description 'default-neutral-direction dir? "Where to go if we're in the middle of the staff")
- (elt-property-description 'stem-end-position number? "Where does the stem end (the end is opposite to the support-head")
- (elt-property-description 'support-head ly-element? "the note head at
-one end of the stem")
- (elt-property-description 'heads list? "list of note heads")
- (elt-property-description 'direction dir? "up or down")
- (elt-property-description 'stem-length number? "length of stem")
- (elt-property-description 'style string? "") ; symbol!?
- (elt-property-description 'flag-style string? "") ; symbol!?
- (elt-property-description 'dir-forced boolean? "set if direction has been forced; read by Beam.")
+ '(
+ thickness
+ beamed-lengths
+ beamed-minimum-lengths
+ stem-centered
+ lengths
+ beam
+ stem-shorten
+ duration-log
+ beaming
+ default-neutral-direction
+ stem-end-position
+ support-head
+ heads
+ direction
+ stem-length
+ style
+ flag-style
+ dir-forced
)))
(lily-interface
'slur-interface
"A slur"
- (list
- (elt-property-description 'de-uglify-parameters list? "list of 3 real constants. They define the valid areas for the middle control points. Used in de_uglyfy. They are a bit empirical.")
- (elt-property-description 'details list? "alist containing contaning a few magic constants.")
- (elt-property-description 'attachment pair? "cons of symbols, '(LEFT-TYPE . RIGHT-TYPE), where both types may be alongside-stem, stem, head or loose-end")
- (elt-property-description 'direction dir? "up or down?")
- (elt-property-description 'attachment-offset pair? "cons of offsets, '(LEFT-offset . RIGHT-offset). This offset is added to the attachments to prevent ugly slurs.")
- (elt-property-description 'beautiful number? "number that dictates when a slur should be de-uglyfied. It correlates with the enclosed area between noteheads and slurs. A value of 0.1 yields only undisturbed slurs, a value of 5 will tolerate quite high blown slurs.")
- (elt-property-description 'y-free number? "minimal vertical gap between slur and noteheads or stems")
- (elt-property-description 'control-points list? "[internal] control points of bezier curve")
- (elt-property-description 'extremity-rules list? "an alist (procedure slur dir) -> attachment to determine the attachment (see above). If procedure returns #t, attachment is used. Otherwise, the next procedure is tried.")
- (elt-property-description 'extremity-offset-alist list? "an alist (attachment stem-dir*dir slur-dir*dir) -> offset. The offset adds to the centre of the notehead, or stem.")
- (elt-property-description 'thickness list? "The thickness[stafflinethickness] of slur in the centre.")
- (elt-property-description 'dashed number? "[FIXME: use dash-period/dash length; see text-spanner] number representing the length of the dashes.")
+ '(
+ de-uglify-parameters
+ details
+ attachment
+ direction
+ attachment-offset
+ beautiful
+ y-free
+ control-points
+ extremity-rules
+ extremity-offset-alist
+ thickness
+ dashed
)
)
(define side-position-interface
(lily-interface
'side-position-interface
- "Position a victim object (this one) next to other objects (the support)."
- (list
- (elt-property-description 'side-support list? "the support, a list of score elements")
- (elt-property-description 'direction-source ly-element? "in case side-relative-direction is set, which element to get the direction from ")
- (elt-property-description 'direction dir? "where to put the victim object (left or right?)")
- (elt-property-description 'side-relative-direction dir? "if set: get the direction from a different object, and multiply by this.")
- (elt-property-description 'minimum-space number? "minimum distance that the victim should move (after padding)")
- (elt-property-description 'padding number? "add this much extra space between victim and support")
- (elt-property-description 'self-alignment-X number? "real number: -1 =
-left aligned, 0 = center, 1 right-aligned in X direction.
-
- Set to an element pointer, if you want that element to be the center.
-In this case, the center element should have this object as a
-reference point.
-")
- (elt-property-description 'self-alignment-Y number? "like self-alignment-X but for Y axis")
+ "Position a victim object (this one) next to other objects (the support).
+#'direction = where to put the victim object (left or right?)
+"
+ '(
+ side-support
+ direction-source
+ direction
+ side-relative-direction
+ minimum-space
+ padding
+ self-alignment-X
+ self-alignment-Y
)
))
(lily-interface
'accidentals-interface
"Accidentals"
- (list
- (elt-property-description 'left-padding number? "space left of accs")
- (elt-property-description 'right-padding number? "space right of accs")
+ '(
+ left-padding
+ right-padding
)
))
The columns of a score that form one line. The toplevel element. Any
element has a Line_of_score as both X and Y reference point. The
Paper_score contains one element of this type. Control enters the
-Score_element dependency calculation from this single Line_of_score
+Grob dependency calculation from this single Line_of_score
object."
- (list
- (elt-property-description 'between-system-string string? "string
- to dump between two systems. Useful for forcing pagebreaks")
- (elt-property-description 'spacing-procedure procedure? "procedure taking
-graphical element as argument. This is called after before-line-breaking-callback, but before the actual line breaking itself. Return value is ignored")
- (elt-property-description 'before-line-breaking-callback procedure?
- "Procedure taking graphical element as argument.
-This procedure is called (using dependency resolution) before line breaking, but after generating discretionary items. Return value is ignored")
- (elt-property-description 'after-line-breaking-callback procedure?
- "Procedure taking graphical element as argument.
-This procedure is called (using dependency resolution) after line breaking. Return value is ignored")
- (elt-property-description 'all-elements list? "list of all score elements in this line. Needed for protecting elements from GC.")
- (elt-property-description 'columns list? "list of all paper columns")
+ '(
+ between-system-string
+ spacing-procedure
+ before-line-breaking-callback
+ after-line-breaking-callback
+ all-elements
+ columns
)))
(define note-head-interface
(lily-interface
'note-head-interface
"Note head"
- (list
- (elt-property-description 'style symbol? "symbol that sets note head style")
+ '(
+ style
)
))
(lily-interface
'note-name-interface
"Note name"
- (list
- (elt-property-description 'style symbol? "symbol that sets note name style")
+ '(
+ style
)
))
(lily-interface
'rhythmic-head-interface
"Note head or rest"
- (list
- (elt-property-description 'dot ly-element? "reference to Dots object.")
- (elt-property-description 'stem ly-element? "pointer to Stem object")
- (elt-property-description 'duration-log integer? "2-log of the notehead duration")
+ '(
+ dot
+ stem
+ duration-log
)))
(define rest-interface
(lily-interface
'rest-interface
"a rest"
- (list
- (elt-property-description 'style string? "string specifying glyph style"))))
+ '(style )))
(define tuplet-bracket-interface
(lily-interface
'tuplet-bracket-interface
"A bracket with a number in the middle, used for tuplets."
- (list
- (elt-property-description 'beams list? "list of beam ptrs.")
- (elt-property-description 'columns list? " list of note-columns.")
- (elt-property-description 'number-gap number? "")
- (elt-property-description 'delta-y number? "amount of ascension")
- (elt-property-description 'tuplet-bracket-visibility boolean-or-symbol? "
-This controls the visibility of the tuplet bracket.
-Setting it to false will prevent printing of the
-bracket. Setting the property to #'if-no-beam will make it
-print only if there is no beam associated with this tuplet bracket.")
- (elt-property-description 'tuplet-number-visibility boolean-or-symbol? "
-Like @code{tuplet-bracket-visibility}, but for the number.")
- (elt-property-description 'parallel-beam boolean? "internal: true if there is a beam just as wide as the bracket ")
- (elt-property-description 'thick number? "thickness, in stafflinethickness")
+ '(
+ beams
+ columns
+ number-gap
+ delta-y
+ tuplet-bracket-visibility
+ tuplet-number-visibility
+ parallel-beam
+ thick
)
))
(lily-interface
'align-interface
" Order elements top to bottom/left to right/right to left etc."
- (list
- (elt-property-description 'stacking-dir dir? "stack contents of elements in which direction ?")
- (elt-property-description 'align-dir dir? "Which side to align? -1: left side, 0: around center of width, 1: right side")
- (elt-property-description 'threshold number-pair? "(cons MIN MAX), where MIN and MAX are dimensions in staffspace")
- (elt-property-description 'alignment-done boolean? "boolean to administrate whether we've done the alignment already (to ensure that the process is done only once)")
- (elt-property-description 'center-element ly-element? "element which will be at the
-center of the group after aligning (when using
-Align_interface::center_on_element). ")
- (elt-property-description 'elements list? "to be aligned elements ")
- (elt-property-description 'axes list? "list of axis numbers. Should contain only one number.")
+ '(
+ stacking-dir
+ align-dir
+ threshold
+ alignment-done
+ center-element
+ elements
+ axes
)))
(define aligned-interface
(lily-interface
'aligned-interface
"read by align-interface"
- (list
- (elt-property-description 'minimum-space number-pair? "(cons LEFT RIGHT)")
- (elt-property-description 'extra-space number-pair? "(cons LEFT RIGHT)")
+ '(
+ minimum-space
+ extra-space
)))
(define break-aligned-interface
(lily-interface
'break-aligned-interface
"Items that are aligned in prefatory matter"
- (list
- (elt-property-description 'break-align-symbol symbol? "the index in the spacing table (symbol) of the to be aligned item.")
- (elt-property-description 'visibility-lambda procedure? "a function that takes the break direction and returns a cons of booleans containing (TRANSPARENT . EMPTY)")
- (elt-property-description 'breakable boolean? "boolean indicating if this is a breakable item (clef, barline, key sig, etc.)")
+ '(
+ break-align-symbol
+ visibility-lambda
+ breakable
)))
(define chord-name-interface
(lily-interface
'chord-name-interface
"generate a chord name"
- (list
- (elt-property-description 'pitches list? "list of musical-pitch")
- (elt-property-description 'inversion list? " musical-pitch, optional")
- (elt-property-description 'bass list? " musical-pitch, optional")
- )))
+ '( pitches inversion bass)))
(define time-signature-interface
(lily-interface
'time-signature-interface
"A time signature, in different styles"
- (list
- (elt-property-description 'fraction number-pair? "")
- (elt-property-description 'style string? "")
- )))
+ '( fraction style )))
(define bar-line-interface
(lily-interface
'bar-line-interface
"Bar line"
- (list
- (elt-property-description 'barsize-procedure procedure? "how to compute the size of a bar line")
- (elt-property-description 'kern number? "space after a thick line")
- (elt-property-description 'thin-kern number? "space after a hair-line")
- (elt-property-description 'hair-thickness number? "thickness, measured in stafflinethickness")
- (elt-property-description 'thick-thickness number? "thickness, measured in stafflinethickness")
- (elt-property-description 'glyph string? "what kind barline? A concatenation of |, : and .")
- (elt-property-description 'bar-size number? "")
- (elt-property-description 'break-glyph-function procedure? "function taking glyph and break-direction, returning the glyph at a line break")
- )))
-
-
-
+ '( barsize-procedure kern thin-kern hair-thickness thick-thickness glyph bar-size break-glyph-function )))
(define hairpin-interface
(lily-interface
'hairpin-interface
"hairpin crescendo"
- (list
- (elt-property-description 'grow-direction dir? "crescendo or decrescendo?")
- (elt-property-description 'thickness number? "thickness, measured in stafflinethickness")
- (elt-property-description 'height number? "height, measured in staffspace.")
- (elt-property-description 'padding number? "horizontal padding. This is useful if a crescendo is set next to a text like `mf'")
- )))
+ '( grow-direction thickness height padding )
+ ))
(define arpeggio-interface
(lily-interface
'arpeggio-interface
"Functions and settings for drawing an arpeggio symbol (a wavy line left to noteheads."
- (list
- (elt-property-description 'stems list? "list of stem objects, corresponding to the notes that the arpeggio has to be before.")
- )
+ '(stems)
)
)
"An object that handles collisions between notes with different
stem directions and horizontal shifts. Most of the interesting
properties are to be set in @ref{note-column-interface}"
- (list
- (elt-property-description 'merge-differently-dotted boolean? "
-Merge noteheads in collisions, even if they have a different number of
-dots. This normal notation for some types of polyphonic music. The
-value of this setting is used by @ref{note-collision-interface}
-
-")
- (elt-property-description 'note-width 'number? "unit for horizontal translation, measured in staff-space.")
- ) ) )
+ '(merge-differently-dotted note-width)
+ ))
(define custos-interface
beginning of the 20th century.
[TODO: add to glossary]"
-
- (list
- (elt-property-description 'style string? "a string determining what glyph is
-typeset. Current choices are mensural,
-hufnagel, vaticana and medicaea [TODO: should use symbol] ")
- ))
+
+ '(style)
+)
)
+
(define dot-interface
(lily-interface
'dots-interface
"The dots to go with a notehead/rest. A separate interface, since they
- are a party in collision resolution."
- (list
- (elt-property-description 'direction dir? "Direction to handle staff-line collisions in.")
- (elt-property-description 'dot-count integer? "number of dots")
- )))
+ are a party in collision resolution.
+ #'direction is the Direction to handle staff-line collisions in."
+ '(direction dot-count)
+
+ ))
(define font-interface
(lily-interface
'font-interface
"Any symbol that is typeset through fixed sets of glyphs (ie. fonts)"
- (list
- (elt-property-description 'font-style symbol? "a precooked set of font definitions, eg. finger volta timesig mark script large Large dynamic")
- (elt-property-description 'font-series symbol? "partial font definition: medium, bold")
- (elt-property-description 'font-shape symbol? "partial font definition: upright or italic")
- (elt-property-description 'font-family symbol? "partial font definition: music roman braces dynamic math ...")
- (elt-property-description 'font-name symbol? "partial font definition: base name of font file FIXME: should override other partials")
- (elt-property-description 'font-point-size number? "partial font definition: exact font size in points FIXME: should override font-relative-size")
- (elt-property-description 'font-relative-size number? "partial font definition: the relative size, 0 is style-sheet's normal size, -1 is smaller, +1 is bigger")
- )))
+ '(font-style font-series font-shape font-family font-name
+font-point-size font-relative-size)
+ ))
(define text-interface
(lily-interface
'text-interface
"A scheme markup text"
- (list
- (elt-property-description 'text (lambda (x) (or (string? x) (list? x))) "
-Scheme markup text. It is defined as follows:
-
-@example
-
-TEXT : STRING | (MARKUP SENTENCE)
-MARKUP: PROPERTY | ABBREV
-SENTENCE: TEXT | SENTENCE TEXT
-PROPERTY: (key . value)
-ABBREV: rows lines roman music bold italic named super sub text, or any font-style
-
-@end example
-
-So, TEXT is either a string, or a list of which the CAR is a MARKUP.
-MARKUP is either a CONS: an element property '(key . value) or a symbol:
-a predefined abbreviation for a list of element properties.
-
-
-The following abbreviations are currently defined:
-@table @samp
-@item rows
-horizontal mode: set all text on one line (default)
-@item lines
- vertical mode: set every text on new line
-@item roman
- select roman font
-@item music
- select feta font
-@item bold
- select bold series
-@item italic
- select italic shape
-@item named
- lookup by character name
-@item text
- plain text lookup (by character value)
-@item super
- superscript
-@item sub
- subscript
-@item any font-style
- finger volta timesig mmrest mark script large Large dynamic
-@end table
-" )
- ;; Should move this somewhere else?
- (elt-property-description 'align number? "the alignment of the text, 0 is horizontal, 1 is vertical")
- (elt-property-description 'lookup symbol? "lookup method: 'value for plain text, 'name for character-name")
- (elt-property-description 'raise number? "height for text to be raised (a negative value lowers the text")
- (elt-property-description 'kern number? "amount of extra white space to add before text. This is `relative'(?) to the current alignment.")
- (elt-property-description 'magnify number? "the magnification factor. FIXME: doesn't work for feta fonts")
- )))
+ '(text align lookup raise kern magnify)))
(define dot-column-interface
(lily-interface
'dot-column-interface
"Interface that groups dots so they form a column"
- (list
- )))
+ '( )
+ ))
(define dynamic-interface
(lily-interface
(lily-interface
'grace-alignment-interface
"put grace notes in line"
- (list
- (elt-property-description 'horizontal-space number? "amount of space to add after a note (in staff-space)")
+ '(
+ horizontal-space
)
))
we don't contain any interesting items after linebreaking, then
gracefully commit suicide. Objective: don't disgrace Lily by
typesetting empty lines in orchestral scores."
- (list
- (elt-property-description 'items-worth-living list? "list of interesting items. If empty in a particular system, clear that system.")
+ '(
+ items-worth-living
)))
"A centred hyphen is a simple line between lyrics used to divide
syllables. The length of the hyphen line should stretch based on the
size of the gap between syllables."
- (list
+ '(
- (elt-property-description 'thickness number? "thickness of line (in stafflinethickness)")
- (elt-property-description 'height number? "vertical offset (in staffspace)")
+ thickness
+ height
- (elt-property-description 'minimum-length number? "try to make the hyphens at least this long. Also works as a scaling parameter for the length")
- (elt-property-description 'word-space number? "elongate left by this much (FIXME: cumbersome semantics)")
+ minimum-length
+ word-space
)))
(define key-signature-interface
(lily-interface
'key-signature-interface
"A group of accidentals."
- (list
- (elt-property-description 'c0-position integer? "integer indicating the position of central C")
- (elt-property-description 'old-accidentals list? "list of (pitch, accidental) pairs")
- (elt-property-description 'new-accidentals list? "list of (pitch, accidental) pairs")
+ '(
+ c0-position
+ old-accidentals
+ new-accidentals
)))
(define lyric-extender-interface
'lyric-extender-interface
"The extender is a simple line at the baseline of the lyric
that helps show the length of a melissima (tied/slurred note)."
- (list
- (elt-property-description 'word-space number? "")
- (elt-property-description 'height number? "in stafflinethickness")
- (elt-property-description 'right-trim-amount number? "")
+ '(
+ word-space
+ height
+ right-trim-amount
)))
(lily-interface
'lyric-syllable-interface
"a single piece of lyrics"
- (list
- (elt-property-description 'word-space number? "")
+ '(
+ word-space
)))
(lily-interface
'mark-interface
"a rehearsal mark"
- (list
+ '(
)))
(define multi-measure-rest-interface
"A rest that spans a whole number of measures. For typesetting the
numbers, fields from font-interface may be used.
"
- (list
+ '(
- (elt-property-description 'columns list? "list of paper-columns")
- (elt-property-description 'expand-limit integer? "maximum number of measures expanded in church rests")
- (elt-property-description 'minimum-width number? "minimum-width of rest symbol, in staffspace")
- (elt-property-description 'padding number? "padding between number and rest. Measured in staffspace.")
+ columns
+ expand-limit
+ minimum-width
+ padding
)))
(define paper-column-interface
(lily-interface
'paper-column-interface
""
- (list
- (elt-property-description 'column-space-strength number? "relative strength of space following breakable columns (eg. prefatory matter)")
- (elt-property-description 'before-musical-spacing-factor number?
-"space before musical columns (eg. taken by accidentals) get this much
-stretched when they follow a musical column, in absence of grace
-notes. 0.0 means no extra space (accidentals are ignored)")
- (elt-property-description 'stem-spacing-correction number? "optical correction amount.")
- (elt-property-description 'before-grace-spacing-factor number? " stretch space this much if there are grace notes before the column")
- (elt-property-description 'when moment? "when does this column happen?")
- (elt-property-description 'bounded-by-me list? "list of spanners that have this
-column as start/begin point. Only columns that have elements or act as bounds are spaced.")
- (elt-property-description 'dir-list list? "list of stem directions")
- (elt-property-description 'shortest-playing-duration moment? "duration of the shortest playing in that column.")
- (elt-property-description 'shortest-starter-duration moment? "duration of the shortest notes that starts exactly in this column.")
- (elt-property-description 'contains-grace boolean? "Used to widen entries for grace notes.")
- (elt-property-description 'extra-space number-pair? "pair of distances")
- (elt-property-description 'stretch-distance number-pair? "pair of distances")
+ '(
+ column-space-strength
+ before-musical-spacing-factor
+ stem-spacing-correction
+ before-grace-spacing-factor
+ when
+ bounded-by-me
+ dir-list
+ shortest-playing-duration
+ shortest-starter-duration
+ contains-grace
+ extra-space
+ stretch-distance
)))
(define spaceable-element-interface
'spaceable-element-interface
"An element (generally a Paper_column) that takes part in the
spacing problem. "
- (list
- (elt-property-description 'minimum-distances list? "list of rods (ie. (OBJ . DIST) pairs)")
- (elt-property-description 'ideal-distances list? "(OBJ . (DIST . STRENGTH)) pairs")
- (elt-property-description 'dir-list list? "list of stem directions, needed for optical spacing correction.")
+ '(
+ minimum-distances
+ ideal-distances
+ dir-list
)))
(define rest-collision-interface
'rest-collision-interface
"Move around ordinary rests (not multi-measure-rests) to avoid
conflicts."
- (list
- (elt-property-description 'maximum-rest-count integer? "kill off rests so we don't more than this number left.")
- (elt-property-description 'minimum-distance number? "minimum distance between notes and rests.")
- (elt-property-description 'elements list? "list of elements (NoteColumn,
-generally) participating in the collision. The
-@code{rest-collision} property in @code{elements} is set
-to a pointer to the collision")
+ '(
+ maximum-rest-count
+ minimum-distance
+ elements
)))
(define script-interface
(lily-interface
'script-interface
""
- (list
- (elt-property-description 'script-priority number? "A sorting key that determines in what order a script is within a stack of scripts")
+ '(
+ script-priority
)))
(define script-column-interface
(lily-interface
'script-column-interface
"An interface that sorts scripts according to their @code{script-priority}"
- (list )))
+ '( )))
(define spacing-spanner-interface
(lily-interface
'spacing-spanner-interface
- ""
- (list
- (elt-property-description 'maximum-duration-for-spacing moment? "space as if a duration of this type is available in this measure.")
- (elt-property-description 'arithmetic-basicspace number? "The space taken by a note is determined by the formula
+ " SPACE = arithmetic_multiplier * ( C + log2 (TIME) ))
+The space taken by a note is determined by the formula
- SPACE = arithmetic_multiplier * ( C + log2 (TIME) ))
+
where TIME is the amount of time a note occupies. The value of C is
chosen such that the smallest space within a measure is
arithmetic_basicspace = 4.;
-@end example
-")
- (elt-property-description 'arithmetic-multiplier number? "see arithmetic-basicspace")
+@end example"
+ '(
+ maximum-duration-for-spacing
+ arithmetic-basicspace
+ arithmetic-multiplier
)))
'staff-symbol-interface
"This spanner draws the lines of a staff. The middle line is
position 0."
- (list
- (elt-property-description 'staff-space number? "Amount of line leading relative to global staffspace")
- (elt-property-description 'line-count integer? "Number of staff lines")
+ '(
+ staff-space
+ line-count
)))
(define stem-tremolo-interface
(lily-interface
'stem-tremolo-interface
""
- (list
- (elt-property-description 'stem ly-element? "pointer to the stem object.")
- (elt-property-description 'beam-width number? "width of the tremolo sign")
- (elt-property-description 'beam-thickness number? "thickness, measured in staffspace")
- (elt-property-description 'beam-space-function procedure? "function returning space given multiplicity")
+ '(
+ stem
+ beam-width
+ beam-thickness
+ beam-space-function
)))
(define separation-item-interface
an item to get dependencies correct. It can't be an element_group
since these usually are in a different X_group
"
- (list
- (elt-property-description 'elements list? " -- list of items.")
+ '(
+ elements
)))
(define sustain-pedal-interface
(lily-interface
'sustain-pedal-interface
""
- (list
+ '(
)))
-(define system-start-delimiter
+(define system-start-delimiter-interface
(lily-interface
- 'system-start-delimiter
- ""
- (list
- (elt-property-description 'collapse-height number? "")
- (elt-property-description 'thickness number? "thickness, measured in stafflinethickness")
-
- ; Should collapse into (bracket . ((height . ) ... ))
- ;
- (elt-property-description 'arch-height number? "")
- (elt-property-description 'arch-angle number? "")
- (elt-property-description 'arch-thick number? "")
- (elt-property-description 'arch-width number? "")
- (elt-property-description 'bracket-thick number? "")
- (elt-property-description 'bracket-width number? "")
- (elt-property-description 'glyph symbol? "bar-line, bracket or brace")
- )))
+ 'system-start-delimiter-interface
+ "#'style can be bar-line, bracket or brace"
+ '(collapse-height thickness arch-height arch-angle arch-thick
+ arch-width bracket-thick bracket-width glyph )))
(define text-spanner-interface
(lily-interface
'text-spanner-interface
"generic text spanner"
- (list
- (elt-property-description 'dash-period number? "the length of one dash + white space")
- (elt-property-description 'dash-length number? "the length of a dash")
- (elt-property-description 'line-thickness number? "the thickness[stafflinethickness] of the line")
- (elt-property-description 'edge-height pair? "a cons that specifies the heights of the vertical egdes '(LEFT-height . RIGHT-height)")
- (elt-property-description 'edge-text pair? "a cons that specifies the texts to be set at the edges '(LEFT-text . RIGHT-text)")
- (elt-property-description 'type string? "one of: line, dashed-line or dotted-line") ; SYMBOL!!?
+ '(
+ dash-period
+ dash-length
+ line-thickness
+ edge-height
+ edge-text
+ type
)
))
(define tie-interface
(lily-interface
'tie-interface
- "A tie connecting two noteheads."
- (list
- (elt-property-description 'staffline-clearance number? "don't get closer than this to stafflines.")
- (elt-property-description 'control-points list? "List of 4 offsets (number-pairs) controlling the tie shape")
- (elt-property-description 'heads pair? "pair of element pointers, pointing to the two heads of the tie. ")
- (elt-property-description 'details list? "alist of parameters for the curve shape")
- (elt-property-description 'thickness number? "thickness, measured in stafflinethickness")
- (elt-property-description 'x-gap number? "horizontal gap between notehead and tie")
- (elt-property-description 'direction dir? "up or down?")
- (elt-property-description 'minimum-length number? "minimum length in staffspace")
+ "A tie connecting two noteheads.
+direction = Forced direction for all ties"
+
+ '(
+ staffline-clearance
+ control-points
+ heads
+ details
+ thickness
+ x-gap
+ direction
+ minimum-length
)))
(lily-interface
'tie-column-interface
"that sets tie directions in a tied chord"
- (list
- (elt-property-description 'direction dir? "Forced direction for all ties")
- )))
+ '(direction)
+ ))
(define volta-bracket-interface
(lily-interface
'volta-bracket-interface
"Volta bracket with number"
- (list
- (elt-property-description 'bars list? "list of barline ptrs.")
- (elt-property-description 'thickness number? "thickness, measured in stafflinethickness")
- (elt-property-description 'height number? "in staffspace ")
+ '(
+ bars
+ thickness
+ height
)))
(define span-bar-interface
(lily-interface
'span-bar-interface
""
- (list
+ '(
)))
+
+
+
(define (number-pair? x)
(and (pair? x) (number? (car x)) (number? (cdr x))))
+(define (boolean-or-symbol? x) (or boolean? x) (or symbol? x))
+(define (number-or-string? x) (or (number? x) (string? x)))
+(define markup?
+ (lambda (x) (or (string? x) (list? x))))
+
+
+;; ugh: code dup ; merge.
(define (object-type obj)
(cond
((dir? obj) "direction")
((number-pair? obj) "pair of numbers")
((ly-input-location? obj) "input location")
- ((ly-element? obj) "graphic element")
+ ((ly-grob? obj) "graphic element")
((pair? obj) "pair")
((integer? obj) "integer")
((list? obj) "list")
((eq? predicate dir?) "direction")
((eq? predicate number-pair?) "pair of numbers")
((eq? predicate ly-input-location?) "input location")
- ((eq? predicate ly-element?) "graphic element")
+ ((eq? predicate ly-grob?) "graphic element")
((eq? predicate pair?) "pair")
((eq? predicate integer?) "integer")
((eq? predicate list?) "list")
))
+(define (uniqued-alist alist acc)
+ (if (null? alist) acc
+ (if (assoc (caar alist) acc)
+ (uniqued-alist (cdr alist) acc)
+ (uniqued-alist (cdr alist) (cons (car alist) acc)
+ ))))
+
+
;; The regex module may not be available, or may be broken.
(define use-regex
(let ((os (string-downcase (vector-ref (uname) 0))))
)
)
-(begin
- (eval-string (ly-gulp-file "interface.scm"))
- (eval-string (ly-gulp-file "beam.scm"))
- (eval-string (ly-gulp-file "slur.scm"))
- (eval-string (ly-gulp-file "font.scm"))
- (eval-string (ly-gulp-file "auto-beam.scm"))
- (eval-string (ly-gulp-file "generic-property.scm"))
- (eval-string (ly-gulp-file "basic-properties.scm"))
- (eval-string (ly-gulp-file "chord-name.scm"))
- (eval-string (ly-gulp-file "element-descriptions.scm"))
- )
;;
)
))
+
+(begin
+ (eval-string (ly-gulp-file "backend-property.scm"))
+ (eval-string (ly-gulp-file "translator-properties.scm"))
+ (eval-string (ly-gulp-file "interface.scm"))
+ (eval-string (ly-gulp-file "beam.scm"))
+ (eval-string (ly-gulp-file "slur.scm"))
+ (eval-string (ly-gulp-file "font.scm"))
+ (eval-string (ly-gulp-file "auto-beam.scm"))
+ (eval-string (ly-gulp-file "generic-property.scm"))
+ (eval-string (ly-gulp-file "basic-properties.scm"))
+ (eval-string (ly-gulp-file "chord-name.scm"))
+ (eval-string (ly-gulp-file "element-descriptions.scm"))
+ )
-(define (number-or-string? x) (or (number? x) (string? x)))
+
(define (engraver-description name description created-elts properties)
(list name description created-elts properties)
)
-(define (translator-property-description symbol type? description)
- (list symbol type? description)
- )
(define engraver-description-alist
(list
"Stem_engraver"
"Create stems and single-stem tremolos"
'(Stem StemTremolo)
- (list
- (translator-property-description 'tremoloFlags integer? "")
- (translator-property-description 'stemLeftBeamCount integer? "
-Specify the number of beams to draw on the left side of the next note.
-Overrides automatic beaming. The value is only used once, and then it
-is erased.
-")
- (translator-property-description 'stemRightBeamCount integer? "idem, for the right side")
+ '(
+ tremoloFlags
+ stemLeftBeamCount
+ stemRightBeamCount
)))
(cons
"Hyphen_engraver"
"Create lyric hyphens"
'(LyricHyphen)
- (list
+ '(
)))
(cons
"Extender_engraver"
"Create lyric extenders"
'(LyricExtender)
- (list
+ '(
)))
"Separating_line_group_engraver"
"Generates objects for computing spacing parameters."
'(SeparationItem SeparatingGroupSpanner)
- (list
+ '(
)))
(cons
"Axis_group_engraver"
"Group all objects created in this context in a VerticalAxisGroup spanner."
'(VerticalAxisGroup)
- (list
- (translator-property-description
- 'CONTEXTNAMEVerticalExtent number-pair? "hard coded vertical extent.
-The format is a pair of dimensions, for example, this sets the sizes
-of a staff to 10 (5+5) staffspaces high.
-
-@example
-\property Staff.StaffVerticalExtent = #(-5.0 . 5.0)
-@end example
-
- [fixme, naming]")
- (translator-property-description
- 'CONTEXTNAMEMinimumVerticalExtent number-pair?
- "minimum vertical extent, same format as CONTEXTNAMEVerticalExtent [fixme, naming]")
- (translator-property-description
- 'CONTEXTNAMExtraVerticalExtent number-pair?
- "extra vertical extent, same format
-CONTEXTNAMEMinimumVerticalExtent [fixme, naming]") )))
+ '(CONTEXTNAMEVerticalExtent CONTEXTNAMEMinimumVerticalExtent CONTEXTNAMExtraVerticalExtent)
+ ))
(cons
'Hara_kiri_engraver
with note heads), this needs to be in a context higher than Tie_engraver.
(FIXME)."
'(Accidentals)
- (list
- (translator-property-description 'localKeySignature list? "the key signature at this point in the measure")
- (translator-property-description 'forgetAccidentals boolean? "do
-not set localKeySignature when a note alterated differently from
-localKeySignature is found.
-
-Causes accidentals to be printed at every note instead of
-remembered for the duration of a measure.
-")
- (translator-property-description 'noResetKey boolean? "Do not
-reset local key to the value of keySignature at the start of a measure,
-as determined by measurePosition.
-
-Do not reset the key at the start of a measure. Accidentals will be
-printed only once and are in effect until overridden, possibly many
-measures later.
-")
+ '(
+ localKeySignature
+ forgetAccidentals
+ noResetKey
)))
"Volta_engraver"
"Make volta brackets"
'(VoltaBracket)
- (list
- (translator-property-description 'repeatCommands list?
- "This property is read to find any command of the form (volta . X), where X is a string or #f")
- (translator-property-description 'voltaSpannerDuration moment?
- "maximum duration of the volta bracket.
-
- Set to a duration to control the size of the brackets printed by
-@code{\alternative}. It specifies the number of whole notes duration
-to use for the brackets. This can be used to shrink the length of
-brackets in the situation where one alternative is very large. It may
-have odd effects if the specified duration is longer than the music
-given in an @code{\alternative}.
-")
- )
+ '(repeatCommands voltaSpannerDuration)
))
(cons
"Clef_engraver"
"Determine and set reference point for pitches"
'(Clef OctavateEight)
- (list
- (translator-property-description 'clefPosition number? "Where should the center of the symbol go?")
- (translator-property-description 'clefGlyph string? "Name of the symbol within the music font")
- (translator-property-description 'centralCPosition number? "Place of the central C. Usually determined by looking at clefPosition and clefGlyph.")
- (translator-property-description 'clefOctavation integer? "Add
-this much extra octavation. Values of 7 and -7 are common.")
- (translator-property-description 'explicitClefVisibility procedure? "visibility-lambda function for clef changes.")
- (translator-property-description 'clefPitches list? "an alist mapping GLYPHNAME to the position of the central C for that symbol")
+ '(
+ clefPosition
+ clefGlyph
+ centralCPosition
+ clefOctavation
+ explicitClefVisibility
+ clefPitches
)))
"A2_engraver"
"Part combine engraver for orchestral scores."
'(TextScript)
- (list
- (translator-property-description 'combineParts boolean? "try to combine parts?")
- (translator-property-description 'soloADue boolean? "set Solo/A due texts?")
- (translator-property-description 'soloText string? "text for begin of solo")
- (translator-property-description 'soloIIText string? "text for begin of solo for voice ``two''")
- (translator-property-description 'aDueText string? "text for begin of a due")
- (translator-property-description 'split-interval number-pair? "always split into two voices for contained intervals")
- (translator-property-description 'unison boolean? "set if unisono is detected ")
- (translator-property-description 'solo boolean? "set if solo is detected")
- (translator-property-description 'unisilence boolean? "set if unisilence is detected")
- (translator-property-description 'unirhythm boolean? "set if unirhythm is detected")
+ '(
+ combineParts
+ soloADue
+ soloText
+ soloIIText
+ aDueText
+ split-interval
+ unison
+ solo
+ unisilence
+ unirhythm
)))
(cons
"Align_note_column_engraver"
"Generate object to put grace notes from left to right."
'(GraceAlignment)
- (list
+ '(
- (translator-property-description 'graceAlignPosition dir? "put the grace note before or after the main note?")
- (translator-property-description 'graceAccidentalSpace number? "amount space to alot for an accidental")
+ graceAlignPosition
+ graceAccidentalSpace
)))
(cons
"Arpeggio_engraver"
"Generate an Arpeggio from a Arpeggio_req"
'(Arpeggio)
- (list
+ '(
)))
(cons
"
'(
Beam)
- (list
- (translator-property-description 'noAutoBeaming boolean? " If set to true then beams are not generated automatically.
-")
- (translator-property-description 'autoBeamSettings list? "
-Specifies when automatically generated beams should begin and end. The elements have the format:
-
-@example
-
- function shortest-duration-in-beam time-signature
-
-where
-
- function = begin or end
- shortest-duration-in-beam = numerator denominator; eg: 1 16
- time-signature = numerator denominator, eg: 4 4
-
-unspecified or wildcard entries for duration or time-signature
-are given by * *
-
-The user can override beam begin or end time by pushing a wildcard entries
-'(begin * * * *) or '(end * * * *) resp., eg:
-
- \property Voice.autoBeamSettings \push #'(end * * * *) = #(make-moment 1 4)
-
-The head of the list:
- '(
- ((end * * 3 2) . ,(make-moment 1 2))
- ((end 1 16 3 2) . ,(make-moment 1 4))
- ((end 1 32 3 2) . ,(make-moment 1 8))
- ...
- )
-
-@end example"))))
+ '(
+ noAutoBeaming
+ autoBeamSettings)))
(cons
'Bar_engraver
"Create barlines. This engraver is controlled through the
@code{whichBar} property. If it has no bar line to create, it will forbid a linebreak at this point"
'(BarLine)
- (list
- (translator-property-description 'whichBar string? "This property is read to determine what type of barline to create.
-Example:
-@example
-\\property Staff.whichBar = \"|:\"
-@end example
-will create a start-repeat bar in this staff only
-")
- (translator-property-description 'staffsFound list? "list of all staff-symbols found.")
+ '(
+ whichBar
+ staffsFound
)))
"A bar number is created whenever measurePosition is zero. It is
put on top of all staffs, and appears only at left side of the staff."
'(BarNumber)
- (list
- (translator-property-description 'currentBarNumber integer? "this is read to determine
- the number to put on the bar ")
+ '(
+ currentBarNumber
)))
"Handles Beam_requests by engraving Beams. If omitted, then notes will be
printed with flags instead of beams."
'(Beam)
- (list
- (translator-property-description 'beamMelismaBusy boolean? "Signal if a beam is set when automaticMelismata is set")
+ '(
+ beamMelismaBusy
)))
(cons
"Break_align_engraver"
"Align graphic elements with corresponding break-align-symbols into groups, and order the groups according to breakAlignOrder"
'(BreakAlignment BreakAlignGroup LeftEdge)
- (list
- (translator-property-description 'breakAlignOrder list?
- "Defines the order in which
-prefatory matter (clefs, key signatures) appears, eg. this puts the
-key signatures after the bar lines:
-
-@example
- \\property Score.breakAlignOrder = #'(
- Span_bar
- Breathing_sign
- Clef_item
- Staff_bar
- Key_item
- Time_signature
- )
-@end example
-")
+ '(
+ breakAlignOrder
+
)))
"Breathing_sign_engraver"
""
'(BreathingSign)
- (list
+ '(
)))
"Catch Note_req's, Tonic_reqs, Inversion_reqs, Bass_req
and generate the appropriate chordname."
'(ChordName)
- (list
- (translator-property-description 'chordInversion boolean? " Determines whether LilyPond should look for chord inversions when
- translating from notes to chord names. Set to 1 to find
- inversions. The default is 0 which does not look for
- inversions.")
- (translator-property-description 'drarnChords boolean? "")
+ '(
+ chordInversion
+ drarnChords
)))
"Chord_tremolo_engraver"
"Generates beams for the \repeat X tremolo ... construct"
'(Beam)
- (list
+ '(
)))
""
'(NoteCollision
)
- (list
+ '(
)))
(cons
"Custos_engraver"
""
'(Custos)
- (list
+ '(
)))
"
'(DotColumn
)
- (list
+ '(
)))
'(DynamicLineSpanner
DynamicText Crescendo
TextSpanner)
- (list
+ '(
)))
"Grace_position_engraver"
"Attach a grace note alignment to a note-column "
'()
- (list
+ '(
)))
(cons
"Grace_engraver_group"
"An engraver that creates a `shielded' context-tree with separate notion of time"
'()
- (list
+ '(
)))
@code{Staff.instrument} and @code{Staff.instr}) at the left of the
staff."
'(InstrumentName)
- (list
- (translator-property-description 'instrument string? " If @code{Instrument_name_engraver}
-@cindex Instrument_name_engraver
- is
- added to the Staff translator, then the @code{instrument} property
- is used to label the first line of the staff and the @code{instr}
- property is used to label subsequent lines. If the
- @code{midiInstrument} property is not set, then @code{instrument}
- is used to determine the instrument for MIDI output.")
- (translator-property-description 'instr string? "see @code{instrument}")
+ '(
+ instrument
+ instr
)))
(cons
"Engraver_group_engraver"
"A group of engravers taken together"
'()
- (list
+ '(
)))
(cons
""
'(KeySignature
)
- (list
+ '(
- (translator-property-description 'keySignature list? "")
- (translator-property-description 'keyOctaviation boolean? "")
- (translator-property-description 'explicitKeySignatureVisibility procedure? "")
- (translator-property-description 'createKeyOnClefChange boolean? "")
- (translator-property-description 'keyAccidentalOrder list? "")
- (translator-property-description 'keySignature list? "")
+ keySignature
+ keyOctaviation
+ explicitKeySignatureVisibility
+ createKeyOnClefChange
+ keyAccidentalOrder
+ keySignature
)))
(cons 'Lyric_engraver
"Lyric_engraver"
""
'()
- (list
+ '(
;; FIXME
)))
"Lyric_phrasing_engraver"
""
'()
- (list
- (translator-property-description 'automaticPhrasing boolean? "")
- (translator-property-description 'weAreGraceContext boolean? "")
- (translator-property-description 'melismaEngraverBusy boolean? "")
- (translator-property-description 'associatedVoice string? "")
- (translator-property-description 'phrasingPunctuation string? "")
+ '(
+ automaticPhrasing
+ weAreGraceContext
+ melismaEngraverBusy
+ associatedVoice
+ phrasingPunctuation
)))
(cons
"Mark_engraver"
""
'(RehearsalMark)
- (list
+ '(
- (translator-property-description 'rehearsalMark number-or-string? "")
- (translator-property-description 'staffsFound list? "")
+ rehearsalMark
+ staffsFound
)))
"Melisma_engraver"
""
'()
- (list
+ '(
- (translator-property-description 'melismaBusy boolean? "")
- (translator-property-description 'slurMelismaBusy boolean? "")
- (translator-property-description 'tieMelismaBusy boolean? "")
- (translator-property-description 'beamMelismaBusy boolean? "")
+ melismaBusy
+ slurMelismaBusy
+ tieMelismaBusy
+ beamMelismaBusy
)))
measurePosition and currentBarNumber to determine what number to print over the MultiMeasureRest
"
'(MultiMeasureRest)
- (list
+ '(
)))
"Note_heads_engraver"
"Generate one or more noteheads from Music of type Note_req."
'(NoteHead Dots)
- (list
+ '(
)))
"Note_name_engraver"
""
'(NoteName)
- (list
+ '(
)))
"Interpret Music of Output_property type, and apply a function
to any Graphic objects that satisfies the predicate."
'()
- (list
+ '(
)))
"Piano_pedal_engraver"
"engrave Piano pedals symbols."
'(SostenutoPedal SustainPedal UnaChordaPedal)
- (list
+ '(
- (translator-property-description 'startSustain string? "")
- (translator-property-description 'stopSustain string? "")
- (translator-property-description 'stopStartSustain string? "")
- (translator-property-description 'startUnaChorda string? "")
- (translator-property-description 'stopUnaChorda string? "")
+ startSustain
+ stopSustain
+ stopStartSustain
+ startUnaChorda
+ stopUnaChorda
)))
(cons
Set the position field of all note heads to zero. This useful for
making a single line staff that demonstrates the rhythm of a melody."
'()
- (list
- (translator-property-description 'squashedPosition integer? " Vertical position of
-squashing.")
+ '(
+ squashedPosition
)))
(cons
Due to CPU and memory requirements, the use of this engraver is deprecated."
'()
- (list
- (translator-property-description 'Generic_property_list list? "description of the conversion.
-
-Defines names and types for generic properties. These are properties
-than can be plugged into the backend directly. See the init file
-@file{generic-property.scm} for details. For internal use only,
-deprecated.
-")
- )))
+ '(Generic_property_list)
+ ))
(cons
"Acknowledge repeated music, and convert the contents of
repeatCommands ainto an appropriate setting for whichBar"
'()
- (list
- (translator-property-description 'repeatCommands list? "")
- (translator-property-description 'whichBar string? "")
+ '(
+ repeatCommands
+ whichBar
)))
"Rest_collision_engraver"
"Handles collisions of rests."
'(RestCollision)
- (list
+ '(
)))
"Rest_engraver"
""
'(Rest Dots)
- (list
+ '(
)))
"Rhythmic_column_engraver"
"Generates NoteColumn, an objects that groups stems, noteheads and rests."
'(NoteColumn)
- (list
+ '(
)))
"Script_column_engraver"
""
'(ScriptColumn)
- (list
+ '(
)))
" Handles note ornaments generated by @code{\script}.
"
'(Script)
- (list
- (translator-property-description 'scriptDefinitions list? "
-Description of scripts to use. (fixme)
-")
-
- (translator-property-description 'scriptHorizontal boolean? " Put scripts left or right of note heads. Support for this is
- limited. Accidentals will collide with scripts.
-
-")
+ '(
+ scriptDefinitions
+ scriptHorizontal
)))
(cons
"
'(LineOfScore PaperColumn NonMusicalPaperColumn)
- (list
- (translator-property-description 'currentMusicalColumn ly-element? "")
- (translator-property-description 'currentCommandColumn ly-element? "")
+ '(
+ currentMusicalColumn
+ currentCommandColumn
)))
(cons 'Skip_req_swallow_translator
"Skip_req_swallow_translator"
""
'()
- (list
+ '(
;; FIXME
)))
"Build slurs from Slur_reqs"
'(Slur)
- (list
- (translator-property-description 'slurBeginAttachment symbol? "translates to the car of Slur.element-property 'attachment.")
- (translator-property-description 'slurEndAttachment symbol? "translates to the cdr of Slur.element-property 'attachment.")
- (translator-property-description 'slurMelismaBusy boolean? "Signal a slur if automaticMelismata is set")
+ '(
+ slurBeginAttachment
+ slurEndAttachment
+ slurMelismaBusy
)))
"Spacing_engraver"
"make a SpacingSpanner and do bookkeeping of shortest starting and playing notes "
'(SpacingSpanner)
- (list
+ '(
)))
"Span_arpeggio_engraver"
""
'(Arpeggio)
- (list
- (translator-property-description 'connectArpeggios boolean? " If
-set, connect all arpeggios that are found. In this way, you can make
-arpeggios that cross staffs.
-")
+ '(
+ connectArpeggios
)))
bar lines, and draws a single span-bar across them."
'(SpanBar)
- (list
+ '(
)))
"Staff_symbol_engraver"
"create the constellation of five (default) staff lines."
'(StaffSymbol)
- (list
+ '(
)))
""
'(StanzaNumber
)
- (list
- (translator-property-description 'stz string? "")
- (translator-property-description 'stanza string? "Stanza `number' to print at start of a verse")
+ '(
+ stz
+ stanza
)))
"System_start_delimiter_engraver"
"creates a SystemStartDelimiter spanner"
'(SystemStartDelimiter)
- (list
+ '(
)))
"Text_engraver"
"Create text-scripts"
'(TextScript)
- (list
- (translator-property-description 'scriptHorizontal boolean? " Put scripts left or right of note heads. Support for this is
- limited. Accidentals will collide with scripts.
-
-")
- (translator-property-description 'textNonEmpty boolean? " If set
-to true then text placed above or below the staff is not assumed to
-have zero width. @code{fatText} and @code{emptyText} are predefined
-settings.
-")
+ '(
+ scriptHorizontal
+ textNonEmpty
)))
"Text_spanner_engraver"
"Create text spanner from a Span_req "
'(TextSpanner)
- (list
+ '(
)))
"Tie_engraver"
"Generate ties between noteheads of equal pitch."
'(Tie TieColumn)
- (list
-
-
- (translator-property-description 'sparseTies boolean? "only create one tie per chord.")
- (translator-property-description 'tieMelismaBusy boolean? "Signal ties when automaticMelismata is set")
+ '(sparseTies
+ tieMelismaBusy
)))
"Time_signature_engraver"
"Create a TimeSignature whenever @code{timeSignatureFraction} changes"
'(TimeSignature)
- (list
+ '(
)))
this engraver should be removed from @code{Score} and placed in
@code{Staff}."
'()
- (list
- (translator-property-description 'timeSignatureFraction number-pair? "
-pair of numbers, signifying the time signature. For example #'(4 . 4) is a 4/4time signature.")
- (translator-property-description 'barCheckNoSynchronize boolean?
-"If set, don't reset measurePosition when finding a bbarcheck. This
-makes bar-checks for polyphonic music easier.")
-
- (translator-property-description 'barNonAuto boolean? " If set to true then bar lines will not be printed
- automatically; they must be explicitly created with @code{\bar}
- keywords. Unlike with the @code{\cadenza} keyword, measures are
- still counted. Bar generation will resume according to that
- count if this property is set to zero.
-")
- (translator-property-description 'whichBar string? "if not set
-explicitly (by \property or \bar), this is set according to values of
-defaultBarType, barAlways, barNonAuto and measurePosition.
- ")
-
- (translator-property-description 'barAlways boolean? " If set to true a bar line is drawn after each note.
-")
- (translator-property-description 'defaultBarType string? "Sets the default type of bar line. Available bar types: [FIXME]
-")
- (translator-property-description 'skipBars boolean? " Set to true to skip the empty bars that are produced by
- multimeasure notes and rests. These bars will not appear on the
- printed output. If not set (the default) multimeasure
- notes and rests expand into their full length, printing the appropriate
- number of empty bars so that synchronization with other voices is
- preserved.
-
-@c my @vebatim patch would help...
-@example
-@@lilypond[fragment,verbatim,center]
-r1 r1*3 R1*3\property Score.skipBars=1 r1*3 R1*3
-
-@@end lilypond
-@end example
-
-")
- (translator-property-description 'timing boolean? " Keep administration of measure length, position, bar number, etc?
-Switch off for cadenzas.")
- (translator-property-description 'oneBeat moment? " How long does one beat in the current time signature last?")
- (translator-property-description 'measureLength moment? " How long does one measure in the current time signature last?")
- (translator-property-description 'measurePosition moment? "
- How much of the current measure (measured in whole notes) have we had?
-")
- (translator-property-description 'currentBarNumber integer? "Contains the current barnumber. This property is incremented at
-every barline.
-")
+ '(
+ timeSignatureFraction
+ barCheckNoSynchronize
+ barNonAuto
+ whichBar
+ barAlways
+ defaultBarType
+ skipBars
+ timing
+ oneBeat
+ measureLength
+ measurePosition
+ currentBarNumber
)))
"Catch Time_scaled_music and generate appropriate bracket "
'(
TupletBracket)
- (list
- (translator-property-description 'tupletSpannerDuration moment? "
-Normally a tuplet bracket is as wide as the
-@code{\times} expression that gave rise to it. By setting this
-property, you can make brackets last shorter. Example
-
-@example
-@@lilypond[verbatim,fragment]
-\context Voice \times 2/3 @{
- \property Voice.tupletSpannerDuration = #(make-moment 1 4)
- [c8 c c] [c c c]
-@}
-@@end lilypond
-@end example
-")
- (translator-property-description 'tupletInvisible boolean? "
- If set to true, tuplet bracket creation is switched off
-entirely. This has the same effect as setting both
-@code{tupletNumberVisibility} and @code{tupletBracketVisibility} to
-@code{#f}, but as this does not even create elements, this setting
-uses less memory and time.")
+ '(
+ tupletSpannerDuration
+ tupletInvisible
)))
"Vertical_align_engraver"
"Catch Vertical axis groups and stack them."
'(VerticalAlignment)
- (list
+ '(
)))
"Voice_devnull_engraver"
"Kill off certain items and spanners if we're Voice `two' and unison or unisilence is set."
'()
- (list
+ '(
)))
))
-
+(set! engraver-description-alist
+ (sort engraver-description-alist alist<?))
(define context-description-alist
'(
")
)
)
+
+(set! context-description-alist
+ (sort context-description-alist alist<?))
+
--- /dev/null
+
+(define all-translation-properties '())
+
+(define (translator-property-description symbol type? description)
+ (set-object-property! symbol 'translation-type? type?)
+ (set-object-property! symbol 'translation-doc description)
+ (set! all-translation-properties (cons symbol all-translation-properties))
+ )
+
+(translator-property-description 'tremoloFlags integer? "")
+(translator-property-description 'stemLeftBeamCount integer? "
+Specify the number of beams to draw on the left side of the next note.
+Overrides automatic beaming. The value is only used once, and then it
+is erased.
+")
+(translator-property-description 'stemRightBeamCount integer? "idem, for the right side")
+(translator-property-description
+ 'CONTEXTNAMEVerticalExtent number-pair? "hard coded vertical extent.
+The format is a pair of dimensions, for example, this sets the sizes
+of a staff to 10 (5+5) staffspaces high.
+
+@example
+\property Staff.StaffVerticalExtent = #(-5.0 . 5.0)
+@end example
+
+ [fixme, naming]")
+(translator-property-description 'CONTEXTNAMEMinimumVerticalExtent number-pair?
+ "minimum vertical extent, same format as CONTEXTNAMEVerticalExtent [fixme, naming]")
+(translator-property-description 'CONTEXTNAMExtraVerticalExtent number-pair?
+ "extra vertical extent, same format
+CONTEXTNAMEMinimumVerticalExtent [fixme, naming]")
+(translator-property-description 'localKeySignature list? "the key signature at this point in the measure")
+(translator-property-description 'forgetAccidentals boolean? "do
+not set localKeySignature when a note alterated differently from
+localKeySignature is found.
+
+Causes accidentals to be printed at every note instead of
+remembered for the duration of a measure.
+")
+(translator-property-description 'noResetKey boolean? "Do not
+reset local key to the value of keySignature at the start of a measure,
+as determined by measurePosition.
+
+Do not reset the key at the start of a measure. Accidentals will be
+printed only once and are in effect until overridden, possibly many
+measures later.
+")
+(translator-property-description 'repeatCommands list?
+ "This property is read to find any command of the form (volta . X), where X is a string or #f")
+(translator-property-description 'voltaSpannerDuration moment?
+ "maximum duration of the volta bracket.
+
+ Set to a duration to control the size of the brackets printed by
+@code{\alternative}. It specifies the number of whole notes duration
+to use for the brackets. This can be used to shrink the length of
+brackets in the situation where one alternative is very large. It may
+have odd effects if the specified duration is longer than the music
+given in an @code{\alternative}.
+")
+(translator-property-description 'clefPosition number? "Where should the center of the symbol go?")
+(translator-property-description 'clefGlyph string? "Name of the symbol within the music font")
+(translator-property-description 'centralCPosition number? "Place of the central C. Usually determined by looking at clefPosition and clefGlyph.")
+(translator-property-description 'clefOctavation integer? "Add
+this much extra octavation. Values of 7 and -7 are common.")
+(translator-property-description 'explicitClefVisibility procedure? "visibility-lambda function for clef changes.")
+(translator-property-description 'clefPitches list? "an alist mapping GLYPHNAME to the position of the central C for that symbol")
+(translator-property-description 'combineParts boolean? "try to combine parts?")
+(translator-property-description 'soloADue boolean? "set Solo/A due texts?")
+(translator-property-description 'soloText string? "text for begin of solo")
+(translator-property-description 'soloIIText string? "text for begin of solo for voice ``two''")
+(translator-property-description 'aDueText string? "text for begin of a due")
+(translator-property-description 'split-interval number-pair? "always split into two voices for contained intervals")
+(translator-property-description 'unison boolean? "set if unisono is detected ")
+(translator-property-description 'solo boolean? "set if solo is detected")
+(translator-property-description 'unisilence boolean? "set if unisilence is detected")
+(translator-property-description 'unirhythm boolean? "set if unirhythm is detected")
+(translator-property-description 'graceAlignPosition dir? "put the grace note before or after the main note?")
+(translator-property-description 'graceAccidentalSpace number? "amount space to alot for an accidental")
+(translator-property-description 'noAutoBeaming boolean? " If set to true then beams are not generated automatically.
+")
+(translator-property-description 'autoBeamSettings list? "
+Specifies when automatically generated beams should begin and end. The elements have the format:
+
+@example
+
+ function shortest-duration-in-beam time-signature
+
+where
+
+ function = begin or end
+ shortest-duration-in-beam = numerator denominator; eg: 1 16
+ time-signature = numerator denominator, eg: 4 4
+
+unspecified or wildcard entries for duration or time-signature
+are given by * *
+
+The user can override beam begin or end time by pushing a wildcard entries
+'(begin * * * *) or '(end * * * *) resp., eg:
+
+ \property Voice.autoBeamSettings \push #'(end * * * *) = #(make-moment 1 4)
+
+The head of the list:
+ '(
+((end * * 3 2) . ,(make-moment 1 2))
+((end 1 16 3 2) . ,(make-moment 1 4))
+((end 1 32 3 2) . ,(make-moment 1 8))
+ ...
+ )
+
+@end example")
+(translator-property-description 'whichBar string? "This property is read to determine what type of barline to create.
+Example:
+@example
+\\property Staff.whichBar = \"|:\"
+@end example
+will create a start-repeat bar in this staff only
+")
+(translator-property-description 'staffsFound list? "list of all staff-symbols found.")
+(translator-property-description 'currentBarNumber integer? "this is read to determine
+ the number to put on the bar ")
+(translator-property-description 'beamMelismaBusy boolean? "Signal if a beam is set when automaticMelismata is set")
+(translator-property-description 'breakAlignOrder list?
+ "Defines the order in which
+prefatory matter (clefs, key signatures) appears, eg. this puts the
+key signatures after the bar lines:
+
+@example
+ \\property Score.breakAlignOrder = #'(
+ Span_bar
+ Breathing_sign
+ Clef_item
+ Staff_bar
+ Key_item
+ Time_signature
+ )
+@end example
+") (translator-property-description 'chordInversion boolean? " Determines whether LilyPond should look for chord inversions when
+ translating from notes to chord names. Set to 1 to find
+ inversions. The default is 0 which does not look for
+ inversions.")
+(translator-property-description 'drarnChords boolean? "")
+(translator-property-description 'instrument string? " If @code{Instrument_name_engraver}
+@cindex Instrument_name_engraver
+ is
+ added to the Staff translator, then the @code{instrument} property
+ is used to label the first line of the staff and the @code{instr}
+ property is used to label subsequent lines. If the
+ @code{midiInstrument} property is not set, then @code{instrument}
+ is used to determine the instrument for MIDI output.")
+(translator-property-description 'instr string? "see @code{instrument}")
+(translator-property-description 'keySignature list? "")
+(translator-property-description 'keyOctaviation boolean? "")
+(translator-property-description 'explicitKeySignatureVisibility procedure? "")
+(translator-property-description 'createKeyOnClefChange boolean? "")
+(translator-property-description 'keyAccidentalOrder list? "")
+(translator-property-description 'keySignature list? "")
+(translator-property-description 'automaticPhrasing boolean? "")
+
+(translator-property-description 'weAreGraceContext boolean? "")
+
+(translator-property-description 'melismaEngraverBusy boolean? "")
+
+(translator-property-description 'associatedVoice string? "")
+
+(translator-property-description 'phrasingPunctuation string? "")
+
+(translator-property-description 'rehearsalMark number-or-string? "")
+(translator-property-description 'staffsFound list? "")
+(translator-property-description 'melismaBusy boolean? "")
+(translator-property-description 'slurMelismaBusy boolean? "")
+(translator-property-description 'tieMelismaBusy boolean? "")
+(translator-property-description 'beamMelismaBusy boolean? "")
+
+(translator-property-description 'startSustain string? "")
+(translator-property-description 'stopSustain string? "")
+(translator-property-description 'stopStartSustain string? "")
+(translator-property-description 'startUnaChorda string? "")
+(translator-property-description 'stopUnaChorda string? "")
+(translator-property-description 'squashedPosition integer? " Vertical position of
+squashing.")
+(translator-property-description 'Generic_property_list list? "description of the conversion.
+
+Defines names and types for generic properties. These are properties
+than can be plugged into the backend directly. See the init file
+@file{generic-property.scm} for details. For internal use only,
+deprecated.
+")
+(translator-property-description 'repeatCommands list? "")
+(translator-property-description 'whichBar string? "")
+(translator-property-description 'scriptDefinitions list? "
+Description of scripts to use. (fixme)
+")
+
+(translator-property-description 'scriptHorizontal boolean? " Put scripts left or right of note heads. Support for this is
+ limited. Accidentals will collide with scripts.
+
+")
+(translator-property-description 'currentMusicalColumn ly-grob? "")
+(translator-property-description 'currentCommandColumn ly-grob? "")
+(translator-property-description 'slurBeginAttachment symbol? "translates to the car of Slur.element-property 'attachment.")
+(translator-property-description 'slurEndAttachment symbol? "translates to the cdr of Slur.element-property 'attachment.")
+(translator-property-description 'slurMelismaBusy boolean? "Signal a slur if automaticMelismata is set")
+(translator-property-description 'connectArpeggios boolean? " If
+set, connect all arpeggios that are found. In this way, you can make
+arpeggios that cross staffs.
+")
+(translator-property-description 'stz string? "")
+(translator-property-description 'stanza string? "Stanza `number' to print at start of a verse")
+(translator-property-description 'scriptHorizontal boolean? " Put scripts left or right of note heads. Support for this is
+ limited. Accidentals will collide with scripts.
+
+")
+(translator-property-description 'textNonEmpty boolean? " If set
+to true then text placed above or below the staff is not assumed to
+have zero width. @code{fatText} and @code{emptyText} are predefined
+settings.
+")
+(translator-property-description 'sparseTies boolean? "only create one tie per chord.")
+(translator-property-description 'tieMelismaBusy boolean? "Signal ties when automaticMelismata is set")
+(translator-property-description 'timeSignatureFraction number-pair? "
+pair of numbers, signifying the time signature. For example #'(4 . 4) is a 4/4time signature.")
+(translator-property-description 'barCheckNoSynchronize boolean?
+"If set, don't reset measurePosition when finding a bbarcheck. This
+makes bar-checks for polyphonic music easier.")
+
+(translator-property-description 'barNonAuto boolean? " If set to true then bar lines will not be printed
+ automatically; they must be explicitly created with @code{\bar}
+ keywords. Unlike with the @code{\cadenza} keyword, measures are
+ still counted. Bar generation will resume according to that
+ count if this property is set to zero.
+")
+(translator-property-description 'whichBar string? "if not set
+explicitly (by \property or \bar), this is set according to values of
+defaultBarType, barAlways, barNonAuto and measurePosition.
+ ")
+
+(translator-property-description 'barAlways boolean? " If set to true a bar line is drawn after each note.
+")
+(translator-property-description 'defaultBarType string? "Sets the default type of bar line. Available bar types: [FIXME]
+")
+(translator-property-description 'skipBars boolean? " Set to true to skip the empty bars that are produced by
+ multimeasure notes and rests. These bars will not appear on the
+ printed output. If not set (the default) multimeasure
+ notes and rests expand into their full length, printing the appropriate
+ number of empty bars so that synchronization with other voices is
+ preserved.
+
+@c my @vebatim patch would help...
+@example
+@@lilypond[fragment,verbatim,center]
+r1 r1*3 R1*3\property Score.skipBars=1 r1*3 R1*3
+
+@@end lilypond
+@end example
+
+")
+(translator-property-description 'timing boolean? " Keep administration of measure length, position, bar number, etc?
+Switch off for cadenzas.")
+(translator-property-description 'oneBeat moment? " How long does one beat in the current time signature last?")
+(translator-property-description 'measureLength moment? " How long does one measure in the current time signature last?")
+(translator-property-description 'measurePosition moment? "
+ How much of the current measure (measured in whole notes) have we had?
+")
+(translator-property-description 'currentBarNumber integer? "Contains the current barnumber. This property is incremented at
+every barline.
+")
+(translator-property-description 'tupletSpannerDuration moment? "
+Normally a tuplet bracket is as wide as the
+@code{\times} expression that gave rise to it. By setting this
+property, you can make brackets last shorter. Example
+
+@example
+@@lilypond[verbatim,fragment]
+\context Voice \times 2/3 @{
+ \property Voice.tupletSpannerDuration = #(make-moment 1 4)
+ [c8 c c] [c c c]
+@}
+@@end lilypond
+@end example
+")
+(translator-property-description 'tupletInvisible boolean? "
+ If set to true, tuplet bracket creation is switched off
+entirely. This has the same effect as setting both
+@code{tupletNumberVisibility} and @code{tupletBracketVisibility} to
+@code{#f}, but as this does not even create elements, this setting
+uses less memory and time.")
+
+
+
% by executing a 0 0 moveto
\def\embeddedps##1{%
\special{ps: @beginspecial @setspecial
- \lilypondpaperoutputscale\lilySpace
+ \lilypondpaperoutputscale\lilySpace
\lilypondpaperoutputscale\lilySpace scale
##1 @endspecial}%
}