From: fred Date: Tue, 26 Mar 2002 22:42:57 +0000 (+0000) Subject: lilypond-1.3.2 X-Git-Tag: release/1.5.59~2014 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4e820abe386dff2e30675256739f40b304f671aa;p=lilypond.git lilypond-1.3.2 --- diff --git a/flower/include/hash-table.hh b/flower/include/hash-table.hh index 781784d7fd..491feb3df7 100644 --- a/flower/include/hash-table.hh +++ b/flower/include/hash-table.hh @@ -166,6 +166,17 @@ public: fixed_p_->dict_arr_[l].key_ = s; return fixed_p_->dict_arr_[l].value_; } + bool try_retrieve (K k, V *v) + { + int l = fixed_p_->lookup (k, (*hash_func_)(k)); + if (l < 0 || fixed_p_->dict_arr_[l].free_b_) + return false; + else + { + *v = fixed_p_->dict_arr_[l].value_; + return true; + } + } V elem (K s) const { return const_elem (s); diff --git a/lily/align-element.cc b/lily/align-element.cc index 6ad778670d..9ccc1538d6 100644 --- a/lily/align-element.cc +++ b/lily/align-element.cc @@ -98,18 +98,16 @@ Align_element::do_side_processing () Score_element *e =dynamic_cast(elem_l_arr_[i]); // todo: fucks up if item both in Halign & Valign. - SCM min_dims = e->remove_elt_property (minimum_space_scm_sym); - if (min_dims != SCM_BOOL_F) + SCM min_dims = e->remove_elt_property ("minimum-space"); + if (min_dims != SCM_UNDEFINED) { - min_dims = SCM_CDR (min_dims); y.unite (Interval (gh_scm2double (SCM_CAR (min_dims)), gh_scm2double (SCM_CDR (min_dims)))); } - SCM extra_dims = e->remove_elt_property (extra_space_scm_sym); - if (extra_dims != SCM_BOOL_F) + SCM extra_dims = e->remove_elt_property ("extra-space"); + if (extra_dims != SCM_UNDEFINED) { - extra_dims = SCM_CDR (extra_dims); y[LEFT] += gh_scm2double (SCM_CAR (extra_dims)); y[RIGHT] += gh_scm2double (SCM_CDR (extra_dims)); } @@ -236,3 +234,4 @@ Align_element::get_priority (Score_element const * e) const else return elem_l_arr_.find_i (nonconst); } + diff --git a/lily/align-note-column-engraver.cc b/lily/align-note-column-engraver.cc index 74967e7b66..efb3abd9bf 100644 --- a/lily/align-note-column-engraver.cc +++ b/lily/align-note-column-engraver.cc @@ -93,7 +93,7 @@ Align_note_column_engraver::process_acknowledged () */ Real extra_space = gh_scm2double(grsp); SCM e = gh_cons (gh_double2scm (-extra_space), gh_double2scm (0.0)); - now_column_l_->set_elt_property (extra_space_scm_sym, e); + now_column_l_->set_elt_property ("extra-space", e); } } @@ -112,3 +112,4 @@ Align_note_column_engraver::do_post_move_processing () } ADD_THIS_TRANSLATOR(Align_note_column_engraver); + diff --git a/lily/axis-group-element.cc b/lily/axis-group-element.cc index a0ea8abb99..c14b5186e5 100644 --- a/lily/axis-group-element.cc +++ b/lily/axis-group-element.cc @@ -57,7 +57,7 @@ Axis_group_element::do_print() const Axis_group_element::Axis_group_element() { - set_elt_property (transparent_scm_sym, SCM_BOOL_T); + set_elt_property ("transparent", SCM_BOOL_T); } void @@ -134,7 +134,7 @@ Axis_group_element::add_extra_element (Score_element *e) { extra_elems_.push (se[i]); add_dependency (se[i]); - se[i]->set_elt_property (ly_symbol ("Axis_group_element::add_extra_element"), SCM_BOOL_T); // UGH GUH. + se[i]->set_elt_property (("Axis_group_element::add_extra_element"), SCM_BOOL_T); // UGH GUH. } } @@ -166,3 +166,4 @@ Axis_group_element::extent (Axis a) const return Graphical_element::extent (a); } + diff --git a/lily/axis-group-engraver.cc b/lily/axis-group-engraver.cc index ad7e9784bb..85d21f0f8c 100644 --- a/lily/axis-group-engraver.cc +++ b/lily/axis-group-engraver.cc @@ -46,13 +46,12 @@ Axis_group_engraver::acknowledge_element (Score_element_info i) void Axis_group_engraver::process_acknowledged () { + /* UGH UGH UGH */ for (int i=0; i < elts_.size (); i++) { if (!elts_[i]->parent_l (Y_AXIS)) staffline_p_->add_element (elts_[i]); - - /* UGH UGH UGH */ - else if (elts_[i]->get_elt_property (ly_symbol ("Axis_group_element::add_extra_element")) == SCM_BOOL_F + else if (elts_[i]->get_elt_property ("Axis_group_element::add_extra_element") == SCM_UNDEFINED && ! dynamic_cast (elts_[i]->parent_l (Y_AXIS))) { diff --git a/lily/axis-group-spanner.cc b/lily/axis-group-spanner.cc index 246fcee710..991cf10853 100644 --- a/lily/axis-group-spanner.cc +++ b/lily/axis-group-spanner.cc @@ -133,7 +133,7 @@ Axis_group_spanner::do_break_processing() v->add_element (broken_item, a1, a2); else { - broken_item->set_elt_property (transparent_scm_sym, SCM_BOOL_T); + broken_item->set_elt_property ("transparent", SCM_BOOL_T); broken_item->set_empty (true); } @@ -169,3 +169,4 @@ Axis_group_spanner::do_width () const { return Spanner::do_width (); } + diff --git a/lily/bar-engraver.cc b/lily/bar-engraver.cc index 92378ccbd8..e5a61176a6 100644 --- a/lily/bar-engraver.cc +++ b/lily/bar-engraver.cc @@ -32,7 +32,7 @@ Bar_engraver::create_bar () if (!bar_p_) { bar_p_ = new Staff_bar; - bar_p_->set_elt_property (break_priority_scm_sym, gh_int2scm (0)); + bar_p_->set_elt_property ("break-priority", gh_int2scm (0)); // urg: "" != empty... SCM default_type = get_property ("defaultBarType", 0); @@ -47,7 +47,7 @@ Bar_engraver::create_bar () SCM prop = get_property ("barAtLineStart", 0); if (gh_boolean_p (prop) && gh_scm2bool (prop)) { - bar_p_->set_elt_property (at_line_start_scm_sym, SCM_BOOL_T); + bar_p_->set_elt_property ("at-line-start", SCM_BOOL_T); } announce_element (Score_element_info (bar_p_, 0)); } @@ -139,3 +139,4 @@ Bar_engraver::do_pre_move_processing() ADD_THIS_TRANSLATOR(Bar_engraver); + diff --git a/lily/bar-script-engraver.cc b/lily/bar-script-engraver.cc index cf73f36500..412f0390bb 100644 --- a/lily/bar-script-engraver.cc +++ b/lily/bar-script-engraver.cc @@ -61,7 +61,7 @@ Bar_script_engraver::attach_script_to_item (Item *i) How do we make sure that staff_side_p_ has a dependency from someone else? We can't use I for that, so we use some other element. */ - // staff_side_p_->set_elt_property (dangling_scm_sym, SCM_BOOL_T) + // staff_side_p_->set_elt_property ("dangling", SCM_BOOL_T) get_staff_info ().command_pcol_l ()->add_dependency (staff_side_p_); } } @@ -135,11 +135,11 @@ Bar_script_engraver::create_items (Request *rq) staff_side_p_ = new Staff_side_item; staff_side_p_->axis_ = axis_; - staff_side_p_->set_elt_property (breakable_scm_sym, SCM_BOOL_T); // ugh + staff_side_p_->set_elt_property ("breakable", SCM_BOOL_T); // ugh text_p_ = new Text_item; - text_p_->set_elt_property (breakable_scm_sym, SCM_BOOL_T); // ugh + text_p_->set_elt_property ("breakable", SCM_BOOL_T); // ugh SCM prop = get_property (type_ + "Direction", 0); if (isdir_b (prop)) @@ -156,20 +156,21 @@ Bar_script_engraver::create_items (Request *rq) SCM padding = get_property (type_ + "ScriptPadding", 0); if (gh_number_p(padding)) { - staff_side_p_->set_elt_property (padding_scm_sym, padding); + staff_side_p_->set_elt_property ("padding", padding); } else { staff_side_p_ - ->set_elt_property (padding_scm_sym, - gh_double2scm(paper_l ()->get_realvar (interline_scm_sym))); + ->set_elt_property ("padding", + gh_double2scm(paper_l ()->get_realvar (gh_symbol2scm("interline")))); } - staff_side_p_->set_elt_property (visibility_lambda_scm_sym, + staff_side_p_->set_elt_property ("visibility-lambda", visibility_lambda_); - text_p_->set_elt_property (visibility_lambda_scm_sym, + text_p_->set_elt_property ("visibility-lambda", visibility_lambda_); announce_element (Score_element_info (text_p_, rq)); announce_element (Score_element_info (staff_side_p_, rq)); } + diff --git a/lily/bar.cc b/lily/bar.cc index f21d68fbac..f2d3d187ea 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -17,7 +17,7 @@ Bar::Bar () { - set_elt_property (breakable_scm_sym, SCM_BOOL_T); + set_elt_property ("breakable", SCM_BOOL_T); type_str_ = "|"; } @@ -76,7 +76,7 @@ Bar::do_pre_processing () break; } } - if (remove_elt_property (at_line_start_scm_sym) != SCM_BOOL_F // UGR. + if (remove_elt_property ("at-line-start") == SCM_BOOL_T // UGR. && (break_status_dir () == RIGHT) && (type_str_ == "")) { type_str_ = "|"; @@ -86,3 +86,4 @@ Bar::do_pre_processing () set_empty (true, X_AXIS); } + diff --git a/lily/base-span-bar-engraver.cc b/lily/base-span-bar-engraver.cc index 1ffc9be842..53800c6681 100644 --- a/lily/base-span-bar-engraver.cc +++ b/lily/base-span-bar-engraver.cc @@ -54,12 +54,12 @@ Base_span_bar_engraver::acknowledge_element (Score_element_info i) spanbar_p_->set_parent (bar_l_arr_[0], Y_AXIS); String visnam = String(name()) + "_visibility"; - spanbar_p_->set_elt_property (visibility_lambda_scm_sym, + spanbar_p_->set_elt_property ("visibility-lambda", ly_ch_C_eval_scm (visnam.ch_C())); if (use_priority_b_) { - spanbar_p_->set_elt_property (break_priority_scm_sym, + spanbar_p_->set_elt_property ("break-priority", gh_int2scm (break_priority_i_)); } else @@ -90,3 +90,4 @@ Base_span_bar_engraver::do_pre_move_processing() ADD_THIS_TRANSLATOR(Base_span_bar_engraver); + diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index 99a7c00d28..8f0f52cf1c 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -156,7 +156,7 @@ Beam_engraver::acknowledge_element (Score_element_info info) return; - bool stem_grace = stem_l->get_elt_property (grace_scm_sym) != SCM_BOOL_F; + 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); @@ -193,3 +193,4 @@ Beam_engraver::acknowledge_element (Score_element_info info) ADD_THIS_TRANSLATOR(Beam_engraver); + diff --git a/lily/bezier.cc b/lily/bezier.cc index 9acb9004e9..3bc35d2da4 100644 --- a/lily/bezier.cc +++ b/lily/bezier.cc @@ -172,7 +172,7 @@ Bezier_bow::blow_fit () return; #ifndef STANDALONE - Real internote_f = paper_l_->get_realvar (interline_scm_sym)/2.0; + Real internote_f = paper_l_->get_var ("interline")/2.0; #else Real internote_f = STAFFHEIGHT / 8; #endif @@ -219,7 +219,7 @@ Bezier_bow::calc_bezier () Real s = sqrt (control_[3][X_AXIS] * control_[3][X_AXIS] + control_[1][Y_AXIS] * control_[2][Y_AXIS]); #ifndef STANDALONE - Real internote = paper_l_->get_realvar (interline_scm_sym)/2.0; + Real internote = paper_l_->get_var ("interline")/2.0; #else Real internote = STAFFHEIGHT / 8; #endif @@ -476,7 +476,7 @@ Bezier_bow::calc_tangent_controls () // emperic computer science: // * tangents somewhat steeper than minimal line #ifndef STANDALONE - Real internote = paper_l_->get_realvar (interline_scm_sym)/2.0; + Real internote = paper_l_->get_var ("interline")/2.0; Real rc_correct = paper_l_->get_var ("slur_rc_factor"); #else Real internote = STAFFHEIGHT / 8; @@ -635,3 +635,4 @@ Bezier_bow::calc_default (Real h) Bezier::set (control); } + diff --git a/lily/bow.cc b/lily/bow.cc index f3c4e59eeb..a3214f281e 100644 --- a/lily/bow.cc +++ b/lily/bow.cc @@ -29,11 +29,11 @@ Bow::do_brew_molecule_p () const Molecule a; - SCM d = get_elt_property (dashed_scm_sym); - if (d == SCM_BOOL_F) + SCM d = get_elt_property ("dashed"); + if (d == SCM_UNDEFINED) a = lookup_l ()->slur (c, thick); else - a = lookup_l ()->dashed_slur (c, thick, gh_scm2int (SCM_CDR(d))); + a = lookup_l ()->dashed_slur (c, thick, gh_scm2int (d)); return new Molecule (a); } @@ -98,3 +98,4 @@ Bow::get_encompass_offset_arr () const return offset_arr; } + diff --git a/lily/breathing-sign.cc b/lily/breathing-sign.cc index 923eeeab1e..7c8e44b4e5 100644 --- a/lily/breathing-sign.cc +++ b/lily/breathing-sign.cc @@ -22,8 +22,8 @@ TODO: --> see breathing-sign-engraver.cc Breathing_sign::Breathing_sign () { dir_ = UP; - set_elt_property (breakable_scm_sym, SCM_BOOL_T); - set_elt_property (visibility_lambda_scm_sym, + set_elt_property ("breakable", SCM_BOOL_T); + set_elt_property ("visibility-lambda", ly_ch_C_eval_scm ("non_postbreak_visibility")); } @@ -55,3 +55,4 @@ Breathing_sign::do_post_processing() translate_axis(2.0 * dl * dir_, Y_AXIS); } + diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index 335ff0a62f..4c7eb954c6 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -129,7 +129,7 @@ Clef_engraver::acknowledge_element (Score_element_info info) bool def = !clef_p_; create_clef(); if(def) - clef_p_->set_elt_property(visibility_lambda_scm_sym, + clef_p_->set_elt_property("visibility-lambda", ly_ch_C_eval_scm ("postbreak_only_visibility")); } @@ -164,7 +164,7 @@ Clef_engraver::do_creation_processing() if (clef_type_str_.length_i ()) { create_clef(); - clef_p_->set_elt_property (non_default_scm_sym, SCM_BOOL_T); + clef_p_->set_elt_property ("non-default", SCM_BOOL_T); } } @@ -198,7 +198,7 @@ Clef_engraver::create_clef() clef_p_->y_position_i_ = clef_position_i_; if (octave_dir_) { - clef_p_->set_elt_property (octave_dir_scm_sym, gh_int2scm (octave_dir_)); + clef_p_->set_elt_property ("octave-dir", gh_int2scm (octave_dir_)); } } @@ -248,3 +248,4 @@ Clef_engraver::do_removal_processing() ADD_THIS_TRANSLATOR(Clef_engraver); + diff --git a/lily/clef-item.cc b/lily/clef-item.cc index f203d39bae..168a1e45e9 100644 --- a/lily/clef-item.cc +++ b/lily/clef-item.cc @@ -20,16 +20,16 @@ void Clef_item::do_pre_processing() { translate_axis (y_position_i_ * staff_line_leading_f () / 2.0, Y_AXIS); - SCM style_sym =get_elt_property (style_scm_sym); + SCM style_sym =get_elt_property ("style"); String style; - if (style_sym != SCM_BOOL_F) - style = ly_scm2string (SCM_CDR(style_sym)); + if (style_sym != SCM_UNDEFINED) + style = ly_scm2string (style_sym); if (break_status_dir() != RIGHT && style != "fullSizeChanges") symbol_ += "_change"; if (style == "transparent") { - set_elt_property (transparent_scm_sym, SCM_BOOL_T); + set_elt_property ("transparent", SCM_BOOL_T); set_empty (true, X_AXIS); } } @@ -39,7 +39,7 @@ Clef_item::do_pre_processing() */ Clef_item::Clef_item() { - set_elt_property (breakable_scm_sym, SCM_BOOL_T); + set_elt_property ("breakable", SCM_BOOL_T); symbol_ = "treble"; y_position_i_ = -2; @@ -52,15 +52,15 @@ Clef_item::do_add_processing () { Text_item *g =0; - SCM octave_dir = remove_elt_property (octave_dir_scm_sym); - if (octave_dir != SCM_BOOL_F) + SCM octave_dir = remove_elt_property ("octave-dir"); + if (octave_dir != SCM_UNDEFINED) { - Direction d = Direction (gh_scm2int (SCM_CDR(octave_dir))); + Direction d = Direction (gh_scm2int (octave_dir)); g = new Text_item; pscore_l_->typeset_element (g); g->text_str_ = "8"; - g->set_elt_property (style_scm_sym, gh_str02scm ("italic")); + g->set_elt_property ("style", gh_str02scm ("italic")); g->set_parent (this, Y_AXIS); g->set_parent (this, X_AXIS); @@ -69,9 +69,9 @@ Clef_item::do_add_processing () Real r = do_height ()[d] - g->extent (Y_AXIS)[-d]; g->dim_cache_[Y_AXIS]->set_offset (r); - SCM my_vis = get_elt_property (visibility_lambda_scm_sym); - if (my_vis != SCM_BOOL_F) - g->set_elt_property (visibility_lambda_scm_sym, SCM_CDR (my_vis)); + SCM my_vis = get_elt_property ("visibility-lambda"); + if (my_vis != SCM_UNDEFINED) + g->set_elt_property ("visibility-lambda", my_vis); } @@ -87,3 +87,4 @@ Clef_item::do_brew_molecule_p() const + diff --git a/lily/collision.cc b/lily/collision.cc index c8e97cc998..0c08134b88 100644 --- a/lily/collision.cc +++ b/lily/collision.cc @@ -10,7 +10,7 @@ #include "note-column.hh" #include "note-head.hh" #include "paper-def.hh" -#include "ly-symbols.hh" + #include "tuple.hh" Collision::Collision() @@ -80,12 +80,12 @@ Collision::automatic_shift () for (int i=0; i < clashes.size (); i++) { SCM sh - = clashes[i]->remove_elt_property (horizontal_shift_scm_sym); + = clashes[i]->remove_elt_property ("horizontal-shift"); - if (sh == SCM_BOOL_F) - shift.push (0); + if (gh_number_p (sh)) + shift.push (gh_scm2int (sh)); else - shift.push (gh_scm2int (SCM_CDR (sh))); + shift.push (0); } for (int i=1; i < shift.size (); i++) @@ -178,12 +178,10 @@ Collision::forced_shift () for (int i=0; i < clash_l_arr_.size (); i++) { - SCM force = clash_l_arr_[i]->remove_elt_property (force_hshift_scm_sym); - if (force != SCM_BOOL_F) + SCM force = clash_l_arr_[i]->remove_elt_property ("force-hshift"); + if (force != SCM_UNDEFINED) { - force = SCM_CDR (force); - tups. push (Shift_tup (clash_l_arr_[i], - gh_scm2double (force))); + tups. push (Shift_tup (clash_l_arr_[i], gh_scm2double (force))); } } return tups; @@ -200,3 +198,4 @@ Collision::do_substitute_element_pointer (Score_element*o_l,Score_element*n_l) } } + diff --git a/lily/crescendo.cc b/lily/crescendo.cc index 01f2ba5a77..c570a2b153 100644 --- a/lily/crescendo.cc +++ b/lily/crescendo.cc @@ -27,7 +27,7 @@ Molecule Crescendo::get_symbol () const { Real w_dim = extent (X_AXIS).length () - get_broken_left_end_align (); - Real absdyn_dim = paper_l ()-> get_realvar (ly_symbol ("crescendo_shorten")); + Real absdyn_dim = paper_l ()-> get_var ("crescendo_shorten"); if (dyn_b_drul_[LEFT]) { w_dim -= absdyn_dim; @@ -62,7 +62,7 @@ Molecule* Crescendo::do_brew_molecule_p () const { Molecule* m_p =0; - Real absdyn_dim = paper_l ()-> get_realvar (ly_symbol ("crescendo_shorten")); + Real absdyn_dim = paper_l ()-> get_var ("crescendo_shorten"); Real x_off_dim = get_broken_left_end_align (); if (dyn_b_drul_[LEFT]) diff --git a/lily/dots.cc b/lily/dots.cc index c125ffcd42..43dac77057 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -29,7 +29,7 @@ Dots::do_post_processing () if (!dots_i_) { - set_elt_property (transparent_scm_sym, SCM_BOOL_T); + set_elt_property ("transparent", SCM_BOOL_T); set_empty (true, X_AXIS, Y_AXIS); } } @@ -56,3 +56,4 @@ Dots::do_brew_molecule_p () const } + diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 93dc2e7d5a..ce2c068c64 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -116,7 +116,7 @@ Dynamic_engraver::do_process_requests() text_p_->text_str_ = loud; // ugh staff_side_p_ = new Staff_side_item; - staff_side_p_->set_elt_property (script_priority_scm_sym, + staff_side_p_->set_elt_property ("script-priority", gh_int2scm (100)); staff_side_p_->set_victim (text_p_); @@ -143,7 +143,7 @@ Dynamic_engraver::do_process_requests() prop = get_property ("dynamicPadding", 0); if (gh_number_p(prop)) { - staff_side_p_->set_elt_property (padding_scm_sym, prop); + staff_side_p_->set_elt_property ("padding", prop); } announce_element (Score_element_info (text_p_, absd)); announce_element (Score_element_info (staff_side_p_, absd)); @@ -182,7 +182,7 @@ Dynamic_engraver::do_process_requests() prop = get_property ("dynamicPadding", 0); if (gh_number_p(prop)) { - to_end_ss_span_p_->set_elt_property (padding_scm_sym,prop); + to_end_ss_span_p_->set_elt_property ("padding",prop); } } } @@ -198,7 +198,7 @@ Dynamic_engraver::do_process_requests() new_sss_p->set_victim (new_cresc_p); new_sss_p->axis_ = Y_AXIS; // UGH.! - // new_sss_p->set_elt_property (dangling_scm_sym, SCM_BOOL_T); + // new_sss_p->set_elt_property ("dangling", SCM_BOOL_T); announce_element (Score_element_info (new_sss_p, span_l)); } } @@ -293,3 +293,4 @@ Dynamic_engraver::acknowledge_element (Score_element_info i) ss_span_p_->add_support (i.elem_l_); } } + diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index 0e0ea46f4b..130f1a0821 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -182,13 +182,14 @@ Gourlay_breaking::combine_demerits (Column_x_positions const &prev, Paper_column * pc = this_one.cols_.top (); if (pc->original_l_) { - SCM pen = pc->get_elt_property (penalty_scm_sym); - if (pen != SCM_BOOL_F) + SCM pen = pc->get_elt_property ("penalty"); + if (pen != SCM_UNDEFINED) { - break_penalties += gh_scm2double (SCM_CDR(pen)); + break_penalties += gh_scm2double (pen); } } return abs (this_one.force_f_) + abs (prev.force_f_ - this_one.force_f_) + break_penalties; } + diff --git a/lily/grace-align-item.cc b/lily/grace-align-item.cc index 4da8f4b6b5..49739fdad7 100644 --- a/lily/grace-align-item.cc +++ b/lily/grace-align-item.cc @@ -22,7 +22,7 @@ Grace_align_item::do_pre_processing () { Real nhw = lookup_l ()->notehead (2, "").dim_[X_AXIS].length(); threshold_interval_[MIN] = nhw* 1.5; - column_l ()->set_elt_property (contains_grace_scm_sym, SCM_BOOL_T); + column_l ()->set_elt_property ("contains-grace", SCM_BOOL_T); Axis_align_item::do_pre_processing (); @@ -41,3 +41,4 @@ void Grace_align_item::do_add_processing () { } + diff --git a/lily/grace-engraver-group.cc b/lily/grace-engraver-group.cc index 6c7547362d..cb99415a2b 100644 --- a/lily/grace-engraver-group.cc +++ b/lily/grace-engraver-group.cc @@ -8,7 +8,7 @@ */ #include "grace-engraver-group.hh" #include "lily-guile.hh" -#include "ly-symbols.hh" + #include "score-element.hh" #include "musical-request.hh" @@ -50,7 +50,7 @@ Grace_engraver_group::announce_element (Score_element_info inf) // do not propagate to top announce_to_top_.push (inf); - inf.elem_l_->set_elt_property (grace_scm_sym, SCM_BOOL_T); + inf.elem_l_->set_elt_property ("grace", SCM_BOOL_T); } void @@ -121,3 +121,4 @@ Grace_engraver_group::pass_to_top_b (Music *m) const } return false; } + diff --git a/lily/grace-performer-group.cc b/lily/grace-performer-group.cc index 004c7a4923..da7b622c3f 100644 --- a/lily/grace-performer-group.cc +++ b/lily/grace-performer-group.cc @@ -8,7 +8,7 @@ */ #include "grace-performer-group.hh" #include "lily-guile.hh" -#include "ly-symbols.hh" + #include "audio-element.hh" ADD_THIS_TRANSLATOR (Grace_performer_group); @@ -51,7 +51,7 @@ Grace_performer_group::announce_element (Audio_element_info info) // do not propagate to top announce_to_top_.push (info); - //inf.elem_l_->set_elt_property (grace_scm_sym, SCM_BOOL_T); + //inf.elem_l_->set_elt_property ("grace", SCM_BOOL_T); info.elem_l_->grace_b_ = true; } @@ -109,3 +109,4 @@ Grace_performer_group::do_try_music (Music *m) return hebbes_b; } + diff --git a/lily/grace-position-engraver.cc b/lily/grace-position-engraver.cc index 843801274a..d45ea19b34 100644 --- a/lily/grace-position-engraver.cc +++ b/lily/grace-position-engraver.cc @@ -45,12 +45,12 @@ Grace_position_engraver::acknowledge_element (Score_element_info i) } else if (Note_head * n = dynamic_cast (i.elem_l_)) { - if (n->get_elt_property (grace_scm_sym) == SCM_BOOL_F) + if (n->get_elt_property ("grace") == SCM_UNDEFINED) support_.push (n); } else if (Local_key_item*it = dynamic_cast(i.elem_l_)) { - if (it->get_elt_property (grace_scm_sym) == SCM_BOOL_F) + if (it->get_elt_property ("grace") == SCM_UNDEFINED) support_.push (it); else if (align_l_) it->add_dependency (align_l_); @@ -106,3 +106,4 @@ Grace_position_engraver::do_post_move_processing () } ADD_THIS_TRANSLATOR(Grace_position_engraver); + diff --git a/lily/hara-kiri-vertical-group-spanner.cc b/lily/hara-kiri-vertical-group-spanner.cc index 4b09a5d8a7..9ea5c23de1 100644 --- a/lily/hara-kiri-vertical-group-spanner.cc +++ b/lily/hara-kiri-vertical-group-spanner.cc @@ -37,7 +37,7 @@ Hara_kiri_group_spanner::do_post_processing () if ( line_l () != s->line_l ()) programming_error ("Killing other children too"); - s->set_elt_property (transparent_scm_sym, SCM_BOOL_T); + s->set_elt_property ("transparent", SCM_BOOL_T); s->set_empty (true, X_AXIS, Y_AXIS); } @@ -58,3 +58,4 @@ Hara_kiri_group_spanner::do_print () const { Axis_group_spanner::do_print (); } + diff --git a/lily/include/score-element.hh b/lily/include/score-element.hh index c9b1a30188..55fe6efa2b 100644 --- a/lily/include/score-element.hh +++ b/lily/include/score-element.hh @@ -70,9 +70,9 @@ public: /* properties */ - SCM get_elt_property (SCM sym) const; - void set_elt_property (SCM sym, SCM val); - SCM remove_elt_property (SCM key); + SCM get_elt_property (String nm) const; + void set_elt_property (String, SCM val); + SCM remove_elt_property (String nm); /* related classes. diff --git a/lily/item.cc b/lily/item.cc index e8ea0357df..eba020f52b 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -26,7 +26,7 @@ Item::breakable_b () const return false; Item * i =dynamic_cast (parent_l (X_AXIS)); - return (i) ? i->breakable_b () : get_elt_property( breakable_scm_sym) != SCM_BOOL_F; + return (i) ? i->breakable_b () : get_elt_property( "breakable") != SCM_UNDEFINED; } void @@ -82,18 +82,18 @@ Item::copy_breakable_items() void Item::try_visibility_lambda () { - SCM vis = remove_elt_property (visibility_lambda_scm_sym); - if (vis != SCM_BOOL_F) + SCM vis = remove_elt_property ("visibility-lambda"); + if (vis != SCM_UNDEFINED) { SCM args = scm_listify (gh_int2scm (break_status_dir ()), SCM_UNDEFINED); - SCM result = gh_apply ( SCM_CDR(vis), args); + SCM result = gh_apply (vis, args); int trans = gh_scm2bool (gh_car (result)); int empty = gh_scm2bool (gh_cdr (result)); if (empty) set_empty (true, X_AXIS, Y_AXIS); if (trans) - set_elt_property (transparent_scm_sym, SCM_BOOL_T); + set_elt_property ("transparent", SCM_BOOL_T); } } @@ -227,3 +227,4 @@ Item::break_status_dir () const return CENTER; } + diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index 6e571d4fcb..e5c53f74f8 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -33,7 +33,7 @@ Key_engraver::create_key () if (!item_p_) { item_p_ = new Key_item; - item_p_->set_elt_property (break_priority_scm_sym, gh_int2scm(-1)); // ugh + item_p_->set_elt_property ("break-priority", gh_int2scm(-1)); // ugh item_p_->multi_octave_b_ = key_.multi_octave_b_; announce_element (Score_element_info (item_p_,keyreq_l_)); @@ -91,7 +91,7 @@ Key_engraver::acknowledge_element (Score_element_info info) create_key (); if (def) { - item_p_->set_elt_property (visibility_lambda_scm_sym, + item_p_->set_elt_property ("visibility-lambda", ly_ch_C_eval_scm ("postbreak_only_visibility")); } } @@ -195,3 +195,4 @@ Key_engraver::do_post_move_processing () } ADD_THIS_TRANSLATOR (Key_engraver); + diff --git a/lily/lyric-engraver.cc b/lily/lyric-engraver.cc index f6b61316fa..7227f51f83 100644 --- a/lily/lyric-engraver.cc +++ b/lily/lyric-engraver.cc @@ -44,7 +44,7 @@ Lyric_engraver::do_process_requests() text_p_->text_str_ = req_l_->text_str_; text_p_->text_str_ += " "; // ugh. - text_p_->set_elt_property (non_rhythmic_scm_sym, SCM_BOOL_T); + text_p_->set_elt_property ("non-rhythmic", SCM_BOOL_T); announce_element (Score_element_info (text_p_, req_l_)); } @@ -66,3 +66,4 @@ Lyric_engraver::do_post_move_processing () req_l_ =0; } + diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 1254eb4c6b..95f7040bc7 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -74,10 +74,10 @@ Multi_measure_rest::do_brew_molecule_p () const Molecule s; bool rest_symbol=true; - SCM alt_symbol_sym =get_elt_property (alt_symbol_scm_sym); - if (alt_symbol_sym != SCM_BOOL_F) + SCM alt_symbol_sym =get_elt_property ("alt-symbol"); + if (alt_symbol_sym != SCM_UNDEFINED) { - s = lookup_l () -> afm_find (ly_scm2string (SCM_CDR(alt_symbol_sym))); + s = lookup_l () -> afm_find (ly_scm2string (alt_symbol_sym)); rest_symbol = false; } else if (measures_i_ == 1 || measures_i_ == 2 || measures_i_ == 4) @@ -120,7 +120,7 @@ void Multi_measure_rest::do_post_processing () { if (!column_arr_.size ()) - set_elt_property (transparent_scm_sym, SCM_BOOL_T); + set_elt_property ("transparent", SCM_BOOL_T); } @@ -180,3 +180,4 @@ Multi_measure_rest::get_rods () const return a; } + diff --git a/lily/music-output-def.cc b/lily/music-output-def.cc index d355840d24..c05534131b 100644 --- a/lily/music-output-def.cc +++ b/lily/music-output-def.cc @@ -39,6 +39,7 @@ Music_output_def::Music_output_def (Music_output_def const &s) { scope_p_ = new Scope (*s.scope_p_); translator_p_dict_p_ = new Scope (*s.translator_p_dict_p_); + default_properties_ = s.default_properties_; for (Scope_iter i (*translator_p_dict_p_); i.ok (); i++) { @@ -102,10 +103,11 @@ Music_output_def::print () const String Music_output_def::get_default_output () const { - if (safe_global_b || !scope_p_->elem_b (output_scm_sym)) + if (safe_global_b || !scope_p_->elem_b ("output")) return ""; - Identifier * id = scope_p_->elem (output_scm_sym); + Identifier * id = scope_p_->elem ("output"); String *p = id->access_content_String (false); return p ? *p : String (""); } + diff --git a/lily/note-column.cc b/lily/note-column.cc index accc399bd7..c592d92ce5 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -23,11 +23,11 @@ Note_column::rest_b () const int Note_column::shift_compare (Note_column *const &p1, Note_column*const&p2) { - SCM s1 = p1->get_elt_property (horizontal_shift_scm_sym); - SCM s2 = p2->get_elt_property (horizontal_shift_scm_sym); + SCM s1 = p1->get_elt_property ("horizontal-shift"); + SCM s2 = p2->get_elt_property ("horizontal-shift"); - int h1 = (s1 == SCM_BOOL_F) ? 0 : gh_scm2int (SCM_CDR(s1)); - int h2 = (s2 == SCM_BOOL_F) ? 0 : gh_scm2int (SCM_CDR(s2)); + int h1 = (s1 == SCM_UNDEFINED) ? 0 : gh_scm2int (s1); + int h2 = (s2 == SCM_UNDEFINED) ? 0 : gh_scm2int (s2); return h1 - h2; } @@ -184,3 +184,4 @@ Note_column::do_post_processing () translate_rests (-d * discrete_dist); } + diff --git a/lily/note-head.cc b/lily/note-head.cc index 3c13d1ae1c..faad356297 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -67,10 +67,10 @@ Note_head::do_brew_molecule_p() const String type; - SCM style =get_elt_property (style_scm_sym); - if (style != SCM_BOOL_F) + SCM style =get_elt_property ("style"); + if (style != SCM_UNDEFINED) { - type = ly_scm2string (SCM_CDR(style)); + type = ly_scm2string (style); } Molecule* out = new Molecule (lookup_l()->notehead (balltype_i_, type)); @@ -101,3 +101,4 @@ Note_head::do_brew_molecule_p() const out->dim_ = b; return out; } + diff --git a/lily/note-heads-engraver.cc b/lily/note-heads-engraver.cc index 92c4b7ef98..d23ee6e806 100644 --- a/lily/note-heads-engraver.cc +++ b/lily/note-heads-engraver.cc @@ -79,7 +79,7 @@ Note_heads_engraver::do_process_requests() if (gh_string_p (noteheadstyle)) { - note_p->set_elt_property (style_scm_sym, noteheadstyle); + note_p->set_elt_property ("style", noteheadstyle); } Score_element_info itinf (note_p,note_req_l); @@ -116,3 +116,4 @@ Note_heads_engraver::do_post_move_processing() ADD_THIS_TRANSLATOR(Note_heads_engraver); + diff --git a/lily/paper-def.cc b/lily/paper-def.cc index ead9c06ae5..39b8fcf165 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -81,7 +81,7 @@ Paper_def::line_dimensions_int (int n) const { if (!shape_int_a_.size ()) { - Real lw = get_realvar (linewidth_scm_sym); + Real lw = get_var ("linewidth"); Real ind = n? 0.0:get_var ("indent"); return Interval (ind, lw); @@ -137,9 +137,9 @@ Real Paper_def::interbeam_f (int multiplicity_i) const { if (multiplicity_i <= 3) - return get_realvar (interbeam_scm_sym); + return get_var ("interbeam"); else - return get_realvar (interbeam4_scm_sym); + return get_var ("interbeam4"); } @@ -239,3 +239,4 @@ Paper_def::base_output_str () const return str; } + diff --git a/lily/paper-score.cc b/lily/paper-score.cc index d8cba19d43..12eacc3071 100644 --- a/lily/paper-score.cc +++ b/lily/paper-score.cc @@ -50,7 +50,7 @@ Paper_score::typeset_element (Score_element * elem_p) SCM_CDR(element_smob_list_) = gh_cons (elem_p->self_scm_, SCM_CDR (element_smob_list_)); - elem_p->set_elt_property (ly_symbol ("full-name"), + elem_p->set_elt_property ("full-name", gh_str02scm((char*)elem_p->name())); scm_unprotect_object (elem_p->self_scm_); diff --git a/lily/property-engraver.cc b/lily/property-engraver.cc index 1ff12820ff..268969759b 100644 --- a/lily/property-engraver.cc +++ b/lily/property-engraver.cc @@ -60,14 +60,17 @@ Property_engraver::apply_properties (SCM p, Score_element *e) SCM type_p = gh_cadr (entry); SCM elt_prop_name = gh_caddr (entry); - if (e->get_elt_property (elt_prop_name) != SCM_BOOL_F) + /* + urg scm <-> symbol-string + */ + if (e->get_elt_property (ly_scm2string (elt_prop_name)) != SCM_UNDEFINED) continue; SCM val = get_property (prop_sym, 0); if (val != SCM_UNDEFINED && gh_apply (type_p, scm_listify (val, SCM_UNDEFINED)) == SCM_BOOL_T) - e->set_elt_property (elt_prop_name, val); + e->set_elt_property (ly_scm2string (elt_prop_name), val); } } diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index e3e189315a..52c0149bce 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -137,6 +137,7 @@ Rest_collision::do_substitute_element_pointer (Score_element*o,Score_element*n) Rest_collision::Rest_collision() { - set_elt_property (transparent_scm_sym, SCM_BOOL_T); + set_elt_property ("transparent", SCM_BOOL_T); set_empty (true, X_AXIS, Y_AXIS); } + diff --git a/lily/rest.cc b/lily/rest.cc index 14e10a3537..7a3e5fab03 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -51,10 +51,10 @@ Rest::do_brew_molecule_p () const String style; - SCM style_sym =get_elt_property (style_scm_sym); - if (balltype_i_ >= 2 && style_sym != SCM_BOOL_F) + SCM style_sym =get_elt_property ("style"); + if (balltype_i_ >= 2 && style_sym != SCM_UNDEFINED) { - style = ly_scm2string (SCM_CDR(style_sym)); + style = ly_scm2string (style_sym); } Molecule s(lookup_l ()->rest (balltype_i_, ledger_b, style)); @@ -64,3 +64,4 @@ Rest::do_brew_molecule_p () const } + diff --git a/lily/rhythmic-column-engraver.cc b/lily/rhythmic-column-engraver.cc index 5862e6f790..6c31e63337 100644 --- a/lily/rhythmic-column-engraver.cc +++ b/lily/rhythmic-column-engraver.cc @@ -74,7 +74,7 @@ Rhythmic_column_engraver::acknowledge_element (Score_element_info i) SCM wg = get_property ("weAreGraceContext",0); bool wegrace = gh_boolean_p (wg) && gh_scm2bool (wg); if ((wegrace != - (i.elem_l_->get_elt_property (grace_scm_sym) != SCM_BOOL_F)) + (i.elem_l_->get_elt_property ("grace") != SCM_UNDEFINED)) && !dynamic_cast (i.elem_l_)) return ; @@ -97,7 +97,7 @@ Rhythmic_column_engraver::acknowledge_element (Score_element_info i) end slurs starting on grace notes */ - if (s->get_elt_property (grace_scm_sym) != SCM_BOOL_F) + if (s->get_elt_property ("grace") != SCM_UNDEFINED) grace_slur_endings_.push (s); } } @@ -121,3 +121,4 @@ Rhythmic_column_engraver::do_post_move_processing() } ADD_THIS_TRANSLATOR(Rhythmic_column_engraver); + diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index be6dd2417f..83d2c47eef 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -33,7 +33,7 @@ Score_engraver::prepare (Moment w) Global_translator::prepare (w); set_columns (new Score_column (w), new Score_column (w)); - command_column_l_->set_elt_property (breakable_scm_sym, SCM_BOOL_T); + command_column_l_->set_elt_property ("breakable", SCM_BOOL_T); post_move_processing(); } @@ -57,7 +57,7 @@ Score_engraver::do_creation_processing () scoreline_l_->set_bounds(LEFT, command_column_l_); - command_column_l_->set_elt_property (breakable_scm_sym, SCM_BOOL_T); + command_column_l_->set_elt_property ("breakable", SCM_BOOL_T); Engraver_group_engraver::do_creation_processing(); } @@ -68,7 +68,7 @@ Score_engraver::do_removal_processing() { Engraver_group_engraver::do_removal_processing(); scoreline_l_->set_bounds(RIGHT,command_column_l_); - command_column_l_->set_elt_property (breakable_scm_sym, SCM_BOOL_T); + command_column_l_->set_elt_property ("breakable", SCM_BOOL_T); typeset_all (); set_columns (0,0); @@ -122,15 +122,6 @@ Score_engraver::typeset_all() Score_element * elem_p = elem_p_arr_[i]; elem_p->add_processing (); -#if 0 // TODO! - /* - elem_p wants to be connected to the rest of the - dependency graph. - */ - - if (elem_p->get_elt_property (dangling_scm_sym) != SCM_BOOL_F) - scoreline_l_->add_dependency (elem_p); -#endif if (Spanner *s = dynamic_cast (elem_p)) { @@ -153,7 +144,7 @@ Score_engraver::typeset_all() if (!item_p->parent_l (X_AXIS)) { - bool br = (item_p->remove_elt_property (breakable_scm_sym) != SCM_BOOL_F); + bool br = (item_p->remove_elt_property ("breakable") != SCM_UNDEFINED); if (br) command_column_l_->add_element(item_p); else @@ -169,7 +160,7 @@ Score_engraver::typeset_all() void Score_engraver::do_pre_move_processing() { - if (command_column_l_->get_elt_property (breakable_scm_sym) != SCM_BOOL_F) + if (command_column_l_->get_elt_property ("breakable") != SCM_UNDEFINED) { breaks_i_ ++; if (! (breaks_i_%8)) @@ -243,16 +234,16 @@ Score_engraver::do_try_music (Music*r) gotcha = true; - SCM pen = command_column_l_->get_elt_property (penalty_scm_sym); - Real total_penalty = (pen == SCM_BOOL_F) + SCM pen = command_column_l_->get_elt_property ("penalty"); + Real total_penalty = (pen == SCM_UNDEFINED) ? 0.0 - : gh_scm2double (SCM_CDR(pen)); // ugh. Should typecheck. + : gh_scm2double(pen); // ugh. Should typecheck. total_penalty += b->penalty_f_; if (b->penalty_f_ > 10000.0) // ugh. arbitrary. forbid_breaks (); - command_column_l_->set_elt_property (penalty_scm_sym, + command_column_l_->set_elt_property ("penalty", gh_double2scm (total_penalty)); } } @@ -265,7 +256,7 @@ Score_engraver::forbid_breaks () /* result is junked. */ - command_column_l_->remove_elt_property (breakable_scm_sym); + command_column_l_->remove_elt_property ("breakable"); } ADD_THIS_TRANSLATOR(Score_engraver); @@ -279,3 +270,4 @@ Score_engraver::do_add_processing () pscore_p_ = new Paper_score; pscore_p_->paper_l_ = dynamic_cast(output_def_l_); } + diff --git a/lily/score-priority-engraver.cc b/lily/score-priority-engraver.cc index c72a60d01f..a182c7a7d5 100644 --- a/lily/score-priority-engraver.cc +++ b/lily/score-priority-engraver.cc @@ -44,8 +44,8 @@ Score_priority_engraver::acknowledge_element (Score_element_info inf) if (item_l->empty_b (X_AXIS) || item_l->parent_l (X_AXIS)) return; - SCM bp=item_l->remove_elt_property (breakable_scm_sym); - bool breakable = (bp != SCM_BOOL_F); + SCM bp=item_l->remove_elt_property ("breakable"); + bool breakable = (bp != SCM_UNDEFINED); if (!breakable) return ; @@ -53,7 +53,7 @@ Score_priority_engraver::acknowledge_element (Score_element_info inf) if (!halign_p_) { halign_p_ = new Break_align_item; - halign_p_->set_elt_property (breakable_scm_sym, SCM_BOOL_T); + halign_p_->set_elt_property ("breakable", SCM_BOOL_T); announce_element (Score_element_info (halign_p_,0)); } @@ -62,3 +62,4 @@ Score_priority_engraver::acknowledge_element (Score_element_info inf) } ADD_THIS_TRANSLATOR(Score_priority_engraver); + diff --git a/lily/script-column.cc b/lily/script-column.cc index cc38a6eae8..c5a0ec1144 100644 --- a/lily/script-column.cc +++ b/lily/script-column.cc @@ -21,8 +21,8 @@ get_Staff_side (Item *i) void Script_column::add_staff_sided (Item *i) { - SCM p = get_Staff_side (i)->get_elt_property (script_priority_scm_sym); - if (p == SCM_BOOL_F) + SCM p = get_Staff_side (i)->get_elt_property ("script-priority"); + if (p == SCM_UNDEFINED) return; staff_sided_item_l_arr_.push (i); @@ -36,10 +36,10 @@ staff_side_compare (Item * const &i1, Score_element *e1 = get_Staff_side (i1); Score_element *e2 = get_Staff_side (i2); - SCM p1 = e1->get_elt_property (script_priority_scm_sym); - SCM p2 = e2->get_elt_property (script_priority_scm_sym); + SCM p1 = e1->get_elt_property ("script-priority"); + SCM p2 = e2->get_elt_property ("script-priority"); - return gh_scm2int (SCM_CDR(p1)) - gh_scm2int (SCM_CDR(p2)); + return gh_scm2int (p1) - gh_scm2int (p2); } void @@ -69,9 +69,10 @@ Script_column::do_pre_processing () gs->add_support (get_Staff_side (last)); } - gs->remove_elt_property (script_priority_scm_sym); + gs->remove_elt_property ("script-priority"); last = arr[i]; } } while (flip (&d) != DOWN); } + diff --git a/lily/script-engraver.cc b/lily/script-engraver.cc index f7657e676f..58bff60dde 100644 --- a/lily/script-engraver.cc +++ b/lily/script-engraver.cc @@ -51,9 +51,9 @@ Script_engraver::do_process_requests() } Script *p =new Script; Stem_staff_side_item * ss =new Stem_staff_side_item; - list = SCM_CDR (list); - - p->set_elt_property (molecule_scm_sym, + + list = gh_cdr (list); + p->set_elt_property ("molecule", SCM_CAR(list)); list = SCM_CDR(list); @@ -80,7 +80,7 @@ Script_engraver::do_process_requests() SCM paddingprop = get_property ("articulationScriptPadding", 0); if (gh_number_p(paddingprop)) { - ss->set_elt_property (padding_scm_sym, paddingprop); + ss->set_elt_property ("padding", paddingprop); } SCM axisprop = get_property ("scriptHorizontal",0); @@ -88,12 +88,12 @@ Script_engraver::do_process_requests() ss->axis_ = X_AXIS; if (follow_staff && !gh_boolean_p (axisprop) && gh_scm2bool (axisprop)) - ss->set_elt_property (no_staff_support_scm_sym, SCM_BOOL_T); + ss->set_elt_property ("no-staff-support", SCM_BOOL_T); p->set_staff_side (ss); - ss->set_elt_property (script_priority_scm_sym, priority); + ss->set_elt_property ("script-priority", priority); if (gh_number_p (paddingprop)) - ss->set_elt_property (padding_scm_sym, paddingprop); + ss->set_elt_property ("padding", paddingprop); script_p_arr_.push (p); @@ -155,3 +155,4 @@ Script_engraver::do_post_move_processing() ADD_THIS_TRANSLATOR(Script_engraver); + diff --git a/lily/script.cc b/lily/script.cc index 3bc415d077..4e10621df9 100644 --- a/lily/script.cc +++ b/lily/script.cc @@ -36,19 +36,18 @@ Script::do_substitute_element_pointer (Score_element*o, Score_element*n) Molecule Script::get_molecule(Direction d) const { - SCM s = get_elt_property (molecule_scm_sym); - assert (s != SCM_BOOL_F); + SCM s = get_elt_property ("molecule"); + assert (s != SCM_UNDEFINED); - s = SCM_CDR(s); SCM key = SCM_CAR (s); if (key == ly_symbol ("feta")) { return lookup_l ()->afm_find ("scripts-" + - ly_scm2string (index_cell (SCM_CDR (s), d))); + ly_scm2string (index_cell (gh_cdr (s), d))); } else if (key == ly_symbol ("accordion")) { - return lookup_l ()->accordion (SCM_CDR(s), paper_l()->get_realvar(interline_scm_sym)); + return lookup_l ()->accordion (s, paper_l()->get_var("interline")); } else assert (false); @@ -76,7 +75,7 @@ Script::do_post_processing () /* UGH UGH UGH */ - if (staff_side_l_->get_elt_property (no_staff_support_scm_sym) == SCM_BOOL_F) + if (staff_side_l_->get_elt_property ("no-staff-support") == SCM_UNDEFINED) translate_axis (- m.dim_[Y_AXIS][Direction (-d)], Y_AXIS); } @@ -99,3 +98,4 @@ Script::do_print () const { } + diff --git a/lily/separating-line-group-engraver.cc b/lily/separating-line-group-engraver.cc index 41be6e3180..797ecfd76f 100644 --- a/lily/separating-line-group-engraver.cc +++ b/lily/separating-line-group-engraver.cc @@ -60,7 +60,7 @@ Separating_line_group_engraver::acknowledge_element (Score_element_info i) { p_ref_ = new Single_malt_grouping_item; if (ib) - p_ref_->set_elt_property (breakable_scm_sym, SCM_BOOL_T); + p_ref_->set_elt_property ("breakable", SCM_BOOL_T); announce_element (Score_element_info (p_ref_, 0)); } p_ref_->add_item (it); @@ -88,3 +88,4 @@ Separating_line_group_engraver::do_pre_move_processing () ADD_THIS_TRANSLATOR( Separating_line_group_engraver); + diff --git a/lily/single-malt-grouping-item.cc b/lily/single-malt-grouping-item.cc index 90227b09b2..39fcd793aa 100644 --- a/lily/single-malt-grouping-item.cc +++ b/lily/single-malt-grouping-item.cc @@ -13,7 +13,7 @@ Single_malt_grouping_item ::Single_malt_grouping_item() { - set_elt_property (transparent_scm_sym, SCM_BOOL_T); + set_elt_property ("transparent", SCM_BOOL_T); // this is weird! , but needed! set_empty (true, X_AXIS, Y_AXIS); @@ -78,3 +78,4 @@ Single_malt_grouping_item::do_print () const } #endif } + diff --git a/lily/slur.cc b/lily/slur.cc index 8f04b9fa76..349dbd34d1 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -154,7 +154,7 @@ Slur::do_post_processing () y = length >= 5ss : y next interline - d * 0.25 ss */ - Real interline_f = paper_l ()->get_realvar (interline_scm_sym); + Real interline_f = paper_l ()->get_var ("interline"); Real internote_f = interline_f / 2; Real x_gap_f = paper_l ()->get_var ("slur_x_gap"); @@ -510,3 +510,4 @@ Slur::get_rods () const return a; } + diff --git a/lily/spacing-engraver.cc b/lily/spacing-engraver.cc index 8b6b4c893d..e8a5e38292 100644 --- a/lily/spacing-engraver.cc +++ b/lily/spacing-engraver.cc @@ -52,10 +52,10 @@ Spacing_engraver::do_removal_processing () void Spacing_engraver::acknowledge_element (Score_element_info i) { - if (i.elem_l_->get_elt_property (grace_scm_sym) != SCM_BOOL_F) + if (i.elem_l_->get_elt_property ("grace") != SCM_UNDEFINED) return; - if (i.elem_l_->get_elt_property (non_rhythmic_scm_sym) != SCM_BOOL_F) + if (i.elem_l_->get_elt_property ("non-rhythmic") != SCM_UNDEFINED) return; if (Rhythmic_req * r = dynamic_cast(i.req_l_)) @@ -112,3 +112,4 @@ Spacing_engraver::do_post_move_processing () ADD_THIS_TRANSLATOR(Spacing_engraver); + diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index 967783c294..cb7eb9b4d4 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -17,7 +17,7 @@ Spacing_spanner::Spacing_spanner () { - set_elt_property (transparent_scm_sym, SCM_BOOL_T); + set_elt_property ("transparent", SCM_BOOL_T); } int @@ -89,17 +89,15 @@ Spacing_spanner::do_measure (int col1, int col2) const s.item_l_drul_[LEFT] = lc; s.item_l_drul_[RIGHT] = rc; - SCM hint = lc->get_elt_property (extra_space_scm_sym); - SCM next_hint = rc->get_elt_property (extra_space_scm_sym); - SCM stretch_hint = lc->get_elt_property (stretch_distance_scm_sym); - SCM next_stretch_hint = rc->get_elt_property (stretch_distance_scm_sym); + SCM hint = lc->get_elt_property ("extra-space"); + SCM next_hint = rc->get_elt_property ("extra-space"); + SCM stretch_hint = lc->get_elt_property ("stretch-distance"); + SCM next_stretch_hint = rc->get_elt_property ("stretch-distance"); Real left_distance; - if (hint != SCM_BOOL_F) + if (hint != SCM_UNDEFINED) { - hint = SCM_CDDR (hint); - - left_distance = gh_scm2double (hint); + left_distance = gh_scm2double (gh_cdr (hint)); } else if (!lc->musical_b() && i+1 < col_count()) { @@ -126,10 +124,9 @@ Spacing_spanner::do_measure (int col1, int col2) const Real right_dist = 0.0; - if (next_hint != SCM_BOOL_F) + if (next_hint != SCM_UNDEFINED) { - next_hint = SCM_CADR(next_hint); - right_dist += - gh_scm2double (next_hint); + right_dist += - gh_scm2double (gh_car (next_hint)); } else { @@ -142,25 +139,25 @@ Spacing_spanner::do_measure (int col1, int col2) const */ if (lc->musical_b () && rc->musical_b ()) { - if (rc->get_elt_property (contains_grace_scm_sym) == SCM_BOOL_F) + if (rc->get_elt_property ("contains-grace") == SCM_UNDEFINED) right_dist *= paper_l ()->get_var ("musical_to_musical_left_spacing_factor"); } - if (rc->musical_b () && rc->get_elt_property (contains_grace_scm_sym) != SCM_BOOL_F) + if (rc->musical_b () && rc->get_elt_property ("contains-grace") != SCM_UNDEFINED) right_dist *= paper_l ()->get_var ("before_grace_spacing_factor"); s.distance_f_ = left_distance + right_dist; Real stretch_dist = 0.; - if (stretch_hint != SCM_BOOL_F) - stretch_dist += gh_scm2double (SCM_CDDR (stretch_hint)); + if (gh_number_p (stretch_hint)) + stretch_dist += gh_scm2double (stretch_hint); else stretch_dist += left_distance; - if (next_stretch_hint != SCM_BOOL_F) + if (next_stretch_hint != SCM_UNDEFINED) // see regtest spacing-tight - stretch_dist += - gh_scm2double (SCM_CADR (next_stretch_hint)); + stretch_dist += - gh_scm2double (SCM_CAR (next_stretch_hint)); else stretch_dist += right_dist; @@ -251,13 +248,11 @@ Spacing_spanner::note_spacing (Score_column *lc, Score_column *rc, Moment shorte Real Spacing_spanner::stem_dir_correction (Score_column*l, Score_column*r) const { - SCM dl = l->get_elt_property (dir_list_scm_sym); - SCM dr = r->get_elt_property (dir_list_scm_sym); - if (dl == SCM_BOOL_F || dr == SCM_BOOL_F) + SCM dl = l->get_elt_property ("dir-list"); + SCM dr = r->get_elt_property ("dir-list"); + if (dl == SCM_UNDEFINED || dr == SCM_UNDEFINED) return 0.0; - dl = SCM_CDR (dl); - dr = SCM_CDR (dr); if (scm_ilength (dl) != 1 && scm_ilength (dr) != 1) return 0.; @@ -315,3 +310,4 @@ Spacing_spanner::get_springs () const + diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 02c7c29e3b..fe85a4e6b6 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -60,13 +60,13 @@ Span_bar::evaluate_empty () { if (spanning_l_arr_.size () < 1) { - set_elt_property (transparent_scm_sym, SCM_BOOL_T); + set_elt_property ("transparent", SCM_BOOL_T); set_empty (true, X_AXIS, Y_AXIS); } if (type_str_.empty_b ()) { - set_elt_property (transparent_scm_sym, SCM_BOOL_T); + set_elt_property ("transparent", SCM_BOOL_T); set_empty (true); } else if (type_str_ == "|:") @@ -127,3 +127,4 @@ Span_bar::Span_bar () { type_str_ = ""; } + diff --git a/lily/span-score-bar-engraver.cc b/lily/span-score-bar-engraver.cc index 3b18cfa127..1c6a21541c 100644 --- a/lily/span-score-bar-engraver.cc +++ b/lily/span-score-bar-engraver.cc @@ -17,7 +17,7 @@ Span_score_bar_engraver::get_span_bar_p () const { Span_bar*s = new Span_bar; s->type_str_ = "scorebar"; - s->set_elt_property (break_priority_scm_sym, + s->set_elt_property ("break-priority", gh_int2scm (-4)); return s; @@ -55,7 +55,7 @@ Staff_group_bar_engraver::acknowledge_element (Score_element_info i) if (Span_bar * b = dynamic_cast (i.elem_l_)) { if (b->type_str_ == "brace") - b->translate_axis ( -paper_l ()->get_realvar (interline_scm_sym), + b->translate_axis ( -paper_l ()->get_var ("interline"), X_AXIS); // ugh } } @@ -64,3 +64,4 @@ ADD_THIS_TRANSLATOR (Piano_bar_engraver); ADD_THIS_TRANSLATOR (Staff_group_bar_engraver); ADD_THIS_TRANSLATOR (Span_score_bar_engraver); + diff --git a/lily/staff-bar.cc b/lily/staff-bar.cc index df97770e25..00e71d2282 100644 --- a/lily/staff-bar.cc +++ b/lily/staff-bar.cc @@ -12,9 +12,10 @@ Real Staff_bar::get_bar_size () const { - SCM size_sym = get_elt_property (bar_size_scm_sym); - if (size_sym != SCM_BOOL_F) - return gh_scm2double (SCM_CDR(size_sym)); + SCM size = get_elt_property ("bar-size"); + if (gh_number_p (size)) + return gh_scm2double (size); else return (lines_i () -1) * staff_line_leading_f (); } + diff --git a/lily/staff-side.cc b/lily/staff-side.cc index 1ac107f6c8..d2b9ab974d 100644 --- a/lily/staff-side.cc +++ b/lily/staff-side.cc @@ -18,7 +18,7 @@ Staff_side_element::Staff_side_element () { dir_ = CENTER; to_position_l_ = 0; - set_elt_property (transparent_scm_sym, SCM_BOOL_T); + set_elt_property ("transparent", SCM_BOOL_T); axis_ = Y_AXIS; } @@ -69,7 +69,7 @@ void Staff_side_element::position_self () { if (to_position_l_ && - to_position_l_->get_elt_property (transparent_scm_sym) != SCM_BOOL_F) + to_position_l_->get_elt_property ("transparent") != SCM_UNDEFINED) return; Axis other = Axis ((axis_ + 1) % NO_AXES); @@ -78,7 +78,7 @@ Staff_side_element::position_self () { warning (_("No support; erasing script")); to_position_l_->set_empty (X_AXIS,Y_AXIS); - to_position_l_->set_elt_property (transparent_scm_sym, SCM_BOOL_T); + to_position_l_->set_elt_property ("transparent", SCM_BOOL_T); set_empty (X_AXIS, Y_AXIS); return ; } @@ -114,17 +114,17 @@ Staff_side_element::position_self () Real off = relative_coordinate (common, axis_); - SCM pad = remove_elt_property (padding_scm_sym); - if (pad != SCM_BOOL_F) + SCM pad = remove_elt_property ("padding"); + if (pad != SCM_UNDEFINED) { - off += gh_scm2double (SCM_CDR(pad)) * dir_; + off += gh_scm2double (pad) * dir_; } Real total_off = dim[dir_] + off; /* - no_staff_support_scm_sym is ugh bugfix to get staccato dots right. + "no-staff-support" is ugh bugfix to get staccato dots right. */ - if (to_position_l_ && to_position_l_->get_elt_property (no_staff_support_scm_sym) == SCM_BOOL_F) + if (to_position_l_ && to_position_l_->get_elt_property ("no-staff-support") == SCM_UNDEFINED) total_off += - sym_dim[-dir_]; dim_cache_[axis_]->set_offset (total_off); @@ -143,7 +143,7 @@ Staff_side_element::do_post_processing () void Staff_side_element::do_add_processing () { - if (get_elt_property (no_staff_support_scm_sym) == SCM_BOOL_F + if (get_elt_property ("no-staff-support") == SCM_UNDEFINED && axis_ == Y_AXIS && staff_symbol_l ()) { add_support (staff_symbol_l ()); @@ -192,3 +192,4 @@ Staff_side_spanner::do_print () const { Staff_side_element::do_print (); } + diff --git a/lily/staff-sym-engraver.cc b/lily/staff-sym-engraver.cc index a326789009..188cdc48ac 100644 --- a/lily/staff-sym-engraver.cc +++ b/lily/staff-sym-engraver.cc @@ -47,7 +47,7 @@ Staff_symbol_engraver::do_removal_processing() } else { - span_p_->staff_line_leading_f_ = paper_l ()->get_realvar (interline_scm_sym); + span_p_->staff_line_leading_f_ = paper_l ()->get_var ("interline"); } span_p_->set_bounds(RIGHT,get_staff_info().command_pcol_l ()); typeset_element (span_p_); @@ -65,3 +65,4 @@ Staff_symbol_engraver::acknowledge_element (Score_element_info s) ADD_THIS_TRANSLATOR(Staff_symbol_engraver); + diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc index 813d8a8b17..2af11bc5f7 100644 --- a/lily/staff-symbol-referencer.cc +++ b/lily/staff-symbol-referencer.cc @@ -49,7 +49,7 @@ Staff_symbol_referencer::staff_symbol_l () const Real Staff_symbol_referencer::staff_line_leading_f () const { - return (staff_sym_l_) ? staff_sym_l_->staff_line_leading_f_ : paper_l ()->get_realvar (interline_scm_sym); + return (staff_sym_l_) ? staff_sym_l_->staff_line_leading_f_ : paper_l ()->get_var ("interline"); } Real @@ -63,3 +63,4 @@ Staff_symbol_referencer::position_f () const return 2.0 * y / staff_line_leading_f (); } + diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index edd978df5e..a3779c61e7 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -100,7 +100,7 @@ Stem_engraver::do_pre_move_processing() if (gh_number_p(prop)) { stem_p_->dir_ = to_dir (prop); - stem_p_->set_elt_property (dir_forced_scm_sym, SCM_BOOL_T); + stem_p_->set_elt_property ("dir-forced", SCM_BOOL_T); } Translator_group* which; @@ -135,3 +135,4 @@ Stem_engraver::do_try_music (Music* r) ADD_THIS_TRANSLATOR(Stem_engraver); + diff --git a/lily/stem-info.cc b/lily/stem-info.cc index f555ab0a6b..270ce80072 100644 --- a/lily/stem-info.cc +++ b/lily/stem-info.cc @@ -32,14 +32,14 @@ Stem_info::Stem_info (Stem*s, int mult) stem_l_ = s; x_ = stem_l_->hpos_f (); dir_ = stem_l_->dir_; - SCM bd = stem_l_->remove_elt_property (beam_dir_scm_sym); + SCM bd = stem_l_->remove_elt_property ("beam-dir"); - beam_dir_ = gh_scm2int (SCM_CDR(bd)); + beam_dir_ = gh_scm2int (bd); Paper_def* paper_l = stem_l_->paper_l (); Real internote_f = stem_l_->staff_line_leading_f ()/2; Real interbeam_f = paper_l->interbeam_f (mult_i_); - Real beam_f = paper_l->get_realvar (beam_thickness_scm_sym);; + Real beam_f = paper_l->get_var ("beam_thickness");; // strangely enough, dim(chord_start_f) == pt (and not internote!) @@ -51,9 +51,9 @@ Stem_info::Stem_info (Stem*s, int mult) // for simplicity, we calculate as if dir == UP idealy_f_ *= beam_dir_; - bool grace_b = stem_l_->get_elt_property (grace_scm_sym) != SCM_BOOL_F; - bool no_extend_b = stem_l_->get_elt_property (no_stem_extend_scm_sym) - != SCM_BOOL_F; + bool grace_b = stem_l_->get_elt_property ("grace") != SCM_UNDEFINED; + bool no_extend_b = stem_l_->get_elt_property ("no-stem-extend") + != SCM_UNDEFINED; int stem_max = (int)rint(paper_l->get_var ("stem_max")); String type_str = grace_b ? "grace_" : ""; @@ -123,3 +123,4 @@ Stem_info::Stem_info (Stem*s, int mult) maxy_f_ += interstaff_f_ * beam_dir_; } + diff --git a/lily/stem-staff-side.cc b/lily/stem-staff-side.cc index 1b6f7bc750..56e0201754 100644 --- a/lily/stem-staff-side.cc +++ b/lily/stem-staff-side.cc @@ -47,19 +47,19 @@ Stem_staff_side_item::get_default_direction () const void Stem_staff_side_item::do_pre_processing () { - SCM p = remove_elt_property (padding_scm_sym); + SCM p = remove_elt_property ("padding"); Real pad = paper_l ()->get_var ("articulation_script_padding_default"); - if (get_elt_property (no_staff_support_scm_sym) != SCM_BOOL_F) + if (get_elt_property ("no-staff-support") != SCM_UNDEFINED) pad =0.0; Real il = (stem_l_) ? stem_l_->staff_line_leading_f (): paper_l ()->get_var ("interline"); - if (p != SCM_BOOL_F) + if (p != SCM_UNDEFINED) { pad = gh_scm2double (p); } pad *= il ; - set_elt_property (padding_scm_sym, + set_elt_property ("padding", gh_double2scm(pad)); Staff_side_item::do_pre_processing (); @@ -79,7 +79,7 @@ Stem_staff_side_item::do_post_processing () should use general no_staff_line_collision elt property, and use the same elt prop also for positioning slurs, ties and dots. */ - if (get_elt_property (no_staff_support_scm_sym) != SCM_BOOL_F) + if (get_elt_property ("no-staff-support") != SCM_UNDEFINED) { Graphical_element * c =common_refpoint (staff_symbol_l (), Y_AXIS); Real staff_coord = staff_symbol_l ()->relative_coordinate (c, Y_AXIS); @@ -95,3 +95,4 @@ Stem_staff_side_item::do_post_processing () translate_axis (desired_coord * dir_ * staff_line_leading_f () / 2.0 - now_coord, Y_AXIS); } } + diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index 71dead81d1..ee93f94fa8 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -54,7 +54,7 @@ Stem_tremolo::do_brew_molecule_p () const Real space = stem_l_->staff_line_leading_f (); Real internote_f = space/2; - Real beam_f = paper_l ()->get_realvar (beam_thickness_scm_sym); + Real beam_f = paper_l ()->get_var ("beam_thickness"); int beams_i = 0; Real slope_f = internote_f / 4 / internote_f; // HUH? @@ -133,3 +133,4 @@ Stem_tremolo::set_stem (Stem *s) stem_l_ = s; add_dependency (s); } + diff --git a/lily/stem.cc b/lily/stem.cc index 7c7797a385..018011adbc 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -169,15 +169,15 @@ void Stem::set_default_stemlen () { Real length_f = 0.; - SCM scm_len = get_elt_property(length_scm_sym); - if (scm_len != SCM_BOOL_F) + SCM scm_len = get_elt_property("length"); + if (scm_len != SCM_UNDEFINED) { - length_f = gh_scm2double (SCM_CDR(scm_len)); + length_f = gh_scm2double (scm_len); } else length_f = paper_l ()->get_var ("stem_length0"); - bool grace_b = get_elt_property (grace_scm_sym) != SCM_BOOL_F; + bool grace_b = get_elt_property ("grace") != SCM_UNDEFINED; String type_str = grace_b ? "grace_" : ""; Real shorten_f = paper_l ()->get_var (type_str + "forced_stem_shorten0"); @@ -201,7 +201,7 @@ Stem::set_default_stemlen () set_stemend ((dir_ > 0) ? head_positions()[BIGGER] + length_f: head_positions()[SMALLER] - length_f); - bool no_extend_b = get_elt_property (no_stem_extend_scm_sym) != SCM_BOOL_F; + bool no_extend_b = get_elt_property ("no-stem-extend") != SCM_UNDEFINED; if (!grace_b && !no_extend_b && (dir_ * stem_end_f () < 0)) set_stemend (0); } @@ -225,9 +225,9 @@ Stem::set_noteheads () head_l_arr_.reverse (); Note_head * beginhead = head_l_arr_[0]; - beginhead->set_elt_property (extremal_scm_sym, SCM_BOOL_T); + beginhead->set_elt_property ("extremal", SCM_BOOL_T); if (beginhead != head_l_arr_.top ()) - head_l_arr_.top ()->set_elt_property (extremal_scm_sym, SCM_BOOL_T); + head_l_arr_.top ()->set_elt_property ("extremal", SCM_BOOL_T); int parity=1; int lastpos = int (beginhead->position_f ()); @@ -256,7 +256,7 @@ Stem::do_pre_processing () if (invisible_b ()) { - set_elt_property (transparent_scm_sym, SCM_BOOL_T); + set_elt_property ("transparent", SCM_BOOL_T); } set_empty (invisible_b (), X_AXIS, Y_AXIS); set_spacing_hints (); @@ -278,16 +278,14 @@ Stem::set_spacing_hints () if (!invisible_b ()) { SCM scmdir = gh_int2scm (dir_); - SCM dirlist = column_l ()->get_elt_property (dir_list_scm_sym); - if (dirlist == SCM_BOOL_F) + SCM dirlist = column_l ()->get_elt_property ("dir-list"); + if (dirlist == SCM_UNDEFINED) dirlist = SCM_EOL; - else - dirlist = SCM_CDR (dirlist); if (scm_sloppy_memq (scmdir, dirlist) == SCM_EOL) { dirlist = gh_cons (scmdir, dirlist); - column_l ()->set_elt_property (dir_list_scm_sym, dirlist); + column_l ()->set_elt_property ("dir-list", dirlist); } } } @@ -296,10 +294,9 @@ Molecule Stem::flag () const { String style; - SCM st = get_elt_property (style_scm_sym); - if ( st != SCM_BOOL_F) + SCM st = get_elt_property ("style"); + if ( st != SCM_UNDEFINED) { - st = SCM_CDR(st); style = ly_scm2string (st); } @@ -402,3 +399,4 @@ Stem::do_substitute_element_pointer (Score_element*o,Score_element*n) } Staff_symbol_referencer::do_substitute_element_pointer (o,n); } + diff --git a/lily/text-item.cc b/lily/text-item.cc index eeaf40c30a..d839410a7e 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -16,8 +16,8 @@ Molecule* Text_item::do_brew_molecule_p () const { - SCM style = get_elt_property (style_scm_sym); - String st = (style == SCM_BOOL_F) ? "" : ly_scm2string (gh_cdr (style)); + SCM style = get_elt_property ("style"); + String st = (style == SCM_UNDEFINED) ? "" : ly_scm2string (style); Molecule a= paper_l ()->lookup_l(0)->text (st, text_str_, paper_l ()); @@ -29,3 +29,4 @@ Text_item::do_print () const { DEBUG_OUT << "text= " << text_str_; } + diff --git a/lily/tie.cc b/lily/tie.cc index bdc3089f64..8773cf2c78 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -68,7 +68,7 @@ Tie::do_post_processing() { assert (head_l_drul_[LEFT] || head_l_drul_[RIGHT]); - Real interline_f = paper_l ()->get_realvar (interline_scm_sym); + Real interline_f = paper_l ()->get_var ("interline"); Real internote_f = interline_f / 2; Real x_gap_f = paper_l ()->get_var ("tie_x_gap"); Real y_gap_f = paper_l ()->get_var ("tie_y_gap"); @@ -99,8 +99,6 @@ Tie::do_post_processing() */ if (head_l_drul_[d] /* - && head_l_drul_[d]->remove_elt_property (extremal_scm_sym) != SCM_BOOL_F) - ugh, ugh: a~a~a; @@ -109,8 +107,8 @@ Tie::do_post_processing() Getting scared a bit by score-element's comment: // is this a good idea? */ - && (head_l_drul_[d]->get_elt_property (extremal_scm_sym) - != SCM_BOOL_F)) + && (head_l_drul_[d]->get_elt_property ("extremal") + != SCM_UNDEFINED)) { if (d == LEFT) dx_f_drul_[d] += head_width_f; @@ -196,3 +194,4 @@ Tie::get_rods () const a.push (r); return a; } + diff --git a/lily/time-signature-engraver.cc b/lily/time-signature-engraver.cc index f680885064..e30d1619e2 100644 --- a/lily/time-signature-engraver.cc +++ b/lily/time-signature-engraver.cc @@ -41,7 +41,7 @@ Time_signature_engraver::do_process_requests() time_signature_p_ = new Time_signature (); time_signature_p_->args_ = args; - time_signature_p_->set_elt_property (break_priority_scm_sym, gh_int2scm (1)); // 1 + time_signature_p_->set_elt_property ("break-priority", gh_int2scm (1)); // 1 } @@ -63,3 +63,4 @@ Time_signature_engraver::do_pre_move_processing() ADD_THIS_TRANSLATOR(Time_signature_engraver); + diff --git a/lily/time-signature.cc b/lily/time-signature.cc index 1f6234cd9c..4ba3e65ab6 100644 --- a/lily/time-signature.cc +++ b/lily/time-signature.cc @@ -15,17 +15,17 @@ Time_signature::Time_signature () { - set_elt_property (breakable_scm_sym, SCM_BOOL_T); + set_elt_property ("breakable", SCM_BOOL_T); } Molecule* Time_signature::do_brew_molecule_p () const { - SCM st = get_elt_property (style_scm_sym); + SCM st = get_elt_property ("style"); - if (st != SCM_BOOL_F) + if (st != SCM_UNDEFINED) { - String style (ly_scm2string (gh_cdr (st))); + String style (ly_scm2string (st)); if (style[0]=='1') { Array tmparr = args_; @@ -43,3 +43,4 @@ Time_signature::do_brew_molecule_p () const + diff --git a/lily/tuplet-engraver.cc b/lily/tuplet-engraver.cc index b9e3cf16dc..e1e0f54c85 100644 --- a/lily/tuplet-engraver.cc +++ b/lily/tuplet-engraver.cc @@ -49,10 +49,10 @@ Tuplet_engraver::do_process_requests () Tuplet_spanner* glep = new Tuplet_spanner; started_span_p_arr_.push (glep); glep->number_str_ = to_str (time_scaled_music_arr_[i]->den_i_); - glep->set_elt_property(tuplet_visibility_scm_sym, + glep->set_elt_property("tuplet-visibility", gh_int2scm (visibility)); if (dir != 0) - glep->set_elt_property(dir_forced_scm_sym, gh_int2scm (dir)); + glep->set_elt_property("dir-forced", gh_int2scm (dir)); announce_element (Score_element_info (glep, time_scaled_music_arr_ [i])); } } @@ -60,7 +60,7 @@ Tuplet_engraver::do_process_requests () void Tuplet_engraver::acknowledge_element (Score_element_info i) { - bool grace= (i.elem_l_->get_elt_property (grace_scm_sym) != SCM_BOOL_F); + bool grace= (i.elem_l_->get_elt_property ("grace") != SCM_UNDEFINED); SCM wg = get_property ("weAreGraceContext",0); bool wgb = gh_boolean_p (wg) && gh_scm2bool (wg); if (grace != wgb) @@ -105,3 +105,4 @@ Tuplet_engraver::do_removal_processing () ADD_THIS_TRANSLATOR(Tuplet_engraver); + diff --git a/ly/engraver.ly b/ly/engraver.ly index c1687a847d..60174acd44 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -41,7 +41,6 @@ StaffContext=\translator { marginBreakPriority = #-5 \consists "Separating_line_group_engraver"; - \consists "Font_size_engraver"; \accepts "Voice"; dynamicStyle = #"dynamic" @@ -112,7 +111,6 @@ VoiceContext = \translator { \consists "Script_engraver"; \consists "Script_column_engraver"; \consists "Rhythmic_column_engraver"; - \consists "Font_size_engraver"; \consists "Slur_engraver"; \consists "Tie_engraver"; \consists "Tuplet_engraver"; diff --git a/mutopia/GNUmakefile b/mutopia/GNUmakefile index 7cbaeea0ed..a1129ad5ad 100644 --- a/mutopia/GNUmakefile +++ b/mutopia/GNUmakefile @@ -2,7 +2,7 @@ depth = .. -SUBDIRS = J.S.Bach Coriolan W.A.Mozart F.Schubert D.Zipoli Hymns D.Scarlatti L.Mozart E.Satie N.W.Gade +SUBDIRS = J.S.Bach Coriolan W.A.Mozart F.Schubert D.Zipoli Hymns L.Mozart E.Satie N.W.Gade examples= LOCALSTEPMAKE_TEMPLATES=mutopia diff --git a/mutopia/W.A.Mozart/horn-concerto-3/rondo.ly b/mutopia/W.A.Mozart/horn-concerto-3/rondo.ly index f10ace98ae..b8b72b7927 100644 --- a/mutopia/W.A.Mozart/horn-concerto-3/rondo.ly +++ b/mutopia/W.A.Mozart/horn-concerto-3/rondo.ly @@ -18,12 +18,12 @@ lipbreaker = \notes \relative c' [c c c] [c c c] } -rightsixteenth = { \property Voice.stemLeftBeamCount = "1" - \property Voice.stemRightBeamCount = "2" } -leftsixteenth = { \property Voice.stemLeftBeamCount = "2" - \property Voice.stemRightBeamCount = "1" } -bothsixteenth = { \property Voice.stemLeftBeamCount = "2" - \property Voice.stemRightBeamCount = "2" } +rightsixteenth = { \property Voice.stemLeftBeamCount = 1 + \property Voice.stemRightBeamCount = 2 } +leftsixteenth = { \property Voice.stemLeftBeamCount = 2 + \property Voice.stemRightBeamCount = 1 } +bothsixteenth = { \property Voice.stemLeftBeamCount = 2 + \property Voice.stemRightBeamCount = 2 } rondo = \notes \relative c' { @@ -92,7 +92,7 @@ rondo = \notes \relative c' R2.*3 r4 r8 r4 c8 a4. c - f ~ [f8. \rightsixteenth e16( d )c] + f ~ [f8. \rightsixteenth e16( \bothsixteenth d )c] bes4 g8 e4 g8 c4. ~ c8 r r R2.*3| @@ -153,7 +153,7 @@ rondo = \notes \relative c' R2.*5 [c8\f c, c] [c c c] c4 r8 c4 r8 - c4 r8 r4 \bar "||."; % B&H do another r8. + c4 r8 r4 \bar "|."; % B&H do another r8. } diff --git a/scm/generic-property.scm b/scm/generic-property.scm index a895d3ba13..463fad46e5 100644 --- a/scm/generic-property.scm +++ b/scm/generic-property.scm @@ -3,10 +3,10 @@ (cons "Beam" (list (list 'beamslopedamping number? 'damping) - (list 'autoKneeGap number? 'auto_knee_gap) - (list 'autoInterstaffKneeGap number? 'auto_interstaff_knee_gap) - (list 'beamQuantisation symbol? 'slope_quantisation) - (list 'beamDirAlgorithm symbol? 'beam_dir_algorithm) + (list 'autoKneeGap number? 'auto-knee-gap) + (list 'autoInterstaffKneeGap number? 'auto-interstaff-knee-gap) + (list 'beamQuantisation symbol? 'slope-quantisation) + (list 'beamDirAlgorithm symbol? 'beam-dir-algorithm) ) ) ) @@ -17,7 +17,7 @@ (list (list 'stemLength number? 'length) (list 'stemStyle string? 'style) - (list 'noStemExtend boolean? 'no_stem_extend) + (list 'noStemExtend boolean? 'no-stem-extend) )) ) @@ -30,19 +30,19 @@ (define generic-bar-properties (cons "Staff_bar" (list - (list 'barSize number? 'bar_size)) + (list 'barSize number? 'bar-size)) ) ) (define generic-breathing-sign-properties (cons "Breathing_sign" (list - (list 'breathingSignBreakPriority number? 'break_priority + (list 'breathingSignBreakPriority number? 'break-priority )))) (define generic-clef-properties (cons "Clef_item" (list - (list 'clefBreakPriority number? 'break_priority) + (list 'clefBreakPriority number? 'break-priority) (list 'clefStyle string? 'style)) ) ) @@ -56,8 +56,8 @@ (define generic-note-column-properties (cons "Note_column" (list - (list 'horizontalNoteShift number? 'horizontal_shift) - (list 'forceHorizontalShift number? 'force_hshift) + (list 'horizontalNoteShift number? 'horizontal-shift) + (list 'forceHorizontalShift number? 'force-hshift) ))) (define generic-slur-properties diff --git a/scripts/abc2ly.py b/scripts/abc2ly.py index 4a5cb5d446..422e2280b3 100644 --- a/scripts/abc2ly.py +++ b/scripts/abc2ly.py @@ -39,6 +39,10 @@ # ??? + +#TODO: +# UNDEF -> None + program_name = 'abc2ly' diff --git a/scripts/musedata2ly.py b/scripts/musedata2ly.py new file mode 100644 index 0000000000..2fe63fc7e2 --- /dev/null +++ b/scripts/musedata2ly.py @@ -0,0 +1,208 @@ +#!@PYTHON@ + +# musedata = musedata.stanford.edu + +import re +import sys +import string + +f = open (sys.argv[1]) +lines =f.readlines() + +def chomp (x): + return re.sub ('[\r\n \t]+$','', x) + +lines = map (chomp, lines) + +default_header_dict = { + 'tagline' :'automatically converted from Musedata', + 'copyright' : 'all rights reserved -- free for noncommercial use' + } + +# Jezus, wat een ranzig formaat. (2am) +def parse_header (lines): + d = default_header_dict + enter = string.split (lines[3], ' ') + d['enteredby'] = string.join (enter[1:]) + d['enteredon'] = enter[0] + d['opus'] = lines[4] + d['source'] = lines[5] + d['title'] = lines[6] + d['subtitle'] = lines[7] + d['instrument']= lines[8] + d['musedatamisc'] =lines[9] + d['musedatagroups'] =lines[10] + d['musedatagroupnumber']=lines[11] + + return d + +clef_dict = { +04: 'treble', +13 : 'alto', +22: 'bass', + +} + +def get_clef(s): + return '\\clef "%s";\n' % clef_dict [string.atoi (s)] + +def get_mudela_notename (p, ac): + if p > 5: + p = p - 7 + s = chr (p + ord ('c')) + infix = 'i' + if ac < 0: + infix = 'e' + ac = -ac + + while ac: + s = s + infix + 's' + ac = ac - 1 + return s + +def get_key (s): + i = string.atoi (s) + return '' + +def get_timesig (s): + return '\\time %s;\n' % s + + +divisions = 4 +def get_divisions_per_quarter (s): + divisions = string.atoi (s) + return '' + +def get_directive (s): + return '%% %s\n' % s + +def get_transposing (s): + return '' + +def get_num_instruments (s): + return '' + +attr_dict = { + 'C' : get_clef, + 'K' : get_key , + 'T' : get_timesig, + 'Q' : get_divisions_per_quarter, + 'D' : get_directive, + 'X' : get_transposing, + 'I': get_num_instruments, + } + +def parse_musical_attributes (l): + s = '' + l = l[1:] + atts = re.split('[ \t]+', l) + for a in atts: + if not a: + continue + m = re.search ('(.):(.*)', a) + if m == None: + print 'Huh, unknown attr `%s\'' % a + continue + + s = s + attr_dict[m.group(1)](m.group (2)) + return s + + +def get_mudela_pitch (n, a, o): + c = '\'' + if o < 1: + c = ',' + o = 1 - o + + return get_mudela_notename (n,a) + '%s' % c * o + +def dump_header (h, out): + out.write ('\\header {\n') + for tup in h.items (): + out.write ('\t%s = \"%s\";\n' % tup) + out.write ('}\n') + +header_dict = parse_header (lines[0:12]) +dump_header (header_dict, sys.stdout) + + +lines = lines [12:] + + +def parse_line_comment (l): + return re.sub ('@' , '%' , l) + +def parse_note_line (l): + pitch = ((ord (l[0]) -ord('A')) + 5) % 7 + acc = 0 + l= l[1:] + while l[0] == 'f': + l= l[1:] + acc = acc - 1 + while l[0] == '#': + l= l[1:] + acc = acc + 1 + while l[0] in ' \t': + l= l[1:] + + oct = 0 + if l[0] in '0123456789': + oct = string.atoi (l[0]) - 4 + l= l[1:] + + while l[0] in ' \t': + l= l[1:] + + + print get_mudela_pitch (pitch,acc,oct), parse_duration(l[:2]) + l = l[2:] + + + + +def parse_duration (l): + s = '' + while l[0] in '0123456789': + s = s + l[0] + l= l[1:] + print l + num = string.atoi (s) + den = 4 * divisions + + current_dots = 0 + try_dots = [3, 2, 1] + for d in try_dots: + f = 1 << d + multiplier = (2*f-1) + if num % multiplier == 0 and den % f == 0: + num = num / multiplier + den = den / f + current_dots = current_dots + d + + if num <> 1: + sys.stderr.write ('huh. Durations left') + return '%s%s' % (den, '.' * current_dots) + +comment_switch = 0 +for l in lines: + if l[0] == '&': + comment_switch = not comment_switch + if comment_switch: + l= l[1:] + print '%{' + else: + print '%}' + + if comment_switch: + print l + continue + + if 0: + pass + elif l[0] == '$': + print parse_musical_attributes (l) + elif l[0] == '@': + parse_line_comment (l) + + elif l[0] in 'ABCDEFG': + parse_note_line (l)