(c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+#include "staff-symbol-referencer.hh"
#include "stem-engraver.hh"
#include "note-head.hh"
#include "stem.hh"
void
Stem_engraver::do_creation_processing ()
{
- Scalar prop = get_property ("abbrev", 0);
- if (prop.isnum_b ())
+ SCM prop = get_property ("abbrev", 0);
+ if (gh_number_p(prop))
{
- default_abbrev_i_ = prop;
+ default_abbrev_i_ = gh_scm2int (prop);
}
}
{
if (Rhythmic_head * h = dynamic_cast<Rhythmic_head *> (i.elem_l_))
{
- if (h->stem_l_)
+ if (h->stem_l ())
return;
Rhythmic_req * r = dynamic_cast <Rhythmic_req *> (i.req_l_);
if (!stem_p_)
{
stem_p_ = new Stem;
- stem_p_->flag_i_ = duration_log;
+ Staff_symbol_referencer_interface st(stem_p_);
+ st.set_interface ();
+
+ stem_p_->set_elt_property ("duration-log", gh_int2scm (duration_log));
if (abbrev_req_l_)
{
announce_element (Score_element_info (stem_p_, r));
}
- if (stem_p_->flag_i_ != duration_log)
+ if (stem_p_->flag_i () != duration_log)
{
- r->warning (_f("Adding note head to incompatible stem (type = %d)", 1 << stem_p_->flag_i_));
+ r->warning (_f ("Adding note head to incompatible stem (type = %d)", 1 << stem_p_->flag_i ()));
}
stem_p_->add_head (h);
if (stem_p_)
{
- Scalar prop = get_property ("verticalDirection", 0);
- Direction dir = prop.isnum_b () ? (Direction)int(prop) : CENTER;
- if (dir)
+ Translator_group* which;
+ SCM prop = get_property ("stemLeftBeamCount", &which);
+ if (gh_number_p(prop))
{
- stem_p_->dir_ = dir;
- stem_p_->set_elt_property (dir_forced_scm_sym, SCM_BOOL_T);
- }
-
- Translator_group const *which;
- prop = get_property ("stemLeftBeamCount", &which);
- if (prop.isnum_b ())
- {
- 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 (gh_number_p(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 ())
+ // UGH. Should mark non-forced instead.
+ SCM dir = stem_p_->get_elt_property ("direction");
+ if (gh_number_p (dir) && to_dir(dir))
{
- stem_p_->set_elt_property (length_scm_sym, gh_double2scm (prop.to_f ()));
+ stem_p_->set_elt_property ("dir-forced", SCM_BOOL_T);
}
- prop = get_property ("stemStyle", 0);
- if (prop.to_bool ())
- {
- stem_p_->set_elt_property (style_scm_sym, gh_str02scm (prop.ch_C()));
- }
-
+
typeset_element(stem_p_);
stem_p_ = 0;
}
ADD_THIS_TRANSLATOR(Stem_engraver);
+