-1.3.108.uu1
-===========
+1.3.109.jcn2
+============
+
+* Fixed a mysterious typo in toplevel index.
+
+* Enabled property-engraver.
+
+* Cleanup in Auto-beam-engraver (still broken, because timings are off?)
+
+* Collapsed all ``void Foo::create_grobs () { deprecated_process_music
+(); }'' occurences, and reactivated some disabled code (note-name,
+chord-name, custos, lyrics). Reactivated Timing_translator using
+process_music ().
+
+1.3.109.hwn1
+============
+
+* unsmob_element -> unsmob_grob
+
+* Make a Slur::height callback, to prevent early brew_molecule
+call. This fixes cross-staff slurs.
+
+* Bugfix: custodes style must be symbol, not string.
+
+* do_creation_processing () -> initialize (), do_removal_processing ()
+-> finalize (). Remove (do_)add_processing.
+
+* Move Relative_octave_music::last_pitch_ into SCM, junk
+Transposed_music::to_pitch_, junked Time_scaled_music::{den_i_,
+num_i_}, Rhythmic_req::duration_, Melodic_req::pitch_
+
+1.3.109
+=======
* Bugfix: resurrected point-and-click.
{pre,post}_move_processing -> {stop,start}_translation_timestep,
do_try_music -> try_music.
-1.3.107.jcn3
-============
+1.3.108
+=======
* Dropped ly_lists_equal for gh_equal_
@unnumberedsec What is LilyPond?
-LilyPond is a music typesetting. It produces beautiful sheet music
+LilyPond is a music typesetter. 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
examples include sound bites in MIDI, pictures in PNG, printable scores
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
-by Scarlatti}. Jeff Covey, guitar player and overall nice guy, is
-putting @uref{http://www4.smart.net/~jcovey/scores/,guitar music} on the
-net. The @uref{http://sca.uwaterloo.ca/Mutopia/,Mutopia project} is an
-archive of public domain sheet music under construction. Dirk Lattermann
-also put some works @uref{http://www.alqualonde.de/lilypond.html,on the
-web}.
@html
<a name="download-source">
PACKAGE_NAME=LilyPond
MAJOR_VERSION=1
MINOR_VERSION=3
-PATCH_LEVEL=109
+PATCH_LEVEL=110
MY_PATCH_LEVEL=
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
VIRTUAL_COPY_CONS (Translator);
protected:
- void deprecated_process_music ();
virtual void acknowledge_grob (Grob_info);
virtual void create_grobs ();
void
-A2_engraver::deprecated_process_music ()
+A2_engraver::create_grobs ()
{
if (!to_boolean (get_property ("combineParts")))
return ;
}
}
-void
-A2_engraver::create_grobs ()
-{
- deprecated_process_music ();
-}
-
void
A2_engraver::stop_translation_timestep ()
{
SCM
Align_interface::alignment_callback (SCM element_smob, SCM axis)
{
- Grob * me = unsmob_element (element_smob);
+ Grob * me = unsmob_grob (element_smob);
Axis ax = (Axis )gh_scm2int (axis);
Grob * par = me->parent_l (ax);
if (par && !to_boolean (par->get_grob_property ("alignment-done")))
virtual void create_grobs ();
virtual void start_translation_timestep ();
- virtual void do_creation_processing ();
- virtual void do_removal_processing ();
+ virtual void initialize ();
+ virtual void finalize ();
virtual void acknowledge_grob (Grob_info);
public:
VIRTUAL_COPY_CONS(Translator);
}
void
-Align_note_column_engraver::do_creation_processing ()
+Align_note_column_engraver::initialize ()
{
align_item_p_ = new Item (get_property ("GraceAlignment"));
Grace_align_item::set_interface (align_item_p_);
}
void
-Align_note_column_engraver::do_removal_processing ()
+Align_note_column_engraver::finalize ()
{
SCM al = get_property ("graceAlignPosition");
if (isdir_b (al))
SCM
Arpeggio::brew_molecule (SCM smob)
{
- Grob *me = unsmob_element (smob);
+ Grob *me = unsmob_grob (smob);
Grob * common = me;
for (SCM s = me->get_grob_property ("stems"); gh_pair_p (s); s = gh_cdr (s))
{
- Grob * stem = unsmob_element (gh_car (s));
+ Grob * stem = unsmob_grob (gh_car (s));
common = common->common_refpoint (Staff_symbol_referencer::staff_symbol_l (stem),
Y_AXIS);
}
for (SCM s = me->get_grob_property ("stems"); gh_pair_p (s); s = gh_cdr (s))
{
- Grob * stem = unsmob_element (gh_car (s));
+ Grob * stem = unsmob_grob (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)
{
- Grob * me = unsmob_element (smob);
+ Grob * me = unsmob_grob (smob);
Axis a = (Axis)gh_scm2int (axis);
assert (a == X_AXIS);
Molecule arpeggio = Font_interface::get_default_font (me)->find_by_name ("scripts-arpeggio");
protected:
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
- virtual void do_removal_processing ();
+ virtual void finalize ();
virtual void acknowledge_grob (Grob_info);
virtual void create_grobs ();
private:
- void begin_beam ();
- void consider_end_and_begin (Moment test_mom);
+ bool test_moment (Direction, Moment);
+ void consider_begin (Moment);
+ void consider_end (Moment);
Spanner* create_beam_p ();
+ void begin_beam ();
void end_beam ();
void junk_beam ();
bool same_grace_state_b (Grob* e);
Link_array<Item>* stem_l_arr_p_;
- bool first_b_;
+ bool count_i_;
Moment last_add_mom_;
/*
Auto_beam_engraver::Auto_beam_engraver ()
{
- first_b_ = true;
+ count_i_ = 0;
stem_l_arr_p_ = 0;
shortest_mom_ = Moment (1, 8);
finished_beam_p_ = 0;
}
/*
- rename me: consider_end_or_begin () ?
- */
-void
-Auto_beam_engraver::consider_end_and_begin (Moment test_mom)
+ Determine end moment for auto beaming (or begin moment, but mostly
+ 0==anywhere) In order of increasing priority:
+
+ i. begin anywhere, end at every beat
+ ii. end * <num> <den>
+ iii. end <type> <num> <den>
+
+ iv. end * * *
+ v. end <type> * *
+
+
+ Rationale:
+
+ [to be defined in config file]
+ i. easy catch-all rule
+ ii. exceptions for time signature
+ iii. exceptions for time signature, for specific duration type
+
+ [user override]
+ iv. generic override
+ v. override for specific duration type
+
+*/
+bool
+Auto_beam_engraver::test_moment (Direction dir, Moment test_mom)
{
SCM wild = gh_list (ly_symbol2scm ("*"), ly_symbol2scm ("*"), SCM_UNDEFINED);
- SCM b = gh_list (ly_symbol2scm ("begin"), SCM_UNDEFINED);
- SCM e = gh_list (ly_symbol2scm ("end"), SCM_UNDEFINED);
+ SCM function;
+ if (dir == START)
+ function = gh_list (ly_symbol2scm ("begin"), SCM_UNDEFINED);
+ else
+ function = gh_list (ly_symbol2scm ("end"), SCM_UNDEFINED);
Moment one_beat = *unsmob_moment( get_property ("beatLength"));
int num = *unsmob_moment (get_property("measureLength")) / one_beat;
SCM settings = get_property ("autoBeamSettings");
- /*
- Determine end moment for auto beaming (and begin, mostly 0==anywhere)
- In order of increasing priority:
-
- i. every beat
- ii. end * <num> <den>
- iii. end <type> <num> <den>
-
- iv. end * * *
- v. end <type> * *
-
-
- Rationale:
-
- [to be defined in config file]
- i. easy catch-all rule
- ii. exceptions for time signature
- iii. exceptions for time signature, for specific duration type
-
- [user override]
- iv. generic override
- v. override for specific duration type
-
- */
+ /* first guess */
-
- /*
- first guess: begin beam at any position
- */
- Moment begin_mom (0);
- /*
- first guess: end beam at end of beat
- */
- SCM one (get_property ("beatLength"));
-
- Moment end_mom;
- if (unsmob_moment (one))
- end_mom = *unsmob_moment (one);
-
- /*
- second guess: property generic time exception
- */
- SCM begin = gh_assoc (gh_append3 (b, wild, time), settings);
+ /* begin beam at any position
+ (and fallback for end) */
+ Moment moment (0);
- if (begin != SCM_BOOL_F && unsmob_moment (gh_cdr (begin)))
- begin_mom = * unsmob_moment (gh_cdr (begin));
-
- SCM end = gh_assoc (gh_append3 (e, wild, time), settings);
- if (end != SCM_BOOL_F && unsmob_moment (gh_cdr (end)))
- end_mom = * unsmob_moment (gh_cdr (end));
+ /* end beam at end of beat */
+ if (dir == STOP)
+ {
+ SCM beat (get_property ("beatLength"));
+
+ if (unsmob_moment (beat))
+ moment = *unsmob_moment (beat);
+ }
- /*
- third guess: property time exception, specific for duration type
- */
- SCM begin_mult = gh_assoc (gh_append3 (b, type, time), settings);
- if (begin_mult != SCM_BOOL_F && unsmob_moment (gh_cdr (begin_mult)))
- begin_mom = * unsmob_moment (gh_cdr (begin_mult));
+ /* second guess: property generic time exception */
+ SCM m = gh_assoc (gh_append3 (function, wild, time), settings);
- SCM end_mult = gh_assoc (gh_append3 (e, type, time), settings);
- if (end_mult != SCM_BOOL_F && unsmob_moment (gh_cdr (end_mult)))
- end_mom = * unsmob_moment (gh_cdr (end_mult));
-
- /*
- fourth guess [user override]: property plain generic
- */
- begin = gh_assoc (gh_append3 (b, wild, wild), settings);
- if (begin != SCM_BOOL_F && unsmob_moment (gh_cdr (begin)))
- begin_mom = * unsmob_moment (gh_cdr (begin));
-
- end = gh_assoc (gh_append3 (e, wild, wild), settings);
- if (end != SCM_BOOL_F && unsmob_moment (gh_cdr (end)))
- end_mom = * unsmob_moment (gh_cdr (end));
-
- /*
- fifth guess [user override]: property plain, specific for duration type
- */
- begin_mult = gh_assoc (gh_append3 (b, type, wild), settings);
- if (begin_mult != SCM_BOOL_F && unsmob_moment (gh_cdr (begin_mult)))
- begin_mom = * unsmob_moment (gh_cdr (begin_mult));
+ if (m != SCM_BOOL_F && unsmob_moment (gh_cdr (m)))
+ moment = * unsmob_moment (gh_cdr (m));
+
+ /* third guess: property time exception, specific for duration type */
+ m = gh_assoc (gh_append3 (function, type, time), settings);
+ if (m != SCM_BOOL_F && unsmob_moment (gh_cdr (m)))
+ moment = * unsmob_moment (gh_cdr (m));
+
+ /* fourth guess [user override]: property plain generic */
+ m = gh_assoc (gh_append3 (function, wild, wild), settings);
+ if (m != SCM_BOOL_F && unsmob_moment (gh_cdr (m)))
+ moment = * unsmob_moment (gh_cdr (m));
+
+ /* fifth guess [user override]: property plain, specific for duration type */
+ m = gh_assoc (gh_append3 (function, type, wild), settings);
+ if (m != SCM_BOOL_F && unsmob_moment (gh_cdr (m)))
+ moment = * unsmob_moment (gh_cdr (m));
- end_mult = gh_assoc (gh_append3 (e, type, wild), settings);
- if (end_mult != SCM_BOOL_F && unsmob_moment (gh_cdr (end_mult)))
- end_mom = * unsmob_moment (gh_cdr (end_mult));
-
Rational r;
- if (end_mom)
- r = unsmob_moment (get_property ("measurePosition"))->mod_rat (end_mom);
+ if (moment)
+ r = unsmob_moment (get_property ("measurePosition"))->mod_rat (moment);
else
- r = Moment (1);
-
- if (stem_l_arr_p_ && stem_l_arr_p_->size () > 1 && !r)
- end_beam ();
+ {
+ if (dir == START)
+ /* if undefined, starting is ok */
+ r = 0;
+ else
+ /* but ending is not */
+ r = 1;
+ }
+ return !r;
+}
- /*
- Allow already started autobeam to end
- */
- SCM on = get_property ("noAutoBeaming");
- if (to_boolean (on))
- return;
+void
+Auto_beam_engraver::consider_begin (Moment test_mom)
+{
+ bool off = to_boolean (get_property ("noAutoBeaming"));
+ if (!stem_l_arr_p_ && ! off)
+ {
+ bool b = test_moment (START, test_mom);
+ if (b)
+ begin_beam ();
+ }
+}
- if (begin_mom)
- r = unsmob_moment (get_property ("measurePosition"))->mod_rat (begin_mom);
- if (!stem_l_arr_p_ && (!begin_mom || !r))
- begin_beam ();
+void
+Auto_beam_engraver::consider_end (Moment test_mom)
+{
+ if (stem_l_arr_p_ && stem_l_arr_p_->size () > 1)
+ {
+ /* Allow already started autobeam to end:
+ don't check for noAutoBeaming */
+ bool b = test_moment (STOP, test_mom);
+ if (b)
+ end_beam ();
+ }
}
-
+
Spanner*
Auto_beam_engraver::create_beam_p ()
{
void
Auto_beam_engraver::start_translation_timestep ()
{
- first_b_ =true;
+ count_i_ = 0;
/*
don't beam over skips
*/
}
void
-Auto_beam_engraver::do_removal_processing ()
+Auto_beam_engraver::finalize ()
{
/* finished beams may be typeset */
typeset_beam ();
return;
}
- /*
- if shortest duration would change
- reconsider ending/starting beam first.
- */
Moment dur = unsmob_duration (rhythmic_req->get_mus_property ("duration"))->length_mom ();
- consider_end_and_begin (dur);
- if (!stem_l_arr_p_)
- return;
+ /* FIXME:
+
+ This comment has been here since long:
+
+ if shortest duration would change
+ consider ending and beginning beam first.
+
+ but the code didn't match: */
+#if 1
+ consider_end (dur);
+ consider_begin (dur);
+
+ if (dur < shortest_mom_)
+ shortest_mom_ = dur;
+#else
+ /* I very much suspect that we wanted: */
+
+ consider_end (shortest_mom_);
if (dur < shortest_mom_)
{
shortest_mom_ = dur;
- if (stem_l_arr_p_->size ())
- {
- shortest_mom_ = dur;
- consider_end_and_begin (shortest_mom_);
- if (!stem_l_arr_p_)
- return;
- }
+ consider_end (shortest_mom_);
}
+ consider_begin (shortest_mom_);
+#endif
+
+ if (!stem_l_arr_p_)
+ return;
Moment now = now_mom ();
void
Auto_beam_engraver::create_grobs ()
{
- if (first_b_)
+ if (!count_i_)
{
- first_b_ = false;
- consider_end_and_begin (shortest_mom_);
+ consider_end (shortest_mom_);
+ consider_begin (shortest_mom_);
}
- else
+ else if (count_i_ > 1)
{
if (stem_l_arr_p_)
{
junk_beam ();
}
}
- }
+ }
+
+ /*
+ count_i_++ ->
+
+ auto-beam-engraver.cc:459: warning: value computed is not used (gcc: 2.96) */
+ count_i_ = count_i_ + 1;
}
protected:
Spanner *staffline_p_;
Link_array<Grob> elts_;
- virtual void do_creation_processing();
- virtual void do_removal_processing();
+ virtual void initialize();
+ virtual void finalize();
virtual void acknowledge_grob (Grob_info);
virtual void create_grobs ();
virtual Spanner* get_spanner_p () const;
}
void
-Axis_group_engraver::do_creation_processing ()
+Axis_group_engraver::initialize ()
{
staffline_p_ = get_spanner_p ();
Axis_group_interface::set_interface (staffline_p_);
Axis_group_interface::set_axes (staffline_p_, Y_AXIS, Y_AXIS);
- Grob * it = unsmob_element (get_property ("currentCommandColumn"));
+ Grob * it = unsmob_grob (get_property ("currentCommandColumn"));
staffline_p_->set_bound(LEFT,it);
}
void
-Axis_group_engraver::do_removal_processing ()
+Axis_group_engraver::finalize ()
{
String type = daddy_grav_l ()->type_str_ ;
SCM dims = get_property ((type + "VerticalExtent").ch_C());
&& gh_number_p (gh_cdr (dims)))
staffline_p_->set_grob_property ("extra-extent-Y", dims);
- Grob * it = unsmob_element (get_property ("currentCommandColumn"));
+ Grob * it = unsmob_grob (get_property ("currentCommandColumn"));
staffline_p_->set_bound(RIGHT,it);
Interval r;
for (SCM s = elts; gh_pair_p (s); s = gh_cdr (s))
{
- Grob * se = unsmob_element (gh_car (s));
+ Grob * se = unsmob_grob (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)
{
- Grob *me = unsmob_element (element_smob);
+ Grob *me = unsmob_grob (element_smob);
Axis a = (Axis) gh_scm2int (scm_axis);
Grob * common =(Grob*) me;
for (SCM s = me->get_grob_property ("elements"); gh_pair_p (s); s = gh_cdr (s))
{
- Grob * se = unsmob_element (gh_car (s));
+ Grob * se = unsmob_grob (gh_car (s));
common = se->common_refpoint (common, a);
}
for (SCM ep = me->get_grob_property ("elements"); gh_pair_p (ep); ep = gh_cdr (ep))
{
- Grob* e = unsmob_element (gh_car (ep));
+ Grob* e = unsmob_grob (gh_car (ep));
if (e)
childs.concat (Axis_group_interface::get_children (e));
}
void request_bar (String type_str);
protected:
- virtual void do_removal_processing ();
- void deprecated_process_music();
+ virtual void finalize ();
virtual void stop_translation_timestep();
virtual void create_grobs ();
}
void
-Bar_engraver::do_removal_processing ()
+Bar_engraver::finalize ()
{
typeset_bar ();
}
modify whichBar in deprecated_process_music () be typeset
*/
void
-Bar_engraver::deprecated_process_music()
+Bar_engraver::create_grobs ()
{
if (!bar_p_ && gh_string_p (get_property ("whichBar")))
{
}
}
-void
-Bar_engraver::create_grobs ()
-{
- deprecated_process_music ();
-}
-
void
Bar_engraver::typeset_bar ()
{
protected:
virtual void stop_translation_timestep ();
virtual void acknowledge_grob (Grob_info);
- virtual void do_creation_processing ();
+ virtual void initialize ();
virtual void create_grobs ();
void create_items();
- void deprecated_process_music ();
+
public:
VIRTUAL_COPY_CONS(Translator);
Bar_number_engraver();
};
void
-Bar_number_engraver::deprecated_process_music ()
+Bar_number_engraver::create_grobs ()
{
// todo include (&&!time->cadenza_b_ )
SCM bn = get_property("currentBarNumber");
}
}
-void
-Bar_number_engraver::create_grobs ()
-{
- deprecated_process_music ();
-}
-
-
ADD_THIS_TRANSLATOR(Bar_number_engraver);
Bar_number_engraver::Bar_number_engraver ()
}
void
-Bar_number_engraver::do_creation_processing ()
+Bar_number_engraver::initialize ()
{
/*
ugh: need to share code with mark_engraver
SCM
Bar::brew_molecule (SCM smob)
{
- Grob * me = unsmob_element (smob);
+ Grob * me = unsmob_grob (smob);
SCM s = me->get_grob_property ("glyph");
SCM barsiz_proc = me->get_grob_property ("barsize-procedure");
SCM
Bar::before_line_breaking (SCM smob)
{
- Grob*me=unsmob_element (smob);
+ Grob*me=unsmob_grob (smob);
Item * item = dynamic_cast<Item*> (me);
SCM g = me->get_grob_property ("glyph");
SCM
Bar::get_staff_bar_size (SCM smob)
{
- Grob*me = unsmob_element (smob);
+ Grob*me = unsmob_grob (smob);
Real ss = Staff_symbol_referencer::staff_space (me);
SCM size = me->get_grob_property ("bar-size");
if (gh_number_p (size))
protected:
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
- virtual void do_removal_processing ();
+ virtual void finalize ();
virtual void create_grobs ();
virtual void acknowledge_grob (Grob_info);
virtual bool try_music (Music*);
- void deprecated_process_music ();
+
public:
Beam_engraver ();
VIRTUAL_COPY_CONS (Translator);
void
-Beam_engraver::deprecated_process_music ()
+Beam_engraver::create_grobs ()
{
if (reqs_drul_[STOP])
{
}
void
-Beam_engraver::do_removal_processing ()
+Beam_engraver::finalize ()
{
typeset_beam ();
if (beam_p_)
}
}
-void
-Beam_engraver::create_grobs ()
-{
- deprecated_process_music ();
-}
-
-
void
Beam_engraver::acknowledge_grob (Grob_info info)
{
int m = 0;
for (SCM s = me->get_grob_property ("stems"); gh_pair_p (s); s = gh_cdr (s))
{
- Grob * sc = unsmob_element (gh_car (s));
+ Grob * sc = unsmob_grob (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)
{
- Grob * me = unsmob_element (smob);
+ Grob * me = unsmob_grob (smob);
// Why?
if (visible_stem_count (me) < 2)
SCM
Beam::after_line_breaking (SCM smob)
{
- Grob * me = unsmob_element (smob);
+ Grob * me = unsmob_grob (smob);
/* first, calculate y, dy */
Real y, dy;
SCM
Beam::brew_molecule (SCM smob)
{
- Grob * me =unsmob_element (smob);
+ Grob * me =unsmob_grob (smob);
Molecule mol;
if (!gh_pair_p (me->get_grob_property ("stems")))
SCM
Beam::rest_collision_callback (SCM element_smob, SCM axis)
{
- Grob *rest = unsmob_element (element_smob);
+ Grob *rest = unsmob_grob (element_smob);
Axis a = (Axis) gh_scm2int (axis);
assert (a == Y_AXIS);
- Grob * st = unsmob_element (rest->get_grob_property ("stem"));
+ Grob * st = unsmob_grob (rest->get_grob_property ("stem"));
Grob * stem = st;
if (!stem)
return gh_double2scm (0.0);
- Grob * beam = unsmob_element (stem->get_grob_property ("beam"));
+ Grob * beam = unsmob_grob (stem->get_grob_property ("beam"));
if (!beam || !Beam::has_interface (beam) || !Beam::visible_stem_count (beam))
return gh_double2scm (0.0);
Item *align_l_;
Protected_scm column_alist_;
protected:
- virtual void do_removal_processing ();
+ virtual void finalize ();
virtual void acknowledge_grob(Grob_info i);
virtual void stop_translation_timestep ();
void add_column (SCM);
void
Break_align_engraver::add_column (SCM smob)
{
- Grob * e = unsmob_element (smob);
+ Grob * e = unsmob_grob (smob);
Break_align_interface::add_element (align_l_,e);
typeset_grob (e);
}
void
-Break_align_engraver::do_removal_processing ()
+Break_align_engraver::finalize ()
{
column_alist_ = SCM_EOL;
}
if (s != SCM_BOOL_F)
{
- Grob *e = unsmob_element (gh_cdr(s));
+ Grob *e = unsmob_grob (gh_cdr(s));
group = dynamic_cast<Item*> (e);
}
else
SCM
Break_align_interface::before_line_breaking (SCM smob)
{
- Grob* me = unsmob_element (smob);
+ Grob* me = unsmob_grob (smob);
do_alignment (me);
return SCM_UNSPECIFIED;
}
SCM
Break_align_interface::alignment_callback (SCM element_smob, SCM axis)
{
- Grob *me = unsmob_element (element_smob);
+ Grob *me = unsmob_grob (element_smob);
Axis a = (Axis) gh_scm2int (axis);
assert (a == X_AXIS);
SCM
Break_align_interface::self_align_callback (SCM element_smob, SCM axis)
{
- Grob *me = unsmob_element (element_smob);
+ Grob *me = unsmob_grob (element_smob);
Axis a = (Axis) gh_scm2int (axis);
assert (a == X_AXIS);
protected:
virtual bool try_music (Music *req_l);
- void deprecated_process_music();
-
+ virtual void create_grobs ();
virtual void stop_translation_timestep();
virtual void start_translation_timestep();
}
void
-Breathing_sign_engraver::deprecated_process_music()
+Breathing_sign_engraver::create_grobs ()
{
if(breathing_sign_req_l_ && ! breathing_sign_p_)
{
Breathing_sign::set_interface (breathing_sign_p_);
announce_grob (breathing_sign_p_, breathing_sign_req_l_);
+ breathing_sign_req_l_ = 0;
}
}
SCM
Breathing_sign::brew_molecule (SCM smob)
{
- Grob * me = unsmob_element (smob);
+ Grob * me = unsmob_grob (smob);
Real space = Staff_symbol_referencer::staff_space (me);
// todo: cfg'able.
SCM
Breathing_sign::offset_callback (SCM element_smob, SCM )
{
- Grob *me = unsmob_element (element_smob);
+ Grob *me = unsmob_grob (element_smob);
Direction d = Directional_element_interface::get (me);
if (!d)
protected:
virtual void stop_translation_timestep ();
virtual void acknowledge_grob (Grob_info i);
- void deprecated_process_music ();
+ virtual void create_grobs ();
virtual bool try_music (Music *);
private:
return false;
}
-/* 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
- possibly-please just number these functions:
-
- do_creation0
-
- post_move1
- try_music2
- deprecated_process_music3 (or is it acknowledge_grob3 ?)
- acknowledge_grob4
-
- do_pre_move9
-
- do_removal99
-
- and what was the deal with this ``do'' prefix again? */
void
Chord_name_engraver::acknowledge_grob (Grob_info i)
{
}
void
-Chord_name_engraver::deprecated_process_music ()
+Chord_name_engraver::create_grobs ()
{
if (!chord_name_p_ && gh_car (chord_) != SCM_EOL)
{
-#if 0
- bool find_inversion_b = false;
- SCM chord_inversion = get_property ("chordInversion");
- if (gh_boolean_p (chord_inversion))
- find_inversion_b = gh_scm2bool (chord_inversion);
-
- chord_ = Chord::pitches_and_requests_to_chord (pitches_,
- inversion_,
- bass_,
- find_inversion_b);
-
-#endif
-
chord_name_p_ = new Item (get_property ("ChordName"));
chord_name_p_->set_grob_property ("chord", chord_);
announce_grob (chord_name_p_, 0);
SCM
Chord_name::after_line_breaking (SCM smob)
{
- Item* me = dynamic_cast<Item*> (unsmob_element (smob));
+ Item* me = dynamic_cast<Item*> (unsmob_grob (smob));
assert (me);
SCM s = me->get_grob_property ("begin-of-line-visible");
SCM
Chord_name::brew_molecule (SCM smob)
{
- Grob *me = unsmob_element (smob);
+ Grob *me = unsmob_grob (smob);
SCM style = me->get_grob_property ("style");
if (!gh_symbol_p (style))
Spanner * finished_beam_p_;
protected:
- virtual void do_removal_processing();
- void deprecated_process_music();
+ virtual void finalize();
virtual bool try_music (Music*);
virtual void acknowledge_grob (Grob_info);
virtual void stop_translation_timestep();
void
Chord_tremolo_engraver::create_grobs ()
-{
- deprecated_process_music ();
-}
-
-void
-Chord_tremolo_engraver::deprecated_process_music ()
{
if (repeat_ && !beam_p_)
{
void
-Chord_tremolo_engraver::do_removal_processing ()
+Chord_tremolo_engraver::finalize ()
{
typeset_beam ();
if (beam_p_)
Direction octave_dir_;
protected:
- void deprecated_process_music ();
virtual void stop_translation_timestep ();
- virtual void do_creation_processing ();
virtual void start_translation_timestep ();
virtual void create_grobs ();
virtual void acknowledge_grob (Grob_info);
void
Clef_engraver::acknowledge_grob (Grob_info info)
{
- deprecated_process_music ();
+ create_grobs ();
Item * item =dynamic_cast <Item *> (info.elem_l_);
if (item)
{
}
}
-void
-Clef_engraver::do_creation_processing ()
-{
-}
-
-
-
void
Clef_engraver::create_clef ()
{
void
Clef_engraver::create_grobs ()
-{
- deprecated_process_music ();
-}
-
-void
-Clef_engraver::deprecated_process_music ()
{
SCM glyph = get_property ("clefGlyph");
SCM clefpos = get_property ("clefPosition");
SCM
Clef::before_line_breaking (SCM smob)
{
- Item * s = dynamic_cast<Item*> (unsmob_element (smob));
+ Item * s = dynamic_cast<Item*> (unsmob_grob (smob));
SCM glyph = s->get_grob_property ("glyph");
SCM
Clef::brew_molecule (SCM smob)
{
- Grob * sc = unsmob_element (smob);
+ Grob * sc = unsmob_grob (smob);
SCM glyph = sc->get_grob_property ("glyph");
if (gh_string_p (glyph))
{
SCM
Collision::force_shift_callback (SCM element_smob, SCM axis)
{
- Grob *me = unsmob_element (element_smob);
+ Grob *me = unsmob_grob (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_grob_property ("done")))
+ if (!unsmob_grob (me->get_grob_property ("done")))
{
me->set_grob_property ("done", me->self_scm ());
do_shifts (me);
for (; gh_pair_p (hand); hand =gh_cdr (hand))
{
- Grob * s = unsmob_element (gh_caar (hand));
+ Grob * s = unsmob_grob (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))
{
- Grob * s = unsmob_element (gh_caar (autos));
+ Grob * s = unsmob_grob (gh_caar (autos));
Real amount = gh_scm2double (gh_cdar (autos));
if (!done.find_l (s))
{
SCM car = gh_car (s);
- Grob * se = unsmob_element (car);
+ Grob * se = unsmob_grob (car);
if (Note_column::has_interface (se))
clash_groups[Note_column::dir (se)].push (se);
}
SCM s = me->get_grob_property ("elements");
for (; gh_pair_p (s); s = gh_cdr (s))
{
- Grob * se = unsmob_element (gh_car (s));
+ Grob * se = unsmob_grob (gh_car (s));
SCM force = se->remove_grob_property ("force-hshift");
if (gh_number_p (force))
{
Tempo_req const *t = dynamic_cast <Tempo_req const*> (r);
- return t&& t->dur_.length_mom ()== dur_.length_mom ();
+ return t; // && t->dur_.length_mom ()== dur_.length_mom ();
// && metronome_i_ == t->metronome_i_;
}
SCM
Hairpin::brew_molecule (SCM smob)
{
- Grob *me= unsmob_element (smob);
+ Grob *me= unsmob_grob (smob);
Spanner *span = dynamic_cast<Spanner*>(me);
Real line = me->paper_l ()->get_var ("stafflinethickness");
Custos_engraver();
virtual void start_translation_timestep();
virtual void acknowledge_grob(Grob_info);
- void deprecated_process_music ();
virtual void create_grobs ();
virtual void stop_translation_timestep ();
- virtual void do_removal_processing ();
+ virtual void finalize ();
VIRTUAL_COPY_CONS(Translator);
private:
}
-/*
- TODO check if this works with forced bar lines?
- */
-void
-Custos_engraver::deprecated_process_music ()
-{
- if (gh_string_p (get_property( "whichBar")))
- custos_permitted = true;
-}
-
void
Custos_engraver::acknowledge_grob (Grob_info info)
{
void
Custos_engraver::create_grobs ()
{
- deprecated_process_music ();
-
+ if (gh_string_p (get_property( "whichBar")))
+ custos_permitted = true;
+
if (custos_permitted)
{
for (int i = pitches_.size (); i--;)
}
void
-Custos_engraver::do_removal_processing ()
+Custos_engraver::finalize ()
{
for (int i = custos_arr_.size (); i--;)
{
*
* (3) The thickness of the ledger line is fixed (limitation).
*/
-Molecule create_ledger_line (Interval x_extent, Grob *me)
+Molecule
+Custos::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(Grob* me,
+void
+Custos::add_streepjes(Grob* me,
int pos,
int interspaces,
Molecule* custos_p_)
SCM
Custos::brew_molecule (SCM smob)
{
- Item *me = (Item *)unsmob_element (smob);
+ Item *me = (Item *)unsmob_grob (smob);
SCM scm_style = me->get_grob_property ("style");
if (gh_symbol_p (scm_style))
void
Dot_column_engraver::acknowledge_grob (Grob_info info)
{
- Grob *d = unsmob_element (info.elem_l_->get_grob_property ("dot"));
+ Grob *d = unsmob_grob (info.elem_l_->get_grob_property ("dot"));
if (d)
{
if (!dotcol_p_)
SCM
Dot_column::force_shift_callback (SCM element_smob, SCM axis)
{
- Grob *me = unsmob_element (element_smob);
+ Grob *me = unsmob_grob (element_smob);
Axis a = (Axis) gh_scm2int (axis);
assert (a == Y_AXIS);
me = me->parent_l (X_AXIS);
Link_array<Grob> dots;
while (gh_pair_p (l))
{
- dots.push (unsmob_element (gh_car (l)));
+ dots.push (unsmob_grob (gh_car (l)));
l = gh_cdr (l);
}
void
Dot_column::add_head (Grob * me, Grob *rh)
{
- Grob * d = unsmob_element (rh->get_grob_property ("dot"));
+ Grob * d = unsmob_grob (rh->get_grob_property ("dot"));
if (d)
{
Side_position::add_support (me,rh);
SCM
Dots::quantised_position_callback (SCM element_smob, SCM axis)
{
- Grob *me = unsmob_element (element_smob);
+ Grob *me = unsmob_grob (element_smob);
Axis a = (Axis) gh_scm2int (axis);
assert (a == Y_AXIS);
SCM
Dots::brew_molecule (SCM d)
{
- Grob *sc = unsmob_element (d);
+ Grob *sc = unsmob_grob (d);
Molecule mol;
SCM c = sc->get_grob_property ("dot-count");
Dynamic_engraver ();
protected:
- virtual void do_removal_processing ();
+ virtual void finalize ();
virtual void acknowledge_grob (Grob_info);
virtual bool try_music (Music *req_l);
- void deprecated_process_music ();
virtual void stop_translation_timestep ();
virtual void create_grobs ();
virtual void start_translation_timestep ();
}
void
-Dynamic_engraver::deprecated_process_music ()
+Dynamic_engraver::create_grobs ()
{
if (accepted_spanreqs_drul_[START] || accepted_spanreqs_drul_[STOP] || script_req_l_)
else
{
assert (!finished_cresc_p_);
- Grob* cc = unsmob_element (get_property ("currentMusicalColumn"));
+ Grob* cc = unsmob_grob (get_property ("currentMusicalColumn"));
cresc_p_->set_bound (RIGHT, cc);
}
cresc_p_->set_bound (LEFT, script_p_
? script_p_
- : unsmob_element (get_property ("currentMusicalColumn")));
+ : unsmob_grob (get_property ("currentMusicalColumn")));
Axis_group_interface::add_element (line_spanner_, cresc_p_);
announce_grob (cresc_p_, accepted_spanreqs_drul_[START]);
}
void
-Dynamic_engraver::create_grobs ()
-{
- deprecated_process_music ();
-}
-
-void
-Dynamic_engraver::do_removal_processing ()
+Dynamic_engraver::finalize ()
{
typeset_all ();
if (line_spanner_)
{
finished_cresc_p_->set_bound (RIGHT, script_p_
? script_p_
- : unsmob_element (get_property ("currentMusicalColumn")));
+ : unsmob_grob (get_property ("currentMusicalColumn")));
typeset_grob (finished_cresc_p_);
finished_cresc_p_ =0;
VIRTUAL_COPY_CONS (Translator);
Dynamic_performer ();
- ~Dynamic_performer ();
protected:
virtual bool try_music (Music* req_l);
- void deprecated_process_music ();
virtual void stop_translation_timestep ();
virtual void create_grobs ();
audio_p_ = 0;
}
-Dynamic_performer::~Dynamic_performer ()
-{
-}
-
-
void
-Dynamic_performer::deprecated_process_music ()
+Dynamic_performer::create_grobs ()
{
if (script_req_l_)
{
}
}
-void
-Dynamic_performer::create_grobs ()
-{
- deprecated_process_music ();
-}
-
void
Dynamic_performer::stop_translation_timestep ()
{
protected:
virtual void acknowledge_grob (Grob_info);
- virtual void do_removal_processing();
- void deprecated_process_music();
+ virtual void finalize();
virtual bool try_music (Music*);
virtual void stop_translation_timestep();
virtual void start_translation_timestep ();
}
void
-Extender_engraver::do_removal_processing ()
+Extender_engraver::finalize ()
{
if (extender_p_)
{
req_l_->origin ()->warning (_ ("unterminated extender"));
- extender_p_->set_bound(RIGHT, unsmob_element (get_property ("currentCommandColumn")));
+ extender_p_->set_bound(RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
}
}
void
Extender_engraver::create_grobs ()
-{
- deprecated_process_music ();
-}
-
-void
-Extender_engraver::deprecated_process_music ()
{
if (req_l_ && ! extender_p_)
{
SCM
Grace_align_item::before_line_breaking (SCM smob)
{
- Grob*me = unsmob_element (smob);
+ Grob*me = unsmob_grob (smob);
SCM space = me->get_grob_property ("horizontal-space");
me->set_grob_property ("threshold",
}
void
-Grace_engraver_group::do_removal_processing ()
+Grace_engraver_group::finalize ()
{
- Engraver_group_engraver::do_removal_processing ();
+ Engraver_group_engraver::finalize ();
}
void
}
void
-Grace_engraver_group::do_creation_processing ()
+Grace_engraver_group::initialize ()
{
calling_self_b_ = true;
- Engraver_group_engraver::do_creation_processing ();
+ Engraver_group_engraver::initialize ();
calling_self_b_ = false;
}
}
void
-Grace_performer_group::do_removal_processing ()
+Grace_performer_group::finalize ()
{
- Performer_group_performer::do_removal_processing ();
+ Performer_group_performer::finalize ();
}
void
Axis_group_interface::add_element (last_musical_col_l_, align_l_);
}
- last_musical_col_l_ = dynamic_cast<Paper_column*>( unsmob_element (get_property ("currentMusicalColumn")));
+ last_musical_col_l_ = dynamic_cast<Paper_column*>( unsmob_grob (get_property ("currentMusicalColumn")));
}
void
SCM
Grob::molecule_extent (SCM element_smob, SCM scm_axis)
{
- Grob *s = unsmob_element (element_smob);
+ Grob *s = unsmob_grob (element_smob);
Axis a = (Axis) gh_scm2int (scm_axis);
Molecule *m = s->get_molecule ();
SCM
Grob::preset_extent (SCM element_smob, SCM scm_axis)
{
- Grob *s = unsmob_element (element_smob);
+ Grob *s = unsmob_grob (element_smob);
Axis a = (Axis) gh_scm2int (scm_axis);
SCM ext = s->get_grob_property ((a == X_AXIS)
for (SCM d= get_grob_property ("dependencies"); gh_pair_p (d); d = gh_cdr (d))
{
- unsmob_element (gh_car (d))
+ unsmob_grob (gh_car (d))
->calculate_dependencies (final, busy, funcname);
}
SCM mol = get_grob_property ("molecule");
if (unsmob_molecule (mol))
return unsmob_molecule (mol);
+
+ mol = get_uncached_molecule ();
+
+ Grob *me = (Grob*)this;
+ me->set_grob_property ("molecule", mol);
+ return unsmob_molecule (mol);
+}
+SCM
+Grob::get_uncached_molecule ()const
+{
SCM proc = get_grob_property ("molecule-callback");
- mol = SCM_EOL;
+ SCM mol = SCM_EOL;
if (gh_procedure_p (proc))
mol = gh_apply (proc, gh_list (this->self_scm (), SCM_UNDEFINED));
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;
+ return mol;
}
-
/*
VIRTUAL STUBS
Grob::handle_broken_smobs (SCM src, SCM criterion)
{
again:
- Grob *sc = unsmob_element (src);
+ Grob *sc = unsmob_grob (src);
if (sc)
{
if (gh_number_p (criterion))
else
{
Line_of_score * line
- = dynamic_cast<Line_of_score*> (unsmob_element (criterion));
+ = dynamic_cast<Line_of_score*> (unsmob_grob (criterion));
if (sc->line_l () != line)
{
sc = sc->find_broken_piece (line);
Grob * common = (Grob*) this;
for (; gh_pair_p (elist); elist = gh_cdr (elist))
{
- Grob * s = unsmob_element (gh_car (elist));
+ Grob * s = unsmob_grob (gh_car (elist));
if (s)
common = common->common_refpoint (s, a);
}
SCM
Grob::fixup_refpoint (SCM smob)
{
- Grob *me = unsmob_element (smob);
+ Grob *me = unsmob_grob (smob);
for (int a = X_AXIS; a < NO_AXES; a ++)
{
Axis ax = (Axis)a;
****************************************************/
-IMPLEMENT_UNSMOB(Grob, element);
+IMPLEMENT_UNSMOB(Grob, grob);
IMPLEMENT_SMOBS(Grob);
IMPLEMENT_DEFAULT_EQUAL_P(Grob);
SCM
ly_set_grob_property (SCM elt, SCM sym, SCM val)
{
- Grob * sc = unsmob_element (elt);
+ Grob * sc = unsmob_grob (elt);
if (!gh_symbol_p (sym))
{
SCM
ly_get_grob_property (SCM elt, SCM sym)
{
- Grob * sc = unsmob_element (elt);
+ Grob * sc = unsmob_grob (elt);
if (sc)
{
SCM
spanner_get_bound (SCM slur, SCM dir)
{
- return dynamic_cast<Spanner*> (unsmob_element (slur))->get_bound (to_dir (dir))->self_scm ();
+ return dynamic_cast<Spanner*> (unsmob_grob (slur))->get_bound (to_dir (dir))->self_scm ();
}
SCM
Hara_kiri_group_spanner::y_extent (SCM element_smob, SCM scm_axis)
{
- Grob *me = unsmob_element (element_smob);
+ Grob *me = unsmob_grob (element_smob);
Axis a = (Axis) gh_scm2int (scm_axis);
assert (a == Y_AXIS);
SCM
Hara_kiri_group_spanner::force_hara_kiri_callback (SCM element_smob, SCM axis)
{
- Grob *me = unsmob_element (element_smob);
+ Grob *me = unsmob_grob (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)
{
- Grob *daughter = unsmob_element (element_smob);
+ Grob *daughter = unsmob_grob (element_smob);
Axis a = (Axis) gh_scm2int (axis);
assert (a == Y_AXIS);
force_hara_kiri_callback (daughter->parent_l (a)->self_scm (), axis);
protected:
virtual void acknowledge_grob (Grob_info);
- virtual void do_removal_processing();
- void deprecated_process_music();
+ virtual void finalize();
virtual bool try_music (Music*);
virtual void stop_translation_timestep();
virtual void start_translation_timestep ();
}
void
-Hyphen_engraver::do_removal_processing ()
+Hyphen_engraver::finalize ()
{
if (hyphen_p_)
{
req_l_->origin ()->warning (_ ("unterminated hyphen"));
- hyphen_p_->set_bound(RIGHT, unsmob_element (get_property ("currentCommandColumn")));
+ hyphen_p_->set_bound(RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
}
}
void
Hyphen_engraver::create_grobs ()
-{
- deprecated_process_music ();
-}
-
-void
-Hyphen_engraver::deprecated_process_music ()
{
if (req_l_ &&! hyphen_p_)
{
SCM
Hyphen_spanner::brew_molecule (SCM smob)
{
- Spanner * sp = dynamic_cast<Spanner*> (unsmob_element (smob));
+ Spanner * sp = dynamic_cast<Spanner*> (unsmob_grob (smob));
Grob * common = sp;
Direction d = LEFT;
class Tempo_req : public Request
{
public:
- Duration dur_;
-
-
Tempo_req();
protected:
{
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
static bool has_interface (Grob*);
+
+private:
+ static void add_streepjes(Grob* me, int pos, int interspaces, Molecule* custos_p_);
+ static Molecule create_ledger_line (Interval x_extent, Grob *me) ;
+
};
#endif // CUSTOS_HH
VIRTUAL_COPY_CONS(Translator);
Grace_engraver_group ();
protected:
- virtual void do_creation_processing ();
+ virtual void initialize ();
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 finalize () ;
virtual void typeset_grob (Grob*);
virtual bool try_music (Music *m);
};
virtual void finish ();
virtual void process ();
virtual void each (Method_pointer);
- virtual void do_removal_processing () ;
+ virtual void finalize () ;
virtual void play_element (Audio_element*);
virtual bool try_music (Music *m);
};
virtual SCM do_derived_mark ();
Molecule * get_molecule () const;
+ SCM get_uncached_molecule () const;
+
void suicide ();
DECLARE_SCHEME_CALLBACK(preset_extent, (SCM smob, SCM axis));
DECLARE_SCHEME_CALLBACK(fixup_refpoint, (SCM));
};
-Grob * unsmob_element (SCM);
+Grob * unsmob_grob (SCM);
#endif // STAFFELEM_HH
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)));
+ arr.push (dynamic_cast<T*> (unsmob_grob (e)));
}
arr.reverse ();
Spanner *staffline_p_;
virtual void create_line_spanner ();
- virtual void do_creation_processing();
- virtual void do_removal_processing();
+ virtual void initialize();
+ virtual void finalize();
virtual void typeset_grob (Grob*);
public:
VIRTUAL_COPY_CONS(Translator);
virtual void acknowledge_grob(Grob_info);
virtual void create_grobs ();
virtual void stop_translation_timestep();
- virtual void do_removal_processing ();
+ virtual void finalize ();
private:
void record_notehead(const String &context_id, Grob * notehead);
void record_lyric(const String &context_id, Grob * lyric);
*/
class Rhythmic_req : public virtual Request {
public:
- Duration duration_;
-
bool do_equal_b (Request const*) const;
void compress (Moment);
virtual Moment length_mom () const;
/// request which has some kind of pitch
struct Melodic_req :virtual Request
{
- Pitch pitch_;
-
static int compare (Melodic_req const&,Melodic_req const&);
protected:
/* Engraver_group_engraver interface */
virtual bool try_music (Music*);
- virtual void do_creation_processing();
- virtual void do_removal_processing();
+ virtual void initialize();
+ virtual void finalize();
virtual void announce_grob (Grob_info);
virtual void do_announces();
virtual void typeset_grob (Grob*elem_p);
virtual void stop_translation_timestep();
- virtual void do_add_processing ();
+
};
#endif // SCORE_GRAV_HH
virtual void prepare (Moment mom);
virtual void process();
virtual void start();
- virtual void do_add_processing ();
+ virtual void initialize ();
virtual void announce_element (Audio_element_info);
virtual int get_tempo_i() const;
virtual void play_element (Audio_element* p);
static Direction get_default_dir (Grob *me);
DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM ));
-
+ DECLARE_SCHEME_CALLBACK (height, (SCM,SCM));
private:
static Real get_first_notecolumn_y (Grob *me, Direction dir);
static Offset broken_trend_offset (Grob *me, Direction dir);
Music *check_;
protected:
- virtual void do_creation_processing ();
+ virtual void initialize ();
virtual bool try_music (Music *req_l);
- void deprecated_process_music();
- virtual void stop_translation_timestep();
- virtual void start_translation_timestep();
+ virtual void process_music ();
+ virtual void stop_translation_timestep ();
+ virtual void start_translation_timestep ();
public:
Moment measure_position () const;
bool try_music_on_nongroup_children (Music *m);
virtual void do_announces ();
- virtual void do_add_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 initialize();
+ virtual void finalize();
virtual void each (Method_pointer);
};
void pre_move_processing();
- void add_processing ();
void announces();
void post_move_processing();
void removal_processing();
DECLARE_SMOBS(Translator, dummy);
public:
- virtual void do_add_processing ();
/**
try to fit the request in this engraver
virtual void stop_translation_timestep();
virtual void start_translation_timestep();
virtual void do_announces () ;
- virtual void do_creation_processing() ;
- virtual void do_removal_processing();
+ virtual void initialize() ;
+ virtual void finalize();
};
class Transposed_music : public Music_wrapper
{
public:
- Pitch transpose_to_pitch_;
-
-
Transposed_music (Music*, Pitch);
VIRTUAL_COPY_CONS(Music);
Protected_scm old_accs_; // ugh. -> property
protected:
- virtual void do_creation_processing();
- virtual void do_removal_processing ();
+ virtual void initialize();
+ virtual void finalize ();
virtual bool try_music (Music *req_l);
- void deprecated_process_music();
virtual void stop_translation_timestep();
virtual void start_translation_timestep();
virtual void create_grobs ();
void
-Key_engraver::do_removal_processing ()
+Key_engraver::finalize ()
{
old_accs_ = SCM_EOL; // unprotect can not be called from dtor.
}
void
Key_engraver::create_grobs ()
-{
- deprecated_process_music ();
-}
-
-void
-Key_engraver::deprecated_process_music ()
{
if (keyreq_l_ || old_accs_ != get_property ("keySignature"))
{
}
void
-Key_engraver::do_creation_processing ()
+Key_engraver::initialize ()
{
daddy_trans_l_->set_property ("keySignature", SCM_EOL);
old_accs_ = SCM_EOL;
SCM
Key_item::brew_molecule (SCM smob)
{
- Grob*me =unsmob_element (smob);
+ Grob*me =unsmob_grob (smob);
Real inter = Staff_symbol_referencer::staff_space (me)/2.0;
void
-Line_group_engraver_group::do_removal_processing()
+Line_group_engraver_group::finalize()
{
- Engraver_group_engraver::do_removal_processing ();
+ Engraver_group_engraver::finalize ();
Grob * it
- = unsmob_element (get_property (ly_symbol2scm ("currentCommandColumn")));
+ = unsmob_grob (get_property (ly_symbol2scm ("currentCommandColumn")));
staffline_p_->set_bound(RIGHT,it);
Engraver_group_engraver::typeset_grob (staffline_p_);
}
void
-Line_group_engraver_group::do_creation_processing()
+Line_group_engraver_group::initialize()
{
create_line_spanner ();
Grob * it
- = unsmob_element (get_property (ly_symbol2scm ("currentCommandColumn")));
+ = unsmob_grob (get_property (ly_symbol2scm ("currentCommandColumn")));
staffline_p_->set_bound(LEFT,it);
Engraver::announce_grob (staffline_p_,0);
for (SCM s = get_grob_property ("all-elements");
gh_pair_p (s); s = gh_cdr (s))
{
- unsmob_element (gh_car (s))->do_break_processing ();
+ unsmob_grob (gh_car (s))->do_break_processing ();
}
/*
fixups must be done in broken line_of_scores, because new 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 ();
+ unsmob_grob (gh_car (s))->handle_broken_dependencies ();
}
handle_broken_dependencies ();
if (i < broken_into_l_arr_.size () - 1)
{
SCM lastcol = gh_car (line_l->get_grob_property ("columns"));
- Grob* e = unsmob_element (lastcol);
+ Grob* e = unsmob_grob (lastcol);
SCM inter = e->get_grob_property ("between-system-string");
if (gh_string_p (inter))
{
{
Grob *me = this;
SCM cs = me->get_grob_property ("columns");
- Grob * prev = gh_pair_p (cs) ? unsmob_element (gh_car (cs)) : 0;
+ Grob * prev = gh_pair_p (cs) ? unsmob_grob (gh_car (cs)) : 0;
p->rank_i_ = prev ? Paper_column::rank_i (prev) + 1 : 0;
Line_of_score::pre_processing ()
{
for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
- unsmob_element (gh_car (s))->discretionary_processing ();
+ unsmob_grob (gh_car (s))->discretionary_processing ();
if(verbose_global_b)
progress_indication ( _f("Element count %d ", element_count ()));
for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
- unsmob_element (gh_car (s))->handle_prebroken_dependencies ();
+ unsmob_grob (gh_car (s))->handle_prebroken_dependencies ();
fixup_refpoints (get_grob_property ("all-elements"));
for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
{
- Grob* sc = unsmob_element (gh_car (s));
+ Grob* sc = unsmob_grob (gh_car (s));
sc->calculate_dependencies (PRECALCED, PRECALCING, ly_symbol2scm ("before-line-breaking-callback"));
}
progress_indication ("\n" + _ ("Calculating column positions...") + " " );
for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
{
- Grob * e = unsmob_element (gh_car (s));
+ Grob * e = unsmob_grob (gh_car (s));
SCM proc = e->get_grob_property ("spacing-procedure");
if (gh_procedure_p (proc))
gh_call1 (proc, e->self_scm ());
for (SCM s = get_grob_property ("all-elements");
gh_pair_p (s); s = gh_cdr (s))
{
- Grob* sc = unsmob_element (gh_car (s));
+ Grob* sc = unsmob_grob (gh_car (s));
sc->calculate_dependencies (POSTCALCED, POSTCALCING,
ly_symbol2scm ("after-line-breaking-callback"));
}
(ugh. This is not very memory efficient.) */
for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
{
- unsmob_element (gh_car (s))->get_molecule ();
+ unsmob_grob (gh_car (s))->get_molecule ();
}
/*
font defs;
*/
for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
{
- Grob *sc = unsmob_element (gh_car (s));
+ Grob *sc = unsmob_grob (gh_car (s));
Molecule *m = sc->get_molecule ();
if (!m)
continue;
while (gh_pair_p (s) && gh_car (s) != l->self_scm ())
{
- Paper_column*c = dynamic_cast<Paper_column*> ( unsmob_element (gh_car (s)));
+ Paper_column*c = dynamic_cast<Paper_column*> ( unsmob_grob (gh_car (s)));
if (Item::breakable_b (c) && !c->line_l_)
ret.push (c);
void deprecated_process_music();
virtual void acknowledge_grob (Grob_info);
virtual void stop_translation_timestep();
- virtual void do_creation_processing ();
+ virtual void initialize ();
virtual void create_grobs ();
- virtual void do_removal_processing ();
+ virtual void finalize ();
public:
// todo -> property
}
void
-Local_key_engraver::do_creation_processing ()
+Local_key_engraver::initialize ()
{
last_keysig_ = get_property ("keySignature");
daddy_trans_l_->set_property ("localKeySignature", last_keysig_);
}
void
-Local_key_engraver::do_removal_processing ()
+Local_key_engraver::finalize ()
{
// TODO: if grace ? signal accidentals to Local_key_engraver the
}
SCM
Local_key_item::brew_molecule (SCM smob)
{
- Grob* me = unsmob_element (smob);
+ Grob* me = unsmob_grob (smob);
Molecule mol;
Jan Nieuwenhuizen <janneke@gnu.org>
*/
-#include "lyric-engraver.hh"
+#include "engraver.hh"
#include "musical-request.hh"
#include "item.hh"
#include "paper-def.hh"
#include "font-metric.hh"
#include "side-position-interface.hh"
+/**
+ Generate texts for lyric syllables. We only do one lyric at a time.
+ Multiple copies of this engraver should be used to do multiple voices.
+ */
+class Lyric_engraver : public Engraver
+{
+protected:
+ virtual void stop_translation_timestep();
+ virtual bool try_music (Music *);
+ virtual void create_grobs ();
+ virtual void start_translation_timestep ();
+
+public:
+ Lyric_engraver ();
+ VIRTUAL_COPY_CONS (Translator);
+
+private:
+ Lyric_req * req_l_;
+ Item* text_p_;
+};
+
ADD_THIS_TRANSLATOR (Lyric_engraver);
}
void
-Lyric_engraver::deprecated_process_music()
+Lyric_engraver::create_grobs ()
{
if (req_l_)
{
SCM
Lyric_extender::brew_molecule (SCM smob)
{
- Spanner *sp = dynamic_cast<Spanner*> (unsmob_element (smob));
+ Spanner *sp = dynamic_cast<Spanner*> (unsmob_grob (smob));
// ugh: refp
Real leftext = sp->get_bound (LEFT)->extent (sp->get_bound (LEFT),
}
void
-Lyric_phrasing_engraver::do_removal_processing ()
+Lyric_phrasing_engraver::finalize ()
{
/*
but do need to unprotect alist_, since Engravers are gc'd now.
virtual void acknowledge_grob (Grob_info);
void create_items(Request*);
virtual bool try_music (Music *req_l);
- void deprecated_process_music ();
virtual void start_translation_timestep ();
- virtual void do_creation_processing ();
+ virtual void initialize ();
virtual void create_grobs ();
private:
}
void
-Mark_engraver::do_creation_processing ()
+Mark_engraver::initialize ()
{
daddy_trans_l_->set_property ("staffsFound", SCM_EOL); // ugh: sharing with barnumber grav.
}
void
Mark_engraver::create_grobs ()
-{
- deprecated_process_music ();
-}
-
-void
-Mark_engraver::deprecated_process_music ()
{
if (mark_req_l_)
{
protected:
virtual void acknowledge_grob (Grob_info i);
- void deprecated_process_music ();
virtual bool try_music (Music*);
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
- virtual void do_removal_processing ();
+ virtual void finalize ();
virtual void create_grobs ();
private:
void
Multi_measure_rest_engraver::create_grobs ()
-{
- deprecated_process_music ();
-}
-
-
-void
-Multi_measure_rest_engraver::deprecated_process_music ()
{
if (new_req_l_ && stop_req_l_)
stop_req_l_ = 0;
void
-Multi_measure_rest_engraver::do_removal_processing ()
+Multi_measure_rest_engraver::finalize ()
{
if (mmrest_p_)
typeset_grob (mmrest_p_);
SCM
Multi_measure_rest::brew_molecule (SCM smob)
{
- Grob *me = unsmob_element (smob);
+ Grob *me = unsmob_grob (smob);
Spanner * sp = dynamic_cast<Spanner*> (me);
SCM alist_chain = Font_interface::font_alist_chain (me);
SCM
Multi_measure_rest::set_spacing_rods (SCM smob)
{
- Grob*me = unsmob_element (smob);
+ Grob*me = unsmob_grob (smob);
Spanner*sp = dynamic_cast<Spanner*> (me);
if (!(sp->get_bound (LEFT) && sp->get_bound (RIGHT)))
Translator_group * tg = t->instantiate (this);
- tg->add_processing ();
- tg->do_creation_processing ();
+ tg->initialize ();
return dynamic_cast <Global_translator *> (tg);
}
bool
Note_column::rest_b (Grob*me)
{
- return unsmob_element (me->get_grob_property ("rest"));
+ return unsmob_grob (me->get_grob_property ("rest"));
}
int
Note_column::stem_l (Grob*me)
{
SCM s = me->get_grob_property ("stem");
- return dynamic_cast<Item*>(unsmob_element (s));
+ return dynamic_cast<Item*>(unsmob_grob (s));
}
Slice
SCM h = me->get_grob_property ("note-heads");
for (; gh_pair_p (h); h = gh_cdr (h))
{
- Grob *se = unsmob_element (gh_car (h));
+ Grob *se = unsmob_grob (gh_car (h));
int j = int (Staff_symbol_referencer::position_f (se));
iv.unite (Slice (j,j));
Direction
Note_column::dir (Grob* me)
{
- Grob *stem = unsmob_element (me->get_grob_property ("stem"));
+ Grob *stem = unsmob_grob (me->get_grob_property ("stem"));
if (stem && Stem::has_interface (stem))
return Stem::get_direction (stem);
else if (gh_pair_p (me->get_grob_property ("note-heads")))
void
Note_column::translate_rests (Grob*me,int dy_i)
{
- Grob * r = unsmob_element (me->get_grob_property ("rest"));
+ Grob * r = unsmob_grob (me->get_grob_property ("rest"));
if (r)
{
r->translate_axis (dy_i * Staff_symbol_referencer::staff_space (r)/2.0, Y_AXIS);
SCM
Note_head::brew_molecule (SCM smob)
{
- Grob *me = unsmob_element (smob);
+ Grob *me = unsmob_grob (smob);
Real inter_f = Staff_symbol_referencer::staff_space (me)/2;
Moment note_end_mom_;
public:
VIRTUAL_COPY_CONS(Translator);
- Note_heads_engraver();
protected:
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 stop_translation_timestep();
};
-
-
-
-Note_heads_engraver::Note_heads_engraver()
-{
-}
-
bool
Note_heads_engraver::try_music (Music *m)
{
}
-void
-Note_heads_engraver::create_grobs ()
-{
- deprecated_process_music ();
-}
-
void
Note_heads_engraver::acknowledge_grob (Grob_info)
{
- //deprecated_process_music ();
+ //create_grobs ();
}
void
-Note_heads_engraver::deprecated_process_music()
+Note_heads_engraver::create_grobs ()
{
if (note_p_arr_.size ())
return ;
Link_array<Note_req> req_l_arr_;
Link_array<Item> texts_;
virtual bool try_music (Music*m);
- void deprecated_process_music ();
+ virtual void create_grobs ();
virtual void stop_translation_timestep ();
};
return false;
}
-
void
-Note_name_engraver::deprecated_process_music ()
+Note_name_engraver::create_grobs ()
{
if (texts_.size ())
return;
junk this ? there already is tempo stuff in
music.
*/
- int m = gh_scm2int ( $2->get_mus_property ("metronome-count"));
- dynamic_cast<Midi_def*> ($$)->set_tempo ($2->dur_.length_mom (), m);
+ int m = gh_scm2int ( $2->get_mus_property ("metronome-count"));
+ Duration *d = unsmob_duration ($2->get_mus_property ("duration"));
+ dynamic_cast<Midi_def*> ($$)->set_tempo (d->length_mom (), m);
}
| music_output_def_body error {
Piano_pedal_engraver ();
~Piano_pedal_engraver ();
protected:
- virtual void do_creation_processing ();
+ virtual void initialize ();
virtual bool try_music (Music*);
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
info_list_ = 0;
}
void
-Piano_pedal_engraver::do_creation_processing()
+Piano_pedal_engraver::initialize()
{
info_list_ = new Pedal_info[4];
Pedal_info *p = info_list_;
~Piano_pedal_performer ();
protected:
- virtual void do_creation_processing ();
+ virtual void initialize ();
virtual bool try_music (Music*);
virtual void create_grobs ();
virtual void stop_translation_timestep ();
}
void
-Piano_pedal_performer::do_creation_processing ()
+Piano_pedal_performer::initialize ()
{
info_alist_ = new Pedal_info[4];
Pedal_info *p = info_alist_;
protected:
virtual void acknowledge_grob (Grob_info ei);
- virtual void do_creation_processing ();
- virtual void do_removal_processing ();
+ virtual void initialize ();
+ virtual void finalize ();
public:
~Property_engraver();
Property_engraver();
prop_dict_ = 0;
}
void
-Property_engraver::do_removal_processing()
+Property_engraver::finalize()
{
}
}
void
-Property_engraver::do_creation_processing ()
+Property_engraver::initialize ()
{
prop_dict_ = new Scheme_hash_table;
void
Property_engraver::acknowledge_grob (Grob_info i)
{
- /////////
- return;
- SCM ifs = i.elem_l_->get_grob_property ("interfaces");
+ SCM ifs = i.elem_l_->get_grob_property ("interfaces");
SCM props;
for (; gh_pair_p (ifs); ifs = gh_cdr (ifs))
{
Pitch
Relative_octave_music::to_relative_octave (Pitch)
{
- return last_pitch_;
+ return * unsmob_pitch (get_mus_property ("last-pitch"));
}
Relative_octave_music::Relative_octave_music(Music*p,Pitch def)
: Music_wrapper (p)
{
- last_pitch_ = element ()->to_relative_octave (def);
+ set_mus_property ("last-pitch", element ()->to_relative_octave (def).smobbed_copy ());
set_mus_property ("type", ly_symbol2scm ("relative-octave-music"));
}
virtual void start_translation_timestep ();
virtual void process_music ();
- virtual void do_creation_processing ();
+ virtual void initialize ();
bool first_b_;
};
void
-Repeat_acknowledge_engraver::do_creation_processing ()
+Repeat_acknowledge_engraver::initialize ()
{
first_b_ = true;
daddy_trans_l_->set_property ("repeatCommands", SCM_EOL);
SCM
Rest_collision::force_shift_callback (SCM element_smob, SCM axis)
{
- Grob *them = unsmob_element (element_smob);
+ Grob *them = unsmob_grob (element_smob);
Axis a = (Axis) gh_scm2int (axis);
assert (a == Y_AXIS);
- Grob * rc = unsmob_element (them->get_grob_property ("rest-collision"));
+ Grob * rc = unsmob_grob (them->get_grob_property ("rest-collision"));
if (rc)
{
static SCM
head_characteristic (Grob * col)
{
- Grob * s = unsmob_element (col->get_grob_property ("rest"));
+ Grob * s = unsmob_grob (col->get_grob_property ("rest"));
if (!s)
return SCM_BOOL_F;
for (SCM s = elts; gh_pair_p (s); s = gh_cdr (s))
{
- Grob * e = unsmob_element (gh_car (s));
+ Grob * e = unsmob_grob (gh_car (s));
if (!e)
continue;
else
commony= commony->common_refpoint (e, Y_AXIS);
- if (unsmob_element (e->get_grob_property ("rest")))
+ if (unsmob_grob (e->get_grob_property ("rest")))
rests.push (e);
else
notes.push (e);
display_count = gh_scm2int (s);
for (; i > display_count; i--)
{
- Grob* r = unsmob_element (rests[i-1]->get_grob_property ("rest"));
+ Grob* r = unsmob_grob (rests[i-1]->get_grob_property ("rest"));
if (r)
r->suicide ();
rests[i-1]->suicide ();
// try to be opposite of noteheads.
Direction dir = - Note_column::dir (notes[0]);
- Grob * r = unsmob_element (rcol->get_grob_property ("rest"));
+ Grob * r = unsmob_grob (rcol->get_grob_property ("rest"));
Interval restdim = r->extent (r, Y_AXIS); // ??
if (restdim.empty_b ())
virtual bool try_music (Music *);
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
- void deprecated_process_music ();
+ virtual void create_grobs ();
+
public:
VIRTUAL_COPY_CONS(Translator);
}
void
-Rest_engraver::deprecated_process_music ()
+Rest_engraver::create_grobs ()
{
if (rest_req_l_ && !rest_p_)
{
SCM
Rest::after_line_breaking (SCM smob)
{
- Grob *me = unsmob_element (smob);
+ Grob *me = unsmob_grob (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);
}
- Grob * d = unsmob_element (me->get_grob_property ("dot"));
+ Grob * d = unsmob_grob (me->get_grob_property ("dot"));
if (d && bt > 4) // UGH.
{
d->set_grob_property ("staff-position",
SCM
Rest::brew_internal_molecule (SCM smob)
{
- Grob* me = unsmob_element (smob);
+ Grob* me = unsmob_grob (smob);
bool ledger_b =false;
Rhythmic_head::dots_l (Grob*me)
{
SCM s = me->get_grob_property ("dot");
- return dynamic_cast<Item*> (unsmob_element (s));
+ return dynamic_cast<Item*> (unsmob_grob (s));
}
int
Rhythmic_head::stem_l (Grob*me)
{
SCM s = me->get_grob_property ("stem");
- return dynamic_cast<Item*> (unsmob_element (s));
+ return dynamic_cast<Item*> (unsmob_grob (s));
}
int
#include "item.hh"
#include "score-engraver.hh"
#include "paper-score.hh"
-#include "musical-request.hh"
#include "paper-column.hh"
#include "command-request.hh"
#include "paper-def.hh"
#include "axis-group-interface.hh"
+#include "translator-def.hh"
Score_engraver::Score_engraver()
use start/finish?
*/
void
-Score_engraver::do_creation_processing ()
+Score_engraver::initialize ()
{
+ unsmob_translator_def (definition_)->apply_property_operations (this);
+
+ assert (dynamic_cast<Paper_def *> (output_def_l_));
+ assert (!daddy_trans_l_);
+ pscore_p_ = new Paper_score;
+ pscore_p_->paper_l_ = dynamic_cast<Paper_def*>(output_def_l_);
+
+ SCM props = get_property (ly_symbol2scm ("LineOfScore"));
+
+ pscore_p_->typeset_line (new Line_of_score (props));
+
make_columns (Moment (0));
scoreline_l_ = pscore_p_->line_l_;
command_column_l_->set_grob_property ("breakable", SCM_BOOL_T);
- Engraver_group_engraver::do_creation_processing();
+ Engraver_group_engraver::initialize();
}
void
-Score_engraver::do_removal_processing()
+Score_engraver::finalize()
{
- Engraver_group_engraver::do_removal_processing();
+ Engraver_group_engraver::finalize();
scoreline_l_->set_bound(RIGHT,command_column_l_);
command_column_l_->set_grob_property ("breakable", SCM_BOOL_T);
Score_engraver::process()
{
process_music();
-
announces();
pre_move_processing();
check_removal();
if (*current[i])
{
scoreline_l_->add_column ((*current[i]));
-#if 0
- /*
- TODO: delay this decision.
- */
- if (!Paper_column::used_b (*current[i]))
- {
- (*current[i])->suicide ();
- *current[i] =0;
- }
-#endif
}
if (news[i])
*current[i] = news[i];
ADD_THIS_TRANSLATOR(Score_engraver);
-void
-Score_engraver::do_add_processing ()
-{
- Translator_group::do_add_processing ();
- assert (dynamic_cast<Paper_def *> (output_def_l_));
- assert (!daddy_trans_l_);
- pscore_p_ = new Paper_score;
- pscore_p_->paper_l_ = dynamic_cast<Paper_def*>(output_def_l_);
-
- SCM props = get_property (ly_symbol2scm ("LineOfScore"));
-
- pscore_p_->typeset_line (new Line_of_score (props));
-}
#include "midi-stream.hh"
#include "string-convert.hh"
#include "debug.hh"
-#include "score.hh"
-#include "source-file.hh"
-#include "source.hh"
-#include "audio-staff.hh"
-
+#include "translator-def.hh"
ADD_THIS_TRANSLATOR (Score_performer);
}
void
-Score_performer::do_add_processing ()
+Score_performer::initialize ()
{
- Translator_group::do_add_processing ();
+ unsmob_translator_def (definition_)->apply_property_operations (this);
assert (dynamic_cast<Midi_def *> (output_def_l_));
performance_p_ = new Performance;
- performance_p_->midi_l_ = dynamic_cast<Midi_def*>(output_def_l_);
+ performance_p_->midi_l_ = dynamic_cast<Midi_def*>(output_def_l_);
+
+ Translator_group::initialize ();
}
protected:
virtual void acknowledge_grob (Grob_info);
virtual void create_grobs ();
- virtual void stop_translation_timestep ();
- virtual void start_translation_timestep ();
+ virtual void stop_translation_timestep ();
+ virtual void start_translation_timestep ();
};
SCM
Script_column::before_line_breaking (SCM smob)
{
- Grob* me = unsmob_element (smob);
+ Grob* me = unsmob_grob (smob);
Drul_array<Link_array<Grob> > arrs;
Link_array<Grob> staff_sided
= Pointer_group_interface__extract_elements (me, (Grob*)0, "scripts");
Link_array<Articulation_req> script_req_l_arr_;
public:
- VIRTUAL_COPY_CONS(Translator);
-
- Script_engraver();
+ VIRTUAL_COPY_CONS (Translator);
+
protected:
virtual bool try_music (Music*);
- void deprecated_process_music ();
+ virtual void initialize ();
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
virtual void create_grobs ();
};
-Script_engraver::Script_engraver()
+void
+Script_engraver::initialize ()
{
- start_translation_timestep();
+ script_req_l_arr_.clear();
}
bool
void
Script_engraver::create_grobs ()
-{
- deprecated_process_music ();
-}
-
-void
-Script_engraver::deprecated_process_music()
{
for (int i=0; i < script_req_l_arr_.size(); i++)
{
script_req_l_arr_.clear();
}
-ADD_THIS_TRANSLATOR(Script_engraver);
+ADD_THIS_TRANSLATOR (Script_engraver);
SCM
Script::after_line_breaking (SCM smob)
{
- Grob * me = unsmob_element (smob);
+ Grob * me = unsmob_grob (smob);
Direction d = Side_position::get_direction (me);
Side_position::set_direction (me,d);
SCM
Script::brew_molecule (SCM smob)
{
- Grob *me= unsmob_element (smob);
+ Grob *me= unsmob_grob (smob);
#if 0
Direction dir = DOWN;
SCM d = me->get_grob_property ("direction");
SCM
Separating_group_spanner::set_spacing_rods (SCM smob)
{
- Grob*me = unsmob_element (smob);
+ Grob*me = unsmob_grob (smob);
for (SCM s = me->get_grob_property ("elements"); gh_pair_p (s) && gh_pair_p (gh_cdr (s)); s = gh_cdr (s))
{
SCM elt = gh_cadr (s);
SCM next_elt = gh_car (s);
- Item *l = dynamic_cast<Item*> (unsmob_element (elt));
- Item *r = dynamic_cast<Item*> (unsmob_element ( next_elt));
+ Item *l = dynamic_cast<Item*> (unsmob_grob (elt));
+ Item *r = dynamic_cast<Item*> (unsmob_grob ( next_elt));
if (!r || !l)
continue;
*/
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)));
+ Item * it =dynamic_cast<Item*>(unsmob_grob (gh_car (s)));
if (it && it->broken_b ())
{
it->find_prebroken_piece (LEFT) ->suicide ();
Spanner * sep_span_p_;
virtual void acknowledge_grob (Grob_info);
- virtual void do_creation_processing ();
- virtual void do_removal_processing ();
+ virtual void initialize ();
+ virtual void finalize ();
virtual void stop_translation_timestep ();
public:
Separating_line_group_engraver ();
}
void
-Separating_line_group_engraver::do_creation_processing ()
+Separating_line_group_engraver::initialize ()
{
sep_span_p_ = new Spanner (get_property ("SeparatingGroupSpanner"));
Separating_group_spanner::set_interface (sep_span_p_);
announce_grob (sep_span_p_, 0);
- sep_span_p_->set_bound (LEFT, unsmob_element (get_property ("currentCommandColumn")));
+ sep_span_p_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
}
void
-Separating_line_group_engraver::do_removal_processing ()
+Separating_line_group_engraver::finalize ()
{
- sep_span_p_->set_bound (RIGHT, unsmob_element (get_property ("currentCommandColumn")));
+ sep_span_p_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
typeset_grob (sep_span_p_);
sep_span_p_ =0;
}
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))
+ if (!unsmob_grob (elt))
continue;
- Item *il = dynamic_cast<Item*> (unsmob_element (elt));
+ Item *il = dynamic_cast<Item*> (unsmob_grob (elt));
if (pc != il->column_l ())
{
/* this shouldn't happen, but let's continue anyway. */
}
SCM other_elt = me->get_grob_property ("direction-source");
- Grob * e = unsmob_element(other_elt);
+ Grob * e = unsmob_grob(other_elt);
if (e)
{
return (Direction)(relative_dir * Side_position::get_direction (e));
SCM
Side_position::side_position (SCM element_smob, SCM axis)
{
- Grob *me = unsmob_element (element_smob);
+ Grob *me = unsmob_grob (element_smob);
Axis a = (Axis) gh_scm2int (axis);
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))
{
- Grob * e = unsmob_element (gh_car (s));
+ Grob * e = unsmob_grob (gh_car (s));
if (e)
common = common->common_refpoint (e, a);
}
for (SCM s = support; s != SCM_EOL; s = gh_cdr (s))
{
- Grob * e = unsmob_element ( gh_car (s));
+ Grob * e = unsmob_grob ( gh_car (s));
if (e)
{
dim.unite (e->extent (common, a));
SCM
Side_position::aligned_on_self (SCM element_smob, SCM axis)
{
- Grob *me = unsmob_element (element_smob);
+ Grob *me = unsmob_grob (element_smob);
Axis a = (Axis) gh_scm2int (axis);
String s ("self-alignment-");
return gh_double2scm (- ext.linear_combination (gh_scm2double (align)));
}
}
- else if (unsmob_element (align))
+ else if (unsmob_grob (align))
{
- return gh_double2scm (- unsmob_element (align)->relative_coordinate (me, a));
+ return gh_double2scm (- unsmob_grob (align)->relative_coordinate (me, a));
}
return gh_double2scm (0.0);
}
SCM
Side_position::quantised_position (SCM element_smob, SCM )
{
- Grob *me = unsmob_element (element_smob);
+ Grob *me = unsmob_grob (element_smob);
Direction d = Side_position::get_direction (me);
SCM
Side_position::aligned_side (SCM element_smob, SCM axis)
{
- Grob *me = unsmob_element (element_smob);
+ Grob *me = unsmob_grob (element_smob);
Axis a = (Axis) gh_scm2int (axis);
Direction d = Side_position::get_direction (me);
SCM
Side_position::centered_on_parent (SCM element_smob, SCM axis)
{
- Grob *me = unsmob_element (element_smob);
+ Grob *me = unsmob_grob (element_smob);
Axis a = (Axis) gh_scm2int (axis);
Grob *him = me->parent_l (a);
spring_params == SCM_UNDEFINED && gh_pair_p (s);
s = gh_cdr (s))
{
- Grob *other = unsmob_element (gh_caar (s));
+ Grob *other = unsmob_grob (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))
{
- Grob * other = unsmob_element (gh_caar (s));
+ Grob * other = unsmob_grob (gh_caar (s));
int oi = cols.find_i (other);
if (oi >= 0)
{
protected:
virtual bool try_music (Music*);
- void deprecated_process_music ();
virtual void acknowledge_grob (Grob_info);
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
- virtual void do_removal_processing ();
+ virtual void finalize ();
virtual void create_grobs ();
public:
return false;
}
-void
-Slur_engraver::create_grobs ()
-{
- deprecated_process_music ();
-}
-
void
Slur_engraver::set_melisma (bool m)
{
}
void
-Slur_engraver::do_removal_processing ()
+Slur_engraver::finalize ()
{
for (int i = 0; i < slur_l_stack_.size (); i++)
{
}
void
-Slur_engraver::deprecated_process_music ()
+Slur_engraver::create_grobs ()
{
Link_array<Grob> start_slur_l_arr;
for (int i=0; i< new_slur_req_l_arr_.size (); i++)
SCM
Slur::after_line_breaking (SCM smob)
{
- Grob *me = unsmob_element (smob);
+ Grob *me = unsmob_grob (smob);
if (!scm_ilength (me->get_grob_property ("note-columns")))
{
me->suicide ();
Slur::get_first_notecolumn_y (Grob *me, Direction dir)
{
Grob *col = dir == LEFT
- ? unsmob_element (gh_car (scm_reverse (me->get_grob_property
+ ? unsmob_grob (gh_car (scm_reverse (me->get_grob_property
("note-columns"))))
- : unsmob_element
+ : unsmob_grob
(gh_car (me->get_grob_property ("note-columns")));
Grob *common[] =
Grob **common)
{
Offset o;
- Grob* stem_l = unsmob_element (col->get_grob_property ("stem"));
+ Grob* stem_l = unsmob_grob (col->get_grob_property ("stem"));
Direction dir = Directional_element_interface::get (me);
Link_array<Grob> encompass_arr;
while (gh_pair_p (eltlist))
{
- encompass_arr.push (unsmob_element (gh_car (eltlist)));
+ encompass_arr.push (unsmob_grob (gh_car (eltlist)));
eltlist =gh_cdr (eltlist);
}
encompass_arr.reverse ();
SCM
Slur::set_spacing_rods (SCM smob)
{
- Grob*me = unsmob_element (smob);
+ Grob*me = unsmob_grob (smob);
Rod r;
Spanner*sp = dynamic_cast<Spanner*>(me);
}
+/*
+ ugh ?
+ */
+MAKE_SCHEME_CALLBACK(Slur,height,2);
+SCM
+Slur::height (SCM smob, SCM ax)
+{
+ Axis a = (Axis)gh_scm2int (ax);
+ Grob * me = unsmob_grob (smob);
+ assert ( a == Y_AXIS);
+
+ SCM mol = me->get_uncached_molecule ();
+ return ly_interval2scm (unsmob_molecule (mol)->extent (a));
+}
+
/*
Ugh should have dash-length + dash-period
*/
SCM
Slur::brew_molecule (SCM smob)
{
- Grob * me = unsmob_element (smob);
+ Grob * me = unsmob_grob (smob);
if (!scm_ilength (me->get_grob_property ("note-columns")))
{
me->suicide ();
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 ();
+ virtual void initialize ();
+ virtual void finalize ();
public:
Spacing_engraver ();
};
}
void
-Spacing_engraver::do_creation_processing ()
+Spacing_engraver::initialize ()
{
spacing_p_ =new Spanner (get_property ("SpacingSpanner"));
Spacing_spanner::set_interface (spacing_p_);
- spacing_p_->set_bound (LEFT, unsmob_element (get_property ("currentCommandColumn")));
+ spacing_p_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
announce_grob (spacing_p_, 0);
}
void
-Spacing_engraver::do_removal_processing ()
+Spacing_engraver::finalize ()
{
- Grob * p = unsmob_element (get_property ("currentCommandColumn"));
+ Grob * p = unsmob_grob (get_property ("currentCommandColumn"));
spacing_p_->set_bound (RIGHT, p);
typeset_grob (spacing_p_);
spacing_p_ =0;
shortest_playing = shortest_playing <? starter;
Paper_column * sc
- = dynamic_cast<Paper_column*> (unsmob_element (get_property ("currentMusicalColumn")));
+ = dynamic_cast<Paper_column*> (unsmob_grob (get_property ("currentMusicalColumn")));
SCM sh = shortest_playing.smobbed_copy( );
SCM st = starter.smobbed_copy();
SCM
Spacing_spanner::set_springs (SCM smob)
{
- Grob *me = unsmob_element (smob);
+ Grob *me = unsmob_grob (smob);
Link_array<Grob> all (me->pscore_l_->line_l_->column_l_arr ()) ;
int j = 0;
SCM
Span_bar::width_callback (SCM element_smob, SCM scm_axis)
{
- Grob *se = unsmob_element (element_smob);
+ Grob *se = unsmob_grob (element_smob);
Axis a = (Axis) gh_scm2int (scm_axis);
assert (a == X_AXIS);
String gl = ly_scm2string (se->get_grob_property ("glyph"));
SCM
Span_bar::before_line_breaking (SCM smob)
{
- evaluate_empty (unsmob_element (smob));
- evaluate_glyph (unsmob_element (smob));
+ evaluate_empty (unsmob_grob (smob));
+ evaluate_glyph (unsmob_grob (smob));
/*
no need to call Bar::before_line_breaking (), because the info
SCM
Span_bar::center_on_spanned_callback (SCM element_smob, SCM axis)
{
- Grob *me = unsmob_element (element_smob);
+ Grob *me = unsmob_grob (element_smob);
Axis a = (Axis) gh_scm2int (axis);
assert (a == Y_AXIS);
Interval i (get_spanned_interval (me));
Span_bar::evaluate_glyph (Grob*me)
{
SCM elts = me->get_grob_property ("elements");
- Grob * b = unsmob_element (gh_car (elts));
+ Grob * b = unsmob_grob (gh_car (elts));
SCM glsym =ly_symbol2scm ("glyph");
SCM gl =b ->get_grob_property (glsym);
if (!gh_string_p (gl))
SCM
Span_bar::get_bar_size (SCM smob)
{
- Grob* me = unsmob_element (smob);
+ Grob* me = unsmob_grob (smob);
Interval iv (get_spanned_interval (me));
if (iv.empty_b ())
{
virtual bool try_music (Music*);
virtual void acknowledge_grob (Audio_element_info);
virtual void create_grobs ();
- void deprecated_process_music ();
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
}
void
-Span_dynamic_performer::deprecated_process_music ()
+Span_dynamic_performer::create_grobs ()
{
if (span_start_req_l_ || span_req_l_drul_[START])
{
Audio_dynamic_tuple a = { audio_p_, now_mom () };
dynamic_tuple_arr_.push (a);
}
-}
-void
-Span_dynamic_performer::create_grobs ()
-{
- deprecated_process_music ();
- if (span_req_l_drul_[STOP])
- {
- finished_dynamic_tuple_arr_.top ().audio_l_->volume_ = last_volume_;
- }
+ if (span_req_l_drul_[STOP])
+ {
+ finished_dynamic_tuple_arr_.top ().audio_l_->volume_ = last_volume_;
+ }
+
if (span_req_l_drul_[START])
{
- dynamic_tuple_arr_[0].audio_l_->volume_ = last_volume_;
+ dynamic_tuple_arr_[0].audio_l_->volume_ = last_volume_;
}
span_start_req_l_ = 0;
span_req_l_drul_[START] = 0;
span_req_l_drul_[STOP] = 0;
}
-
+
void
Span_dynamic_performer::stop_translation_timestep ()
{
if (!it)
return;
Item * col = it->column_l ();
- Item * i1 = dynamic_cast<Item*> (unsmob_element (gh_car (extremal_pair)));
- Item * i2 = dynamic_cast<Item*> (unsmob_element (gh_cdr (extremal_pair)));
+ Item * i1 = dynamic_cast<Item*> (unsmob_grob (gh_car (extremal_pair)));
+ Item * i2 = dynamic_cast<Item*> (unsmob_grob (gh_cdr (extremal_pair)));
int r = Paper_column::rank_i (col);
if (!i1 || r < Paper_column::rank_i (i1->column_l ()))
{
extend_spanner_over_elements (gh_car (value), extremal_pair);
extend_spanner_over_elements (gh_cdr (value), extremal_pair);
}
- else if (unsmob_element (value))
+ else if (unsmob_grob (value))
{
- if (Spanner * sp = dynamic_cast<Spanner*> (unsmob_element(value)))
+ if (Spanner * sp = dynamic_cast<Spanner*> (unsmob_grob(value)))
{
extend_spanner_over_item (sp->get_bound (LEFT), extremal_pair);
extend_spanner_over_item (sp->get_bound (RIGHT), extremal_pair);
}
- else if (Item * it= dynamic_cast<Item*> (unsmob_element(value)))
+ else if (Item * it= dynamic_cast<Item*> (unsmob_grob(value)))
extend_spanner_over_item (it, extremal_pair);
}
}
SCM pair = gh_cons (s1,s2);
extend_spanner_over_elements (sp->mutable_property_alist_, pair);
- Grob *p1 = unsmob_element (gh_car (pair));
- Grob* p2 = unsmob_element (gh_cdr (pair));
+ Grob *p1 = unsmob_grob (gh_car (pair));
+ Grob* p2 = unsmob_grob (gh_cdr (pair));
sp->set_bound (LEFT,p1);
sp->set_bound (RIGHT, p2);
protected:
virtual void play_element (Audio_element* p);
- virtual void do_removal_processing ();
- virtual void do_creation_processing ();
+ virtual void finalize ();
+ virtual void initialize ();
virtual void create_grobs ();
virtual void stop_translation_timestep ();
}
void
-Staff_performer::do_creation_processing ()
+Staff_performer::initialize ()
{
audio_staff_p_ = new Audio_staff;
announce_element (Audio_element_info (audio_staff_p_, 0));
tempo_p_ = new Audio_tempo (get_tempo_i ());
announce_element (Audio_element_info (tempo_p_, 0));
- Performer_group_performer::do_creation_processing ();
+ Performer_group_performer::initialize ();
}
void
instrument_p_ = new Audio_instrument (str);
announce_element (Audio_element_info (instrument_p_, 0));
}
- //Performer_group_performer::deprecated_process_music ();
}
void
}
void
-Staff_performer::do_removal_processing ()
+Staff_performer::finalize ()
{
- Performer_group_performer::do_removal_processing ();
+ Performer_group_performer::finalize ();
Performer::play_element (audio_staff_p_);
audio_staff_p_ = 0;
}
protected:
virtual ~Staff_symbol_engraver();
virtual void acknowledge_grob (Grob_info);
- virtual void do_removal_processing();
- virtual void do_creation_processing();
+ virtual void finalize();
+ virtual void initialize();
};
}
void
-Staff_symbol_engraver::do_creation_processing()
+Staff_symbol_engraver::initialize()
{
span_p_ = new Spanner (get_property ("StaffSymbol"));
- span_p_->set_bound(LEFT, unsmob_element (get_property ("currentCommandColumn")));
+ span_p_->set_bound(LEFT, unsmob_grob (get_property ("currentCommandColumn")));
announce_grob (span_p_, 0);
}
void
-Staff_symbol_engraver::do_removal_processing()
+Staff_symbol_engraver::finalize()
{
- span_p_->set_bound(RIGHT,unsmob_element (get_property ("currentCommandColumn")));
+ span_p_->set_bound(RIGHT,unsmob_grob (get_property ("currentCommandColumn")));
typeset_grob (span_p_);
span_p_ =0;
}
bool
Staff_symbol_referencer::has_interface (Grob*e)
{
- return unsmob_element (e->get_grob_property ("staff-symbol"))
+ return unsmob_grob (e->get_grob_property ("staff-symbol"))
|| gh_number_p (e->get_grob_property ("staff-position"));
}
Staff_symbol_referencer::staff_symbol_l (Grob*me)
{
SCM st = me->get_grob_property ("staff-symbol");
- return unsmob_element(st);
+ return unsmob_grob(st);
}
Real
SCM
Staff_symbol_referencer::callback (SCM element_smob, SCM )
{
- Grob *me = unsmob_element (element_smob);
+ Grob *me = unsmob_grob (element_smob);
SCM pos = me->get_grob_property ("staff-position");
SCM
Staff_symbol::brew_molecule (SCM smob)
{
- Grob *me = unsmob_element (smob);
+ Grob *me = unsmob_grob (smob);
Spanner* sp = dynamic_cast<Spanner*> (me);
Grob * common
= sp->get_bound (LEFT)->common_refpoint (sp->get_bound (RIGHT), X_AXIS);
SCM
Stem_tremolo::dim_callback (SCM e, SCM )
{
- Grob * se = unsmob_element (e);
+ Grob * se = unsmob_grob (e);
Real space = Staff_symbol_referencer::staff_space (se);
return ly_interval2scm ( Interval (-space, space));
SCM
Stem_tremolo::brew_molecule (SCM smob)
{
- Grob *me= unsmob_element (smob);
- Grob * stem = unsmob_element (me->get_grob_property ("stem"));
+ Grob *me= unsmob_grob (smob);
+ Grob * stem = unsmob_grob (me->get_grob_property ("stem"));
Grob * beam = Stem::beam_l (stem);
Real dydx;
Stem::support_head (Grob*me)
{
SCM h = me->get_grob_property ("support-head");
- Grob * nh = unsmob_element (h);
+ Grob * nh = unsmob_grob (h);
if (nh)
return nh;
else if (heads_i (me) == 1)
UGH.
*/
- return unsmob_element (gh_car (me->get_grob_property ("heads")));
+ return unsmob_grob (gh_car (me->get_grob_property ("heads")));
}
else
return first_head (me);
for (SCM s = me->get_grob_property ("heads"); gh_pair_p (s); s = gh_cdr (s))
{
- Grob * n = unsmob_element (gh_car (s));
+ Grob * n = unsmob_grob (gh_car (s));
int p = int(Staff_symbol_referencer::position_f (n));
SCM
Stem::before_line_breaking (SCM smob)
{
- Grob*me = unsmob_element (smob);
+ Grob*me = unsmob_grob (smob);
stem_end_position (me); // ugh. Trigger direction calc.
position_noteheads (me);
{
Axis a = (Axis) gh_scm2int (ax);
assert (a == X_AXIS);
- Grob *se = unsmob_element (e);
+ Grob *se = unsmob_grob (e);
Interval r (0, 0);
- if (unsmob_element (se->get_grob_property ("beam")) || abs (flag_i (se)) <= 2)
+ if (unsmob_grob (se->get_grob_property ("beam")) || abs (flag_i (se)) <= 2)
; // TODO!
else
{
SCM
Stem::brew_molecule (SCM smob)
{
- Grob*me = unsmob_element (smob);
+ Grob*me = unsmob_grob (smob);
Molecule mol;
Direction d = get_direction (me);
SCM
Stem::off_callback (SCM element_smob, SCM )
{
- Grob *me = unsmob_element (element_smob);
+ Grob *me = unsmob_grob (element_smob);
Real r=0;
if (Grob * f = first_head (me))
Stem::beam_l (Grob*me)
{
SCM b= me->get_grob_property ("beam");
- return unsmob_element (b);
+ return unsmob_grob (b);
}
SCM
Sustain_pedal::brew_molecule (SCM smob)
{
- Grob * e = unsmob_element (smob);
+ Grob * e = unsmob_grob (smob);
Molecule mol;
SCM glyph = e->get_grob_property ("text");
protected:
Spanner * delim_;
virtual void acknowledge_grob (Grob_info);
- virtual void do_creation_processing ();
- virtual void do_removal_processing ();
+ virtual void initialize ();
+ virtual void finalize ();
};
ADD_THIS_TRANSLATOR(System_start_delimiter_engraver);
}
void
-System_start_delimiter_engraver::do_creation_processing()
+System_start_delimiter_engraver::initialize()
{
delim_ = new Spanner (get_property ("SystemStartDelimiter"));
- delim_->set_bound (LEFT, unsmob_element (get_property ("currentCommandColumn")));
+ delim_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
announce_grob (delim_,0);
}
void
-System_start_delimiter_engraver::do_removal_processing ()
+System_start_delimiter_engraver::finalize ()
{
- delim_->set_bound (RIGHT, unsmob_element (get_property ("currentCommandColumn")));
+ delim_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
typeset_grob (delim_);
}
SCM
System_start_delimiter::after_line_breaking (SCM smob)
{
- try_collapse (unsmob_element (smob));
+ try_collapse (unsmob_grob (smob));
return SCM_UNSPECIFIED;
}
SCM
System_start_delimiter::brew_molecule (SCM smob)
{
- Grob * me = unsmob_element (smob);
+ Grob * me = unsmob_grob (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 met = tempo_req_l_->get_mus_property ("metronome-count");
- audio_p_ = new Audio_tempo (tempo_req_l_->dur_.length_mom () /
+ Duration *d = unsmob_duration (tempo_req_l_->get_mus_property ("tempo"));
+
+ audio_p_ = new Audio_tempo (d->length_mom () /
Moment (1, 4)
* Moment(gh_scm2int (met)));
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
virtual void create_grobs ();
- void deprecated_process_music ();
virtual void acknowledge_grob (Grob_info);
};
void
Text_engraver::create_grobs ()
-{
- deprecated_process_music ();
-}
-
-void
-Text_engraver::deprecated_process_music ()
{
if (texts_.size ())
return;
SCM
Text_item::brew_molecule (SCM smob)
{
- Grob *me = unsmob_element (smob);
+ Grob *me = unsmob_grob (smob);
SCM text = me->get_grob_property ("text");
Text_spanner_engraver ();
protected:
- virtual void do_removal_processing ();
+ virtual void finalize ();
virtual void acknowledge_grob (Grob_info);
virtual bool try_music (Music *);
- void deprecated_process_music ();
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
virtual void create_grobs ();
void
Text_spanner_engraver::create_grobs ()
-{
- deprecated_process_music ();
-}
-
-void
-Text_spanner_engraver::deprecated_process_music ()
{
/////
if (req_drul_[STOP])
else
{
assert (!finished_);
- Grob* e = unsmob_element (get_property ("currentMusicalColumn"));
+ Grob* e = unsmob_grob (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);
- Grob *e = unsmob_element (get_property ("currentMusicalColumn"));
+ Grob *e = unsmob_grob (get_property ("currentMusicalColumn"));
span_->set_bound (LEFT, e);
announce_grob (span_, req_drul_[START]);
}
}
void
-Text_spanner_engraver::do_removal_processing ()
+Text_spanner_engraver::finalize ()
{
typeset_all ();
if (span_)
SCM
Text_spanner::brew_molecule (SCM smob)
{
- Grob *me= unsmob_element (smob);
+ Grob *me= unsmob_grob (smob);
Spanner *spanner = dynamic_cast<Spanner*> (me);
Real staff_space = Staff_symbol_referencer::staff_space (me);
SCM
Tie_column::after_line_breaking (SCM smob)
{
- set_directions (unsmob_element (smob));
+ set_directions (unsmob_grob (smob));
return SCM_UNSPECIFIED;
}
SCM pair = gh_list_ref (head_list, gh_int2scm (i/2));
Spanner * p = new Spanner (basic);
- Tie::set_head (p,LEFT, dynamic_cast<Item*> (unsmob_element (gh_car (pair))));
- Tie::set_head (p,RIGHT, dynamic_cast<Item*> (unsmob_element (gh_cdr (pair))));
+ Tie::set_head (p,LEFT, dynamic_cast<Item*> (unsmob_grob (gh_car (pair))));
+ Tie::set_head (p,RIGHT, dynamic_cast<Item*> (unsmob_grob (gh_cdr (pair))));
tie_p_arr_.push (p);
announce_grob (p, req_l_);
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::set_head (p, LEFT, dynamic_cast<Item*> (unsmob_grob (gh_caar (s))));
+ Tie::set_head (p, RIGHT, dynamic_cast<Item*> (unsmob_grob (gh_cdar (s))));
tie_p_arr_.push (p);
announce_grob (p, req_l_);
{
public:
VIRTUAL_COPY_CONS(Translator);
-
+ Tie_performer ();
private:
bool done_;
PQueue<CNote_melodic_tuple> past_notes_pq_;
Link_array<Audio_tie> tie_p_arr_;
protected:
+ virtual void initialize ();
virtual void start_translation_timestep ();
virtual void stop_translation_timestep ();
virtual void acknowledge_grob (Audio_element_info);
virtual void create_grobs ();
};
+
+Tie_performer::Tie_performer ()
+{
+ req_l_ = 0;
+ done_ = false;
+}
+
ADD_THIS_TRANSLATOR (Tie_performer);
+
+#if 0
+Tie_performer::Tie_performer ()
+{
+ // URG
+ // if we don't do this, lily dumps core
+ // which means that ``initialize'' and
+ // ``start_translation_timestep'' did not happen?!
+ initialize ();
+}
+#endif
+
+void
+Tie_performer::initialize ()
+{
+ req_l_ = 0;
+}
+
+
bool
Tie_performer::try_music (Music *m)
{
SCM c = me->get_grob_property ("heads");
c = index_cell (c, d);
- return unsmob_element (c);
+ return unsmob_grob (c);
}
Real
SCM
Tie::get_control_points (SCM smob)
{
- Spanner*me = dynamic_cast<Spanner*> (unsmob_element (smob));
+ Spanner*me = dynamic_cast<Spanner*> (unsmob_grob (smob));
Direction headdir = CENTER;
if (head (me,LEFT))
headdir = LEFT;
SCM
Tie::set_spacing_rods (SCM smob)
{
- Grob*me = unsmob_element (smob);
+ Grob*me = unsmob_grob (smob);
Spanner*sp = dynamic_cast<Spanner*> (me);
Rod r;
SCM
Tie::brew_molecule (SCM smob)
{
- Grob*me = unsmob_element (smob);
+ Grob*me = unsmob_grob (smob);
SCM cp = me->get_grob_property ("control-points");
if (cp == SCM_EOL)
Time_scaled_music::Time_scaled_music (int n, int d,Music *mp)
: Music_wrapper (mp)
{
- num_i_ = n;
- den_i_ = d;
- compress (Moment (num_i_,den_i_));
+ set_mus_property ("numerator", gh_int2scm (n));
+ set_mus_property ("denominator", gh_int2scm (d));
set_mus_property ("type",
Time_scaled_music_iterator::constructor_cxx_function);
+
+ compress (Moment (n,d));
}
Time_signature_engraver::Time_signature_engraver()
{
time_signature_p_ =0;
- last_time_fraction_ = SCM_EOL;
+ last_time_fraction_ = SCM_BOOL_F;
}
void
not rigorously safe, since the value might get GC'd and
reallocated in the same spot */
SCM fr= get_property ("timeSignatureFraction");
- if (last_time_fraction_ != fr)
+ if (!time_signature_p_ && last_time_fraction_ != fr)
{
last_time_fraction_ = fr;
time_signature_p_ = new Item (get_property ("TimeSignature"));
SCM
Time_signature::brew_molecule (SCM smob)
{
- Grob * me = unsmob_element (smob);
+ Grob * me = unsmob_grob (smob);
SCM st = me->get_grob_property ("style");
SCM frac = me->get_grob_property ("fraction");
int n = 4;
protected:
virtual void start_translation_timestep ();
virtual void stop_translation_timestep ();
+ virtual void process_music ();
public:
VIRTUAL_COPY_CONS(Translator);
};
}
-
+/*
+ ugh. Translator doesn't do process_music ().
+ */
+void
+Timing_engraver::process_music ()
+{
+ Timing_translator::process_music ();
+}
}
void
-Timing_translator::deprecated_process_music()
+Timing_translator::process_music()
{
if (check_ && measure_position ())
{
ADD_THIS_TRANSLATOR(Timing_translator);
void
-Timing_translator::do_creation_processing()
+Timing_translator::initialize()
{
Moment m;
daddy_trans_l_->set_property ("timing" , SCM_BOOL_T);
list = gh_append2 (list, gh_cons (t->self_scm (), SCM_EOL));
t->daddy_trans_l_ = this;
t->output_def_l_ = output_def_l_;
- t->add_processing ();
- t->do_creation_processing ();
+ if (Translator_group*tg = dynamic_cast<Translator_group*> (t))
+ {
+ unsmob_translator_def (tg->definition_)->apply_property_operations (tg);
+ }
+
+ t->initialize ();
return list;
}
void
}
-
-void
-Translator_group::do_add_processing ()
-{
- unsmob_translator_def (definition_)->apply_property_operations (this);
- for (SCM s = simple_trans_list_; gh_pair_p (s) ; s = gh_cdr (s))
- {
- Translator * t = unsmob_translator (gh_car (s));
- t->add_processing ();
- }
-}
-
/*
PROPERTIES
*/
}
void
-Translator_group::do_creation_processing ()
+Translator_group::initialize ()
{
- each (&Translator::do_creation_processing);
+ each (&Translator::initialize);
}
void
-Translator_group::do_removal_processing ()
+Translator_group::finalize ()
{
each (&Translator::removal_processing);
}
}
-void
-Translator::add_processing ()
-{
- do_add_processing ();
-}
-void
-Translator::do_add_processing ()
-{
-}
void
void
Translator::removal_processing ()
{
- do_removal_processing ();
+ finalize ();
}
}
void
-Translator::do_creation_processing ()
+Translator::initialize ()
{
}
void
-Translator::do_removal_processing ()
+Translator::finalize ()
{
}
Transposed_music::Transposed_music (Music *p, Pitch pit)
: Music_wrapper (p)
{
- transpose_to_pitch_ = pit;
p->transpose (pit);
set_mus_property ("type", ly_symbol2scm ("transposed-music"));
}
/// The spanners. Array order is synced with time_scaled_music_arr_
Link_array<Spanner> started_span_p_arr_;
- virtual void do_removal_processing ();
+ virtual void finalize ();
virtual void acknowledge_grob (Grob_info);
virtual bool try_music (Music*r);
- void deprecated_process_music ();
virtual void start_translation_timestep ();
virtual void create_grobs ();
};
void
Tuplet_engraver::create_grobs ()
-{
- deprecated_process_music ();
-}
-
-void
-Tuplet_engraver::deprecated_process_music ()
{
SCM v = get_property ("tupletInvisible");
if (to_boolean (v))
else
started_span_p_arr_[i] = glep;
- glep->set_grob_property ("text",
- ly_str02scm (to_str (time_scaled_music_arr_[i]->den_i_).ch_C()));
+
+ int d = gh_scm2int (time_scaled_music_arr_[i]->get_mus_property ("denominator"));
+ glep->set_grob_property ("text", ly_str02scm (to_str (d).ch_C()));
announce_grob (glep, time_scaled_music_arr_ [i]);
}
}
void
-Tuplet_engraver::do_removal_processing ()
+Tuplet_engraver::finalize ()
{
for (int i=0; i < started_span_p_arr_.size (); i++)
{
SCM
Tuplet_spanner::brew_molecule (SCM smob)
{
- Grob *me= unsmob_element (smob);
+ Grob *me= unsmob_grob (smob);
Molecule mol;
// Default behaviour: number always, bracket when no beam!
SCM
Tuplet_spanner::after_line_breaking (SCM smob)
{
- Grob * me = unsmob_element (smob);
+ Grob * me = unsmob_grob (smob);
Link_array<Note_column> column_arr=
Pointer_group_interface__extract_elements (me, (Note_column*)0, "columns");
Spanner *sp = dynamic_cast<Spanner*> (me);
if (scm_ilength (me->get_grob_property ("beams")) == 1)
{
SCM bs = me->get_grob_property ("beams");
- Grob *b = unsmob_element (gh_car (bs));
+ Grob *b = unsmob_grob (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 ()
d = UP ;
for (SCM s = me->get_grob_property ("columns"); gh_pair_p (s); s = gh_cdr (s))
{
- Grob * nc = unsmob_element (gh_car (s));
+ Grob * nc = unsmob_grob (gh_car (s));
if (Note_column::dir (nc) < 0)
{
d = DOWN;
Vertical_align_engraver();
protected:
virtual void acknowledge_grob (Grob_info);
- virtual void do_creation_processing();
- virtual void do_removal_processing();
+ virtual void initialize();
+ virtual void finalize();
};
Vertical_align_engraver::Vertical_align_engraver()
}
void
-Vertical_align_engraver::do_creation_processing()
+Vertical_align_engraver::initialize()
{
valign_p_ =new Spanner (get_property ("VerticalAlignment"));
- valign_p_->set_bound(LEFT,unsmob_element (get_property ("currentCommandColumn")));
+ valign_p_->set_bound(LEFT,unsmob_grob (get_property ("currentCommandColumn")));
announce_grob (valign_p_ , 0);
}
void
-Vertical_align_engraver::do_removal_processing()
+Vertical_align_engraver::finalize()
{
- valign_p_->set_bound(RIGHT,unsmob_element (get_property ("currentCommandColumn")));
+ valign_p_->set_bound(RIGHT,unsmob_grob (get_property ("currentCommandColumn")));
typeset_grob (valign_p_);
valign_p_ =0;
}
virtual void start_translation_timestep ();
virtual void acknowledge_grob (Grob_info);
- virtual void do_removal_processing ();
+ virtual void finalize ();
virtual void stop_translation_timestep ();
void deprecated_process_music ();
virtual void create_grobs ();
}
void
-Volta_engraver::do_removal_processing ()
+Volta_engraver::finalize ()
{
if (volta_span_p_)
{
SCM
Volta_spanner::brew_molecule (SCM smob)
{
- Grob *me = unsmob_element (smob);
+ Grob *me = unsmob_grob (smob);
Link_array<Item> bar_arr
= Pointer_group_interface__extract_elements (me, (Item*)0, "bars");
(breakable . #t )
(molecule-callback . ,Custos::brew_molecule)
(visibility-lambda . ,end-of-line-visible)
- (style . "vaticana")
+ (style . vaticana)
(Y-offset-callbacks . (,Staff_symbol_referencer::callback))
(meta . ,(element-description "Custos" custos-interface staff-symbol-interface break-aligned-interface) )
))
(extremity-rules . ,default-slur-extremity-rules)
(extremity-offset-alist . ,default-slur-extremity-offset-alist)
(de-uglify-parameters . ( 1.5 0.8 -2.0))
+ (Y-extent-callback . ,Slur::height)
(details . ((height-limit . 2.0) (ratio . 0.333) (force-blowfit . 0.5)
(bezier-pct-c0 . -0.2) (bezier-pct-c3 . 0.000006)
(bezier-pct-out-max . 0.8) (bezier-pct-in-max . 1.2)