void
Bar_script_engraver::do_creation_processing ()
{
- Scalar prop = get_property (type_ + "HangOnClef", 0);
- if (prop.to_bool ())
+ SCM prop = get_property (type_ + "HangOnClef", 0);
+ if (gh_boolean_p (prop) && gh_scm2bool (prop))
{
hang_on_clef_b_ = true;
}
text_p_ = new Text_item;
text_p_->set_elt_property (breakable_scm_sym, SCM_BOOL_T); // ugh
- Scalar prop = get_property (type_ + "Direction", 0);
- if (prop.isnum_b ())
+ SCM prop = get_property (type_ + "Direction", 0);
+ if (isdir_b (prop))
{
- staff_side_p_->dir_ = (Direction) (int) prop;
+ staff_side_p_->dir_ = to_dir (prop);
}
else
{
staff_side_p_->set_victim(text_p_);
- Scalar padding = get_property (type_ + "ScriptPadding", 0);
- if (padding.length_i() && padding.isnum_b ())
+ SCM padding = get_property (type_ + "ScriptPadding", 0);
+ if (SCM_NUMBERP(padding))
{
- staff_side_p_->set_elt_property (padding_scm_sym, gh_double2scm(Real(padding)));
+ staff_side_p_->set_elt_property (padding_scm_sym, padding);
}
else
{
void
Font_size_engraver::do_process_requests ()
{
- Scalar s (get_property ("fontSize", 0));
+ SCM s (get_property ("fontSize", 0));
- if (s.length_i () && s.isnum_b ())
+ if (SCM_NUMBERP(s))
{
- size_i_ = int (s);
+ size_i_ = gh_scm2int (s);
}
}
{
if (dynamic_cast<Melisma_playing_req*>(m))
{
- Scalar plain (get_property ("melismaBusy", 0));
- Scalar slur (get_property ("slurMelismaBusy", 0));
- Scalar tie (get_property ("tieMelismaBusy", 0));
- return plain.to_bool () || slur.to_bool () || tie.to_bool ();
+ SCM plain (get_property ("melismaBusy", 0));
+ SCM slur (get_property ("slurMelismaBusy", 0));
+ SCM tie (get_property ("tieMelismaBusy", 0));
+ return (gh_boolean_p (plain) && gh_scm2bool (plain))
+ || (gh_boolean_p (slur) && gh_scm2bool (slur))
+ || (gh_boolean_p (tie) && gh_scm2bool (tie));
}
return false;
}
stem_l_ = 0;
}
-
- bool wegrace = get_property ("weAreGraceContext",0).to_bool ();
+ SCM wg = get_property ("weAreGraceContext",0);
+ bool wegrace = gh_boolean_p (wg) && gh_scm2bool (wg);
if (!wegrace)
for (int i=0; i < grace_slur_endings_.size(); i++)
void
Rhythmic_column_engraver::acknowledge_element (Score_element_info i)
{
- if ((get_property ("weAreGraceContext",0).to_bool () !=
+ 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))
&& !dynamic_cast<Slur*> (i.elem_l_))
return ;
{
if (ncol_p_)
{
- Scalar sh = get_property ("horizontalNoteShift", 0);
- if (sh.isnum_b ())
+ SCM sh = get_property ("horizontalNoteShift", 0);
+ if (SCM_NUMBERP(sh))
{
- ncol_p_->set_elt_property (horizontal_shift_scm_sym,
- gh_int2scm (int (sh)));
+ ncol_p_->set_elt_property (horizontal_shift_scm_sym, sh);
}
sh = get_property ("forceHorizontalShift" ,0);
- if (sh.isnum_b ())
+ if (SCM_NUMBERP(sh))
{
- ncol_p_->set_elt_property (force_hshift_scm_sym,
- gh_double2scm (double (sh)));
+ ncol_p_->set_elt_property (force_hshift_scm_sym, sh);
}
typeset_element (ncol_p_);
else
ss->dir_ = (Direction)force_dir;
- Scalar dir_prop (get_property ("articulationScriptVerticalDirection", 0));
- if (dir_prop.isnum_b () && (int) dir_prop != CENTER)
- ss->dir_ = (Direction)(int)dir_prop;
+ SCM dir_prop (get_property ("articulationScriptVerticalDirection", 0));
+ if (SCM_NUMBERP(dir_prop))
+ ss->dir_ = to_dir (dir_prop);
if (l->dir_)
ss->dir_ = l->dir_;
- Real padding = 0.0;
- Scalar paddingprop = get_property ("articulationScriptPadding", 0);
- if (paddingprop.length_i() && paddingprop.isnum_b ())
+ SCM paddingprop = get_property ("articulationScriptPadding", 0);
+ if (SCM_NUMBERP(paddingprop))
{
- padding = (Real)paddingprop;
+ ss->set_elt_property (padding_scm_sym, paddingprop);
}
- Scalar axisprop = get_property ("scriptHorizontal",0);
- if (axisprop.to_bool ())
+ SCM axisprop = get_property ("scriptHorizontal",0);
+ if (gh_boolean_p (axisprop) && gh_scm2bool (axisprop))
ss->axis_ = X_AXIS;
- if (follow_staff && !axisprop.to_bool ())
+ if (follow_staff && !gh_boolean_p (axisprop) && gh_scm2bool (axisprop))
ss->set_elt_property (no_staff_support_scm_sym, SCM_BOOL_T);
p->set_staff_side (ss);
ss->set_elt_property (script_priority_scm_sym, priority);
- if (padding)
- ss->set_elt_property (padding_scm_sym, gh_double2scm(padding));
+ if (SCM_NUMBERP (paddingprop))
+ ss->set_elt_property (padding_scm_sym, paddingprop);
+
+
script_p_arr_.push (p);
staff_side_p_arr_.push (ss);
script_req_l_arr_.clear();
}
-
-
ADD_THIS_TRANSLATOR(Script_engraver);
if (!where)
where = daddy_trans_l_;
- daddy_trans_l_->set_property ("slurMelismaBusy", m ? "1" :"0");
+ daddy_trans_l_->set_property ("slurMelismaBusy", m ? SCM_BOOL_T :SCM_BOOL_F);
}
void
typeset_element (slur_l_stack_[i]);
}
slur_l_stack_.clear ();
- if (!get_property ("weAreGraceContext",0).to_bool ())
+ SCM wg = get_property ("weAreGraceContext",0);
+ bool wgb = gh_boolean_p (wg) && gh_scm2bool (wgb);
+ if (!wgb)
for (int i=0; i < requests_arr_.size(); i++)
{
requests_arr_[i]->warning (_ ("unterminated slur"));
// push a new slur onto stack.
//(use temp. array to wait for all slur STOPs)
Slur * s_p =new Slur;
- Scalar prop = get_property ("slurDash", 0);
- if (prop.isnum_b ())
- s_p->set_elt_property (dashed_scm_sym, gh_int2scm(prop));
+ SCM prop = get_property ("slurDash", 0);
+ if (SCM_NUMBERP(prop))
+ s_p->set_elt_property (dashed_scm_sym, prop);
requests_arr_.push (slur_req_l);
void
Slur_engraver::do_pre_move_processing()
{
- Scalar dir (get_property ("slurVerticalDirection", 0));
- Scalar dir2 (get_property ("verticalDirection", 0));
+ SCM dir (get_property ("slurVerticalDirection", 0));
+ SCM dir2 (get_property ("verticalDirection", 0));
Direction slurdir = CENTER;
- if (dir.length_i () && dir.isnum_b ())
- slurdir = (Direction) sign (int(dir));
- else if (dir2.length_i () && dir2.isnum_b ())
- slurdir = (Direction) sign (int (dir2));
+ if (SCM_NUMBERP(dir))
+ slurdir = to_dir (dir);
+ else if (gh_number_p (dir2))
+ slurdir = to_dir (dir2);
for (int i = 0; i < end_slur_l_arr_.size(); i++)
{
Slur_engraver::do_post_move_processing()
{
new_slur_req_l_arr_.clear();
- if (get_property ("automaticMelismata",0).to_bool ())
+ SCM m = get_property ("automaticMelismata",0);
+ if (gh_boolean_p (m) && gh_scm2bool (m))
{
set_melisma (slur_l_stack_.size ());
}
void
Staff_symbol_engraver::do_removal_processing()
{
- Scalar l (get_property ("numberOfStaffLines", 0));
- if (l.isnum_b ())
+ SCM l (get_property ("numberOfStaffLines", 0));
+ if (SCM_NUMBERP(l))
{
- span_p_->no_lines_i_ = l;
+ span_p_->no_lines_i_ = gh_scm2int (l);
}
- Scalar sz (get_property ("staffLineLeading", 0));
- if (!sz.empty_b () && sz.isnum_b ())
+ SCM sz (get_property ("staffLineLeading", 0));
+ if (SCM_NUMBERP(sz))
{
- span_p_->staff_line_leading_f_ = Real(sz);
+ span_p_->staff_line_leading_f_ = gh_scm2double (sz);
}
else
{
void
Stem_engraver::do_creation_processing ()
{
- Scalar prop = get_property ("abbrev", 0);
- if (prop.isnum_b ())
+ SCM prop = get_property ("abbrev", 0);
+ if (SCM_NUMBERP(prop))
{
- default_abbrev_i_ = prop;
+ default_abbrev_i_ = gh_scm2int (prop);
}
}
if (stem_p_)
{
- Scalar prop = get_property ("verticalDirection", 0);
- Direction dir = prop.isnum_b () ? (Direction)int(prop) : CENTER;
- if (dir)
+ SCM prop = get_property ("verticalDirection", 0);
+ if (SCM_NUMBERP(prop))
{
- stem_p_->dir_ = dir;
+ stem_p_->dir_ = to_dir (prop);
stem_p_->set_elt_property (dir_forced_scm_sym, SCM_BOOL_T);
}
Translator_group* which;
prop = get_property ("stemLeftBeamCount", &which);
- if (prop.isnum_b ())
+ if (SCM_NUMBERP(prop))
{
- stem_p_->beams_i_drul_[LEFT] = prop;
- ((Translator_group*)which)->set_property ("stemLeftBeamCount", "");
+ stem_p_->beams_i_drul_[LEFT] = gh_scm2int (prop);
+ ((Translator_group*)which)->set_property ("stemLeftBeamCount", SCM_UNDEFINED);
}
prop = get_property ("stemRightBeamCount", &which);
- if (prop.isnum_b ())
+ if (SCM_NUMBERP(prop))
{
- stem_p_->beams_i_drul_[RIGHT] = prop;
- ((Translator_group*)which)->set_property ("stemRightBeamCount", "");
+ stem_p_->beams_i_drul_[RIGHT] = gh_scm2int (prop);
+ ((Translator_group*)which)->set_property ("stemRightBeamCount", SCM_UNDEFINED);
}
prop = get_property ("stemLength", 0);
- if (prop.isnum_b ())
+ if (SCM_NUMBERP(prop))
{
- stem_p_->set_elt_property (length_scm_sym, gh_double2scm (prop.to_f ()));
+ stem_p_->set_elt_property (length_scm_sym, prop);
}
prop = get_property ("stemStyle", 0);
- if (prop.to_bool ())
+ if (gh_string_p (prop))
{
- stem_p_->set_elt_property (style_scm_sym, ly_ch_C_to_scm (prop.ch_C()));
+ stem_p_->set_elt_property (style_scm_sym, prop);
+ }
+
+ prop = get_property ("noStemExtend", 0);
+ if (gh_boolean_p (prop) && gh_scm2bool (prop))
+ {
+ stem_p_->set_elt_property (no_stem_extend_scm_sym, prop);
}
typeset_element(stem_p_);
- Scalar axisprop = get_property ("scriptHorizontal",0);
- if (axisprop.to_bool ())
+ SCM axisprop = get_property ("scriptHorizontal",0);
+ if (gh_boolean_p (axisprop) && gh_scm2bool (axisprop))
{
ss->axis_ = X_AXIS;
text->set_parent (ss, Y_AXIS);
if (r->style_str_.empty_b ())
{
- Scalar p (get_property ("textStyle", 0));
- if (p.length_i ())
- text->style_str_ = p;
+ SCM p (get_property ("textStyle", 0));
+ if (gh_string_p (p))
+ text->style_str_ = ly_scm2string(p);
}
else
text->style_str_ = r->style_str_;
- Scalar padding = get_property ("textScriptPadding", 0);
- if (padding.length_i() && padding.isnum_b ())
+ SCM padding = get_property ("textScriptPadding", 0);
+ if (SCM_NUMBERP(padding))
{
- ss->set_elt_property (padding_scm_sym, gh_double2scm(Real(padding)));
+ ss->set_elt_property (padding_scm_sym, padding);
}
- Scalar empty = get_property ("textEmptyDimension", 0);
- if (empty.to_bool ())
+ SCM empty = get_property ("textEmptyDimension", 0);
+ if (gh_boolean_p (empty) && gh_scm2bool (empty))
{
text->set_empty (true, X_AXIS);
}
Translator_group * tr=0;
- Scalar barn = get_property ("currentBarNumber", &tr);
- if (!barn.empty_b () && barn.isnum_b ())
+ SCM barn = get_property ("currentBarNumber", &tr);
+ if (SCM_NUMBERP(barn))
{
- time_.bars_i_ = int(barn);
- tr->set_property ("currentBarNumber", "");
+ time_.bars_i_ = gh_scm2int (barn);
+ tr->set_property ("currentBarNumber", SCM_UNDEFINED);
}
-
-
}
while (!global_l);
/* allbars == ! skipbars */
- bool allbars = ! get_property ("skipBars", 0).to_bool ();
+ SCM sb = get_property ("skipBars", 0);
+ bool allbars = !(gh_boolean_p (sb)&&gh_scm2bool (sb));
// urg: multi bar rests: should always process whole of first bar?
if (!time_.cadenza_b_ && allbars)
void
Vertical_align_engraver::do_removal_processing()
{
- Scalar dist (get_property ("maxVerticalAlign", 0));
- if (dist.length_i () && dist.isnum_b ())
+ SCM dist (get_property ("maxVerticalAlign", 0));
+ if (SCM_NUMBERP(dist))
{
- valign_p_->threshold_interval_[BIGGER] = Real (dist);
+ valign_p_->threshold_interval_[BIGGER] = gh_scm2double (dist);
}
dist = get_property ("minVerticalAlign", 0);
- if (dist.length_i () && dist.isnum_b ())
+ if (SCM_NUMBERP(dist))
{
- valign_p_->threshold_interval_[SMALLER] = Real (dist);
+ valign_p_->threshold_interval_[SMALLER] = gh_scm2double (dist);
}
dist = get_property ("alignmentReference",0);
- if (dist.length_i () && dist.isnum_b ())
+ if (isdir_b (dist))
{
- valign_p_->align_dir_ = (Direction)(int)dist;
+ valign_p_->align_dir_ = to_dir (dist);
}
valign_p_->set_bounds(RIGHT,get_staff_info().command_pcol_l ());
typeset_element (valign_p_);