From da2c2eca986fbff9d6e74b58bb1be43baac29119 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2002 23:21:52 +0000 Subject: [PATCH] lilypond-1.3.51 --- flower/polynomial.cc | 2 + input/test/keys.ly | 4 +- lily/bezier.cc | 3 +- lily/box.cc | 56 +++++++++++ lily/clef-engraver.cc | 19 ++-- lily/collision-engraver.cc | 3 + lily/collision.cc | 12 ++- lily/dots.cc | 1 + lily/gourlay-breaking.cc | 4 +- lily/include/bow.hh | 29 ------ lily/include/breathing-sign.hh | 4 + lily/include/clef-item.hh | 2 +- lily/include/collision.hh | 18 +++- lily/include/dots.hh | 9 +- .../hara-kiri-vertical-group-spanner.hh | 9 +- lily/include/item.hh | 5 +- lily/include/key-item.hh | 18 ++-- lily/include/local-key-item.hh | 8 +- lily/include/note-head.hh | 4 + lily/include/rest.hh | 7 ++ lily/include/rhythmic-head.hh | 8 ++ lily/include/single-malt-grouping-item.hh | 10 +- lily/item.cc | 98 +++++++------------ lily/key-item.cc | 98 +++++++++++-------- lily/line-of-score.cc | 2 + lily/multi-measure-rest.cc | 4 +- lily/score-element.cc | 35 +++---- lily/separating-group-spanner.cc | 4 +- lily/single-malt-grouping-item.cc | 2 - lily/spacing-spanner.cc | 4 +- lily/spanner.cc | 6 +- ly/params.ly | 6 ++ scm/lily.scm | 1 + 33 files changed, 290 insertions(+), 205 deletions(-) create mode 100644 lily/box.cc diff --git a/flower/polynomial.cc b/flower/polynomial.cc index 4e7fd944c7..50749f1fe4 100644 --- a/flower/polynomial.cc +++ b/flower/polynomial.cc @@ -276,7 +276,9 @@ Polynomial::solve_cubic()const { sol[i] -= sub; +#ifdef PARANOID assert (fabs (eval (sol[i]) ) < 1e-8); +#endif } return sol; diff --git a/input/test/keys.ly b/input/test/keys.ly index 99bf45142d..0d49507e5f 100644 --- a/input/test/keys.ly +++ b/input/test/keys.ly @@ -4,9 +4,9 @@ test key itemv breaking %} \score { - \notes + \notes \relative c'' { - \key bes; c1 \key c \minor; c1 + \key bes; c2 \key c \minor; c2 \break \key bes \major; c1 \key d;\break c1 } diff --git a/lily/bezier.cc b/lily/bezier.cc index 72bd0e0f46..e7f02063f6 100644 --- a/lily/bezier.cc +++ b/lily/bezier.cc @@ -87,9 +87,10 @@ Bezier::curve_point (Real t)const one_min_tj /= (1-t); } +#ifdef PARANOID assert (fabs (o[X_AXIS] - polynomial (X_AXIS).eval (t))< 1e-8); assert (fabs (o[Y_AXIS] - polynomial (Y_AXIS).eval (t))< 1e-8); - +#endif return o; } diff --git a/lily/box.cc b/lily/box.cc new file mode 100644 index 0000000000..722e08278c --- /dev/null +++ b/lily/box.cc @@ -0,0 +1,56 @@ +/* + box.cc -- implement Box + + source file of the GNU LilyPond music typesetter + + (c) 1996--2000 Han-Wen Nienhuys +*/ + +#include "box.hh" +#include "array.hh" + +void +Box::translate (Offset o) +{ + for (Axis i=X_AXIS; i < NO_AXES; incr(i)) + interval_a_[i] += o[i]; +} + +void +Box::unite (Box b) +{ + for (Axis i=X_AXIS; i < NO_AXES; incr(i)) + interval_a_[i].unite (b[i]); +} + +/** + Initialize to empty. + */ +Box::Box() +{ +} + +void +Box::set_empty () +{ + interval_a_[X_AXIS].set_empty (); + interval_a_[Y_AXIS].set_empty (); +} + +Box::Box (Interval ix, Interval iy) +{ + x() = ix; + y() = iy; +} + +Interval & +Box::operator[] (Axis a) +{ + return interval_a_[a]; +} + +Interval +Box::operator[] (Axis a)const +{ + return interval_a_[a]; +} diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index de2cb687c7..7fff19244c 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -217,21 +217,20 @@ Clef_engraver::do_pre_move_processing() { if (clef_p_) { + SCM vis; if(to_boolean (clef_p_->remove_elt_property("non-default"))) { - SCM all = scm_eval (ly_symbol2scm ("all-visible")); - clef_p_->set_elt_property("visibility-lambda", all); - if (octavate_p_) - octavate_p_->set_elt_property("visibility-lambda", all); + vis = ly_symbol2scm ("all-visible"); } else - { - SCM beg = scm_eval (ly_symbol2scm ("begin-of-line-visible")); + vis = ly_symbol2scm ("begin-of-line-visible"); + + vis = scm_eval (vis); + + clef_p_->set_elt_property("visibility-lambda", vis); + if (octavate_p_) + octavate_p_->set_elt_property("visibility-lambda", vis); - clef_p_->set_elt_property ("visibility-lambda", beg); - if (octavate_p_) - octavate_p_->set_elt_property ("visibility-lambda", beg); - } typeset_element (clef_p_); clef_p_ =0; diff --git a/lily/collision-engraver.cc b/lily/collision-engraver.cc index eebb06122b..c31121dae4 100644 --- a/lily/collision-engraver.cc +++ b/lily/collision-engraver.cc @@ -11,6 +11,9 @@ #include "dimension-cache.hh" #include "engraver.hh" +/* + collect Note_column, and as soon as there are 2 or more, put them in + a collision object. */ class Collision_engraver : public Engraver { Collision* col_p_; Link_array note_column_l_arr_; diff --git a/lily/collision.cc b/lily/collision.cc index 32ee0d69f6..e3eb69a403 100644 --- a/lily/collision.cc +++ b/lily/collision.cc @@ -28,6 +28,15 @@ Collision::add_column (Note_column* ncol_l) void Collision::before_line_breaking () +{ + do_shifts(); +} + +/* + TODO: make callback of this. + */ +void +Collision::do_shifts() { SCM autos (automatic_shift ()); SCM hand (forced_shift ()); @@ -55,8 +64,7 @@ Collision::before_line_breaking () /** This complicated routine moves note columns around horizontally to ensure that notes don't clash. - This should be done better, probably. - + This should be put into Scheme. */ SCM Collision::automatic_shift () diff --git a/lily/dots.cc b/lily/dots.cc index 5fa59bdd50..6f098e6110 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -39,6 +39,7 @@ Dots::after_line_breaking () si.set_position (p + directional_element (this).get ()); } } + Molecule Dots::do_brew_molecule () const { diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index 0425c8a118..696a0d88a6 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -83,8 +83,8 @@ Gourlay_breaking::do_solve () const { Link_array line = all.slice (breaks[start_idx], breaks[break_idx]+1); - line[0] = dynamic_cast(line[0]->find_broken_piece (RIGHT)); - line.top () = dynamic_cast(line.top ()->find_broken_piece (LEFT)); + line[0] = dynamic_cast (line[0] ->find_prebroken_piece (RIGHT)); + line.top () = dynamic_cast (line.top ()->find_prebroken_piece (LEFT)); Column_x_positions cp; cp.cols_ = line; diff --git a/lily/include/bow.hh b/lily/include/bow.hh index 40770af5df..8b13789179 100644 --- a/lily/include/bow.hh +++ b/lily/include/bow.hh @@ -1,30 +1 @@ -/* - bow.hh -- declare Bow - source file of the GNU LilyPond music typesetter - - (c) 1997--2000 Han-Wen Nienhuys -*/ - - -#ifndef BOW_HH -#define BOW_HH - -#include "spanner.hh" - -/** - Base class for anything that looks like a slur. - Anybody with a better name? - - UGH. Fixme. Should junk - - dy_f_drul_ , dx_f_drul_ - - */ -class Bow : public Spanner -{ -protected: -}; -#error - -#endif // BOW_HH diff --git a/lily/include/breathing-sign.hh b/lily/include/breathing-sign.hh index ca074df3fa..e0cda68c19 100644 --- a/lily/include/breathing-sign.hh +++ b/lily/include/breathing-sign.hh @@ -13,6 +13,10 @@ #include "item.hh" #include "parray.hh" +/* + breathing sign (apostrophe within staff, not the comma above staff + type) +*/ class Breathing_sign : public Item { public: diff --git a/lily/include/clef-item.hh b/lily/include/clef-item.hh index 758e42a8a6..111e416393 100644 --- a/lily/include/clef-item.hh +++ b/lily/include/clef-item.hh @@ -16,7 +16,7 @@ properties: - nondefault -- not set because of existence of a bar? + non-default -- not set because of existence of a bar? change -- is this a change clef (smaller size)? diff --git a/lily/include/collision.hh b/lily/include/collision.hh index 7a7b5379f2..4cb7b615ec 100644 --- a/lily/include/collision.hh +++ b/lily/include/collision.hh @@ -18,15 +18,29 @@ TODO - multistaff support (see Chlapik: equal noteheads should be on the + * multistaff support (see Chlapik: equal noteheads should be on the same hpos.) + + * Make interface of this, similar to align-interface. + + Properties: + + elements -- (see Axis_group_interface) + + merge-differently-dotted -- merge black noteheads with differing dot count. + + horizontal-shift -- integer that identifies ranking of note-column for horizontal shifting. + + force-hshift -- amount of collision_note_width that overides automatic collision settings. + Read and removed from elements. + */ class Collision : public Item { protected: SCM automatic_shift (); SCM forced_shift (); - + void do_shifts (); virtual void before_line_breaking (); public: diff --git a/lily/include/dots.hh b/lily/include/dots.hh index 4f3ba7200b..2446e1f906 100644 --- a/lily/include/dots.hh +++ b/lily/include/dots.hh @@ -16,9 +16,14 @@ /** The dots to go with a notehead/rest. A separate class, since they are a party in collision resolution. + + properties: + + dot-count -- number of dots. + + */ -class Dots : - public Item +class Dots : public Item { protected: virtual Molecule do_brew_molecule () const; diff --git a/lily/include/hara-kiri-vertical-group-spanner.hh b/lily/include/hara-kiri-vertical-group-spanner.hh index aeb77bf9b8..389223cf34 100644 --- a/lily/include/hara-kiri-vertical-group-spanner.hh +++ b/lily/include/hara-kiri-vertical-group-spanner.hh @@ -16,7 +16,14 @@ As Vertical_group_spanner, but keep track of interesting items. If we don't contain any interesting items after linebreaking, then gracefully commit suicide. Objective: don't disgrace Lily by - typesetting empty lines in orchestral scores. */ + typesetting empty lines in orchestral scores. + + properties: + + items-worth-living -- list of interesting items. If empty in a particular system, + clear this line + +*/ class Hara_kiri_group_spanner : public Spanner { public: diff --git a/lily/include/item.hh b/lily/include/item.hh index 0f2c951ca4..d92a67fb04 100644 --- a/lily/include/item.hh +++ b/lily/include/item.hh @@ -38,8 +38,6 @@ class Item : public Score_element { Drul_array broken_to_drul_; - void do_break (); - void try_visibility_lambda (); public: VIRTUAL_COPY_CONS(Score_element); Item(); @@ -50,11 +48,12 @@ public: Direction break_status_dir () const; - Item * find_broken_piece (Direction) const; + Item * find_prebroken_piece (Direction) const; Score_element * find_broken_piece (Line_of_score*) const; virtual Line_of_score * line_l() const; virtual Paper_column * column_l () const; + virtual void handle_prebroken_dependencies (); protected: virtual void do_breakable_col_processing(); void copy_breakable_items(); diff --git a/lily/include/key-item.hh b/lily/include/key-item.hh index d8a7f295a0..c003a3094d 100644 --- a/lily/include/key-item.hh +++ b/lily/include/key-item.hh @@ -11,16 +11,20 @@ #include "array.hh" -/** An item which places accidentals at the start of the line +/** + A group of accidentals. - TODO: Schemify me. + Properties: + + c0-position -- integer indicating the position of central C? + + old-accidentals -- list of (pitch, accidental) pairs + + new-accidentals -- list of (pitch, accidental) pairs */ class Key_item :public Item { - Array pitch_arr_; - Array acc_arr_; - Array old_pitch_arr_; - Array old_acc_arr_; + int calculate_position(SCM pair) const; public: VIRTUAL_COPY_CONS(Score_element); @@ -28,8 +32,6 @@ public: void add (int pitch, int acc); void add_old (int pitch, int acc); - int calculate_position(int p, int a) const; - protected: virtual Molecule do_brew_molecule() const; }; diff --git a/lily/include/local-key-item.hh b/lily/include/local-key-item.hh index 3cfb339ce1..39ad2ccac2 100644 --- a/lily/include/local-key-item.hh +++ b/lily/include/local-key-item.hh @@ -32,14 +32,8 @@ struct Local_key_cautionary_tuple /** Accidentals which can be different for each octave. - - TODO - - Make an item for each accidental separately, and make a - Accidental_column to group them. - + TODO: schemify me! */ - class Local_key_item : public Item { Array accidental_arr_; diff --git a/lily/include/note-head.hh b/lily/include/note-head.hh index dcdeca9ca4..3354ecfb24 100644 --- a/lily/include/note-head.hh +++ b/lily/include/note-head.hh @@ -13,6 +13,10 @@ * help lines + Properties + + style -- symbol that sets note head style + */ class Note_head : public Rhythmic_head diff --git a/lily/include/rest.hh b/lily/include/rest.hh index 21ab46ae03..dcd6b81628 100644 --- a/lily/include/rest.hh +++ b/lily/include/rest.hh @@ -12,6 +12,13 @@ #include "rhythmic-head.hh" +/** + A pause. + + Properties + + style -- string specifying glyph style + */ class Rest : public Rhythmic_head { protected: diff --git a/lily/include/rhythmic-head.hh b/lily/include/rhythmic-head.hh index 4733d5f155..5d3ca3d56c 100644 --- a/lily/include/rhythmic-head.hh +++ b/lily/include/rhythmic-head.hh @@ -12,6 +12,14 @@ #include "item.hh" +/* + Properties + + duration-log -- 2-log of the notehead duration + + dot -- reference to Dots object. + +*/ class Rhythmic_head : public Item { public: diff --git a/lily/include/single-malt-grouping-item.hh b/lily/include/single-malt-grouping-item.hh index 78c325dcf7..17280a2b82 100644 --- a/lily/include/single-malt-grouping-item.hh +++ b/lily/include/single-malt-grouping-item.hh @@ -17,6 +17,15 @@ since these usually are in a different X_group It's 1:30 am. Naming suggestions appreciated. + + Properties: + + + elements -- list of items. + + no-spacing-rods -- read from elements: boolean that makes Single_malt_grouping_item ignore + this item + */ class Single_malt_grouping_item : public Item { @@ -27,6 +36,5 @@ public: void add_item (Item*); }; - #endif /* SINGLE_MALT_GROUPING_ITEM_HH */ diff --git a/lily/item.cc b/lily/item.cc index 1f7950658c..8547dd9f1a 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -22,7 +22,7 @@ Item::Item () /** Item copy ctor. Copy nothing: everything should be a elt property - or a special purpose poitner (such as broken_to_drul_[]) */ + or a special purpose pointer (such as broken_to_drul_[]) */ Item::Item (Item const &s) : Score_element (s) { @@ -38,7 +38,7 @@ Item::breakable_b () const return false; Item * i =dynamic_cast (parent_l (X_AXIS)); - return (i) ? i->breakable_b () : to_boolean (get_elt_property( "breakable")); + return (i) ? i->breakable_b () : to_boolean (get_elt_property ("breakable")); } Line_of_score * @@ -63,35 +63,8 @@ Item::copy_breakable_items() } while (flip(&i) != LEFT); broken_to_drul_= new_copies; - - do - { - broken_to_drul_[i]->handle_prebroken_dependencies(); - broken_to_drul_[i]->try_visibility_lambda(); - } - while (flip(&i) != LEFT); } -void -Item::try_visibility_lambda () -{ - SCM vis = remove_elt_property ("visibility-lambda"); - if (gh_procedure_p (vis)) - { - SCM args = scm_listify (gh_int2scm (break_status_dir ()), SCM_UNDEFINED); - SCM result = gh_apply (vis, args); - bool trans = gh_scm2bool (gh_car (result)); - bool empty = gh_scm2bool (gh_cdr (result)); - - if (empty) - { - set_extent_callback (0, X_AXIS); - set_extent_callback (0, Y_AXIS); - } - if (trans) - set_elt_property ("transparent", SCM_BOOL_T); - } -} bool Item::broken_b () const @@ -100,33 +73,13 @@ Item::broken_b () const } void -Item::do_break () +Item::do_breakable_col_processing() { if (broken_b ()) return; if (breakable_b ()) - { - copy_breakable_items(); - handle_prebroken_dependencies(); - - /* - Otherwise the broken items won't be pre_process()'ed. - */ - - if (broken_to_drul_[LEFT]) - { - add_dependency (broken_to_drul_[LEFT]); - add_dependency (broken_to_drul_[RIGHT]); - } - } - try_visibility_lambda (); // ugh. -} - -void -Item::do_breakable_col_processing() -{ - do_break (); + copy_breakable_items(); } Score_element* @@ -137,7 +90,7 @@ Item::find_broken_piece (Line_of_score*l) const Direction d = LEFT; do { - Score_element *s = find_broken_piece (d); + Score_element *s = broken_to_drul_[d]; if (s && s->line_l () == l) return s; } @@ -146,19 +99,14 @@ Item::find_broken_piece (Line_of_score*l) const return 0; } + Item* -Item::find_broken_piece (Direction d) const +Item::find_prebroken_piece (Direction d) const { Item * me = (Item *) (this); if (!d) return me; - else if (breakable_b ()) - { - me->do_break (); - return dynamic_cast (broken_to_drul_[d]); - } - else - return 0; + return dynamic_cast (broken_to_drul_[d]); } Paper_column * @@ -180,4 +128,34 @@ Item::break_status_dir () const return CENTER; } +void +Item::handle_prebroken_dependencies () +{ + if (original_l_) + { + element_property_alist_ + = handle_broken_smobs (original_l_->element_property_alist_, + gh_int2scm (break_status_dir ())); + } + + /* + Can't do this earlier, because try_visibility_lambda () might set + the elt property transparent, which would then be copied. + */ + SCM vis = remove_elt_property ("visibility-lambda"); + if (gh_procedure_p (vis)) + { + SCM args = scm_listify (gh_int2scm (break_status_dir ()), SCM_UNDEFINED); + SCM result = gh_apply (vis, args); + bool trans = gh_scm2bool (gh_car (result)); + bool empty = gh_scm2bool (gh_cdr (result)); + if (empty) + { + set_extent_callback (0, X_AXIS); + set_extent_callback (0, Y_AXIS); + } + if (trans) + set_elt_property ("transparent", SCM_BOOL_T); + } +} diff --git a/lily/key-item.cc b/lily/key-item.cc index e6b8df7b44..72380e7311 100644 --- a/lily/key-item.cc +++ b/lily/key-item.cc @@ -8,13 +8,11 @@ keyplacement by Mats Bengtsson */ +#include "group-interface.hh" #include "key-item.hh" -#include "key.hh" -#include "debug.hh" #include "molecule.hh" #include "paper-def.hh" #include "lookup.hh" -#include "musical-pitch.hh" #include "staff-symbol-referencer.hh" const int FLAT_TOP_PITCH=2; /* fes,ges,as and bes typeset in lower octave */ @@ -24,26 +22,32 @@ Key_item::Key_item () { set_elt_property ("breakable", SCM_BOOL_T); set_elt_property ("c0-position", gh_int2scm (0)); + + set_elt_property ("old-accidentals", SCM_EOL); + set_elt_property ("new-accidentals", SCM_EOL); } void Key_item::add (int p, int a) { - pitch_arr_.push (p); - acc_arr_.push (a); + SCM pair = gh_cons (gh_int2scm (p),gh_int2scm (a)); + Group_interface (this, "new-accidentals").add_thing (pair); } void Key_item::add_old (int p, int a) { - old_pitch_arr_.push (p); - old_acc_arr_.push (a); + SCM pair = gh_cons (gh_int2scm (p),gh_int2scm (a)); + Group_interface (this, "old-accidentals").add_thing (pair); } int -Key_item::calculate_position(int p, int a) const +Key_item::calculate_position(SCM pair) const { + int p = gh_scm2int (gh_car (pair)); + int a = gh_scm2int (gh_cdr (pair)); + if (to_boolean (get_elt_property ("multi-octave"))) { return p + gh_scm2int (get_elt_property ("c0-position")); @@ -62,9 +66,10 @@ Key_item::calculate_position(int p, int a) const { p -= 7; /* Typeset below c_position */ } - /* Provide for the four cases in which there's a glitch */ - /* it's a hack, but probably not worth */ - /* the effort of finding a nicer solution. dl. */ + /* Provide for the four cases in which there's a glitch + it's a hack, but probably not worth + the effort of finding a nicer solution. + --dl. */ if (c0==2 && a>0 && p==3) p -= 7; if (c0==-3 && a>0 && p==-1) @@ -81,8 +86,11 @@ Key_item::calculate_position(int p, int a) const /* TODO - space the `natural' signs wider - - dehair this + + + */ + Molecule Key_item::do_brew_molecule() const { @@ -91,27 +99,23 @@ Key_item::do_brew_molecule() const Staff_symbol_referencer_interface si (this); Real inter = si.staff_space ()/2.0; - int j; - if ((break_status_dir () == LEFT || break_status_dir () == CENTER) - || old_pitch_arr_.size ()) - { - for (int i =0; i < old_pitch_arr_.size(); i++) - { - for (j =0; (j < pitch_arr_.size()) - && (old_pitch_arr_[i] != pitch_arr_[j]); j++) - ; - - if (j == pitch_arr_.size() - || (old_pitch_arr_[i] == pitch_arr_[j] - && old_acc_arr_[i] != acc_arr_[j])) - { - Molecule m =lookup_l ()->afm_find ("accidentals-0"); - - m.translate_axis (calculate_position(old_pitch_arr_[i], old_acc_arr_[i]) * inter, Y_AXIS); - mol.add_at_edge (X_AXIS, RIGHT, m,0); - } - } + SCM newas = get_elt_property ("new-accidentals"); + /* + SCM lists are stacks, so we work from right to left, ending with + the cancellation signature. + */ + for (SCM s = newas; gh_pair_p (s); s = gh_cdr (s)) + { + int a = gh_scm2int (gh_cdar (s)); + Molecule m = lookup_l ()->afm_find ("accidentals-" + to_str (a)); + m.translate_axis (calculate_position(gh_car (s)) * inter, Y_AXIS); + mol.add_at_edge (X_AXIS, LEFT, m, 0); + } + + if (break_status_dir () != RIGHT) + { + SCM old = get_elt_property ("old-accidentals"); /* Add half a space between cancellation and key sig. @@ -120,15 +124,31 @@ Key_item::do_brew_molecule() const Interval x(0, inter); Interval y(0,0); - mol.add_at_edge (X_AXIS, RIGHT, lookup_l()->blank (Box(x,y)),0); + mol.add_at_edge (X_AXIS, LEFT, lookup_l()->blank (Box(x,y)),0); + + for (; gh_pair_p (old); old = gh_cdr (old)) + { + SCM found = SCM_EOL; + + /* + find correspondences in pitches + */ + for (SCM s = newas; gh_pair_p (s); s = gh_cdr (s)) + if (gh_caar(s) == gh_caar (old)) + found = gh_car (s); + + if (found == SCM_EOL || gh_cdr (found) != gh_cdar (old)) + { + Molecule m =lookup_l ()->afm_find ("accidentals-0"); + + m.translate_axis (calculate_position(gh_car(old)) * inter, Y_AXIS); + mol.add_at_edge (X_AXIS, LEFT, m,0); + } + } + + } - for (int i =0; i < pitch_arr_.size(); i++) - { - Molecule m = lookup_l ()->afm_find ("accidentals-" + to_str (acc_arr_[i])); - m.translate_axis (calculate_position(pitch_arr_[i], acc_arr_[i]) * inter, Y_AXIS); - mol.add_at_edge (X_AXIS, RIGHT, m, 0); - } return mol; } diff --git a/lily/line-of-score.cc b/lily/line-of-score.cc index 18596d017d..5ca3685dee 100644 --- a/lily/line-of-score.cc +++ b/lily/line-of-score.cc @@ -212,6 +212,8 @@ Line_of_score::pre_processing () { for (SCM s = get_elt_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s)) unsmob_element (gh_car (s))->do_breakable_col_processing (); + for (SCM s = get_elt_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s)) + unsmob_element (gh_car (s))->handle_prebroken_dependencies (); fixup_refpoints (get_elt_property ("all-elements")); diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 6001e531bf..0d360c945b 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -183,8 +183,8 @@ Multi_measure_rest::get_rods () const Item * l = get_bound (LEFT)->column_l (); Item * r = get_bound (RIGHT)->column_l (); - Item * lb = l->find_broken_piece (RIGHT); - Item * rb = r->find_broken_piece (LEFT); + Item * lb = l->find_prebroken_piece (RIGHT); + Item * rb = r->find_prebroken_piece (LEFT); Item* combinations[4][2]={{l,r}, {lb,r}, {l,rb},{lb,rb}}; for (int i=0; i < 4; i++) diff --git a/lily/score-element.cc b/lily/score-element.cc index 891f67e092..48dd8be722 100644 --- a/lily/score-element.cc +++ b/lily/score-element.cc @@ -27,6 +27,7 @@ #include "dimension-cache.hh" #include "side-position-interface.hh" #include "item.hh" + /* TODO: @@ -291,7 +292,9 @@ Score_element::do_add_processing() } - +/* + ugh. + */ Molecule Score_element::do_brew_molecule() const { @@ -353,18 +356,17 @@ Score_element::handle_broken_smobs (SCM src, SCM criterion) Direction d = to_dir (criterion); if (i && i->break_status_dir () != d) { - Item *br = i->find_broken_piece (d); + Item *br = i->find_prebroken_piece (d); return (br) ? br->self_scm_ : SCM_UNDEFINED; } } else { - Line_of_score * line = dynamic_cast (unsmob_element ( criterion)); - Line_of_score * dep_line = sc->line_l (); + Line_of_score * dep_line = sc->line_l (); if (dep_line != line) { - Score_element * br = sc->find_broken_piece (line); + Score_element * br = sc->find_broken_piece (line); return (br) ? br->self_scm_ : SCM_UNDEFINED; } if (!dep_line) @@ -393,7 +395,8 @@ Score_element::handle_broken_smobs (SCM src, SCM criterion) return handle_broken_smobs (cdr, criterion); - We don't want to rely on the compiler to do this. */ + We don't want to rely on the compiler to do this. Without + tail-recursion, this easily crashes with a stack overflow. */ src = cdr; goto again; } @@ -439,34 +442,19 @@ Score_element::handle_broken_dependencies() /* This element is `invalid'; it has been removed from all dependencies, so let's junk the element itself. - */ element_property_alist_ = SCM_EOL; set_extent_callback (0, Y_AXIS); set_extent_callback (0, X_AXIS); } - - } - -/* - TODO: cleanify. - */ void Score_element::handle_prebroken_dependencies() { - if (Item*i =dynamic_cast (this)) - { - if (original_l_) - { - element_property_alist_ - = handle_broken_smobs (original_l_->element_property_alist_, - gh_int2scm (i->break_status_dir ())); - } - } } + bool Score_element::linked_b() const { @@ -625,7 +613,7 @@ Score_element::fixup_refpoint () Direction my_dir = i->break_status_dir () ; if (my_dir!= parenti->break_status_dir()) { - Item *newparent = parenti->find_broken_piece (my_dir); + Item *newparent = parenti->find_prebroken_piece (my_dir); set_parent (newparent, ax); } } @@ -639,7 +627,6 @@ Score_element::fixup_refpoint () SMOB funcs ****************************************************/ - #include "ly-smobs.icc" IMPLEMENT_UNSMOB(Score_element, element); diff --git a/lily/separating-group-spanner.cc b/lily/separating-group-spanner.cc index c00bfd8e13..43e7d0d8c0 100644 --- a/lily/separating-group-spanner.cc +++ b/lily/separating-group-spanner.cc @@ -52,10 +52,10 @@ Separating_group_spanner::get_rods () const continue; Single_malt_grouping_item *lb - = dynamic_cast(l->find_broken_piece (RIGHT)); + = dynamic_cast(l->find_prebroken_piece (RIGHT)); Single_malt_grouping_item *rb - = dynamic_cast(r->find_broken_piece (LEFT)); + = dynamic_cast(r->find_prebroken_piece (LEFT)); a.push (make_rod(l, r)); if (lb) diff --git a/lily/single-malt-grouping-item.cc b/lily/single-malt-grouping-item.cc index b017addc21..3ab74cdc25 100644 --- a/lily/single-malt-grouping-item.cc +++ b/lily/single-malt-grouping-item.cc @@ -44,8 +44,6 @@ Single_malt_grouping_item::my_width () const SCM elt = gh_car (s); if (!SMOB_IS_TYPE_B(Score_element, elt)) continue; - - Item *il = dynamic_cast (SMOB_TO_TYPE (Score_element, elt)); if (pc != il->column_l ()) diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index d8cf62c2ac..6ad6b1a06c 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -67,8 +67,8 @@ Spacing_spanner::do_measure (Link_array cols) const { Item * l = cols[i]; Item * r = cols[i+1]; - Item * lb = l->find_broken_piece (RIGHT); - Item * rb = r->find_broken_piece (LEFT); + Item * lb = l->find_prebroken_piece (RIGHT); + Item * rb = r->find_prebroken_piece (LEFT); Item* combinations[4][2]={{l,r}, {lb,r}, {l,rb},{lb,rb}}; diff --git a/lily/spanner.cc b/lily/spanner.cc index 9a8ed71038..d3623668e1 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -63,7 +63,7 @@ Spanner::do_break_processing () Direction d = LEFT; do { - Item* bound = left->find_broken_piece (d); + Item* bound = left->find_prebroken_piece (d); if (bound->line_l ()) { Spanner * span_p = dynamic_cast( clone ()); @@ -94,7 +94,7 @@ Spanner::do_break_processing () { Item *&pc_l = bounds[d] ; if (!pc_l->line_l()) - pc_l = pc_l->find_broken_piece(- d); + pc_l = pc_l->find_prebroken_piece(- d); assert (pc_l); } @@ -122,7 +122,7 @@ Spanner::set_my_columns() do { if (!spanned_drul_[i]->line_l()) - set_bound(i,spanned_drul_[i]->find_broken_piece((Direction) -i)); + set_bound(i,spanned_drul_[i]->find_prebroken_piece((Direction) -i)); } while (flip(&i) != LEFT); } diff --git a/ly/params.ly b/ly/params.ly index 6b0629c7ce..cd799fdb76 100644 --- a/ly/params.ly +++ b/ly/params.ly @@ -70,10 +70,16 @@ arithmetic_multiplier = 0.9 * \quartwidth ; arithmetic_basicspace = 2.0; + + #'Stem_tremolo::beam-width = 1.5 * \quartwidth ; #'Left_edge_item::visibility-lambda = #begin-of-line-visible +% +% UGH; junk these! +% + #'Key_item::visibility-lambda = #begin-of-line-visible #'Breathing_sign::visibility-lambda = #begin-of-line-invisible diff --git a/scm/lily.scm b/scm/lily.scm index fec2be9cfe..2f237ac73a 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -104,6 +104,7 @@ ((none Instrument_name) . (extra-space 1.0)) ((Instrument_name Left_edge_item) . (extra-space 1.0)) ((Left_edge_item Clef_item) . (extra-space 1.0)) + ((Left_edge_item Key_item) . (extra-space 0.0)) ((none Left_edge_item) . (extra-space 0.0)) ((Left_edge_item Staff_bar) . (extra-space 0.0)) ; ((none Left_edge_item) . (extra-space -15.0)) -- 2.39.5