#include "musical-request.hh"
#include "bar.hh"
#include "beam.hh"
-#include "chord-tremolo.hh"
#include "rest.hh"
#include "stem.hh"
#include "debug.hh"
if (test_mom.den () != 1)
type_str = type_str + "_" + to_str (test_mom.den ());
+ /*
+ URG
+
+ FIXME: SHOULD USE ALIST
+
+ */
+
/*
Determine end moment for auto beaming (and begin, mostly 0==anywhere)
In order of increasing priority:
/*
second guess: property generic time exception
*/
- Scalar begin = get_property (time_str + "beamAutoBegin", 0);
- if (begin.length_i ())
- begin_mom = begin.to_rat ();
+ SCM begin = get_property (time_str + "beamAutoBegin", 0);
+ if (SMOB_IS_TYPE_B(Moment, begin))
+ begin_mom = * SMOB_TO_TYPE(Moment, begin);
- Scalar end = get_property (time_str + "beamAutoEnd", 0);
- if (end.length_i ())
- end_mom = end.to_rat ();
+ SCM end = get_property (time_str + "beamAutoEnd", 0);
+ if (SMOB_IS_TYPE_B (Moment, end))
+ end_mom = * SMOB_TO_TYPE(Moment,end);
/*
third guess: property time exception, specific for duration type
*/
if (type_str.length_i ())
{
- Scalar end_mult = get_property (time_str + "beamAutoEnd" + type_str, 0);
- if (end_mult.length_i ())
- end_mom = end_mult.to_rat ();
- Scalar begin_mult = get_property (time_str + "beamAutoBegin" + type_str, 0);
- if (begin_mult.length_i ())
- begin_mom = begin_mult.to_rat ();
+ SCM end_mult = get_property (time_str + "beamAutoEnd" + type_str, 0);
+ if (SMOB_IS_TYPE_B (Moment, end_mult))
+ end_mom = * SMOB_TO_TYPE (Moment,end_mult);
+
+ SCM begin_mult = get_property (time_str + "beamAutoBegin" + type_str, 0);
+ if (SMOB_IS_TYPE_B (Moment, begin_mult))
+ begin_mom = * SMOB_TO_TYPE (Moment,begin_mult);
}
/*
fourth guess [user override]: property plain generic
*/
begin = get_property ("beamAutoBegin", 0);
- if (begin.length_i ())
- begin_mom = begin.to_rat ();
+ if (SMOB_IS_TYPE_B(Moment, begin))
+ begin_mom = * SMOB_TO_TYPE(Moment, begin);
+
+
end = get_property ("beamAutoEnd", 0);
- if (end.length_i ())
- end_mom = end.to_rat ();
+ if (SMOB_IS_TYPE_B (Moment, end))
+ end_mom = * SMOB_TO_TYPE (Moment,end);
/*
fifth guess [user override]: property plain, specific for duration type
*/
if (type_str.length_i ())
{
- Scalar end_mult = get_property (String ("beamAutoEnd") + type_str, 0);
- if (end_mult.length_i ())
- end_mom = end_mult.to_rat ();
- Scalar begin_mult = get_property (String ("beamAutoBegin") + type_str, 0);
- if (begin_mult.length_i ())
- begin_mom = begin_mult.to_rat ();
+ SCM end_mult = get_property (String ("beamAutoEnd") + type_str, 0);
+ if (SMOB_IS_TYPE_B (Moment, end_mult))
+ end_mom = * SMOB_TO_TYPE (Moment,end_mult);
+
+ SCM begin_mult = get_property (String ("beamAutoBegin") + type_str, 0);
+ if (SMOB_IS_TYPE_B (Moment, begin_mult))
+ begin_mom = * SMOB_TO_TYPE (Moment,begin_mult);
}
Rational r;
/*
Allow already started autobeam to end
*/
- Scalar on = get_property ("noAutoBeaming", 0);
- if (on.to_bool ())
+ SCM on = get_property ("noAutoBeaming", 0);
+ if (gh_boolean_p (on) && gh_scm2bool (on))
return;
if (begin_mom)
*/
if ((*stem_l_arr_p_)[i]->beam_l_)
{
- delete beam_p;
return 0;
}
beam_p->add_stem ((*stem_l_arr_p_)[i]);
}
- /* urg, copied from Beam_engraver */
- Scalar prop = get_property ("beamslopedamping", 0);
- if (prop.isnum_b ())
- beam_p->set_elt_property (damping_scm_sym, gh_int2scm(prop));
-
- prop = get_property ("autoKneeGap", 0);
- if (prop.isnum_b ())
- beam_p->set_elt_property (auto_knee_gap_scm_sym, gh_int2scm(prop));
-
- prop = get_property ("autoInterstaffKneeGap", 0);
- if (prop.isnum_b ())
- beam_p->set_elt_property (auto_interstaff_knee_gap_scm_sym, gh_int2scm( prop));
-
- prop = get_property ("beamquantisation", 0);
- if (prop.isnum_b ())
- beam_p->quantisation_ = (Beam::Quantisation)(int)prop;
-
announce_element (Score_element_info (beam_p, 0));
+
return beam_p;
}
{
/* finished beams may be typeset */
typeset_beam ();
- /* but unfinished may need another announce/acknoledge pass */
+ /* but unfinished may need another announce/acknowledge pass */
if (stem_l_arr_p_)
junk_beam ();
}
bool
Auto_beam_engraver::same_grace_state_b (Score_element* e)
{
- bool gr = (e->get_elt_property (grace_scm_sym) != SCM_BOOL_F) ;
-
- return gr == get_property ("weAreGraceContext",0).to_bool ();
+ bool gr = e->get_elt_property ("grace") == SCM_BOOL_T;
+ SCM wg =get_property ("weAreGraceContext",0);
+ return (gh_boolean_p (wg) && gh_scm2bool (wg)) == gr;
}
void
{
end_beam ();
}
- else if (Chord_tremolo *b = dynamic_cast<Chord_tremolo*> (info.elem_l_))
- {
- end_beam ();
- }
else if (Bar *b = dynamic_cast<Bar *> (info.elem_l_))
{
end_beam ();
}
}
}
+