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);
Score_element *e =dynamic_cast<Score_element*>(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));
}
else
return elem_l_arr_.find_i (nonconst);
}
+
*/
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);
}
}
}
ADD_THIS_TRANSLATOR(Align_note_column_engraver);
+
Axis_group_element::Axis_group_element()
{
- set_elt_property (transparent_scm_sym, SCM_BOOL_T);
+ set_elt_property ("transparent", SCM_BOOL_T);
}
void
{
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.
}
}
return Graphical_element::extent (a);
}
+
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<Axis_group_element*> (elts_[i]->parent_l (Y_AXIS)))
{
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);
}
{
return Spanner::do_width ();
}
+
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);
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));
}
ADD_THIS_TRANSLATOR(Bar_engraver);
+
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_);
}
}
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))
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));
}
+
Bar::Bar ()
{
- set_elt_property (breakable_scm_sym, SCM_BOOL_T);
+ set_elt_property ("breakable", SCM_BOOL_T);
type_str_ = "|";
}
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_ = "|";
set_empty (true, X_AXIS);
}
+
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
ADD_THIS_TRANSLATOR(Base_span_bar_engraver);
+
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);
ADD_THIS_TRANSLATOR(Beam_engraver);
+
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
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
// 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;
Bezier::set (control);
}
+
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);
}
return offset_arr;
}
+
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"));
}
translate_axis(2.0 * dl * dir_, Y_AXIS);
}
+
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"));
}
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);
}
}
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_));
}
}
ADD_THIS_TRANSLATOR(Clef_engraver);
+
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);
}
}
*/
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;
{
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);
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);
}
+
#include "note-column.hh"
#include "note-head.hh"
#include "paper-def.hh"
-#include "ly-symbols.hh"
+
#include "tuple.hh"
Collision::Collision()
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++)
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;
}
}
+
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;
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])
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);
}
}
}
+
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_);
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));
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);
}
}
}
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));
}
}
ss_span_p_->add_support (i.elem_l_);
}
}
+
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;
}
+
{
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 ();
Grace_align_item::do_add_processing ()
{
}
+
*/
#include "grace-engraver-group.hh"
#include "lily-guile.hh"
-#include "ly-symbols.hh"
+
#include "score-element.hh"
#include "musical-request.hh"
// 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
}
return false;
}
+
*/
#include "grace-performer-group.hh"
#include "lily-guile.hh"
-#include "ly-symbols.hh"
+
#include "audio-element.hh"
ADD_THIS_TRANSLATOR (Grace_performer_group);
// 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;
}
return hebbes_b;
}
+
}
else if (Note_head * n = dynamic_cast <Note_head*> (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<Local_key_item*>(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_);
}
ADD_THIS_TRANSLATOR(Grace_position_engraver);
+
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);
}
{
Axis_group_spanner::do_print ();
}
+
/*
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.
return false;
Item * i =dynamic_cast<Item*> (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
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);
}
}
return CENTER;
}
+
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_));
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"));
}
}
}
ADD_THIS_TRANSLATOR (Key_engraver);
+
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_));
}
req_l_ =0;
}
+
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)
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);
}
return a;
}
+
{
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++)
{
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 ("");
}
+
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;
}
translate_rests (-d * discrete_dist);
}
+
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));
out->dim_ = b;
return out;
}
+
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);
ADD_THIS_TRANSLATOR(Note_heads_engraver);
+
{
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);
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");
}
return str;
}
+
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_);
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);
}
}
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);
}
+
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));
}
+
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<Slur*> (i.elem_l_))
return ;
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);
}
}
}
ADD_THIS_TRANSLATOR(Rhythmic_column_engraver);
+
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();
}
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();
}
{
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);
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 <Spanner *> (elem_p))
{
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
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))
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));
}
}
/*
result is junked.
*/
- command_column_l_->remove_elt_property (breakable_scm_sym);
+ command_column_l_->remove_elt_property ("breakable");
}
ADD_THIS_TRANSLATOR(Score_engraver);
pscore_p_ = new Paper_score;
pscore_p_->paper_l_ = dynamic_cast<Paper_def*>(output_def_l_);
}
+
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 ;
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));
}
}
ADD_THIS_TRANSLATOR(Score_priority_engraver);
+
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);
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
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);
}
+
}
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);
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);
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);
ADD_THIS_TRANSLATOR(Script_engraver);
+
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);
/*
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);
}
{
}
+
{
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);
ADD_THIS_TRANSLATOR( Separating_line_group_engraver);
+
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);
}
#endif
}
+
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");
return a;
}
+
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<Rhythmic_req*>(i.req_l_))
ADD_THIS_TRANSLATOR(Spacing_engraver);
+
Spacing_spanner::Spacing_spanner ()
{
- set_elt_property (transparent_scm_sym, SCM_BOOL_T);
+ set_elt_property ("transparent", SCM_BOOL_T);
}
int
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())
{
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
{
*/
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;
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.;
+
{
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_ == "|:")
{
type_str_ = "";
}
+
{
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;
if (Span_bar * b = dynamic_cast<Span_bar *> (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
}
}
ADD_THIS_TRANSLATOR (Staff_group_bar_engraver);
ADD_THIS_TRANSLATOR (Span_score_bar_engraver);
+
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 ();
}
+
{
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;
}
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);
{
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 ;
}
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);
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 ());
{
Staff_side_element::do_print ();
}
+
}
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_);
ADD_THIS_TRANSLATOR(Staff_symbol_engraver);
+
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
return 2.0 * y / staff_line_leading_f ();
}
+
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;
ADD_THIS_TRANSLATOR(Stem_engraver);
+
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!)
// 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_" : "";
maxy_f_ += interstaff_f_ * beam_dir_;
}
+
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 ();
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);
translate_axis (desired_coord * dir_ * staff_line_leading_f () / 2.0 - now_coord, Y_AXIS);
}
}
+
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?
stem_l_ = s;
add_dependency (s);
}
+
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");
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);
}
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 ());
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 ();
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);
}
}
}
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);
}
}
Staff_symbol_referencer::do_substitute_element_pointer (o,n);
}
+
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 ());
{
DEBUG_OUT << "text= " << text_str_;
}
+
{
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");
*/
if (head_l_drul_[d]
/*
- && head_l_drul_[d]->remove_elt_property (extremal_scm_sym) != SCM_BOOL_F)
- ugh, ugh:
a~a~a;
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;
a.push (r);
return a;
}
+
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
}
ADD_THIS_TRANSLATOR(Time_signature_engraver);
+
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<int> tmparr = args_;
+
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]));
}
}
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)
ADD_THIS_TRANSLATOR(Tuplet_engraver);
+
marginBreakPriority = #-5
\consists "Separating_line_group_engraver";
- \consists "Font_size_engraver";
\accepts "Voice";
dynamicStyle = #"dynamic"
\consists "Script_engraver";
\consists "Script_column_engraver";
\consists "Rhythmic_column_engraver";
- \consists "Font_size_engraver";
\consists "Slur_engraver";
\consists "Tie_engraver";
\consists "Tuplet_engraver";
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
[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'
{
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|
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.
}
(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)
)
)
)
(list
(list 'stemLength number? 'length)
(list 'stemStyle string? 'style)
- (list 'noStemExtend boolean? 'no_stem_extend)
+ (list 'noStemExtend boolean? 'no-stem-extend)
))
)
(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))
)
)
(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
# ???
+
+#TODO:
+# UNDEF -> None
+
program_name = 'abc2ly'
--- /dev/null
+#!@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)