From e0833e924a7b626154c66170d98335c6c4985dfe Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 8 Oct 2000 17:52:41 +0200 Subject: [PATCH] patch::: 1.3.93.jcn2 1.3.93.jcn2 =========== * Added backend framework for arpeggios. 1.3.93.uu1 ========== * Bugfix: don't crash if there is volta bracket to end. * Move offset callbacks into Scheme. --- CHANGES | 18 ++++- VERSION | 2 +- input/test/arpeggio.ly | 20 ++++++ lily/align-interface.cc | 14 ++-- lily/arpeggio-engraver.cc | 74 +++++++++++++++++++++ lily/arpeggio.cc | 50 ++++++++++++++ lily/bar.cc | 6 +- lily/beam-engraver.cc | 2 +- lily/beam.cc | 18 +++-- lily/break-align-item.cc | 27 +++++--- lily/breathing-sign.cc | 17 +++-- lily/chord-name.cc | 7 +- lily/chord-tremolo-engraver.cc | 4 +- lily/clef-engraver.cc | 4 +- lily/clef-item.cc | 2 +- lily/collision.cc | 26 ++++---- lily/crescendo.cc | 2 +- lily/dimension-cache.cc | 6 +- lily/dot-column.cc | 46 +++++++------ lily/dots.cc | 13 ++-- lily/dynamic-engraver.cc | 4 +- lily/grace-align-item.cc | 2 +- lily/hara-kiri-group-spanner.cc | 38 ++++++----- lily/hyphen-spanner.cc | 2 +- lily/include/align-interface.hh | 6 +- lily/include/arpeggio.hh | 23 +++++++ lily/include/beam.hh | 3 +- lily/include/break-align-item.hh | 6 +- lily/include/breathing-sign.hh | 2 +- lily/include/collision.hh | 2 +- lily/include/dimension-cache.hh | 15 +++-- lily/include/dot-column.hh | 2 +- lily/include/dots.hh | 3 +- lily/include/hara-kiri-group-spanner.hh | 4 +- lily/include/lily-guile.hh | 12 ++-- lily/include/lyric-phrasing-engraver.hh | 1 - lily/include/repeated-music.hh | 3 - lily/include/rest-collision.hh | 3 +- lily/include/score-element.hh | 5 +- lily/include/side-position-interface.hh | 13 ++-- lily/include/span-arpeggio.hh | 24 +++++++ lily/include/span-bar.hh | 2 +- lily/include/staff-symbol-referencer.hh | 2 +- lily/include/stem.hh | 2 +- lily/include/translator.hh | 1 - lily/instrument-name-engraver.cc | 2 +- lily/key-item.cc | 2 +- lily/local-key-item.cc | 2 +- lily/lyric-engraver.cc | 2 +- lily/lyric-extender.cc | 2 +- lily/lyric-phrasing-engraver.cc | 10 +++ lily/multi-measure-rest.cc | 4 +- lily/note-head.cc | 2 +- lily/note-heads-engraver.cc | 8 +-- lily/piano-pedal-engraver.cc | 4 +- lily/rest-collision.cc | 11 ++-- lily/rest-engraver.cc | 2 +- lily/rest.cc | 4 +- lily/score-element.cc | 41 +++++++----- lily/script-column.cc | 2 +- lily/script-engraver.cc | 4 +- lily/script.cc | 4 +- lily/separating-group-spanner.cc | 2 +- lily/side-position-interface.cc | 86 ++++++++++++++---------- lily/slur.cc | 6 +- lily/spacing-spanner.cc | 2 +- lily/span-arpeggio-engraver.cc | 87 +++++++++++++++++++++++++ lily/span-arpeggio.cc | 68 +++++++++++++++++++ lily/span-bar.cc | 16 +++-- lily/staff-symbol-referencer.cc | 45 +++++++------ lily/staff-symbol.cc | 2 +- lily/stem-tremolo.cc | 2 +- lily/stem.cc | 17 +++-- lily/sustain-pedal.cc | 2 +- lily/syllable-group.cc | 2 +- lily/system-start-delimiter.cc | 4 +- lily/text-engraver.cc | 4 +- lily/text-item.cc | 2 +- lily/tie-column.cc | 2 +- lily/tie.cc | 4 +- lily/time-signature.cc | 2 +- lily/tuplet-spanner.cc | 4 +- lily/unfolded-repeat-iterator.cc | 3 + lily/volta-engraver.cc | 6 +- lily/volta-spanner.cc | 2 +- ly/engraver.ly | 44 +++++++++---- ly/script.ly | 2 + scm/script.scm | 1 + stepmake/bin/make-version.py | 2 + stepmake/stepmake/generic-targets.make | 4 +- stepmake/stepmake/generic-vars.make | 3 + 91 files changed, 775 insertions(+), 295 deletions(-) create mode 100644 input/test/arpeggio.ly create mode 100644 lily/arpeggio-engraver.cc create mode 100644 lily/arpeggio.cc create mode 100644 lily/include/arpeggio.hh create mode 100644 lily/include/span-arpeggio.hh create mode 100644 lily/span-arpeggio-engraver.cc create mode 100644 lily/span-arpeggio.cc diff --git a/CHANGES b/CHANGES index 71d2795aab..864d18f287 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,15 @@ +1.3.93.jcn2 +=========== + +* Added backend framework for arpeggios. + +1.3.93.uu1 +========== + +* Bugfix: don't crash if there is volta bracket to end. + +* Move offset callbacks into Scheme. + 1.3.93.jcn1 =========== @@ -5,10 +17,10 @@ * Moved Pedal_engraver to Staff context. -* Found some bugs. -1.3.92.jcn2 -=========== + +1.3.93 +====== * Added some error messages for toplevel and stray string parse errors. diff --git a/VERSION b/VERSION index a8eaf561a5..fb37fda8ec 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=93 -MY_PATCH_LEVEL=tca1 +MY_PATCH_LEVEL=jcn2 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/input/test/arpeggio.ly b/input/test/arpeggio.ly new file mode 100644 index 0000000000..8b81878ad4 --- /dev/null +++ b/input/test/arpeggio.ly @@ -0,0 +1,20 @@ +\score{ + \context StaffGroup < + %< + \context Staff=one \notes\relative c''{ + f, + + } + \context Staff=two \notes\relative c{ + \clef bass; + g + + } + > + \paper{ + \translator{ + \StaffContext + \consists Arpeggio_engraver; + } + } +} diff --git a/lily/align-interface.cc b/lily/align-interface.cc index 8e07f9870e..120f2a1282 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -8,7 +8,6 @@ */ #include "align-interface.hh" - #include "score-element.hh" #include "group-interface.hh" #include "axis-group-interface.hh" @@ -18,15 +17,18 @@ This callback is set in the children of the align element. It does not compute anything, but a side effect of a->do_side_processing () is that the elements are placed correctly. */ -Real -Align_interface::alignment_callback (Score_element *sc, Axis ax) +MAKE_SCHEME_CALLBACK(Align_interface,alignment_callback,2); +SCM +Align_interface::alignment_callback (SCM element_smob, SCM axis) { - Score_element * par = sc->parent_l (ax); + Score_element * sun = unsmob_element (element_smob); + Axis ax = (Axis )gh_scm2int (axis); + Score_element * par = sun->parent_l (ax); if (par && !to_boolean (par->get_elt_property ("alignment-done"))) { Align_interface::do_side_processing (par, ax); } - return 0.0; + return gh_double2scm (0.0); } @@ -138,7 +140,7 @@ Align_interface::get_count (Score_element*me,Score_element*s) void Align_interface::add_element (Score_element*me,Score_element* s) { - s->add_offset_callback (alignment_callback, Align_interface::axis (me)); + s->add_offset_callback (Align_interface_alignment_callback_proc, Align_interface::axis (me)); Axis_group_interface::add_element (me, s); } diff --git a/lily/arpeggio-engraver.cc b/lily/arpeggio-engraver.cc new file mode 100644 index 0000000000..15a2011709 --- /dev/null +++ b/lily/arpeggio-engraver.cc @@ -0,0 +1,74 @@ +/* + arpeggio-engraver.cc -- implement Arpeggio_engraver + + source file of the GNU LilyPond music typesetter + + (c) 2000 Jan Nieuwenhuizen + */ + +#include "engraver.hh" +#include "group-interface.hh" +#include "item.hh" +#include "arpeggio.hh" +#include "stem.hh" + +class Arpeggio_engraver : public Engraver +{ +public: + VIRTUAL_COPY_CONS (Translator); + Arpeggio_engraver (); + +protected: + virtual void acknowledge_element (Score_element_info); + virtual void process_acknowledged (); + virtual void do_pre_move_processing (); + +private: + Item* arpeggio_; + Link_array stems_; +}; + +Arpeggio_engraver::Arpeggio_engraver () +{ + arpeggio_ = 0; +} + +void +Arpeggio_engraver::acknowledge_element (Score_element_info info) +{ + if (Stem::has_interface (info.elem_l_)) + { + stems_.push (info.elem_l_); + } +} + +void +Arpeggio_engraver::process_acknowledged () +{ + if (!arpeggio_ && !stems_.empty ()) + { + arpeggio_ = new Item (get_property ("basicArpeggioProperties")); + Pointer_group_interface pgi (arpeggio_, "stems"); + for (int i = 0; i < stems_.size (); i++) + { + pgi.add_element (stems_[i]); + arpeggio_->add_dependency (stems_[i]); + } + announce_element (arpeggio_, 0); + } +} + +void +Arpeggio_engraver::do_pre_move_processing () +{ + if (arpeggio_) + { + typeset_element (arpeggio_); + arpeggio_ = 0; + } + stems_.clear (); +} + + +ADD_THIS_TRANSLATOR (Arpeggio_engraver); + diff --git a/lily/arpeggio.cc b/lily/arpeggio.cc new file mode 100644 index 0000000000..7500ef844b --- /dev/null +++ b/lily/arpeggio.cc @@ -0,0 +1,50 @@ +/* + arpegggio.cc -- implement Arpeggio + + source file of the GNU LilyPond music typesetter + + (c) 2000 Jan Nieuwenhuizen + */ + +#include "molecule.hh" +#include "paper-def.hh" +#include "lookup.hh" +#include "arpeggio.hh" +#include "score-element.hh" +#include "stem.hh" +#include "staff-symbol-referencer.hh" + +bool +Arpeggio::has_interface (Score_element* me) +{ + return me && me->has_interface (ly_symbol2scm ("arpeggio-interface")); +} + +MAKE_SCHEME_CALLBACK (Arpeggio, brew_molecule, 1); +SCM +Arpeggio::brew_molecule (SCM smob) +{ + Score_element *me = unsmob_element (smob); + + Interval iv; + for (SCM s = me->get_elt_property ("stems"); gh_pair_p (s); s = gh_cdr (s)) + { + Score_element *stem = unsmob_element (gh_car (s)); + iv.unite (Stem::head_positions (stem)); + } + + Molecule mol; + Molecule dot = me->paper_l ()->lookup_l (0)->afm_find ("dots-dot"); + Real half_space = Staff_symbol_referencer::staff_space (me) / 2; + for (Real i = iv[MIN]; i <= iv[MAX]; i++) + { + Molecule d (dot); + d.translate_axis (i * half_space, Y_AXIS); + mol.add_molecule (d); + } + mol.translate (Offset (-3, 0)); + + return mol.create_scheme (); +} + + diff --git a/lily/bar.cc b/lily/bar.cc index 80dad453c0..abe7b29ee5 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -20,7 +20,7 @@ #include "item.hh" #include "staff-symbol-referencer.hh" -MAKE_SCHEME_CALLBACK(Bar,brew_molecule); +MAKE_SCHEME_CALLBACK(Bar,brew_molecule,1); SCM Bar::brew_molecule (SCM smob) @@ -122,7 +122,7 @@ Bar::simple_barline (Score_element*me,Real w, Real h) return me->lookup_l ()->filledbox (Box (Interval(0,w), Interval(-h/2, h/2))); } -MAKE_SCHEME_CALLBACK(Bar,before_line_breaking ); +MAKE_SCHEME_CALLBACK(Bar,before_line_breaking ,1); SCM Bar::before_line_breaking (SCM smob) @@ -169,7 +169,7 @@ Bar::has_interface (Score_element*m) } -MAKE_SCHEME_CALLBACK(Bar,get_staff_bar_size); +MAKE_SCHEME_CALLBACK(Bar,get_staff_bar_size,1); SCM Bar::get_staff_bar_size (SCM smob) { diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index 25ab6a735e..74f1331738 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -227,7 +227,7 @@ Beam_engraver::acknowledge_element (Score_element_info info) { if (Rest::has_interface (info.elem_l_)) { - info.elem_l_->add_offset_callback (Beam::rest_collision_callback, Y_AXIS); + info.elem_l_->add_offset_callback (Beam_rest_collision_callback_proc, Y_AXIS); } else if (Stem::has_interface (info.elem_l_)) { diff --git a/lily/beam.cc b/lily/beam.cc index 10bf8d82e8..d00d460b8e 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -72,7 +72,7 @@ Beam::get_multiplicity (Score_element*me) [Alternatively, stems could set its own directions, according to their beam, during 'final-pre-processing'.] */ -MAKE_SCHEME_CALLBACK(Beam,before_line_breaking); +MAKE_SCHEME_CALLBACK(Beam,before_line_breaking,1); SCM Beam::before_line_breaking (SCM smob) { @@ -271,7 +271,7 @@ Beam::set_stem_shorten (Score_element*m) Set elt properties height and y-position if not set. Adjust stem lengths to reach beam. */ -MAKE_SCHEME_CALLBACK(Beam,after_line_breaking); +MAKE_SCHEME_CALLBACK(Beam,after_line_breaking,1); SCM Beam::after_line_breaking (SCM smob) { @@ -767,7 +767,7 @@ Beam::stem_beams (Score_element*me,Item *here, Item *next, Item *prev) return leftbeams; } -MAKE_SCHEME_CALLBACK(Beam,brew_molecule); +MAKE_SCHEME_CALLBACK(Beam,brew_molecule,1); SCM Beam::brew_molecule (SCM smob) { @@ -891,18 +891,22 @@ Beam::last_visible_stem(Score_element*me) rest -> stem -> beam -> interpolate_y_position () */ -Real -Beam::rest_collision_callback (Score_element *rest, Axis a ) +MAKE_SCHEME_CALLBACK(Beam,rest_collision_callback,1); +SCM +Beam::rest_collision_callback (SCM element_smob, SCM axis) { + Score_element *rest = unsmob_element (element_smob); + Axis a = (Axis) gh_scm2int (axis); + assert (a == Y_AXIS); Score_element * st = unsmob_element (rest->get_elt_property ("stem")); Score_element * stem = st; if (!stem) - return 0.0; + return gh_double2scm (0.0); Score_element * beam = unsmob_element (stem->get_elt_property ("beam")); if (!beam || !Beam::has_interface (beam) || !Beam::visible_stem_count (beam)) - return 0.0; + return gh_double2scm (0.0); // make callback for rest from this. Real beam_dy = 0; diff --git a/lily/break-align-item.cc b/lily/break-align-item.cc index ad1f1cbb47..8fd6ba0b06 100644 --- a/lily/break-align-item.cc +++ b/lily/break-align-item.cc @@ -21,7 +21,7 @@ #include "group-interface.hh" #include "align-interface.hh" -MAKE_SCHEME_CALLBACK(Break_align_interface,before_line_breaking); +MAKE_SCHEME_CALLBACK(Break_align_interface,before_line_breaking,1); SCM Break_align_interface::before_line_breaking (SCM smob) @@ -30,24 +30,31 @@ Break_align_interface::before_line_breaking (SCM smob) do_alignment (me); return SCM_UNSPECIFIED; } +MAKE_SCHEME_CALLBACK(Break_align_interface,alignment_callback,2); -Real -Break_align_interface::alignment_callback (Score_element*c, Axis a) +SCM +Break_align_interface::alignment_callback (SCM element_smob, SCM axis) { + Score_element *me = unsmob_element (element_smob); + Axis a = (Axis) gh_scm2int (axis); + assert (a == X_AXIS); - Score_element *par = c->parent_l (a); + Score_element *par = me->parent_l (a); if (par && !to_boolean (par->get_elt_property ("break-alignment-done")))\ { par->set_elt_property ("break-alignment-done", SCM_BOOL_T); Break_align_interface::do_alignment (par); } - return 0.0; + return gh_double2scm (0); } -Real -Break_align_interface::self_align_callback (Score_element *me, Axis a) +MAKE_SCHEME_CALLBACK(Break_align_interface,self_align_callback,2); +SCM +Break_align_interface::self_align_callback (SCM element_smob, SCM axis) { + Score_element *me = unsmob_element (element_smob); + Axis a = (Axis) gh_scm2int (axis); assert (a == X_AXIS); Item* item = dynamic_cast (me); @@ -57,13 +64,13 @@ Break_align_interface::self_align_callback (Score_element *me, Axis a) me->set_elt_property ("self-alignment-X", gh_int2scm (RIGHT)); } - return Side_position::aligned_on_self (me, a); + return Side_position::aligned_on_self (element_smob, axis); } void Break_align_interface::add_element (Score_element*me, Score_element *toadd) { - toadd->add_offset_callback (alignment_callback, X_AXIS); + toadd->add_offset_callback (Break_align_interface_alignment_callback_proc, X_AXIS); Axis_group_interface::add_element (me, toadd); } @@ -218,5 +225,5 @@ Break_align_interface::set_interface (Score_element*me) Align_interface::set_interface (me); Align_interface::set_axis (me,X_AXIS); - me->add_offset_callback (Break_align_interface::self_align_callback, X_AXIS); + me->add_offset_callback (Break_align_interface_self_align_callback_proc, X_AXIS); } diff --git a/lily/breathing-sign.cc b/lily/breathing-sign.cc index 4810dec72e..5d24908532 100644 --- a/lily/breathing-sign.cc +++ b/lily/breathing-sign.cc @@ -22,7 +22,7 @@ -MAKE_SCHEME_CALLBACK(Breathing_sign,brew_molecule); +MAKE_SCHEME_CALLBACK(Breathing_sign,brew_molecule,1); SCM Breathing_sign::brew_molecule (SCM smob) @@ -37,12 +37,15 @@ Breathing_sign::brew_molecule (SCM smob) return me->lookup_l()->filledbox(b).create_scheme (); } -Real -Breathing_sign::offset_callback (Score_element * b, Axis a) +MAKE_SCHEME_CALLBACK(Breathing_sign,offset_callback,2); +SCM +Breathing_sign::offset_callback (SCM element_smob, SCM axis) { - Score_element * me = (Score_element*)b; + Score_element *me = unsmob_element (element_smob); + Axis a = (Axis) gh_scm2int (axis); + - Direction d = Directional_element_interface::get (b); + Direction d = Directional_element_interface::get (me); if (!d) { d = UP; @@ -51,12 +54,12 @@ Breathing_sign::offset_callback (Score_element * b, Axis a) Real inter_f = Staff_symbol_referencer::staff_space (me)/2; int sz = Staff_symbol_referencer::line_count (me)-1; - return inter_f * sz * d; + return gh_double2scm ( inter_f * sz * d); } void Breathing_sign::set_interface (Score_element *b) { Staff_symbol_referencer::set_interface (b); - b->add_offset_callback (Breathing_sign::offset_callback,Y_AXIS); + b->add_offset_callback (Breathing_sign_offset_callback_proc,Y_AXIS); } diff --git a/lily/chord-name.cc b/lily/chord-name.cc index 80955b20d7..19650961e2 100644 --- a/lily/chord-name.cc +++ b/lily/chord-name.cc @@ -23,7 +23,6 @@ "text" ("text" . property-alist) */ - Molecule Chord_name::ly_word2molecule (Score_element * me, SCM word, Real* x) { @@ -126,7 +125,7 @@ Chord_name::ly_text2molecule (Score_element * me, SCM text) return mol; } -MAKE_SCHEME_CALLBACK (Chord_name, after_line_breaking); +MAKE_SCHEME_CALLBACK (Chord_name,after_line_breaking,1); SCM Chord_name::after_line_breaking (SCM smob) { @@ -148,7 +147,7 @@ Chord_name::after_line_breaking (SCM smob) return SCM_UNSPECIFIED; } -MAKE_SCHEME_CALLBACK (Chord_name, brew_molecule); +MAKE_SCHEME_CALLBACK (Chord_name,brew_molecule,1); SCM Chord_name::brew_molecule (SCM smob) { @@ -168,7 +167,7 @@ Chord_name::brew_molecule (SCM smob) SCM pitches = me->get_elt_property ("pitches"); SCM func = me->get_elt_property (ly_symbol2scm ("chord-name-function")); - SCM text = gh_call3 (func, style, ly_quote_scm (pitches), ly_quote_scm (gh_cons (inversion, bass))); + SCM text = gh_call3 (func, style, pitches, gh_cons (inversion, bass)); return ly_text2molecule (me, text).create_scheme (); } diff --git a/lily/chord-tremolo-engraver.cc b/lily/chord-tremolo-engraver.cc index 1891eea844..c11f482960 100644 --- a/lily/chord-tremolo-engraver.cc +++ b/lily/chord-tremolo-engraver.cc @@ -165,11 +165,9 @@ Chord_tremolo_engraver::acknowledge_element (Score_element_info info) } s->set_elt_property ("direction", d); - if (Rhythmic_req* r = dynamic_cast (info.req_l_)) + if (dynamic_cast (info.req_l_)) { Beam::add_stem (beam_p_, s); - Moment stem_location = now_mom () - - start_mom_ + beam_start_location_; } else { diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index 64443eb18b..f435ca6eaf 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -192,8 +192,8 @@ Clef_engraver::create_clef() g->set_parent (clef_p_, Y_AXIS); g->set_parent (clef_p_, X_AXIS); - g->add_offset_callback (Side_position::aligned_on_self, X_AXIS); - g->add_offset_callback (Side_position::centered_on_parent, X_AXIS); + g->add_offset_callback (Side_position_aligned_on_self_proc, X_AXIS); + g->add_offset_callback (Side_position_centered_on_parent_proc, X_AXIS); g->set_elt_property ("direction", gh_int2scm (octave_dir_)); octavate_p_ = g; announce_element (octavate_p_, clef_req_l_); diff --git a/lily/clef-item.cc b/lily/clef-item.cc index b3ce53051e..faf226af33 100644 --- a/lily/clef-item.cc +++ b/lily/clef-item.cc @@ -16,7 +16,7 @@ FIXME: should use symbol for #'style. */ -MAKE_SCHEME_CALLBACK(Clef,before_line_breaking); +MAKE_SCHEME_CALLBACK(Clef,before_line_breaking,1); SCM Clef::before_line_breaking (SCM smob) { diff --git a/lily/collision.cc b/lily/collision.cc index 728ffbb933..d73ce84a4e 100644 --- a/lily/collision.cc +++ b/lily/collision.cc @@ -13,20 +13,16 @@ #include "axis-group-interface.hh" #include "item.hh" -void -Collision::add_column (Score_element*me,Score_element* ncol_l) -{ - ncol_l->add_offset_callback (force_shift_callback, X_AXIS); - Axis_group_interface::add_element (me, ncol_l); - me->add_dependency (ncol_l); -} -Real -Collision::force_shift_callback (Score_element * c, Axis a) +MAKE_SCHEME_CALLBACK(Collision,force_shift_callback,2); +SCM +Collision::force_shift_callback (SCM element_smob, SCM axis) { + Score_element *me = unsmob_element (element_smob); + Axis a = (Axis) gh_scm2int (axis); assert (a == X_AXIS); - Score_element * me = c->parent_l (a); + me = me->parent_l (a); /* ugh. the way DONE is done is not clean */ @@ -36,7 +32,7 @@ Collision::force_shift_callback (Score_element * c, Axis a) do_shifts (me); } - return 0.0; + return gh_double2scm (0.0); } /* @@ -228,3 +224,11 @@ Collision::forced_shift (Score_element *me) + +void +Collision::add_column (Score_element*me,Score_element* ncol_l) +{ + ncol_l->add_offset_callback (Collision_force_shift_callback_proc, X_AXIS); + Axis_group_interface::add_element (me, ncol_l); + me->add_dependency (ncol_l); +} diff --git a/lily/crescendo.cc b/lily/crescendo.cc index 35177fac01..616e431253 100644 --- a/lily/crescendo.cc +++ b/lily/crescendo.cc @@ -23,7 +23,7 @@ Crescendo::set_interface (Score_element*s) -MAKE_SCHEME_CALLBACK(Crescendo,brew_molecule); +MAKE_SCHEME_CALLBACK(Crescendo,brew_molecule,1); /* diff --git a/lily/dimension-cache.cc b/lily/dimension-cache.cc index 96a51cde5a..2c82102960 100644 --- a/lily/dimension-cache.cc +++ b/lily/dimension-cache.cc @@ -17,7 +17,8 @@ Dimension_cache::Dimension_cache (Dimension_cache const &d) init(); extent_callback_l_ = d.extent_callback_l_; offset_ = d.offset_; - off_callbacks_ = d.off_callbacks_; + offset_callbacks_ = d.offset_callbacks_; + offsets_left_ = d.offsets_left_; parent_l_ = d.parent_l_; } @@ -30,7 +31,8 @@ void Dimension_cache::init() { extent_callback_l_ =0; - offset_ =0.0; + offsets_left_ = 0; + offset_callbacks_ = SCM_EOL; offset_ =0.0; dim_.set_empty (); diff --git a/lily/dot-column.cc b/lily/dot-column.cc index 738052d5a2..a0a61a5dfd 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -17,23 +17,6 @@ -void -Dot_column::add_head (Score_element * me, Score_element *rh) -{ - Score_element * d = unsmob_element (rh->get_elt_property ("dot")); - if (d) - { - Side_position::add_support (me,rh); - - Pointer_group_interface gi (me, "dots"); - gi.add_element (d); - - d->add_offset_callback (force_shift_callback , Y_AXIS); - Axis_group_interface::add_element (me, d); - } -} - - void @@ -63,14 +46,17 @@ Dot_column::set_interface (Score_element* me) */ -Real -Dot_column::force_shift_callback (Score_element * dot, Axis a) +MAKE_SCHEME_CALLBACK(Dot_column,force_shift_callback,2); +SCM +Dot_column::force_shift_callback (SCM element_smob, SCM axis) { + Score_element *me = unsmob_element (element_smob); + Axis a = (Axis) gh_scm2int (axis); assert (a == Y_AXIS); - Score_element * me = dot->parent_l (X_AXIS); + me = me->parent_l (X_AXIS); SCM dots = me->get_elt_property ("dots"); do_shifts (dots); - return 0.0; + return gh_double2scm (0.0); } SCM @@ -130,3 +116,21 @@ Dot_column::has_interface (Score_element*m) { return m && m->has_interface (ly_symbol2scm ("dot-column-interface")); } + + +void +Dot_column::add_head (Score_element * me, Score_element *rh) +{ + Score_element * d = unsmob_element (rh->get_elt_property ("dot")); + if (d) + { + Side_position::add_support (me,rh); + + Pointer_group_interface gi (me, "dots"); + gi.add_element (d); + + d->add_offset_callback (Dot_column_force_shift_callback_proc , Y_AXIS); + Axis_group_interface::add_element (me, d); + } +} + diff --git a/lily/dots.cc b/lily/dots.cc index 25e4cec7dd..db1fc24b2e 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -15,9 +15,12 @@ #include "directional-element-interface.hh" -Real -Dots::quantised_position_callback (Score_element * me, Axis a) +MAKE_SCHEME_CALLBACK(Dots,quantised_position_callback,2); +SCM +Dots::quantised_position_callback (SCM element_smob, SCM axis) { + Score_element *me = unsmob_element (element_smob); + Axis a = (Axis) gh_scm2int (axis); assert (a == Y_AXIS); SCM d= me->get_elt_property ("dot-count"); @@ -27,14 +30,14 @@ Dots::quantised_position_callback (Score_element * me, Axis a) Directional_element_interface::set (me, UP); if (Staff_symbol_referencer::on_staffline (me)) - return Staff_symbol_referencer::staff_space (me) / 2.0 * Directional_element_interface::get (me); + return gh_double2scm (Staff_symbol_referencer::staff_space (me) / 2.0 * Directional_element_interface::get (me)); } - return 0.0; + return gh_double2scm (0.0); } -MAKE_SCHEME_CALLBACK(Dots,brew_molecule); +MAKE_SCHEME_CALLBACK(Dots,brew_molecule,1); SCM Dots::brew_molecule (SCM d) { diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index e0788f08e5..8fd1275047 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -190,7 +190,7 @@ Dynamic_engraver::do_process_music () Axis_group_interface::add_element (line_spanner_, text_p_); - text_p_->add_offset_callback (Side_position::aligned_on_self, + text_p_->add_offset_callback (Side_position_aligned_on_self_proc, Y_AXIS); announce_element (text_p_, text_req_l_); } @@ -290,7 +290,7 @@ Dynamic_engraver::do_process_music () Axis_group_interface::add_element (line_spanner_, cresc_p_); cresc_p_->set_elt_property ("self-alignment-Y", gh_int2scm (0)); cresc_p_->add_offset_callback - (Side_position::aligned_on_self, Y_AXIS); + (Side_position_aligned_on_self_proc, Y_AXIS); announce_element (cresc_p_, accepted_spanreqs_drul_[START]); } } diff --git a/lily/grace-align-item.cc b/lily/grace-align-item.cc index fb11733906..f18b7d0355 100644 --- a/lily/grace-align-item.cc +++ b/lily/grace-align-item.cc @@ -13,7 +13,7 @@ #include "paper-column.hh" #include "paper-def.hh" -MAKE_SCHEME_CALLBACK(Grace_align_item,before_line_breaking); +MAKE_SCHEME_CALLBACK(Grace_align_item,before_line_breaking,1); SCM Grace_align_item::before_line_breaking (SCM smob) { diff --git a/lily/hara-kiri-group-spanner.cc b/lily/hara-kiri-group-spanner.cc index bbc6bfc643..2ed9dae9ce 100644 --- a/lily/hara-kiri-group-spanner.cc +++ b/lily/hara-kiri-group-spanner.cc @@ -13,13 +13,6 @@ #include "debug.hh" #include "item.hh" -void -Hara_kiri_group_spanner::set_interface (Score_element*me) -{ - me->add_offset_callback (force_hara_kiri_callback, Y_AXIS); - me->set_interface (ly_symbol2scm ("hara-kiri-spanner-interface")); - me->set_extent_callback (Hara_kiri_group_spanner::y_extent, Y_AXIS); -} Interval Hara_kiri_group_spanner::y_extent(Score_element*me, Axis a) @@ -67,21 +60,27 @@ Hara_kiri_group_spanner::consider_suicide(Score_element*me) We can't rely on offsets and dimensions of elements in a hara-kiri group. Use a callback to make sure that hara-kiri has been done before asking for offsets. */ -Real -Hara_kiri_group_spanner::force_hara_kiri_callback (Score_element *elt, Axis a) +MAKE_SCHEME_CALLBACK(Hara_kiri_group_spanner,force_hara_kiri_callback,2); +SCM +Hara_kiri_group_spanner::force_hara_kiri_callback (SCM element_smob, SCM axis) { + Score_element *me = unsmob_element (element_smob); + Axis a = (Axis) gh_scm2int (axis); assert (a == Y_AXIS); - consider_suicide (elt); - return 0.0; + consider_suicide (me); + return gh_double2scm (0.0); } -Real -Hara_kiri_group_spanner::force_hara_kiri_in_parent_callback (Score_element*daughter, Axis a) +MAKE_SCHEME_CALLBACK(Hara_kiri_group_spanner,force_hara_kiri_in_parent_callback,2); +SCM +Hara_kiri_group_spanner::force_hara_kiri_in_parent_callback (SCM element_smob, SCM axis) { + Score_element *daughter = unsmob_element (element_smob); + Axis a = (Axis) gh_scm2int (axis); assert (a == Y_AXIS); - force_hara_kiri_callback (daughter->parent_l (a), Y_AXIS); - return 0.0; + force_hara_kiri_callback (daughter->parent_l (a)->self_scm (), Y_AXIS); + return gh_double2scm ( 0.0); } void @@ -90,3 +89,12 @@ Hara_kiri_group_spanner::add_element (Score_element * me, Score_element *e) // e->add_offset_callback (force_hara_kiri_in_parent_callback, Y_AXIS); Axis_group_interface::add_element (me, e); } + + +void +Hara_kiri_group_spanner::set_interface (Score_element*me) +{ + me->add_offset_callback (Hara_kiri_group_spanner_force_hara_kiri_callback_proc, Y_AXIS); + me->set_interface (ly_symbol2scm ("hara-kiri-spanner-interface")); + me->set_extent_callback (Hara_kiri_group_spanner::y_extent, Y_AXIS); +} diff --git a/lily/hyphen-spanner.cc b/lily/hyphen-spanner.cc index a798afe422..eb64b7d134 100644 --- a/lily/hyphen-spanner.cc +++ b/lily/hyphen-spanner.cc @@ -19,7 +19,7 @@ #include "spanner.hh" #include "item.hh" -MAKE_SCHEME_CALLBACK(Hyphen_spanner,brew_molecule) +MAKE_SCHEME_CALLBACK(Hyphen_spanner,brew_molecule,1) SCM Hyphen_spanner::brew_molecule (SCM smob) diff --git a/lily/include/align-interface.hh b/lily/include/align-interface.hh index 3eb8b9e972..35070547be 100644 --- a/lily/include/align-interface.hh +++ b/lily/include/align-interface.hh @@ -12,7 +12,9 @@ #include "axes.hh" #include "lily-proto.hh" +#include "lily-guile.hh" +extern SCM Align_interface_alignment_callback_proc; /* Order elements top to bottom/left to right/right to left etc. @@ -51,7 +53,7 @@ */ struct Align_interface { - static Real alignment_callback (Score_element *,Axis); + static SCM alignment_callback (SCM element, SCM axis); static void do_side_processing (Score_element*,Axis a); static void set_axis (Score_element*,Axis); static Axis axis (Score_element*) ; @@ -59,7 +61,7 @@ struct Align_interface { static int get_count (Score_element*,Score_element*); static void set_interface (Score_element*); static bool has_interface (Score_element*); - static Real center_on_element (Score_element *c, Axis); + static SCM center_on_element (SCM element, SCM axis); }; #endif /* ALIGN_INTERFACE_HH */ diff --git a/lily/include/arpeggio.hh b/lily/include/arpeggio.hh new file mode 100644 index 0000000000..362c87e193 --- /dev/null +++ b/lily/include/arpeggio.hh @@ -0,0 +1,23 @@ +/* + arpegio.hh -- declare Arpeggio + + source file of the GNU LilyPond music typesetter + + (c) 2000 Jan Nieuwenhuizen +*/ + +#ifndef ARPEGGIO_HH +#define ARPEGGIO_HH + +#include "lily-guile.hh" +#include "lily-proto.hh" + +class Arpeggio +{ +public: + static SCM brew_molecule (SCM); + static bool has_interface (Score_element*); +}; + +#endif /* ARPEGGIO_HH */ + diff --git a/lily/include/beam.hh b/lily/include/beam.hh index 3ed32fae68..99de7ea4f4 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -11,6 +11,7 @@ #include "lily-guile.hh" +extern SCM Beam_rest_collision_callback_proc; /** a beam connects multiple stems. Beam adjusts the stems its owns to make sure that they reach the @@ -61,7 +62,7 @@ public: static Item* last_visible_stem (Score_element*); static bool has_interface (Score_element*); static void set_interface (Score_element*); - static Real rest_collision_callback (Score_element *,Axis); + static SCM rest_collision_callback (SCM element, SCM axis); Beam (SCM); static void add_stem (Score_element*,Score_element*); static void set_beaming (Score_element*,Beaming_info_list *); diff --git a/lily/include/break-align-item.hh b/lily/include/break-align-item.hh index 8449f07498..9e3bc936ab 100644 --- a/lily/include/break-align-item.hh +++ b/lily/include/break-align-item.hh @@ -11,7 +11,7 @@ #define BREAK_ALIGN_ITEM_HH #include "item.hh" - +extern SCM Break_align_interface_alignment_callback_proc; /** align breakable items (clef, bar, etc.) @@ -29,7 +29,7 @@ public: static void set_interface (Score_element*); static bool has_interface (Score_element*); static void add_element (Score_element*me, Score_element*add); - static Real alignment_callback (Score_element*, Axis); - static Real self_align_callback (Score_element*, Axis); + static SCM alignment_callback (SCM element, SCM axis); + static SCM self_align_callback (SCM element, SCM axis); }; #endif // BREAK_ALIGN_ITEM_HH diff --git a/lily/include/breathing-sign.hh b/lily/include/breathing-sign.hh index 17e06d03a4..e0f8dc8b63 100644 --- a/lily/include/breathing-sign.hh +++ b/lily/include/breathing-sign.hh @@ -20,7 +20,7 @@ class Breathing_sign { public: static SCM brew_molecule (SCM); - static Real offset_callback (Score_element *, Axis); + static SCM offset_callback (SCM element, SCM axis); static void set_interface (Score_element*); static bool has_interface (Score_element*); }; diff --git a/lily/include/collision.hh b/lily/include/collision.hh index 650a80f14f..e8c3100037 100644 --- a/lily/include/collision.hh +++ b/lily/include/collision.hh @@ -43,7 +43,7 @@ class Collision // interface public: static SCM automatic_shift (Score_element*); static SCM forced_shift (Score_element*); - static Real force_shift_callback (Score_element *, Axis); + static SCM force_shift_callback (SCM element, SCM axis); static void do_shifts (Score_element*); static void add_column (Score_element*me,Score_element*ncol_l); }; diff --git a/lily/include/dimension-cache.hh b/lily/include/dimension-cache.hh index ca4fad3c16..adbcc2aa04 100644 --- a/lily/include/dimension-cache.hh +++ b/lily/include/dimension-cache.hh @@ -15,24 +15,27 @@ #include "lily-proto.hh" #include "parray.hh" #include "dimension-cache-callback.hh" +#include "lily-guile.hh" /** - Adminstration of offset dimension info. - */ + Adminstration of offset dimension info. + + TODO: use SCM for callbacks, and let them be set as basic + properties. +*/ struct Dimension_cache { - bool valid_b_; Interval dim_; /** The offset wrt. to the center of #parent_l_# */ Real offset_; - - + SCM offset_callbacks_; - Array off_callbacks_; + bool valid_b_; + char offsets_left_; /** What to call to find extent. Nil means empty. diff --git a/lily/include/dot-column.hh b/lily/include/dot-column.hh index 27a1eb3225..8ee712ae42 100644 --- a/lily/include/dot-column.hh +++ b/lily/include/dot-column.hh @@ -22,7 +22,7 @@ public: static void add_head (Score_element * dotcol, Score_element* rh ); static void set_interface (Score_element*); static bool has_interface (Score_element*); - static Real force_shift_callback (Score_element * , Axis); + static SCM force_shift_callback (SCM,SCM); static SCM do_shifts (SCM dotlist); }; #endif // DOT_COLUMN_HH diff --git a/lily/include/dots.hh b/lily/include/dots.hh index 76189d65f6..4d9394eecd 100644 --- a/lily/include/dots.hh +++ b/lily/include/dots.hh @@ -13,6 +13,7 @@ #include "lily-proto.hh" #include "lily-guile.hh" +extern SCM Dots_quantised_position_callback_proc; /** The dots to go with a notehead/rest. A separate class, since they @@ -27,7 +28,7 @@ class Dots // interface { public: - static Real quantised_position_callback(Score_element*, Axis); + static SCM quantised_position_callback (SCM element, SCM axis); static SCM brew_molecule (SCM); }; diff --git a/lily/include/hara-kiri-group-spanner.hh b/lily/include/hara-kiri-group-spanner.hh index 9f42879107..7e3856e445 100644 --- a/lily/include/hara-kiri-group-spanner.hh +++ b/lily/include/hara-kiri-group-spanner.hh @@ -30,9 +30,9 @@ class Hara_kiri_group_spanner { public: - static Real force_hara_kiri_callback (Score_element * , Axis); + static SCM force_hara_kiri_callback (SCM,SCM); static Interval y_extent (Score_element * , Axis); - static Real force_hara_kiri_in_parent_callback (Score_element * , Axis); + static SCM force_hara_kiri_in_parent_callback(SCM,SCM); static void add_element (Score_element *me, Score_element *e); static void set_interface (Score_element*me); static bool has_interface (Score_element*); diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index bc9287c763..092d7a57e6 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -84,18 +84,20 @@ void add_scm_init_func (void (*)()); typedef SCM(*Scheme_function_unknown)(); #if __GNUC_MINOR__ >= 96 -typedef SCM(*Scheme_function_1)(SCM); +typedef SCM(*Scheme_function_1)(SCM); +typedef SCM(*Scheme_function_2)(SCM,SCM); #else typedef SCM(*Scheme_function_1)(...); +typedef SCM(*Scheme_function_2)(...); #endif -#define MAKE_SCHEME_CALLBACK(TYPE, FUNC) \ -static SCM TYPE ## _ ## FUNC ## _proc;\ +#define MAKE_SCHEME_CALLBACK(TYPE, FUNC, ARGS) \ +SCM TYPE ## _ ## FUNC ## _proc;\ void \ TYPE ## _ ## FUNC ## _init_functions () \ { \ - TYPE ## _ ## FUNC ## _proc = gh_new_procedure1_0 (#TYPE "::" #FUNC, \ - ((Scheme_function_1)TYPE :: FUNC)); \ + TYPE ## _ ## FUNC ## _proc = gh_new_procedure ## ARGS ## _0 (#TYPE "::" #FUNC, \ + ((Scheme_function_ ## ARGS)TYPE :: FUNC)); \ } \ \ ADD_SCM_INIT_FUNC(TYPE ## _ ## FUNC ## _callback, TYPE ## _ ## FUNC ## _init_functions); \ diff --git a/lily/include/lyric-phrasing-engraver.hh b/lily/include/lyric-phrasing-engraver.hh index cda6f6584a..6888caa1b1 100644 --- a/lily/include/lyric-phrasing-engraver.hh +++ b/lily/include/lyric-phrasing-engraver.hh @@ -23,7 +23,6 @@ class Syllable_group; right aligning end of phrases, centering others under their notes. */ - /* * Build an engraver that catches noteheads and lyrics. diff --git a/lily/include/repeated-music.hh b/lily/include/repeated-music.hh index 3c70ae5a30..beca7dc1d0 100644 --- a/lily/include/repeated-music.hh +++ b/lily/include/repeated-music.hh @@ -49,10 +49,7 @@ */ class Repeated_music : public Music { - Music * repeat_body_p_; - Music_sequence * alternatives_p_; public: - Music * body () const; Music_sequence * alternatives () const; String type_; diff --git a/lily/include/rest-collision.hh b/lily/include/rest-collision.hh index c2ae9cd1fd..2df8ae606c 100644 --- a/lily/include/rest-collision.hh +++ b/lily/include/rest-collision.hh @@ -14,6 +14,7 @@ #include "lily-guile.hh" +extern SCM Rest_collision_force_shift_callback_proc; /* Move rests in note-columns so that they do not collide. @@ -48,7 +49,7 @@ public: static void add_column (Score_element*me,Score_element*); static void set_interface (Score_element*me); static bool has_interface (Score_element*); - static Real force_shift_callback (Score_element *, Axis); + static SCM force_shift_callback (SCM element, SCM axis); static SCM do_shift (Score_element*,SCM); }; #endif // REST_COLLISION_HH diff --git a/lily/include/score-element.hh b/lily/include/score-element.hh index b867d2119e..c83579304c 100644 --- a/lily/include/score-element.hh +++ b/lily/include/score-element.hh @@ -188,8 +188,9 @@ public: Score_element*common_refpoint (SCM elt_list, Axis a) const; // duh. slim down interface here. (todo) - bool has_offset_callback_b (Offset_callback, Axis)const; - void add_offset_callback (Offset_callback, Axis); + bool has_offset_callback_b (SCM callback, Axis)const; + void add_offset_callback (SCM callback, Axis); + bool has_extent_callback_b (Extent_callback, Axis)const; bool has_extent_callback_b (Axis) const; void set_extent_callback (Extent_callback , Axis); diff --git a/lily/include/side-position-interface.hh b/lily/include/side-position-interface.hh index a4f8e90356..dde5487bae 100644 --- a/lily/include/side-position-interface.hh +++ b/lily/include/side-position-interface.hh @@ -13,6 +13,9 @@ #include "spanner.hh" #include "item.hh" +extern SCM Side_position_aligned_on_self_proc; +extern SCM Side_position_centered_on_parent_proc; +extern SCM Side_position_quantised_position_proc; /** Position victim object (ELT_L_) next to other objects (the support). @@ -46,11 +49,11 @@ struct Side_position { public: - static Real side_position (Score_element *, Axis); - static Real aligned_on_self (Score_element *, Axis); - static Real aligned_side (Score_element *, Axis); - static Real quantised_position (Score_element *, Axis); - static Real centered_on_parent (Score_element *, Axis); + static SCM side_position (SCM element, SCM axis); + static SCM aligned_on_self (SCM element, SCM axis); + static SCM aligned_side (SCM element, SCM axis); + static SCM quantised_position (SCM element, SCM axis); + static SCM centered_on_parent (SCM element, SCM axis); static void set_axis (Score_element*,Axis); static void set_minimum_space (Score_element*,Real); static void set_padding (Score_element*,Real); diff --git a/lily/include/span-arpeggio.hh b/lily/include/span-arpeggio.hh new file mode 100644 index 0000000000..bda8c85722 --- /dev/null +++ b/lily/include/span-arpeggio.hh @@ -0,0 +1,24 @@ +/* + span-arpegio.hh -- declare Span_arpeggio + + source file of the GNU LilyPond music typesetter + + (c) 2000 Jan Nieuwenhuizen +*/ + +#ifndef SPAN_ARPEGGIO_HH +#define SPAN_ARPEGGIO_HH + +#include "lily-guile.hh" +#include "lily-proto.hh" +#include "interval.hh" + +class Span_arpeggio +{ +public: + static SCM brew_molecule (SCM); + static bool has_interface (Score_element*); +}; + +#endif /* SPAN_ARPEGGIO_HH */ + diff --git a/lily/include/span-bar.hh b/lily/include/span-bar.hh index b13a68364f..506a2e7438 100644 --- a/lily/include/span-bar.hh +++ b/lily/include/span-bar.hh @@ -34,7 +34,7 @@ public: static Interval width_callback(Score_element *, Axis) ; static SCM get_bar_size (SCM); static SCM before_line_breaking (SCM); - static Real center_on_spanned_callback (Score_element*,Axis); + static SCM center_on_spanned_callback (SCM element, SCM axis); }; #endif // SPAN_BAR_HH diff --git a/lily/include/staff-symbol-referencer.hh b/lily/include/staff-symbol-referencer.hh index 129848172b..ecded8250b 100644 --- a/lily/include/staff-symbol-referencer.hh +++ b/lily/include/staff-symbol-referencer.hh @@ -24,7 +24,7 @@ public: static void set_interface (Score_element*); static bool has_interface (Score_element*); static void set_position (Score_element*,Real); - static Real callback (Score_element *, Axis a); + static SCM callback (SCM element, SCM axis); /** Leading are the lead strips between the sticks (lines) of diff --git a/lily/include/stem.hh b/lily/include/stem.hh index 8c3e6f7691..0a4aee4859 100644 --- a/lily/include/stem.hh +++ b/lily/include/stem.hh @@ -71,7 +71,7 @@ public: static Real get_default_stem_end_position (Score_element*me) ; static void position_noteheads(Score_element*); static Real stem_end_position (Score_element*) ; - static Real off_callback (Score_element *, Axis); + static SCM off_callback (SCM element, SCM axis); static Molecule flag (Score_element*); static SCM before_line_breaking (SCM); static Interval dim_callback (Score_element *,Axis); diff --git a/lily/include/translator.hh b/lily/include/translator.hh index 2eb5023cc3..05f865082d 100644 --- a/lily/include/translator.hh +++ b/lily/include/translator.hh @@ -96,7 +96,6 @@ protected: */ virtual void do_add_processing (); virtual bool do_try_music (Music *req_l); - virtual void do_pre_move_processing(); virtual void do_post_move_processing(); virtual void do_process_music () ; diff --git a/lily/instrument-name-engraver.cc b/lily/instrument-name-engraver.cc index 26520d46e3..ce4c328946 100644 --- a/lily/instrument-name-engraver.cc +++ b/lily/instrument-name-engraver.cc @@ -42,7 +42,7 @@ Instrument_name_engraver::do_pre_move_processing () { if (text_) { - text_->add_offset_callback (Side_position::centered_on_parent, + text_->add_offset_callback (Side_position_centered_on_parent_proc, Y_AXIS); typeset_element (text_); diff --git a/lily/key-item.cc b/lily/key-item.cc index bb3ad4a377..dcddc27c74 100644 --- a/lily/key-item.cc +++ b/lily/key-item.cc @@ -71,7 +71,7 @@ Key_item::calculate_position(Score_element *ki, SCM pair) TODO - space the `natural' signs wider */ -MAKE_SCHEME_CALLBACK(Key_item,brew_molecule); +MAKE_SCHEME_CALLBACK(Key_item,brew_molecule,1); SCM Key_item::brew_molecule (SCM smob) { diff --git a/lily/local-key-item.cc b/lily/local-key-item.cc index 6ef1dfba8a..b797e02d93 100644 --- a/lily/local-key-item.cc +++ b/lily/local-key-item.cc @@ -72,7 +72,7 @@ Local_key_item::parenthesize (Score_element*me, Molecule m) accidental placement is more complicated than this. */ -MAKE_SCHEME_CALLBACK(Local_key_item,brew_molecule); +MAKE_SCHEME_CALLBACK(Local_key_item,brew_molecule,1); SCM Local_key_item::brew_molecule (SCM smob) { diff --git a/lily/lyric-engraver.cc b/lily/lyric-engraver.cc index 3f9da4327d..42a7ee3287 100644 --- a/lily/lyric-engraver.cc +++ b/lily/lyric-engraver.cc @@ -47,7 +47,7 @@ Lyric_engraver::do_process_music() // ly_str02scm ((req_l_->text_str_ + " ").ch_C ())); ly_str02scm ((req_l_->text_str_).ch_C ())); - text_p_->add_offset_callback (&Side_position::aligned_on_self,X_AXIS); + text_p_->add_offset_callback (Side_position_aligned_on_self_proc,X_AXIS); /* We can't reach the notehead where we're centered from here. So we kludge. diff --git a/lily/lyric-extender.cc b/lily/lyric-extender.cc index 456f8a5317..fb09d42307 100644 --- a/lily/lyric-extender.cc +++ b/lily/lyric-extender.cc @@ -16,7 +16,7 @@ #include "lyric-extender.hh" -MAKE_SCHEME_CALLBACK(Lyric_extender,brew_molecule) +MAKE_SCHEME_CALLBACK(Lyric_extender,brew_molecule,1) SCM Lyric_extender::brew_molecule (SCM smob) { diff --git a/lily/lyric-phrasing-engraver.cc b/lily/lyric-phrasing-engraver.cc index 5cc40bc936..26b2a97452 100644 --- a/lily/lyric-phrasing-engraver.cc +++ b/lily/lyric-phrasing-engraver.cc @@ -18,6 +18,12 @@ String trim_suffix(String &id); ADD_THIS_TRANSLATOR (Lyric_phrasing_engraver); +/* + TODO: this code is too hairy, and does things that should be in the + backend. Fixme. +*/ + + /* We find start and end of phrases, and align lyrics accordingly. Also, lyrics at start of melismata should be left aligned. @@ -241,6 +247,10 @@ void Lyric_phrasing_engraver::process_acknowledged () // ((current . oldflag) . previous) if(!to_boolean(gh_cdar(v_entry))) { // not an old entry left over from a prior note ... Syllable_group *entry = unsmob_voice_entry(gh_caar(v_entry)); + + /* + TODO: give context for warning. + */ if(! entry->set_lyric_align(punc.ch_C(), any_notehead_l_)) warning (_ ("lyrics found without any matching notehead")); diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 37538e28be..e414c09bf6 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -35,7 +35,7 @@ Multi_measure_rest::has_interface (Score_element*me) [TODO] 17 * variable-sized multi-measure rest symbol: |====| ?? */ -MAKE_SCHEME_CALLBACK(Multi_measure_rest,brew_molecule); +MAKE_SCHEME_CALLBACK(Multi_measure_rest,brew_molecule,1); SCM Multi_measure_rest::brew_molecule (SCM smob) { @@ -153,7 +153,7 @@ Multi_measure_rest::add_column (Score_element*me,Item* c) } -MAKE_SCHEME_CALLBACK (Multi_measure_rest, set_spacing_rods); +MAKE_SCHEME_CALLBACK (Multi_measure_rest, set_spacing_rods,1); SCM Multi_measure_rest::set_spacing_rods (SCM smob) diff --git a/lily/note-head.cc b/lily/note-head.cc index 847799f180..619520ce95 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -50,7 +50,7 @@ Note_head::ledger_line (Interval xwid, Score_element *me) } -MAKE_SCHEME_CALLBACK(Note_head,brew_molecule); +MAKE_SCHEME_CALLBACK(Note_head,brew_molecule,1); SCM Note_head::brew_molecule (SCM smob) diff --git a/lily/note-heads-engraver.cc b/lily/note-heads-engraver.cc index 453753130e..1e73315091 100644 --- a/lily/note-heads-engraver.cc +++ b/lily/note-heads-engraver.cc @@ -52,15 +52,15 @@ Note_heads_engraver::do_try_music (Music *m) return true; } - else if (Tonic_req* t = dynamic_cast (m)) + else if ( dynamic_cast (m)) { return true; } - else if (Inversion_req* i = dynamic_cast (m)) + else if ( dynamic_cast (m)) { return true; } - else if (Bass_req* b = dynamic_cast (m)) + else if (dynamic_cast (m)) { return true; } @@ -104,7 +104,7 @@ Note_heads_engraver::do_process_music() d->set_elt_property ("dot-count", gh_int2scm (note_req_l->duration_.dots_i_)); d->set_parent (note_p, Y_AXIS); - d->add_offset_callback (Dots::quantised_position_callback, Y_AXIS); + d->add_offset_callback (Dots_quantised_position_callback_proc, Y_AXIS); announce_element (d,0); dot_p_arr_.push (d); } diff --git a/lily/piano-pedal-engraver.cc b/lily/piano-pedal-engraver.cc index b9688e5de7..861c74f939 100644 --- a/lily/piano-pedal-engraver.cc +++ b/lily/piano-pedal-engraver.cc @@ -190,8 +190,8 @@ Piano_pedal_engraver::do_process_music () Side_position::set_axis (p->item_p_,Y_AXIS); // todo: init with basic props. - p->item_p_->add_offset_callback (Side_position::aligned_on_self, X_AXIS); - p->item_p_->add_offset_callback (Side_position::centered_on_parent, X_AXIS); + p->item_p_->add_offset_callback (Side_position_aligned_on_self_proc, X_AXIS); + p->item_p_->add_offset_callback (Side_position_centered_on_parent_proc, X_AXIS); announce_element (p->item_p_, p->req_l_drul_[START] ? p->req_l_drul_[START] diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index a6cecb9013..be3edfdabc 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -19,9 +19,12 @@ #include "staff-symbol-referencer.hh" #include "duration.hh" -Real -Rest_collision::force_shift_callback (Score_element *them, Axis a) +MAKE_SCHEME_CALLBACK(Rest_collision,force_shift_callback,2); +SCM +Rest_collision::force_shift_callback (SCM element_smob, SCM axis) { + Score_element *them = unsmob_element (element_smob); + Axis a = (Axis) gh_scm2int (axis); assert (a == Y_AXIS); Score_element * rc = unsmob_element (them->get_elt_property ("rest-collision")); @@ -37,7 +40,7 @@ Rest_collision::force_shift_callback (Score_element *them, Axis a) do_shift (rc, elts); } - return 0.0; + return gh_double2scm (0.0); } void @@ -47,7 +50,7 @@ Rest_collision::add_column (Score_element*me,Score_element *p) Pointer_group_interface gi (me); gi.add_element (p); - p->add_offset_callback (&Rest_collision::force_shift_callback, Y_AXIS); + p->add_offset_callback (Rest_collision_force_shift_callback_proc, Y_AXIS); p->set_elt_property ("rest-collision", me->self_scm ()); } diff --git a/lily/rest-engraver.cc b/lily/rest-engraver.cc index 40cba4eb91..ce77975e2b 100644 --- a/lily/rest-engraver.cc +++ b/lily/rest-engraver.cc @@ -81,7 +81,7 @@ Rest_engraver::do_process_music () Staff_symbol_referencer::set_interface (dot_p_); Rhythmic_head::set_dots (rest_p_, dot_p_); dot_p_->set_parent (rest_p_, Y_AXIS); - dot_p_->add_offset_callback (Dots::quantised_position_callback, Y_AXIS); + dot_p_->add_offset_callback (Dots_quantised_position_callback_proc, Y_AXIS); dot_p_->set_elt_property ("dot-count", gh_int2scm (rest_req_l_->duration_.dots_i_)); announce_element (dot_p_,0); diff --git a/lily/rest.cc b/lily/rest.cc index dcff306422..1ca731b20f 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -15,7 +15,7 @@ #include "staff-symbol-referencer.hh" // -> offset callback -MAKE_SCHEME_CALLBACK(Rest,after_line_breaking); +MAKE_SCHEME_CALLBACK(Rest,after_line_breaking,1); SCM Rest::after_line_breaking (SCM smob) { @@ -37,7 +37,7 @@ Rest::after_line_breaking (SCM smob) } -MAKE_SCHEME_CALLBACK(Rest,brew_molecule) +MAKE_SCHEME_CALLBACK(Rest,brew_molecule,1) SCM Rest::brew_molecule (SCM smob) { diff --git a/lily/score-element.cc b/lily/score-element.cc index c4d43ca0b8..7a27361638 100644 --- a/lily/score-element.cc +++ b/lily/score-element.cc @@ -59,6 +59,14 @@ Score_element::Score_element(SCM basicprops) mutable_property_alist_ = SCM_EOL; smobify_self (); + + dim_cache_[X_AXIS].offset_callbacks_ + = get_elt_property ("X-offset-callbacks"); + dim_cache_[Y_AXIS].offset_callbacks_ + = get_elt_property ("Y-offset-callbacks"); + + dim_cache_[X_AXIS].offsets_left_ = scm_ilength (dim_cache_[X_AXIS].offset_callbacks_); + dim_cache_[Y_AXIS].offsets_left_ = scm_ilength (dim_cache_[Y_AXIS].offset_callbacks_); } @@ -295,7 +303,7 @@ Score_element::do_add_processing() } -MAKE_SCHEME_CALLBACK(Score_element,brew_molecule) +MAKE_SCHEME_CALLBACK(Score_element,brew_molecule,1) /* ugh. @@ -477,7 +485,8 @@ Score_element::suicide () for (int a= X_AXIS; a <= Y_AXIS; a++) { - dim_cache_[a].off_callbacks_.clear (); + dim_cache_[a].offset_callbacks_ = SCM_EOL; + dim_cache_[a].offsets_left_ = 0; } } @@ -524,11 +533,13 @@ Real Score_element::get_offset (Axis a) const { Score_element *me = (Score_element*) this; - while (dim_cache_[a].off_callbacks_.size ()) + while (dim_cache_[a].offsets_left_) { - Offset_callback c = dim_cache_[a].off_callbacks_[0]; - me->dim_cache_[a].off_callbacks_.del (0); - Real r = (*c) (me,a ); + int l = --me->dim_cache_[a].offsets_left_; + SCM cb = scm_list_ref (dim_cache_[a].offset_callbacks_, gh_int2scm (l)); + SCM retval = gh_call2 (cb, self_scm (), gh_int2scm (a)); + + Real r = gh_scm2double (retval); if (isinf (r) || isnan (r)) { programming_error (INFINITY_MSG); @@ -643,9 +654,10 @@ Score_element::name () const } void -Score_element::add_offset_callback (Offset_callback cb, Axis a) +Score_element::add_offset_callback (SCM cb, Axis a) { - dim_cache_[a].off_callbacks_.push (cb); + dim_cache_[a].offset_callbacks_ = gh_cons (cb, dim_cache_[a].offset_callbacks_ ); + dim_cache_[a].offsets_left_ ++; } bool @@ -662,14 +674,9 @@ Score_element::has_extent_callback_b (Axis a) const } bool -Score_element::has_offset_callback_b (Offset_callback cb, Axis a)const +Score_element::has_offset_callback_b (SCM cb, Axis a)const { - for (int i= dim_cache_[a].off_callbacks_.size (); i--;) - { - if (dim_cache_[a].off_callbacks_[i] == cb) - return true; - } - return false; + return scm_memq (cb, dim_cache_[a].offset_callbacks_) != SCM_BOOL_F; } void @@ -685,7 +692,7 @@ Score_element::set_parent (Score_element *g, Axis a) dim_cache_[a].parent_l_ = g; } -MAKE_SCHEME_CALLBACK(Score_element,fixup_refpoint); +MAKE_SCHEME_CALLBACK(Score_element,fixup_refpoint,1); SCM Score_element::fixup_refpoint (SCM smob) { @@ -739,6 +746,8 @@ Score_element::mark_smob (SCM ses) Score_element * s = (Score_element*) SCM_CELL_WORD_1(ses); scm_gc_mark (s->immutable_property_alist_); scm_gc_mark (s->mutable_property_alist_); + scm_gc_mark (s->dim_cache_[X_AXIS].offset_callbacks_); + scm_gc_mark (s->dim_cache_[Y_AXIS].offset_callbacks_); if (s->parent_l (Y_AXIS)) scm_gc_mark (s->parent_l (Y_AXIS)->self_scm ()); diff --git a/lily/script-column.cc b/lily/script-column.cc index 51055a3a9a..e4a1989c69 100644 --- a/lily/script-column.cc +++ b/lily/script-column.cc @@ -34,7 +34,7 @@ staff_side_compare (Score_element * const &i1, return gh_scm2int (p1) - gh_scm2int (p2); } -MAKE_SCHEME_CALLBACK(Script_column,before_line_breaking); +MAKE_SCHEME_CALLBACK(Script_column,before_line_breaking,1); SCM Script_column::before_line_breaking (SCM smob) diff --git a/lily/script-engraver.cc b/lily/script-engraver.cc index 059d14dd08..8736506d57 100644 --- a/lily/script-engraver.cc +++ b/lily/script-engraver.cc @@ -70,7 +70,7 @@ Script_engraver::do_process_music() Score_element *p =new Item (get_property ("basicScriptProperties")); Script::set_interface (p); - p->add_offset_callback (Side_position::centered_on_parent, X_AXIS); + p->add_offset_callback (Side_position_centered_on_parent_proc, X_AXIS); list = gh_cdr (list); p->set_elt_property ("molecule", @@ -102,7 +102,7 @@ Script_engraver::do_process_music() p->set_elt_property ("staff-support", SCM_BOOL_T); if (!xaxis && follow_staff) - p->add_offset_callback (Side_position::quantised_position, Y_AXIS); + p->add_offset_callback (Side_position_quantised_position_proc, Y_AXIS); p->set_elt_property ("script-priority", priority); diff --git a/lily/script.cc b/lily/script.cc index 333593a2d8..10f9627184 100644 --- a/lily/script.cc +++ b/lily/script.cc @@ -36,7 +36,7 @@ Script::get_molecule(Score_element * me, Direction d) return Molecule (); } -MAKE_SCHEME_CALLBACK(Script,after_line_breaking); +MAKE_SCHEME_CALLBACK(Script,after_line_breaking,1); SCM Script::after_line_breaking (SCM smob) { @@ -48,7 +48,7 @@ Script::after_line_breaking (SCM smob) return SCM_UNSPECIFIED; } -MAKE_SCHEME_CALLBACK(Script,brew_molecule); +MAKE_SCHEME_CALLBACK(Script,brew_molecule,1); SCM Script::brew_molecule (SCM smob) diff --git a/lily/separating-group-spanner.cc b/lily/separating-group-spanner.cc index 628af83903..644366f5a9 100644 --- a/lily/separating-group-spanner.cc +++ b/lily/separating-group-spanner.cc @@ -34,7 +34,7 @@ do_rod (Item *l, Item *r) rod.add_to_cols (); } -MAKE_SCHEME_CALLBACK(Separating_group_spanner,set_spacing_rods); +MAKE_SCHEME_CALLBACK(Separating_group_spanner,set_spacing_rods,1); SCM Separating_group_spanner::set_spacing_rods (SCM smob) { diff --git a/lily/side-position-interface.cc b/lily/side-position-interface.cc index efbaf14844..3b22afbe44 100644 --- a/lily/side-position-interface.cc +++ b/lily/side-position-interface.cc @@ -52,17 +52,20 @@ Side_position::get_direction (Score_element*me) Callback that does the aligning. Puts the element next to the support */ -Real -Side_position::side_position (Score_element *cme, Axis axis) +MAKE_SCHEME_CALLBACK(Side_position,side_position,2); +SCM +Side_position::side_position (SCM element_smob, SCM axis) { - Score_element* me = (Score_element*)cme; - Score_element *common = me->parent_l (axis); + Score_element *me = unsmob_element (element_smob); + Axis a = (Axis) gh_scm2int (axis); + + Score_element *common = me->parent_l (a); SCM support = me->get_elt_property ("side-support-elements"); for (SCM s = support; s != SCM_EOL; s = gh_cdr (s)) { Score_element * e = unsmob_element (gh_car (s)); if (e) - common = common->common_refpoint (e, axis); + common = common->common_refpoint (e, a); } Interval dim; @@ -72,9 +75,9 @@ Side_position::side_position (Score_element *cme, Axis axis) Score_element * e = unsmob_element ( gh_car (s)); if (e) { - Real coord = e->relative_coordinate (common, axis); + Real coord = e->relative_coordinate (common, a); - dim.unite (coord + e->extent (axis)); + dim.unite (coord + e->extent (a)); } } @@ -85,7 +88,7 @@ Side_position::side_position (Score_element *cme, Axis axis) Direction dir = Side_position::get_direction (me); - Real off = me->parent_l (axis)->relative_coordinate (common, axis); + Real off = me->parent_l (a)->relative_coordinate (common, a); SCM minimum = me->remove_elt_property ("minimum-space"); Real total_off = dim[dir] + off; @@ -101,40 +104,43 @@ Side_position::side_position (Score_element *cme, Axis axis) if (fabs (total_off) > 100 CM) programming_error ("Huh ? Improbable staff side dim."); - return total_off; + return gh_double2scm (total_off); } /** callback that centers the element on itself */ -Real -Side_position::aligned_on_self (Score_element *me, Axis ax) +MAKE_SCHEME_CALLBACK(Side_position,aligned_on_self,2); +SCM +Side_position::aligned_on_self (SCM element_smob, SCM axis) { + Score_element *me = unsmob_element (element_smob); + Axis a = (Axis) gh_scm2int (axis); String s ("self-alignment-"); - s += (ax == X_AXIS) ? "X" : "Y"; + s += (a == X_AXIS) ? "X" : "Y"; SCM align (me->get_elt_property (s.ch_C())); if (gh_number_p (align)) { - Interval ext(me->extent (ax)); + Interval ext(me->extent (a)); if (ext.empty_b ()) { programming_error ("I'm empty. Can't align on self"); - return 0.0; + return gh_double2scm (0.0); } else { Real lambda = (0.5 - gh_scm2double (align) / 2.0); - return - (lambda * ext[LEFT] + (1 - lambda) * ext[RIGHT]); + return gh_double2scm (- (lambda * ext[LEFT] + (1 - lambda) * ext[RIGHT])); } } else if (unsmob_element (align)) { - return - unsmob_element (align)->relative_coordinate (me, ax); + return gh_double2scm (- unsmob_element (align)->relative_coordinate (me, a)); } - return 0.0; + return gh_double2scm (0.0); } @@ -154,9 +160,13 @@ directed_round (Real f, Direction d) Only rounds when we're inside the staff, as determined by Staff_symbol_referencer::staff_radius() */ -Real -Side_position::quantised_position (Score_element *me, Axis ) +MAKE_SCHEME_CALLBACK(Side_position,quantised_position,2); +SCM +Side_position::quantised_position (SCM element_smob, SCM ) { + Score_element *me = unsmob_element (element_smob); + + Direction d = Side_position::get_direction (me); if (Staff_symbol_referencer::has_interface (me)) @@ -172,22 +182,25 @@ Side_position::quantised_position (Score_element *me, Axis ) rp += d; } - return (rp - p) * Staff_symbol_referencer::staff_space (me) / 2.0; + return gh_double2scm ((rp - p) * Staff_symbol_referencer::staff_space (me) / 2.0); } - return 0.0; + return gh_double2scm (0.0); } /* Position next to support, taking into account my own dimensions and padding. */ -Real -Side_position::aligned_side (Score_element *me, Axis ax) +MAKE_SCHEME_CALLBACK(Side_position,aligned_side,2); +SCM +Side_position::aligned_side (SCM element_smob, SCM axis) { + Score_element *me = unsmob_element (element_smob); + Axis a = (Axis) gh_scm2int (axis); - Direction d = Side_position ::get_direction (me); - Real o = side_position (me,ax); + Direction d = Side_position::get_direction (me); + Real o = gh_scm2double (side_position (element_smob,axis)); - Interval iv = me->extent (ax); + Interval iv = me->extent (a); if (!iv.empty_b ()) { @@ -197,18 +210,21 @@ Side_position::aligned_side (Score_element *me, Axis ax) if (gh_number_p (pad)) o += d *gh_scm2double (pad) ; } - return o; + return gh_double2scm (o); } /* Position centered on parent. */ -Real -Side_position::centered_on_parent (Score_element * me, Axis a) +MAKE_SCHEME_CALLBACK(Side_position,centered_on_parent,2); +SCM +Side_position::centered_on_parent (SCM element_smob, SCM axis) { + Score_element *me = unsmob_element (element_smob); + Axis a = (Axis) gh_scm2int (axis); Score_element *him = me->parent_l (a); - return him->extent (a).center (); + return gh_double2scm (him->extent (a).center ()); } @@ -225,18 +241,18 @@ Side_position::add_staff_support (Score_element*me) void Side_position::set_axis (Score_element*me, Axis a) { - if (!me->has_offset_callback_b (aligned_side, a)) - me->add_offset_callback (aligned_side, a); + if (!me->has_offset_callback_b (Side_position_aligned_side_proc, a)) + me->add_offset_callback (Side_position_aligned_side_proc, a); } - +// ugh. doesn't cactch all variants. Axis Side_position::get_axis (Score_element*me) { - if (me->has_offset_callback_b (&side_position, X_AXIS) - || me->has_offset_callback_b (&aligned_side , X_AXIS)) + if (me->has_offset_callback_b (Side_position_aligned_side_proc, X_AXIS) + || me->has_offset_callback_b (Side_position_aligned_side_proc , X_AXIS)) return X_AXIS; diff --git a/lily/slur.cc b/lily/slur.cc index a55a77812f..4a86f7c96f 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -107,7 +107,7 @@ Slur::get_default_dir (Score_element*me) } -MAKE_SCHEME_CALLBACK (Slur, after_line_breaking); +MAKE_SCHEME_CALLBACK (Slur, after_line_breaking,1); SCM Slur::after_line_breaking (SCM smob) { @@ -428,7 +428,7 @@ Slur::get_encompass_offset_arr (Score_element*me) } -MAKE_SCHEME_CALLBACK(Slur,set_spacing_rods); +MAKE_SCHEME_CALLBACK(Slur,set_spacing_rods,1); SCM Slur::set_spacing_rods (SCM smob) { @@ -450,7 +450,7 @@ Slur::set_spacing_rods (SCM smob) /* Ugh should have dash-length + dash-period */ -MAKE_SCHEME_CALLBACK (Slur, brew_molecule); +MAKE_SCHEME_CALLBACK (Slur, brew_molecule,1); SCM Slur::brew_molecule (SCM smob) { diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index 5ad98d494e..dd369960ce 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -309,7 +309,7 @@ Spacing_spanner::stem_dir_correction (Score_element*me, Score_element*l, Score_e } -MAKE_SCHEME_CALLBACK(Spacing_spanner, set_springs); +MAKE_SCHEME_CALLBACK(Spacing_spanner, set_springs,1); SCM Spacing_spanner::set_springs (SCM smob) { diff --git a/lily/span-arpeggio-engraver.cc b/lily/span-arpeggio-engraver.cc new file mode 100644 index 0000000000..9f5bc6083d --- /dev/null +++ b/lily/span-arpeggio-engraver.cc @@ -0,0 +1,87 @@ +/* + span-arpeggio-engraver.cc -- implement Span_arpeggio_engraver + + source file of the GNU LilyPond music typesetter + + (c) 2000 Jan Nieuwenhuizen +*/ + +#include "engraver.hh" +#include "item.hh" +#include "arpeggio.hh" +#include "span-arpeggio.hh" +#include "group-interface.hh" + + +/** + + Make arpeggios that span multiple staffs. Catch arpeggios, and span a + Span_arpeggio over them if we find more than two arpeggios. + */ +class Span_arpeggio_engraver : public Engraver +{ +public: + VIRTUAL_COPY_CONS (Translator); + Span_arpeggio_engraver (); + +protected: + virtual void acknowledge_element (Score_element_info); + virtual void process_acknowledged (); + virtual void do_pre_move_processing (); + +private: + Item *span_arpeggio_; + Link_array arpeggios_; +}; + + +Span_arpeggio_engraver::Span_arpeggio_engraver () +{ + span_arpeggio_ = 0; +} + +void +Span_arpeggio_engraver::acknowledge_element (Score_element_info info) +{ + int depth = info.origin_trans_l_arr (this).size (); + if (Arpeggio::has_interface (info.elem_l_)) + //if (info.origin_trans_l_arr (this).size () + // && Arpeggio::has_interface (info.elem_l_)) + { + arpeggios_.push (info.elem_l_); + } +} + +void +Span_arpeggio_engraver::process_acknowledged () +{ + if (arpeggios_.size () > 1 && !span_arpeggio_) + { + span_arpeggio_ = new Item (get_property ("basicSpanArpeggioProperties")); + Pointer_group_interface pgi (span_arpeggio_, "arpeggios"); + for (int i = 0; i < arpeggios_.size () ; i++) + { + pgi.add_element (arpeggios_[i]); + span_arpeggio_->add_dependency (arpeggios_[i]); + } + + span_arpeggio_->set_parent (arpeggios_[0], Y_AXIS); + span_arpeggio_->set_parent (arpeggios_[0], X_AXIS); + + announce_element (span_arpeggio_, 0); + } +} + +void +Span_arpeggio_engraver::do_pre_move_processing () +{ + if (span_arpeggio_) + { + typeset_element (span_arpeggio_); + span_arpeggio_ = 0; + } + arpeggios_.clear (); +} + +ADD_THIS_TRANSLATOR (Span_arpeggio_engraver); + diff --git a/lily/span-arpeggio.cc b/lily/span-arpeggio.cc new file mode 100644 index 0000000000..5a574a8eb8 --- /dev/null +++ b/lily/span-arpeggio.cc @@ -0,0 +1,68 @@ +/* + span-arpeggio.cc -- implement Span_arpeggio + + source file of the GNU LilyPond music typesetter + + (c) 2000 Jan Nieuwenhuizen +*/ + +#include "axis-group-interface.hh" +#include "molecule.hh" +#include "paper-def.hh" +#include "lookup.hh" +#include "arpeggio.hh" +#include "span-arpeggio.hh" +#include "score-element.hh" +#include "stem.hh" +#include "staff-symbol-referencer.hh" + +bool +Span_arpeggio::has_interface (Score_element* me) +{ + return me && me->has_interface (ly_symbol2scm ("span-arpeggio-interface")); +} + +/* + We could collapse this with Arpeggio::brew_molecule, but that requires + hairy scm callback hacking. + */ +MAKE_SCHEME_CALLBACK (Span_arpeggio, brew_molecule, 1); +SCM +Span_arpeggio::brew_molecule (SCM smob) +{ + Score_element *me = unsmob_element (smob); + + Interval iv; + Score_element *common = me; + for (SCM s = me->get_elt_property ("arpeggios"); gh_pair_p (s); s = gh_cdr (s)) + { + Score_element *arpeggio = unsmob_element (gh_car (s)); + common = arpeggio->common_refpoint (common, Y_AXIS); + } + // Hmm, nothing in common? + if (0) //(common) + for (SCM s = me->get_elt_property ("arpeggios"); gh_pair_p (s); s = gh_cdr (s)) + { + Score_element *arpeggio = unsmob_element (gh_car (s)); + Real c = common->relative_coordinate (arpeggio, Y_AXIS); + //iv.unite (Arpeggio::head_positions (stem)); + iv.unite (Interval (c, c)); + } + else + iv = Interval (-23, 5); + + Molecule mol; + Molecule dot = me->paper_l ()->lookup_l (0)->afm_find ("dots-dot"); + Real half_space = Staff_symbol_referencer::staff_space (me) / 2; + for (Real i = iv[MIN]; i < iv[MAX]; i++) + { + Molecule d (dot); + d.translate_axis (i * half_space, Y_AXIS); + mol.add_molecule (d); + } + mol.translate (Offset (-6, 0)); + + return mol.create_scheme (); +} + + diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 54b5ef953c..5c916a23e6 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -39,7 +39,7 @@ Span_bar::width_callback (Score_element *se, Axis ) return m.extent (X_AXIS); } -MAKE_SCHEME_CALLBACK(Span_bar,before_line_breaking); +MAKE_SCHEME_CALLBACK(Span_bar,before_line_breaking,1); SCM Span_bar::before_line_breaking (SCM smob) { @@ -53,9 +53,12 @@ Span_bar::before_line_breaking (SCM smob) return SCM_UNSPECIFIED; } -Real -Span_bar::center_on_spanned_callback (Score_element * me, Axis a) +MAKE_SCHEME_CALLBACK(Span_bar,center_on_spanned_callback,2); +SCM +Span_bar::center_on_spanned_callback (SCM element_smob, SCM axis) { + Score_element *me = unsmob_element (element_smob); + Axis a = (Axis) gh_scm2int (axis); assert (a == Y_AXIS); Interval i (get_spanned_interval (me)); @@ -64,7 +67,7 @@ Span_bar::center_on_spanned_callback (Score_element * me, Axis a) we have to translate ourselves to be in the center of the interval that we span. */ - return i.center (); + return gh_double2scm (i.center ()); } void @@ -122,7 +125,7 @@ Span_bar::get_spanned_interval (Score_element*me) } -MAKE_SCHEME_CALLBACK(Span_bar,get_bar_size); +MAKE_SCHEME_CALLBACK(Span_bar,get_bar_size,1); SCM Span_bar::get_bar_size (SCM smob) { @@ -138,6 +141,7 @@ Span_bar::get_bar_size (SCM smob) } return gh_double2scm (iv.length ()); } + void Span_bar::set_interface (Score_element *me) { @@ -145,7 +149,7 @@ Span_bar::set_interface (Score_element *me) Pointer_group_interface(me).set_interface (); me->set_extent_callback (width_callback, X_AXIS); - me->add_offset_callback (center_on_spanned_callback, Y_AXIS); + me->add_offset_callback (Span_bar_center_on_spanned_callback_proc, Y_AXIS); me->set_interface (ly_symbol2scm ("span-bar-interface")); me->set_extent_callback (0, Y_AXIS); } diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc index 4e70b158b6..9a339f72ae 100644 --- a/lily/staff-symbol-referencer.cc +++ b/lily/staff-symbol-referencer.cc @@ -12,18 +12,6 @@ #include "staff-symbol.hh" #include "paper-def.hh" - - - -void -Staff_symbol_referencer::set_interface (Score_element * e) -{ - if (!gh_number_p (e->get_elt_property ("staff-position"))) - e->set_elt_property ("staff-position", gh_double2scm (0.0)); - - e->add_offset_callback (callback, Y_AXIS); -} - bool Staff_symbol_referencer::has_interface (Score_element*e) { @@ -31,7 +19,6 @@ Staff_symbol_referencer::has_interface (Score_element*e) || gh_number_p (e->get_elt_property ("staff-position")); } - int Staff_symbol_referencer::line_count (Score_element*me) { @@ -100,28 +87,30 @@ Staff_symbol_referencer::position_f (Score_element*me) /* should use offset callback! */ -Real -Staff_symbol_referencer::callback (Score_element * sc,Axis ) +MAKE_SCHEME_CALLBACK(Staff_symbol_referencer,callback,2); +SCM +Staff_symbol_referencer::callback (SCM element_smob, SCM axis) { - Score_element* me = (Score_element*)sc; // UGH. + Score_element *me = unsmob_element (element_smob); + Axis a = (Axis) gh_scm2int (axis); - SCM pos = sc->get_elt_property ("staff-position"); + SCM pos = me->get_elt_property ("staff-position"); Real off =0.0; if (gh_number_p (pos)) { - Real space = Staff_symbol_referencer::staff_space (sc); + Real space = Staff_symbol_referencer::staff_space (me); off = gh_scm2double (pos) * space/2.0; } me->set_elt_property ("staff-position", gh_double2scm (0.0)); - return off; + return gh_double2scm (off); } -/* + /* This sets the position relative to the center of the staff symbol. - + The function is hairy, because it can be callled in two situations: 1. There is no staff yet; we must set staff-position @@ -149,10 +138,10 @@ Staff_symbol_referencer::set_position (Score_element*me,Real p) } - if (me->has_offset_callback_b (callback, Y_AXIS)) + if (me->has_offset_callback_b (Staff_symbol_referencer_callback_proc, Y_AXIS)) return ; - me->add_offset_callback (callback, Y_AXIS); + me->add_offset_callback (Staff_symbol_referencer_callback_proc, Y_AXIS); } /* @@ -171,3 +160,13 @@ compare_position (Score_element *const &a, Score_element * const &b) return sign (Staff_symbol_referencer::position_f((Score_element*)a) - Staff_symbol_referencer::position_f((Score_element*)b)); } + + +void +Staff_symbol_referencer::set_interface (Score_element * e) +{ + if (!gh_number_p (e->get_elt_property ("staff-position"))) + e->set_elt_property ("staff-position", gh_double2scm (0.0)); + + e->add_offset_callback (Staff_symbol_referencer_callback_proc, Y_AXIS); +} diff --git a/lily/staff-symbol.cc b/lily/staff-symbol.cc index ffdd54e56d..00aafa5ada 100644 --- a/lily/staff-symbol.cc +++ b/lily/staff-symbol.cc @@ -16,7 +16,7 @@ #include "spanner.hh" -MAKE_SCHEME_CALLBACK(Staff_symbol,brew_molecule); +MAKE_SCHEME_CALLBACK(Staff_symbol,brew_molecule,1); SCM Staff_symbol::brew_molecule (SCM smob) diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index 11e2441645..0b3ad55f6c 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -44,7 +44,7 @@ Stem_tremolo::dim_callback (Score_element * se, Axis ) -MAKE_SCHEME_CALLBACK(Stem_tremolo,brew_molecule); +MAKE_SCHEME_CALLBACK(Stem_tremolo,brew_molecule,1); SCM Stem_tremolo::brew_molecule (SCM smob) { diff --git a/lily/stem.cc b/lily/stem.cc index 56c896838c..9671635e05 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -363,7 +363,7 @@ Stem::position_noteheads (Score_element*me) } } -MAKE_SCHEME_CALLBACK(Stem,before_line_breaking); +MAKE_SCHEME_CALLBACK(Stem,before_line_breaking,1); SCM Stem::before_line_breaking (SCM smob) { @@ -446,7 +446,7 @@ Stem::dim_callback (Score_element *se, Axis ) const Real ANGLE = 20* (2.0*M_PI/360.0); // ugh! Should be settable. -MAKE_SCHEME_CALLBACK(Stem,brew_molecule); +MAKE_SCHEME_CALLBACK(Stem,brew_molecule,1); SCM Stem::brew_molecule (SCM smob) @@ -486,22 +486,25 @@ Stem::brew_molecule (SCM smob) return mol.create_scheme(); } -Real -Stem::off_callback (Score_element * me, Axis) +MAKE_SCHEME_CALLBACK(Stem,off_callback,2); +SCM +Stem::off_callback (SCM element_smob, SCM axis) { + Score_element *me = unsmob_element (element_smob); + Axis a = (Axis) gh_scm2int (axis); Real r=0; if (Score_element * f = first_head (me)) { Interval head_wid(0, f->extent (X_AXIS).length ()); if (to_boolean (me->get_elt_property ("stem-centered"))) - return head_wid.center (); + return gh_double2scm ( head_wid.center ()); Real rule_thick = gh_scm2double (me->get_elt_property ("thickness")) * me->paper_l ()->get_var ("stafflinethickness"); Direction d = get_direction (me); r = head_wid[d] - d * rule_thick ; } - return r; + return gh_double2scm (r); } @@ -638,6 +641,6 @@ void Stem::set_interface (Score_element*me) { me->set_elt_property ("heads", SCM_EOL); - me->add_offset_callback ( &Stem::off_callback, X_AXIS); + me->add_offset_callback ( Stem_off_callback_proc, X_AXIS); me->set_interface (ly_symbol2scm ("stem-interface")); } diff --git a/lily/sustain-pedal.cc b/lily/sustain-pedal.cc index f3efc6e76b..ca8463c515 100644 --- a/lily/sustain-pedal.cc +++ b/lily/sustain-pedal.cc @@ -34,7 +34,7 @@ public: }; -MAKE_SCHEME_CALLBACK(Sustain_pedal,brew_molecule); +MAKE_SCHEME_CALLBACK(Sustain_pedal,brew_molecule,1); SCM Sustain_pedal::brew_molecule (SCM smob) diff --git a/lily/syllable-group.cc b/lily/syllable-group.cc index a0cf73d270..3fe3db27b0 100644 --- a/lily/syllable-group.cc +++ b/lily/syllable-group.cc @@ -120,7 +120,7 @@ Syllable_group::set_lyric_align(const char *punc, Score_element *default_notehea // centre on notehead ... if we have one. if(notehead_l_) { lyric->set_parent(notehead_l_, X_AXIS); - lyric->add_offset_callback (Side_position::centered_on_parent, X_AXIS); + lyric->add_offset_callback (Side_position_centered_on_parent_proc, X_AXIS); // reference is on the right of the notehead; move it left half way, and add translation lyric->translate_axis (group_translation_f_-(notehead_l_->extent(X_AXIS)).center(), X_AXIS); } diff --git a/lily/system-start-delimiter.cc b/lily/system-start-delimiter.cc index 95ae1c7a6f..e97c392407 100644 --- a/lily/system-start-delimiter.cc +++ b/lily/system-start-delimiter.cc @@ -63,7 +63,7 @@ System_start_delimiter::simple_bar (Score_element*me,Real h) return me->lookup_l ()->filledbox (Box (Interval(0,w), Interval(-h/2, h/2))); } -MAKE_SCHEME_CALLBACK(System_start_delimiter,after_line_breaking); +MAKE_SCHEME_CALLBACK(System_start_delimiter,after_line_breaking,1); SCM System_start_delimiter::after_line_breaking (SCM smob) @@ -85,7 +85,7 @@ System_start_delimiter::try_collapse (Score_element*me) } -MAKE_SCHEME_CALLBACK(System_start_delimiter,brew_molecule); +MAKE_SCHEME_CALLBACK(System_start_delimiter,brew_molecule,1); SCM System_start_delimiter::brew_molecule (SCM smob) diff --git a/lily/text-engraver.cc b/lily/text-engraver.cc index 508ac78268..a2c8d48e05 100644 --- a/lily/text-engraver.cc +++ b/lily/text-engraver.cc @@ -104,8 +104,8 @@ Text_engraver::do_process_music () /* nicely center the scripts. */ - text->add_offset_callback (Side_position::aligned_on_self, X_AXIS); - text->add_offset_callback (Side_position::centered_on_parent, X_AXIS); + text->add_offset_callback (Side_position_aligned_on_self_proc, X_AXIS); + text->add_offset_callback (Side_position_centered_on_parent_proc, X_AXIS); } diff --git a/lily/text-item.cc b/lily/text-item.cc index 4a576ac7c2..35e0c5d724 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -19,7 +19,7 @@ struct Text_item }; -MAKE_SCHEME_CALLBACK(Text_item,brew_molecule) +MAKE_SCHEME_CALLBACK(Text_item,brew_molecule,1); SCM Text_item::brew_molecule (SCM sm) diff --git a/lily/tie-column.cc b/lily/tie-column.cc index 257885be9e..13951511d9 100644 --- a/lily/tie-column.cc +++ b/lily/tie-column.cc @@ -104,7 +104,7 @@ Tie_column::set_directions (Score_element*me) } -MAKE_SCHEME_CALLBACK(Tie_column,after_line_breaking); +MAKE_SCHEME_CALLBACK(Tie_column,after_line_breaking,1); SCM Tie_column::after_line_breaking (SCM smob) { diff --git a/lily/tie.cc b/lily/tie.cc index 645f04b9b2..f395296288 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -253,7 +253,7 @@ Tie::get_control_points (SCM smob) return controls; } -MAKE_SCHEME_CALLBACK(Tie,set_spacing_rods); +MAKE_SCHEME_CALLBACK(Tie,set_spacing_rods,1); /* TODO: set minimum distances for begin/end of line @@ -275,7 +275,7 @@ Tie::set_spacing_rods (SCM smob) return SCM_UNSPECIFIED; } -MAKE_SCHEME_CALLBACK(Tie,brew_molecule); +MAKE_SCHEME_CALLBACK(Tie,brew_molecule,1); SCM Tie::brew_molecule (SCM smob) { diff --git a/lily/time-signature.cc b/lily/time-signature.cc index 5cc5118cdb..2912f3b37a 100644 --- a/lily/time-signature.cc +++ b/lily/time-signature.cc @@ -13,7 +13,7 @@ #include "paper-def.hh" #include "lookup.hh" -MAKE_SCHEME_CALLBACK(Time_signature,brew_molecule); +MAKE_SCHEME_CALLBACK(Time_signature,brew_molecule,1); SCM Time_signature::brew_molecule (SCM smob) diff --git a/lily/tuplet-spanner.cc b/lily/tuplet-spanner.cc index 34ed2efd0a..9a2e596b7c 100644 --- a/lily/tuplet-spanner.cc +++ b/lily/tuplet-spanner.cc @@ -32,7 +32,7 @@ Tuplet_spanner::set_interface (Score_element*me) TODO. */ -MAKE_SCHEME_CALLBACK(Tuplet_spanner,brew_molecule); +MAKE_SCHEME_CALLBACK(Tuplet_spanner,brew_molecule,1); SCM Tuplet_spanner::brew_molecule (SCM smob) @@ -187,7 +187,7 @@ Tuplet_spanner::calc_dy (Score_element*me,Real * dy) *dy = column_arr.top ()->extent (Y_AXIS) [d] - column_arr[0]->extent (Y_AXIS) [d]; } -MAKE_SCHEME_CALLBACK(Tuplet_spanner,after_line_breaking); +MAKE_SCHEME_CALLBACK(Tuplet_spanner,after_line_breaking,1); SCM Tuplet_spanner::after_line_breaking (SCM smob) diff --git a/lily/unfolded-repeat-iterator.cc b/lily/unfolded-repeat-iterator.cc index f9ac9ea0c4..47eabef881 100644 --- a/lily/unfolded-repeat-iterator.cc +++ b/lily/unfolded-repeat-iterator.cc @@ -178,6 +178,9 @@ Unfolded_repeat_iterator::construct_children () } } +/* + TODO: add source information for debugging + */ void Unfolded_repeat_iterator::add_repeat_command (SCM what) { diff --git a/lily/volta-engraver.cc b/lily/volta-engraver.cc index ed97955f7c..84218a5ce2 100644 --- a/lily/volta-engraver.cc +++ b/lily/volta-engraver.cc @@ -72,7 +72,11 @@ Volta_engraver::do_process_music () bool early_stop = volta_span_p_ && unsmob_moment (l) &&*unsmob_moment (l) <= now - started_mom_; - if (end || early_stop) + if (end && !volta_span_p_) + { + warning (_("No volta spanner to end")); // fixme: be more verbose. + } + else if (end || early_stop) { end_volta_span_p_ = volta_span_p_; volta_span_p_ =0; diff --git a/lily/volta-spanner.cc b/lily/volta-spanner.cc index 34a4016c28..7467464a63 100644 --- a/lily/volta-spanner.cc +++ b/lily/volta-spanner.cc @@ -38,7 +38,7 @@ Volta_spanner::set_interface (Score_element*me) */ -MAKE_SCHEME_CALLBACK(Volta_spanner,brew_molecule); +MAKE_SCHEME_CALLBACK(Volta_spanner,brew_molecule,1); SCM Volta_spanner::brew_molecule (SCM smob) { diff --git a/ly/engraver.ly b/ly/engraver.ly index 670d44787f..785e6223af 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -30,15 +30,10 @@ StaffContext=\translator { \consists "Rest_collision_engraver"; \consists "Local_key_engraver"; - startSustain = #"Ped." - stopSustain = #"*" - stopStartSustain = #"*Ped." - startUnaChorda = #"una chorda" - stopUnaChorda = #"tre chorde" - % should make separate lists for stopsustain and startsustain - \consists "Piano_pedal_engraver"; +% \consists "Arpeggio_engraver"; + \consistsend "Axis_group_engraver"; %{ @@ -115,7 +110,6 @@ VoiceContext = \translator { \consists "Stem_engraver"; \consists "Beam_engraver"; \consists "Auto_beam_engraver"; - \include "auto-beam-settings.ly"; \consists "Chord_tremolo_engraver"; \consists "Melisma_engraver"; @@ -149,7 +143,6 @@ GraceContext=\translator { \consists "Slur_engraver"; \consists "Auto_beam_engraver"; - \include "auto-beam-settings.ly"; \consists "Align_note_column_engraver"; \consists "Rhythmic_column_engraver"; @@ -198,6 +191,7 @@ GrandStaffContext=\translator{ \type "Engraver_group_engraver"; \name GrandStaff; \consists "Span_bar_engraver"; + \consists "Span_arpeggio_engraver"; \consists "System_start_delimiter_engraver"; systemStartDelimiterGlyph = #'brace @@ -219,11 +213,13 @@ PianoStaffContext = \translator{\GrandStaffContext StaffGroupContext= \translator { \type "Engraver_group_engraver"; + \name StaffGroup; + \consists "Span_bar_engraver"; + \consists "Span_arpeggio_engraver"; \consists "Output_property_engraver"; + systemStartDelimiterGlyph = #'bracket \consists "System_start_delimiter_engraver"; - systemStartDelimiterGlyph = #'bracket - \name StaffGroup; \accepts "Staff"; \accepts "RhythmicStaff"; \accepts "GrandStaff"; @@ -344,6 +340,7 @@ ScoreContext = \translator { \consists "Lyric_phrasing_engraver"; \consists "Bar_number_engraver"; + \consists "Span_arpeggio_engraver"; \accepts "Staff"; @@ -401,6 +398,15 @@ ScoreContext = \translator { explicitKeySignatureVisibility = #all-visible scriptDefinitions = #default-script-alist + + startSustain = #"Ped." + stopSustain = #"*" + stopStartSustain = #"*Ped." + startUnaChorda = #"una chorda" + stopUnaChorda = #"tre chorde" + % should make separate lists for stopsustain and startsustain + + % % what order to print accs. We could compute this, % but computing is more work than putting it here. @@ -431,6 +437,11 @@ ScoreContext = \translator { % distances are given in stafflinethickness (thicknesses) and % staffspace (distances) % + basicArpeggioProperties = #`( + (interfaces . (arpeggio-interface)) + (molecule-callback . ,Arpeggio::brew_molecule) + (name . "arpeggio") + ) basicBarProperties = #`( (interfaces . (bar-interface staff-bar-interface)) (break-align-symbol . Staff_bar) @@ -652,7 +663,7 @@ ScoreContext = \translator { ) basicOctavateEightProperties = #`( (self-alignment-X . 0) - (text . "8") += (text . "8") (visibility-lambda . ,begin-of-line-visible) (molecule-callback . ,Text_item::brew_molecule) (style . "italic") @@ -696,6 +707,11 @@ ScoreContext = \translator { (maximum-duration-for-spacing . ,(make-moment 1 8)) (name . "spacing spanner") ) + basicSpanArpeggioProperties = #`( + (interfaces . (span-arpeggio-interface)) + (molecule-callback . ,Span_arpeggio::brew_molecule) + (name . "span arpeggio") + ) basicSpanBarProperties = #`( (interfaces . (bar-interface span-bar-interface)) (break-align-symbol . Staff_bar) @@ -859,6 +875,10 @@ ScoreContext = \translator { (interfaces . (axis-group-interface)) (name . "Y-axis group") ) + + + \include "auto-beam-settings.ly"; + } OrchestralScoreContext= \translator { diff --git a/ly/script.ly b/ly/script.ly index d6c35d9c55..2ebe362fc5 100644 --- a/ly/script.ly +++ b/ly/script.ly @@ -2,6 +2,8 @@ #(eval-string (ly-gulp-file "script.scm")) +#default-script-alist + "dash-hat" = "marcato" "dash-plus" = "stopped" "dash-dash" = "tenuto" diff --git a/scm/script.scm b/scm/script.scm index 47d61ab91c..bf47558dc2 100644 --- a/scm/script.scm +++ b/scm/script.scm @@ -91,3 +91,4 @@ default-script-alist) ) + diff --git a/stepmake/bin/make-version.py b/stepmake/bin/make-version.py index 4912f0a2a7..9f4a3f46a3 100644 --- a/stepmake/bin/make-version.py +++ b/stepmake/bin/make-version.py @@ -24,4 +24,6 @@ for d in defs: if ('MY_PATCH_LEVEL', '') in defs: sys.stdout.write ('#define NO_MY_PATCHLEVEL') + +sys.stdout.write('\n'); diff --git a/stepmake/stepmake/generic-targets.make b/stepmake/stepmake/generic-targets.make index 5552912e20..f9ee8b35df 100644 --- a/stepmake/stepmake/generic-targets.make +++ b/stepmake/stepmake/generic-targets.make @@ -108,8 +108,8 @@ html: $(HTML_FILES) TAGS: -if [ "$(TAGS_FILES)" != "" ]; then \ - etags -CT $(TAGS_FILES) || \ - ctags -h ".h.hh.tcc.icc" $(TAGS_FILES) $(ERROR_LOG); \ + etags $(ETAGS_FLAGS) $(TAGS_FILES) || \ + ctags $(CTAGS_FLAGS) ".h.hh.tcc.icc" $(TAGS_FILES) $(ERROR_LOG); \ fi $(LOOP) diff --git a/stepmake/stepmake/generic-vars.make b/stepmake/stepmake/generic-vars.make index ebcbe573aa..f165a99e93 100644 --- a/stepmake/stepmake/generic-vars.make +++ b/stepmake/stepmake/generic-vars.make @@ -136,5 +136,8 @@ endif DO_STRIP=true LOOP=$(foreach i, $(SUBDIRS), $(MAKE) PACKAGE=$(PACKAGE) -C $(i) $@ &&) true +ETAGS_FLAGS=-CT +CTAGS_FLAGS=-h include $(stepdir)/files.make + -- 2.39.5