- if (Rhythmic_head::stem_l (h))
- return;
-
- Rhythmic_req * r = dynamic_cast <Rhythmic_req *> (i.req_l_);
- int duration_log = r->duration_.durlog_i_;
- if (!stem_p_)
- {
- stem_p_ = new Item (get_property ("basicStemProperties"));
- Stem::set_interface (stem_p_);
- Staff_symbol_referencer::set_interface(stem_p_);
-
-
- stem_p_->set_elt_property ("duration-log", gh_int2scm (duration_log));
-
- if (tremolo_req_l_)
- {
- /*
- Stem tremolo is never applied to a note by default,
- is must me requested. But there is a default for the
- tremolo value:
-
- c4:8 c c:
-
- the first and last (quarter) note bothe get one tremolo flag.
- */
- int requested_type = tremolo_req_l_->type_i_;
- if (!requested_type)
- requested_type = default_tremolo_type_i_;
- else
- default_tremolo_type_i_ = requested_type;
-
- if (requested_type)
- {
- tremolo_p_ = new Item (get_property ("basicStemTremoloProperties"));
- Stem_tremolo::set_interface (tremolo_p_);
-
- announce_element (tremolo_p_, tremolo_req_l_);
- /*
- The number of tremolo flags is the number of flags of
- the tremolo-type minus the number of flags of the note
- itself.
- */
- int tremolo_flags = intlog2 (requested_type) - 2
- - (duration_log > 2 ? duration_log - 2 : 0);
- if (tremolo_flags < 0)
- tremolo_flags = 0;
- tremolo_p_->set_elt_property ("tremolo-flags",
- gh_int2scm (tremolo_flags));
- }
- }
- announce_element (stem_p_, r);
- }
-
- if (Stem::flag_i (stem_p_) != duration_log)
- {
- r->origin ()->warning (_f ("Adding note head to incompatible stem (type = %d)", 1 << Stem::flag_i (stem_p_)));
- }
-
- Stem::add_head (stem_p_,h);
+ Item *flag = make_item ("Flag", stem_->self_scm ());
+ flag->set_parent (stem_, X_AXIS);
+ stem_->set_object ("flag", flag->self_scm ());
+ maybe_flags_.push_back (flag);