From 17f71cac865c9d93068685e5841b1fc71ed10af5 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 22 Dec 1999 11:43:54 +0000 Subject: [PATCH] lilypond-1.3.16 --- input/test/tie-sparse.sly | 4 ++++ lily/align-note-column-engraver.cc | 3 ++- lily/auto-beam-engraver.cc | 6 +++--- lily/bar-engraver.cc | 4 ++-- lily/bar-script-engraver.cc | 2 +- lily/beam-engraver.cc | 2 +- lily/bow.cc | 5 +++-- lily/break-align-engraver.cc | 2 +- lily/breathing-sign.cc | 6 ++---- lily/collision.cc | 7 ++----- lily/directional-element.cc | 28 ++++++++++++++++++++++------ lily/dot-column.cc | 3 ++- lily/dots.cc | 7 ++++--- lily/extender-spanner.cc | 2 +- lily/hyphen-spanner.cc | 2 +- lily/key-engraver.cc | 4 ++-- 16 files changed, 53 insertions(+), 34 deletions(-) create mode 100644 input/test/tie-sparse.sly diff --git a/input/test/tie-sparse.sly b/input/test/tie-sparse.sly new file mode 100644 index 0000000000..cbfc70dbb4 --- /dev/null +++ b/input/test/tie-sparse.sly @@ -0,0 +1,4 @@ + +\context Voice { +\property Voice.sparseTies = ##t +c'' ~ } diff --git a/lily/align-note-column-engraver.cc b/lily/align-note-column-engraver.cc index 11bcefe652..f83c2747ac 100644 --- a/lily/align-note-column-engraver.cc +++ b/lily/align-note-column-engraver.cc @@ -12,6 +12,7 @@ #include "note-column.hh" #include "local-key-item.hh" #include "warn.hh" +#include "directional-element-interface.hh" /** catch notes, and put them in a row. @@ -53,7 +54,7 @@ Align_note_column_engraver::do_removal_processing () SCM al = get_property ("graceAlignPosition", 0); if (isdir_b (al)) { - align_item_p_->set_direction (to_dir (al)); + directional_element (align_item_p_).set (to_dir (al)); } typeset_element (align_item_p_); diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 81e7cf94b8..74761145cd 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -176,7 +176,7 @@ Auto_beam_engraver::consider_end_and_begin (Moment test_mom) Allow already started autobeam to end */ SCM on = get_property ("noAutoBeaming", 0); - if (gh_boolean_p (on) && gh_scm2bool (on)) + if (to_boolean (on)) return; if (begin_mom) @@ -290,7 +290,7 @@ Auto_beam_engraver::same_grace_state_b (Score_element* e) { bool gr = e->get_elt_property ("grace") == SCM_BOOL_T; SCM wg =get_property ("weAreGraceContext",0); - return (gh_boolean_p (wg) && gh_scm2bool (wg)) == gr; + return (to_boolean (wg)) == gr; } void @@ -327,7 +327,7 @@ Auto_beam_engraver::acknowledge_element (Score_element_info info) /* Don't (start) auto-beam over empty stems; skips or rests */ - if (!stem_l->first_head ()) + if (!stem_l->heads_i ()) { if (stem_l_arr_p_) end_beam (); diff --git a/lily/bar-engraver.cc b/lily/bar-engraver.cc index e8b29882f8..a364995d4c 100644 --- a/lily/bar-engraver.cc +++ b/lily/bar-engraver.cc @@ -45,7 +45,7 @@ Bar_engraver::create_bar () urg. Why did I implement this? */ SCM prop = get_property ("barAtLineStart", 0); - if (gh_boolean_p (prop) && gh_scm2bool (prop)) + if (to_boolean (prop)) { bar_p_->set_elt_property ("at-line-start", SCM_BOOL_T); } @@ -64,7 +64,7 @@ Bar_engraver::request_bar (String requested_type) if (!now_mom ()) { SCM prop = get_property ("barAtLineStart", 0); - if (!gh_boolean_p (prop) && gh_scm2bool (prop)) + if (!to_boolean (prop)) return; } bool bar_existed = bar_p_; diff --git a/lily/bar-script-engraver.cc b/lily/bar-script-engraver.cc index f4fa06452c..c51d661175 100644 --- a/lily/bar-script-engraver.cc +++ b/lily/bar-script-engraver.cc @@ -31,7 +31,7 @@ void Bar_script_engraver::do_creation_processing () { SCM prop = get_property (type_ + "HangOnClef", 0); - if (gh_boolean_p (prop) && gh_scm2bool (prop)) + if (to_boolean (prop)) { hang_on_clef_b_ = true; } diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index 1fa729cc51..9ca8607885 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -159,7 +159,7 @@ Beam_engraver::acknowledge_element (Score_element_info info) bool stem_grace = stem_l->get_elt_property ("grace") == SCM_BOOL_T; SCM wg =get_property ("weAreGraceContext",0); - bool wgb= gh_boolean_p (wg) && gh_scm2bool (wg); + bool wgb= to_boolean (wg); if (wgb!= stem_grace) return; diff --git a/lily/bow.cc b/lily/bow.cc index a87329fe78..ac43af288e 100644 --- a/lily/bow.cc +++ b/lily/bow.cc @@ -15,6 +15,7 @@ #include "lookup.hh" #include "bezier-bow.hh" #include "main.hh" +#include "directional-element-interface.hh" Bow::Bow () { @@ -33,7 +34,7 @@ Bow::do_brew_molecule_p () const if (gh_number_p (d)) a = lookup_l ()->dashed_slur (one, thick, gh_scm2int (d)); else - a = lookup_l ()->slur (one, get_direction () * thick, thick); + a = lookup_l ()->slur (one, directional_element (this).get () * thick, thick); return new Molecule (a); } @@ -58,7 +59,7 @@ Bezier Bow::get_curve () const { Bezier_bow b (paper_l (), - get_encompass_offset_arr (), get_direction ()); + get_encompass_offset_arr (), directional_element (this).get ()); return b.get_curve (); } diff --git a/lily/break-align-engraver.cc b/lily/break-align-engraver.cc index f735fe9e8c..44d94270a6 100644 --- a/lily/break-align-engraver.cc +++ b/lily/break-align-engraver.cc @@ -83,7 +83,7 @@ Break_align_engraver::acknowledge_element (Score_element_info inf) return; SCM bp=item_l->remove_elt_property ("breakable"); - bool breakable = (gh_boolean_p (bp) && gh_scm2bool (bp)); + bool breakable = (to_boolean (bp)); if (!breakable) return ; diff --git a/lily/breathing-sign.cc b/lily/breathing-sign.cc index 9861ac19c5..97460a490a 100644 --- a/lily/breathing-sign.cc +++ b/lily/breathing-sign.cc @@ -9,6 +9,7 @@ TODO: --> see breathing-sign-engraver.cc */ #include "staff-symbol-referencer.hh" +#include "directional-element-interface.hh" #include "breathing-sign.hh" #include "string.hh" @@ -22,12 +23,9 @@ TODO: --> see breathing-sign-engraver.cc Breathing_sign::Breathing_sign () { - set_direction (UP); set_elt_property ("breakable", SCM_BOOL_T); } - - Molecule* Breathing_sign::do_brew_molecule_p () const { @@ -47,6 +45,6 @@ Breathing_sign::do_post_processing() { Real dl = Staff_symbol_referencer_interface (this).staff_space(); - translate_axis(2.0 * dl * get_direction (), Y_AXIS); + translate_axis(2.0 * dl * directional_element(this).get (), Y_AXIS); } diff --git a/lily/collision.cc b/lily/collision.cc index 91301c6ca6..a6bf46e56c 100644 --- a/lily/collision.cc +++ b/lily/collision.cc @@ -145,10 +145,8 @@ Collision::automatic_shift () /* TODO. */ - Note_head * nu_l= cu_l->first_head(); // cu_l->head_l_arr_[0]; - Note_head * nd_l = cd_l->first_head(); // cd_l->head_l_arr_.top(); - - + Note_head * nu_l= cu_l->first_head(); + Note_head * nd_l = cd_l->first_head(); int downpos = cd_l->head_positions_interval ()[BIGGER]; int uppos = cu_l->head_positions_interval ()[SMALLER]; @@ -172,7 +170,6 @@ Collision::automatic_shift () while ((flip (&d))!= UP); } - do { for (int i=0; i < clash_groups[d].size (); i++) diff --git a/lily/directional-element.cc b/lily/directional-element.cc index 83a4aaecb5..dac91951bd 100644 --- a/lily/directional-element.cc +++ b/lily/directional-element.cc @@ -7,18 +7,28 @@ */ -#include "directional-element.hh" +#include "directional-element-interface.hh" -Directional_element::Directional_element () +Directional_element_interface::Directional_element_interface (Score_element const *s) { + elt_l_ = (Score_element*)s; } +bool +Directional_element_interface::has_interface_b () const +{ + return isdir_b (elt_l_->get_elt_property ("direction")); +} + + + + Direction -Directional_element::get_direction () const +Directional_element_interface::get () const { // return dir_; - SCM d= get_elt_property ("direction"); + SCM d= elt_l_->get_elt_property ("direction"); if (!isdir_b(d)) return CENTER; @@ -26,7 +36,13 @@ Directional_element::get_direction () const } void -Directional_element::set_direction (Direction d) +Directional_element_interface::set (Direction d) +{ + elt_l_->set_elt_property ("direction", gh_int2scm (d)); +} + +Directional_element_interface +directional_element (Score_element const*s) { - set_elt_property ("direction", gh_int2scm (d)); + return s; } diff --git a/lily/dot-column.cc b/lily/dot-column.cc index d085bf4011..b9868a29b8 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -11,6 +11,7 @@ #include "rhythmic-head.hh" #include "group-interface.hh" #include "staff-symbol-referencer.hh" +#include "directional-element-interface.hh" void Dot_column::add_dots (Dots *d) @@ -49,7 +50,7 @@ Dot_column::Dot_column () Group_interface gi (this, "dots"); gi.set_interface (); - set_direction (RIGHT); + directional_element (this).set (RIGHT); set_axes(X_AXIS,X_AXIS); } diff --git a/lily/dots.cc b/lily/dots.cc index fc3c57e0dd..ad62ecceda 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -11,6 +11,7 @@ #include "paper-def.hh" #include "lookup.hh" #include "staff-symbol-referencer.hh" +#include "directional-element-interface.hh" Dots::Dots () { @@ -28,13 +29,13 @@ Dots::do_post_processing () } else { - if (!get_direction ()) - set_direction (UP); + if (!directional_element (this).get ()) + directional_element (this).set (UP); Staff_symbol_referencer_interface si (this); int p = int (si.position_f ()); if (!(p % 2)) - si.set_position (p + get_direction ()); + si.set_position (p + directional_element (this).get ()); } } Molecule* diff --git a/lily/extender-spanner.cc b/lily/extender-spanner.cc index a9eb6640c5..e70e848035 100644 --- a/lily/extender-spanner.cc +++ b/lily/extender-spanner.cc @@ -21,7 +21,7 @@ #include "extender-spanner.hh" Extender_spanner::Extender_spanner () - : Directional_spanner () + : Spanner () { dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0; dim_cache_[Y_AXIS]->set_callback (Dimension_cache::point_dimension_callback); diff --git a/lily/hyphen-spanner.cc b/lily/hyphen-spanner.cc index ebb02d18d4..be36b99bf6 100644 --- a/lily/hyphen-spanner.cc +++ b/lily/hyphen-spanner.cc @@ -23,7 +23,7 @@ #include "dimension-cache.hh" Hyphen_spanner::Hyphen_spanner () - : Directional_spanner () + : Spanner () { dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0; diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index 6758de4207..299c6d49ed 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -86,7 +86,7 @@ Key_engraver::acknowledge_element (Score_element_info info) if (dynamic_cast (info.req_l_)) { SCM c = get_property ("createKeyOnClefChange", 0); - if (gh_boolean_p (c) && gh_scm2bool (c)) + if (to_boolean (c)) create_key (); } else if (dynamic_cast (info.elem_l_) @@ -133,7 +133,7 @@ Key_engraver::read_req (Key_change_req const * r) key_.clear (); SCM prop = get_property ("keyOctaviation", 0); - key_.multi_octave_b_ = gh_boolean_p (prop) && gh_scm2bool (prop); + key_.multi_octave_b_ = to_boolean (prop); accidental_idx_arr_.clear (); -- 2.11.4.GIT