bool
Note_column::has_rests (Grob *me)
{
- return Grob::is_smob (me->get_object ("rest"));
+ return unsmob<Grob> (me->get_object ("rest"));
}
bool
Note_column::get_stem (Grob *me)
{
SCM s = me->get_object ("stem");
- return Item::unsmob (s);
+ return unsmob<Item> (s);
}
Item *
if (stem)
{
SCM s = stem->get_object ("flag");
- return Item::unsmob (s);
+ return unsmob<Item> (s);
}
return 0;
}
Direction
Note_column::dir (Grob *me)
{
- Grob *stem = Grob::unsmob (me->get_object ("stem"));
- if (stem && Stem::has_interface (stem))
+ Grob *stem = unsmob<Grob> (me->get_object ("stem"));
+ if (has_interface<Stem> (stem))
return get_grob_direction (stem);
else
{
return (Direction)sign (head_positions_interval (me).center ());
}
- if (has_interface (me))
+ if (has_interface<Note_column> (me))
programming_error ("Note_column without heads and stem");
else
programming_error ("dir() given grob without Note_column interface");
Grob *
Note_column::get_rest (Grob *me)
{
- return Grob::unsmob (me->get_object ("rest"));
+ return unsmob<Grob> (me->get_object ("rest"));
}
void
Note_column::add_head (Grob *me, Grob *h)
{
bool both = false;
- if (Rest::has_interface (h))
+ if (has_interface<Rest> (h))
{
extract_grob_set (me, "note-heads", heads);
if (heads.size ())
else
me->set_object ("rest", h->self_scm ());
}
- else if (Note_head::has_interface (h))
+ else if (has_interface<Note_head> (h))
{
- if (Grob::is_smob (me->get_object ("rest")))
+ if (unsmob<Grob> (me->get_object ("rest")))
both = true;
Pointer_group_interface::add_grob (me, ly_symbol2scm ("note-heads"), h);
}
}
Grob *main_item = main_head
? main_head
- : Grob::unsmob (me->get_object ("rest"));
+ : unsmob<Grob> (me->get_object ("rest"));
return main_item
? main_item->extent (me, X_AXIS)
for (vsize i = 0; i < heads.size (); i++)
{
Grob *h = heads[i];
- acc = h ? Grob::unsmob (h->get_object ("accidental-grob")) : 0;
+ acc = h ? unsmob<Grob> (h->get_object ("accidental-grob")) : 0;
if (acc)
break;
}
if (!acc)
return 0;
- if (Accidental_placement::has_interface (acc->get_parent (X_AXIS)))
+ if (has_interface<Accidental_placement> (acc->get_parent (X_AXIS)))
return acc->get_parent (X_AXIS);
/* compatibility. */
extract_grob_set (me, "note-heads", heads);
for (vsize i = 0; i < heads.size (); i++)
{
- Grob *dots = Grob::unsmob (heads[i]->get_object ("dot"));
+ Grob *dots = unsmob<Grob> (heads[i]->get_object ("dot"));
if (dots)
return dots->get_parent (X_AXIS);
}