This saves a memory access and comparison and leads to better code
even when unsmob is called afterwards anyway.
73 files changed:
{
Grob *a = Grob::unsmob (scm_car (s));
{
Grob *a = Grob::unsmob (scm_car (s));
- if (Grob::unsmob (a->get_object ("tie"))
+ if (Grob::is_smob (a->get_object ("tie"))
&& !to_boolean (a->get_property ("forced")))
break_reminder->push_back (a);
else
&& !to_boolean (a->get_property ("forced")))
break_reminder->push_back (a);
else
If the engraver is added to a percussion context,
filter out unpitched note heads.
*/
If the engraver is added to a percussion context,
filter out unpitched note heads.
*/
- if (!Pitch::unsmob (p))
+ if (!Pitch::is_smob (p))
return;
Pitch pitch = *Pitch::unsmob (p);
Drul_array<bool> expands = pitch_interval_.add_point (pitch);
return;
Pitch pitch = *Pitch::unsmob (p);
Drul_array<bool> expands = pitch_interval_.add_point (pitch);
for (vsize i = 0; i < elts_.size (); i++)
{
for (vsize i = 0; i < elts_.size (); i++)
{
- if (!Grob::unsmob (elts_[i]->get_object ("axis-group-parent-Y")))
+ if (!Grob::is_smob (elts_[i]->get_object ("axis-group-parent-Y")))
{
if (staffline_->get_parent (Y_AXIS)
&& staffline_->get_parent (Y_AXIS) == elts_[i])
{
if (staffline_->get_parent (Y_AXIS)
&& staffline_->get_parent (Y_AXIS) == elts_[i])
for (vsize i = 0; i < elements.size (); i++)
{
SCM skyline_scm = elements[i]->get_property ("vertical-skylines");
for (vsize i = 0; i < elements.size (); i++)
{
SCM skyline_scm = elements[i]->get_property ("vertical-skylines");
- if (Skyline_pair::unsmob (skyline_scm))
+ if (Skyline_pair::is_smob (skyline_scm))
{
Real offset = elements[i]->relative_coordinate (y_common, Y_AXIS);
Skyline_pair other = *Skyline_pair::unsmob (skyline_scm);
{
Real offset = elements[i]->relative_coordinate (y_common, Y_AXIS);
Skyline_pair other = *Skyline_pair::unsmob (skyline_scm);
else
{
SCM lf = tr->get_property ("barCheckLastFail");
else
{
SCM lf = tr->get_property ("barCheckLastFail");
- if (Moment::unsmob (lf)
+ if (Moment::is_smob (lf)
&& *Moment::unsmob (lf) == *where)
warn = false;
else
&& *Moment::unsmob (lf) == *where)
warn = false;
else
{
// Do not consider note heads attached to the beam.
if (Stem::has_interface (covered_grob))
{
// Do not consider note heads attached to the beam.
if (Stem::has_interface (covered_grob))
- if (Grob::unsmob (covered_grob->get_object ("beam")))
+ if (Grob::is_smob (covered_grob->get_object ("beam")))
continue;
if (Grob *stem = Grob::unsmob (covered_grob->get_object ("stem")))
continue;
if (Grob *stem = Grob::unsmob (covered_grob->get_object ("stem")))
- my_y;
Real factor = parameters_.STEM_COLLISION_FACTOR;
- my_y;
Real factor = parameters_.STEM_COLLISION_FACTOR;
- if (!Grob::unsmob (s->get_object ("beam")))
+ if (!Grob::is_smob (s->get_object ("beam")))
factor = 1.0;
add_collision (x, y, factor);
}
factor = 1.0;
add_collision (x, y, factor);
}
}
}
else if (Text_interface::is_markup_list (scm_car (s))
}
}
else if (Text_interface::is_markup_list (scm_car (s))
- || Page_marker::unsmob (scm_car (s)))
+ || Page_marker::is_smob (scm_car (s)))
output_paper_book->add_score (scm_car (s));
else
assert (0);
output_paper_book->add_score (scm_car (s));
else
assert (0);
sym_string = ly_symbol2string (rsym);
string orig_string;
sym_string = ly_symbol2string (rsym);
string orig_string;
- if (Grob::unsmob (l->get_property ("cause")))
+ if (Grob::is_smob (l->get_property ("cause")))
orig_string = Grob::unsmob (l->get_property ("cause"))->name ();
programming_error (to_string ("No spacing entry from %s to `%s'",
orig_string = Grob::unsmob (l->get_property ("cause"))->name ();
programming_error (to_string ("No spacing entry from %s to `%s'",
- if (Grob::unsmob (src))
+ if (Grob::is_smob (src))
{
Grob *new_ptr = substitute_grob (Grob::unsmob (src));
return new_ptr ? new_ptr->self_scm () : SCM_UNDEFINED;
{
Grob *new_ptr = substitute_grob (Grob::unsmob (src));
return new_ptr ? new_ptr->self_scm () : SCM_UNDEFINED;
set_break_subsititution (l ? l->self_scm () : SCM_UNDEFINED);
SCM newval = sc->internal_get_object (sym);
set_break_subsititution (l ? l->self_scm () : SCM_UNDEFINED);
SCM newval = sc->internal_get_object (sym);
- if (!Grob_array::unsmob (newval))
+ if (!Grob_array::is_smob (newval))
{
newval = Grob_array::make_array ();
sc->set_object (sym, newval);
{
newval = Grob_array::make_array ();
sc->set_object (sym, newval);
if (grob_array)
{
SCM newval = sc->internal_get_object (sym);
if (grob_array)
{
SCM newval = sc->internal_get_object (sym);
- if (!Grob_array::unsmob (newval))
+ if (!Grob_array::is_smob (newval))
{
newval = Grob_array::make_array ();
sc->set_object (sym, newval);
{
newval = Grob_array::make_array ();
sc->set_object (sym, newval);
{
Stream_event *n = notes_[i];
SCM p = n->get_property ("pitch");
{
Stream_event *n = notes_[i];
SCM p = n->get_property ("pitch");
- if (!Pitch::unsmob (p))
+ if (!Pitch::is_smob (p))
continue;
if (n->get_property ("bass") == SCM_BOOL_T)
continue;
if (n->get_property ("bass") == SCM_BOOL_T)
return typecheck_grob (symbol, upc->unpure_part ())
&& typecheck_grob (symbol, upc->pure_part ());
return ly_is_procedure (value)
return typecheck_grob (symbol, upc->unpure_part ())
&& typecheck_grob (symbol, upc->pure_part ());
return ly_is_procedure (value)
- || Simple_closure::unsmob (value)
+ || Simple_closure::is_smob (value)
|| type_check_assignment (symbol, value, ly_symbol2scm ("backend-type?"));
}
|| type_check_assignment (symbol, value, ly_symbol2scm ("backend-type?"));
}
{
SCM l = context->get_property ("measureLength");
Rational length (1);
{
SCM l = context->get_property ("measureLength");
Rational length (1);
- if (Moment::unsmob (l))
+ if (Moment::is_smob (l))
length = Moment::unsmob (l)->main_part_;
return length;
}
length = Moment::unsmob (l)->main_part_;
return length;
}
SCM sm = context->get_property ("measurePosition");
Moment m = 0;
SCM sm = context->get_property ("measurePosition");
Moment m = 0;
- if (Moment::unsmob (sm))
+ if (Moment::is_smob (sm))
{
m = *Moment::unsmob (sm);
{
m = *Moment::unsmob (sm);
return;
Grob *note = gi.grob ();
return;
Grob *note = gi.grob ();
- if (Grob::unsmob (note->get_object ("dot")))
+ if (Grob::is_smob (note->get_object ("dot")))
return;
Duration *dur = Duration::unsmob (cause->get_property ("duration"));
return;
Duration *dur = Duration::unsmob (cause->get_property ("duration"));
" @var{cause} should either be another grob"
" or a music event.")
{
" @var{cause} should either be another grob"
" or a music event.")
{
- LY_ASSERT_TYPE (Engraver::unsmob, engraver, 1);
+ LY_ASSERT_SMOB (Engraver, engraver, 1);
LY_ASSERT_TYPE (ly_is_symbol, grob_name, 2);
LY_ASSERT_TYPE (ly_is_grob_cause, cause, 3);
LY_ASSERT_TYPE (ly_is_symbol, grob_name, 2);
LY_ASSERT_TYPE (ly_is_grob_cause, cause, 3);
" @var{grob} being a grob. @var{cause} should either"
" be another grob or a music event.")
{
" @var{grob} being a grob. @var{cause} should either"
" be another grob or a music event.")
{
- LY_ASSERT_TYPE (Engraver::unsmob, engraver, 1);
+ LY_ASSERT_SMOB (Engraver, engraver, 1);
LY_ASSERT_SMOB (Grob, grob, 2);
LY_ASSERT_TYPE (ly_is_grob_cause, cause, 3);
LY_ASSERT_SMOB (Grob, grob, 2);
LY_ASSERT_TYPE (ly_is_grob_cause, cause, 3);
cause = m->to_event ()->unprotect ();
}
if (e->get_property ("cause") == SCM_EOL
cause = m->to_event ()->unprotect ();
}
if (e->get_property ("cause") == SCM_EOL
- && (Stream_event::unsmob (cause) || Grob::unsmob (cause)))
+ && (Stream_event::is_smob (cause) || Grob::is_smob (cause)))
e->set_property ("cause", cause);
return Grob_info (this, e);
e->set_property ("cause", cause);
return Grob_info (this, e);
bool
ly_is_grob_cause (SCM obj)
{
bool
ly_is_grob_cause (SCM obj)
{
- return Grob::unsmob (obj) || Stream_event::unsmob (obj) || (obj == SCM_EOL);
+ return Grob::is_smob (obj) || Stream_event::is_smob (obj) || (obj == SCM_EOL);
}
#include "translator.icc"
}
#include "translator.icc"
junkme.
*/
SCM pitch = r->get_property ("pitch");
junkme.
*/
SCM pitch = r->get_property ("pitch");
- if (Pitch::unsmob (pitch))
+ if (Pitch::is_smob (pitch))
fingering->set_property ("pitch", pitch);
/*
fingering->set_property ("pitch", pitch);
/*
init_func_doc ()
{
ly_add_type_predicate ((void *) &is_direction, "direction");
init_func_doc ()
{
ly_add_type_predicate ((void *) &is_direction, "direction");
- ly_add_type_predicate ((void *) &Music_function::unsmob, "Music_function");
+ ly_add_type_predicate ((void *) &Music_function::is_smob, "Music_function");
ly_add_type_predicate ((void *) &ly_is_port, "port");
ly_add_type_predicate ((void *) &ly_cheap_is_list, "list");
ly_add_type_predicate ((void *) &ly_is_port, "port");
ly_add_type_predicate ((void *) &ly_cheap_is_list, "list");
- ly_add_type_predicate ((void *) &Global_context::unsmob, "Global_context");
- ly_add_type_predicate ((void *) &Input::unsmob, "Input");
- ly_add_type_predicate ((void *) &Moment::unsmob, "Moment");
- ly_add_type_predicate ((void *) &Paper_score::unsmob, "Paper_score");
- ly_add_type_predicate ((void *) &Performance::unsmob, "Performance");
- ly_add_type_predicate ((void *) &Unpure_pure_container::unsmob, "unpure pure container");
+ ly_add_type_predicate ((void *) &Global_context::is_smob, "Global_context");
+ ly_add_type_predicate ((void *) &Input::is_smob, "Input");
+ ly_add_type_predicate ((void *) &Moment::is_smob, "Moment");
+ ly_add_type_predicate ((void *) &Paper_score::is_smob, "Paper_score");
+ ly_add_type_predicate ((void *) &Performance::is_smob, "Performance");
+ ly_add_type_predicate ((void *) &Unpure_pure_container::is_smob, "unpure pure container");
ly_add_type_predicate ((void *) &is_axis, "axis");
ly_add_type_predicate ((void *) &is_number_pair, "number pair");
ly_add_type_predicate ((void *) &ly_is_list, "list");
ly_add_type_predicate ((void *) &is_axis, "axis");
ly_add_type_predicate ((void *) &is_number_pair, "number pair");
ly_add_type_predicate ((void *) &ly_is_list, "list");
ly_add_type_predicate ((void *) &scm_is_rational, "rational");
ly_add_type_predicate ((void *) &scm_is_string, "string");
ly_add_type_predicate ((void *) &scm_is_vector, "vector");
ly_add_type_predicate ((void *) &scm_is_rational, "rational");
ly_add_type_predicate ((void *) &scm_is_string, "string");
ly_add_type_predicate ((void *) &scm_is_vector, "vector");
- ly_add_type_predicate ((void *) &Item::unsmob, "Item");
- ly_add_type_predicate ((void *) &Music::unsmob, "Music");
- ly_add_type_predicate ((void *) &Spanner::unsmob, "Spanner");
- ly_add_type_predicate ((void *) &Stream_event::unsmob, "Stream_event");
+ ly_add_type_predicate ((void *) &Item::is_smob, "Item");
+ ly_add_type_predicate ((void *) &Music::is_smob, "Music");
+ ly_add_type_predicate ((void *) &Spanner::is_smob, "Spanner");
+ ly_add_type_predicate ((void *) &Stream_event::is_smob, "Stream_event");
}
ADD_SCM_INIT_FUNC (func_doc, init_func_doc);
}
ADD_SCM_INIT_FUNC (func_doc, init_func_doc);
{
Global_context *g = dynamic_cast<Global_context *> (Context::unsmob (context));
{
Global_context *g = dynamic_cast<Global_context *> (Context::unsmob (context));
- LY_ASSERT_TYPE (Global_context::unsmob, context, 1);
+ LY_ASSERT_SMOB (Global_context, context, 1);
SCM output = g->get_output ();
progress_indication ("\n");
SCM output = g->get_output ();
progress_indication ("\n");
" @var{global}. The translator group is returned.")
{
Global_context *g = dynamic_cast<Global_context *> (Context::unsmob (global));
" @var{global}. The translator group is returned.")
{
Global_context *g = dynamic_cast<Global_context *> (Context::unsmob (global));
- LY_ASSERT_TYPE (Global_context::unsmob, global, 1);
+ LY_ASSERT_SMOB (Global_context, global, 1);
Translator_group *tg = new Translator_group ();
tg->connect_to_context (g);
Translator_group *tg = new Translator_group ();
tg->connect_to_context (g);
" @var{ctx}. The context is returned in its final state.")
{
LY_ASSERT_SMOB (Music, mus, 1);
" @var{ctx}. The context is returned in its final state.")
{
LY_ASSERT_SMOB (Music, mus, 1);
- LY_ASSERT_TYPE (Global_context::unsmob, ctx, 2);
+ LY_ASSERT_SMOB (Global_context, ctx, 2);
Music *music = Music::unsmob (mus);
if (!music)
Music *music = Music::unsmob (mus);
if (!music)
SCM data = g->get_property_data (axis_offset_symbol (a));
if (!scm_is_number (data)
&& !ly_is_procedure (data)
SCM data = g->get_property_data (axis_offset_symbol (a));
if (!scm_is_number (data)
&& !ly_is_procedure (data)
- && !Simple_closure::unsmob (data))
+ && !Simple_closure::is_smob (data))
{
g->set_property (axis_offset_symbol (a), proc);
return;
}
{
g->set_property (axis_offset_symbol (a), proc);
return;
}
- if (ly_is_procedure (data) || Unpure_pure_container::unsmob (data))
+ if (ly_is_procedure (data) || Unpure_pure_container::is_smob (data))
data = Simple_closure::make_smob (scm_list_1 (data));
else if (Simple_closure *sc = Simple_closure::unsmob (data))
data = sc->expression ();
data = Simple_closure::make_smob (scm_list_1 (data));
else if (Simple_closure *sc = Simple_closure::unsmob (data))
data = sc->expression ();
{
SCM data = g->get_property_data (sym);
{
SCM data = g->get_property_data (sym);
- if (ly_is_procedure (data) || Unpure_pure_container::unsmob (data))
+ if (ly_is_procedure (data) || Unpure_pure_container::is_smob (data))
data = Simple_closure::make_smob (scm_list_1 (data));
else if (Simple_closure *sc = Simple_closure::unsmob (data))
data = sc->expression ();
data = Simple_closure::make_smob (scm_list_1 (data));
else if (Simple_closure *sc = Simple_closure::unsmob (data))
data = sc->expression ();
Grob_info::ultimate_event_cause () const
{
SCM cause = grob_->self_scm ();
Grob_info::ultimate_event_cause () const
{
SCM cause = grob_->self_scm ();
- while (Grob::unsmob (cause))
+ while (Grob::is_smob (cause))
{
cause = Grob::unsmob (cause)->get_property ("cause");
}
{
cause = Grob::unsmob (cause)->get_property ("cause");
}
if (do_internal_type_checking_global)
{
if (!ly_is_procedure (v)
if (do_internal_type_checking_global)
{
if (!ly_is_procedure (v)
- && !Simple_closure::unsmob (v)
- && !Unpure_pure_container::unsmob (v)
+ && !Simple_closure::is_smob (v)
+ && !Unpure_pure_container::is_smob (v)
&& v != ly_symbol2scm ("calculation-in-progress"))
type_check_assignment (sym, v, ly_symbol2scm ("backend-type?"));
&& v != ly_symbol2scm ("calculation-in-progress"))
type_check_assignment (sym, v, ly_symbol2scm ("backend-type?"));
if (do_internal_type_checking_global && scm_is_pair (handle))
{
SCM val = scm_cdr (handle);
if (do_internal_type_checking_global && scm_is_pair (handle))
{
SCM val = scm_cdr (handle);
- if (!ly_is_procedure (val) && !Simple_closure::unsmob (val)
- && !Unpure_pure_container::unsmob (val))
+ if (!ly_is_procedure (val) && !Simple_closure::is_smob (val)
+ && !Unpure_pure_container::is_smob (val))
type_check_assignment (sym, val, ly_symbol2scm ("backend-type?"));
check_interfaces_for_property (this, sym);
type_check_assignment (sym, val, ly_symbol2scm ("backend-type?"));
check_interfaces_for_property (this, sym);
val = upc->unpure_part ();
if (ly_is_procedure (val)
val = upc->unpure_part ();
if (ly_is_procedure (val)
- || Simple_closure::unsmob (val))
+ || Simple_closure::is_smob (val))
{
Grob *me = ((Grob *)this);
val = me->try_callback_on_alist (&me->mutable_property_alist_, sym, val);
{
Grob *me = ((Grob *)this);
val = me->try_callback_on_alist (&me->mutable_property_alist_, sym, val);
{
SCM val = scm_cdr (s);
if (ly_is_procedure (val)
{
SCM val = scm_cdr (s);
if (ly_is_procedure (val)
- || Simple_closure::unsmob (val)
- || Unpure_pure_container::unsmob (val))
+ || Simple_closure::is_smob (val)
+ || Unpure_pure_container::is_smob (val))
{
Grob *me = ((Grob *)this);
val = me->try_callback_on_alist (&me->object_alist_, sym, val);
{
Grob *me = ((Grob *)this);
val = me->try_callback_on_alist (&me->object_alist_, sym, val);
LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
if (!ly_is_procedure (val)
LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
if (!ly_is_procedure (val)
- && !Simple_closure::unsmob (val)
+ && !Simple_closure::is_smob (val)
&& !type_check_assignment (sym, val, ly_symbol2scm ("backend-type?")))
error ("typecheck failed");
&& !type_check_assignment (sym, val, ly_symbol2scm ("backend-type?")))
error ("typecheck failed");
Grob *gr = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
Grob *gr = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
- SCM_ASSERT_TYPE (ly_is_procedure (proc) || Unpure_pure_container::unsmob (proc), proc, SCM_ARG2, __FUNCTION__, "procedure or unpure pure container");
+ SCM_ASSERT_TYPE (ly_is_procedure (proc) || Unpure_pure_container::is_smob (proc), proc, SCM_ARG2, __FUNCTION__, "procedure or unpure pure container");
LY_ASSERT_TYPE (ly_is_symbol, sym, 3);
chain_callback (gr, proc, sym);
LY_ASSERT_TYPE (ly_is_symbol, sym, 3);
chain_callback (gr, proc, sym);
Grob::pure_stencil_height (SCM smob, SCM /* beg */, SCM /* end */)
{
Grob *me = Grob::unsmob (smob);
Grob::pure_stencil_height (SCM smob, SCM /* beg */, SCM /* end */)
{
Grob *me = Grob::unsmob (smob);
- if (Stencil::unsmob (me->get_property_data ("stencil")))
+ if (Stencil::is_smob (me->get_property_data ("stencil")))
return grob_stencil_extent (me, Y_AXIS);
return ly_interval2scm (Interval ());
return grob_stencil_extent (me, Y_AXIS);
return ly_interval2scm (Interval ());
-#define LY_ASSERT_SMOB(klass, var, number) LY_ASSERT_TYPE(klass::unsmob, var, number)
+#define LY_ASSERT_SMOB(klass, var, number) LY_ASSERT_TYPE(klass::is_smob, var, number)
#endif /* LILY_GUILE_MACROS_HH */
#endif /* LILY_GUILE_MACROS_HH */
fundoc);
scm_c_export (Super::type_p_name_, NULL);
}
fundoc);
scm_c_export (Super::type_p_name_, NULL);
}
- ly_add_type_predicate ((void *) unsmob, smob_name_.c_str ());
+ ly_add_type_predicate ((void *) is_smob, smob_name_.c_str ());
if (Super::smob_proc != 0)
scm_set_smob_apply (smob_tag_,
(scm_t_subr)Super::smob_proc,
if (Super::smob_proc != 0)
scm_set_smob_apply (smob_tag_,
(scm_t_subr)Super::smob_proc,
{
Input *ip = Input::unsmob (sip);
{
Input *ip = Input::unsmob (sip);
- LY_ASSERT_TYPE (Input::unsmob, sip, 1);
+ LY_ASSERT_SMOB (Input, sip, 1);
LY_ASSERT_TYPE (scm_is_string, msg, 2);
msg = scm_simple_format (SCM_BOOL_F, msg, rest);
LY_ASSERT_TYPE (scm_is_string, msg, 2);
msg = scm_simple_format (SCM_BOOL_F, msg, rest);
{
Input *ip = Input::unsmob (sip);
{
Input *ip = Input::unsmob (sip);
- LY_ASSERT_TYPE (Input::unsmob, sip, 1);
+ LY_ASSERT_SMOB (Input, sip, 1);
LY_ASSERT_TYPE (scm_is_string, msg, 2);
msg = scm_simple_format (SCM_BOOL_F, msg, rest);
LY_ASSERT_TYPE (scm_is_string, msg, 2);
msg = scm_simple_format (SCM_BOOL_F, msg, rest);
"Return input location in @var{sip} as"
" @code{(file-name line char column)}.")
{
"Return input location in @var{sip} as"
" @code{(file-name line char column)}.")
{
- LY_ASSERT_TYPE (Input::unsmob, sip, 1);
+ LY_ASSERT_SMOB (Input, sip, 1);
Input *ip = Input::unsmob (sip);
int l, ch, col, offset = 0;
Input *ip = Input::unsmob (sip);
int l, ch, col, offset = 0;
" @code{(file-name first-line first-column last-line last-column)}.")
{
" @code{(file-name first-line first-column last-line last-column)}.")
{
- LY_ASSERT_TYPE (Input::unsmob, sip, 1);
+ LY_ASSERT_SMOB (Input, sip, 1);
Input *ip = Input::unsmob (sip);
return scm_list_5 (ly_string2scm (ip->file_string ()),
Input *ip = Input::unsmob (sip);
return scm_list_5 (ly_string2scm (ip->file_string ()),
" end of line, @code{0}@tie{}unbroken, and"
" @code{1}@tie{}beginning of line.")
{
" end of line, @code{0}@tie{}unbroken, and"
" @code{1}@tie{}beginning of line.")
{
- LY_ASSERT_TYPE (Item::unsmob, it, 1);
+ LY_ASSERT_SMOB (Item, it, 1);
Item *me = Item::unsmob (it);
return scm_from_int (me->break_status_dir ());
}
Item *me = Item::unsmob (it);
return scm_from_int (me->break_status_dir ());
}
if (scm_is_pair (handle)) {
yylval = scm_cdr (handle);
if (scm_is_pair (handle)) {
yylval = scm_cdr (handle);
- if (Pitch::unsmob (yylval))
+ if (Pitch::is_smob (yylval))
return (YYSTATE == notes) ? NOTENAME_PITCH : TONICNAME_PITCH;
else if (scm_is_symbol (yylval))
return DRUM_PITCH;
return (YYSTATE == notes) ? NOTENAME_PITCH : TONICNAME_PITCH;
else if (scm_is_symbol (yylval))
return DRUM_PITCH;
SCM v = scm_car (p);
if (Music *m = Music::unsmob (v))
{
SCM v = scm_car (p);
if (Music *m = Music::unsmob (v))
{
- if (!Input::unsmob (m->get_property ("origin")))
+ if (!Input::is_smob (m->get_property ("origin")))
m->set_spot (override_input (here_input ()));
}
m->set_spot (override_input (here_input ()));
}
if (Music *m = Music::unsmob (sval))
{
if (Music *m = Music::unsmob (sval))
{
- if (!Input::unsmob (m->get_property ("origin")))
+ if (!Input::is_smob (m->get_property ("origin")))
m->set_spot (override_input (here_input ()));
}
m->set_spot (override_input (here_input ()));
}
main_input_level_ = 0;
extra_tokens_ = SCM_EOL;
main_input_level_ = 0;
extra_tokens_ = SCM_EOL;
- if (Input::unsmob (override_input))
+ if (Input::is_smob (override_input))
override_input_ = *Input::unsmob (override_input);
smobify_self ();
override_input_ = *Input::unsmob (override_input);
smobify_self ();
{
SCM sml = dynamic_cast<Spanner *> (me)->get_bound (LEFT)
->get_property ("measure-length");
{
SCM sml = dynamic_cast<Spanner *> (me)->get_bound (LEFT)
->get_property ("measure-length");
- Rational ml = (Moment::unsmob (sml)) ? Moment::unsmob (sml)->main_part_
+ Rational ml = (Moment::is_smob (sml)) ? Moment::unsmob (sml)->main_part_
: Rational (1);
double measure_duration = ml.Rational::to_double ();
bool force_round_up = to_boolean (scm_list_p (scm_member (scm_cons (scm_from_int64 (ml.numerator ()),
: Rational (1);
double measure_duration = ml.Rational::to_double ();
bool force_round_up = to_boolean (scm_list_p (scm_member (scm_cons (scm_from_int64 (ml.numerator ()),
(SCM x),
"Return the Scheme function inside@tie{}@var{x}.")
{
(SCM x),
"Return the Scheme function inside@tie{}@var{x}.")
{
- LY_ASSERT_TYPE (Music_function::unsmob, x, 1);
+ LY_ASSERT_SMOB (Music_function, x, 1);
return Music_function::unsmob (x)->get_function ();
}
return Music_function::unsmob (x)->get_function ();
}
(SCM x),
"Return the function signature inside@tie{}@var{x}.")
{
(SCM x),
"Return the function signature inside@tie{}@var{x}.")
{
- LY_ASSERT_TYPE (Music_function::unsmob, x, 1);
+ LY_ASSERT_SMOB (Music_function, x, 1);
return Music_function::unsmob (x)->get_signature ();
}
return Music_function::unsmob (x)->get_signature ();
}
"Get the length of music expression @var{mus} and return"
" it as a @code{Moment} object.")
{
"Get the length of music expression @var{mus} and return"
" it as a @code{Moment} object.")
{
- LY_ASSERT_TYPE (Music::unsmob, mus, 1);
+ LY_ASSERT_SMOB (Music, mus, 1);
Music *sc = Music::unsmob (mus);
return sc->get_length ().smobbed_copy ();
}
Music *sc = Music::unsmob (mus);
return sc->get_length ().smobbed_copy ();
}
" @var{mus}. If no value is found, return @var{val} or"
" @code{'()} if @var{val} is not specified.")
{
" @var{mus}. If no value is found, return @var{val} or"
" @code{'()} if @var{val} is not specified.")
{
- LY_ASSERT_TYPE (Music::unsmob, mus, 1);
+ LY_ASSERT_SMOB (Music, mus, 1);
return ly_prob_property (mus, sym, val);
}
return ly_prob_property (mus, sym, val);
}
"Set property @var{sym} in music expression @var{mus} to"
" @var{val}.")
{
"Set property @var{sym} in music expression @var{mus} to"
" @var{val}.")
{
- LY_ASSERT_TYPE (Music::unsmob, mus, 1);
+ LY_ASSERT_SMOB (Music, mus, 1);
return ly_prob_set_property_x (mus, sym, val);
}
return ly_prob_set_property_x (mus, sym, val);
}
1, 0, 0, (SCM obj),
"Is @var{obj} a music object?")
{
1, 0, 0, (SCM obj),
"Is @var{obj} a music object?")
{
- return scm_from_bool (Music::unsmob (obj));
+ return ly_bool2scm (Music::is_smob (obj));
}
LY_DEFINE (ly_event_p, "ly:event?",
}
LY_DEFINE (ly_event_p, "ly:event?",
" The immutable properties are not available, since they are"
" constant and initialized by the @code{make-music} function.")
{
" The immutable properties are not available, since they are"
" constant and initialized by the @code{make-music} function.")
{
- LY_ASSERT_TYPE (Music::unsmob, mus, 1);
+ LY_ASSERT_SMOB (Music, mus, 1);
Music *m = Music::unsmob (mus);
return m->get_property_alist (true);
}
Music *m = Music::unsmob (mus);
return m->get_property_alist (true);
}
while (scm_is_pair (lst))
{
while (scm_is_pair (lst))
{
- if (!Music::unsmob (scm_car (lst)))
+ if (!Music::is_smob (scm_car (lst)))
return SCM_BOOL_F;
lst = scm_cdr (lst);
}
return SCM_BOOL_F;
lst = scm_cdr (lst);
}
" @var{m} may be an arbitrary type; cons cells and music"
" are copied recursively.")
{
" @var{m} may be an arbitrary type; cons cells and music"
" are copied recursively.")
{
+ if (Music::is_smob (m))
return Music::unsmob (m)->clone ()->unprotect ();
if (scm_is_pair (m))
{
return Music::unsmob (m)->clone ()->unprotect ();
if (scm_is_pair (m))
{
"Transpose @var{m} such that central@tie{}C is mapped"
" to@tie{}@var{p}. Return@tie{}@var{m}.")
{
"Transpose @var{m} such that central@tie{}C is mapped"
" to@tie{}@var{p}. Return@tie{}@var{m}.")
{
- LY_ASSERT_TYPE (Music::unsmob, m, 1);
+ LY_ASSERT_SMOB (Music, m, 1);
LY_ASSERT_SMOB (Pitch, p, 2);
Music *sc = Music::unsmob (m);
LY_ASSERT_SMOB (Pitch, p, 2);
Music *sc = Music::unsmob (m);
2, 0, 0, (SCM m, SCM factor),
"Compress music object@tie{}@var{m} by moment @var{factor}.")
{
2, 0, 0, (SCM m, SCM factor),
"Compress music object@tie{}@var{m} by moment @var{factor}.")
{
- LY_ASSERT_TYPE (Music::unsmob, m, 1);
- LY_ASSERT_TYPE (Moment::unsmob, factor, 2);
+ LY_ASSERT_SMOB (Music, m, 1);
+ LY_ASSERT_SMOB (Moment, factor, 2);
Music *sc = Music::unsmob (m);
sc->compress (*Moment::unsmob (factor));
Music *sc = Music::unsmob (m);
sc->compress (*Moment::unsmob (factor));
"Make @var{music} relative to @var{pitch},"
" return final pitch.")
{
"Make @var{music} relative to @var{pitch},"
" return final pitch.")
{
- LY_ASSERT_TYPE (Music::unsmob, music, 1);
- LY_ASSERT_TYPE (Pitch::unsmob, pitch, 2);
+ LY_ASSERT_SMOB (Music, music, 1);
+ LY_ASSERT_SMOB (Pitch, pitch, 2);
Pitch start = *Pitch::unsmob (pitch);
Music *m = Music::unsmob (music);
Pitch start = *Pitch::unsmob (pitch);
Music *m = Music::unsmob (music);
"Extract the duration field from @var{mus} and return the"
" length.")
{
"Extract the duration field from @var{mus} and return the"
" length.")
{
- LY_ASSERT_TYPE (Music::unsmob, mus, 1);
+ LY_ASSERT_SMOB (Music, mus, 1);
Music *m = Music::unsmob (mus);
Duration *d = Duration::unsmob (m->get_property ("duration"));
Music *m = Music::unsmob (mus);
Duration *d = Duration::unsmob (m->get_property ("duration"));
"Compress @var{mus} by factor @var{fact}, which is a"
" @code{Moment}.")
{
"Compress @var{mus} by factor @var{fact}, which is a"
" @code{Moment}.")
{
- LY_ASSERT_TYPE (Music::unsmob, mus, 1);
+ LY_ASSERT_SMOB (Music, mus, 1);
LY_ASSERT_SMOB (Moment, fact, 2);
Music *m = Music::unsmob (mus);
LY_ASSERT_SMOB (Moment, fact, 2);
Music *m = Music::unsmob (mus);
Music::get_length () const
{
SCM lst = get_property ("length");
Music::get_length () const
{
SCM lst = get_property ("length");
- if (Moment::unsmob (lst))
+ if (Moment::is_smob (lst))
return *Moment::unsmob (lst);
if (ly_is_procedure (length_callback_))
return *Moment::unsmob (lst);
if (ly_is_procedure (length_callback_))
f->set_parent (ft.head_, Y_AXIS);
f->set_property ("avoid-slur", ly_symbol2scm ("inside"));
if (hordir == LEFT
f->set_parent (ft.head_, Y_AXIS);
f->set_property ("avoid-slur", ly_symbol2scm ("inside"));
if (hordir == LEFT
- && Grob::unsmob (ft.head_->get_object ("accidental-grob")))
+ && Grob::is_smob (ft.head_->get_object ("accidental-grob")))
Side_position_interface::add_support (f,
Grob::unsmob (ft.head_->get_object ("accidental-grob")));
Side_position_interface::add_support (f,
Grob::unsmob (ft.head_->get_object ("accidental-grob")));
- else if (Grob::unsmob (ft.head_->get_object ("dot")))
+ else if (Grob::is_smob (ft.head_->get_object ("dot")))
Side_position_interface::add_support (f,
Grob::unsmob (ft.head_->get_object ("dot")));
Side_position_interface::add_support (f,
Grob::unsmob (ft.head_->get_object ("dot")));
bool
Note_column::has_rests (Grob *me)
{
bool
Note_column::has_rests (Grob *me)
{
- return Grob::unsmob (me->get_object ("rest"));
+ return Grob::is_smob (me->get_object ("rest"));
}
else if (Note_head::has_interface (h))
{
}
else if (Note_head::has_interface (h))
{
- if (Grob::unsmob (me->get_object ("rest")))
+ if (Grob::is_smob (me->get_object ("rest")))
both = true;
Pointer_group_interface::add_grob (me, ly_symbol2scm ("note-heads"), h);
}
both = true;
Pointer_group_interface::add_grob (me, ly_symbol2scm ("note-heads"), h);
}
{
SCM scm_tonic = get_property ("tonic");
Pitch tonic;
{
SCM scm_tonic = get_property ("tonic");
Pitch tonic;
- if (Pitch::unsmob (scm_tonic))
+ if (Pitch::is_smob (scm_tonic))
tonic = *Pitch::unsmob (scm_tonic);
unsigned int delta = (pit->get_notename () - tonic.get_notename () + 7) % 7;
tonic = *Pitch::unsmob (scm_tonic);
unsigned int delta = (pit->get_notename () - tonic.get_notename () + 7) % 7;
Pitch transposing;
SCM prop = get_property ("instrumentTransposition");
Pitch transposing;
SCM prop = get_property ("instrumentTransposition");
- if (Pitch::unsmob (prop))
+ if (Pitch::is_smob (prop))
transposing = *Pitch::unsmob (prop);
for (vsize i = 0; i < note_evs_.size (); i++)
transposing = *Pitch::unsmob (prop);
for (vsize i = 0; i < note_evs_.size (); i++)
Grob *last_spacing = last_spacings_[parent];
if (last_spacing
Grob *last_spacing = last_spacings_[parent];
if (last_spacing
- && !Grob_array::unsmob (last_spacing->get_object ("right-items")))
+ && !Grob_array::is_smob (last_spacing->get_object ("right-items")))
{
Grob *col = Grob::unsmob (get_property ("currentCommandColumn"));
{
Grob *col = Grob::unsmob (get_property ("currentCommandColumn"));
in_text_stencil = Text_interface::interpret_markup (layout,
props,
in_text_annotation);
in_text_stencil = Text_interface::interpret_markup (layout,
props,
in_text_annotation);
- if (!Stencil::unsmob (in_text_stencil))
+ if (!Stencil::is_smob (in_text_stencil))
in_text_stencil = SCM_EOL;
annotation.translate_axis ((footnote_stencil.extent (Y_AXIS)[UP]
+ number_raise
in_text_stencil = SCM_EOL;
annotation.translate_axis ((footnote_stencil.extent (Y_AXIS)[UP]
+ number_raise
markup_markup_spacing = paper->c_variable ("markup-markup-spacing");
last_bottom_spacing = paper->c_variable ("last-bottom-spacing");
top_system_spacing = paper->c_variable ("top-system-spacing");
markup_markup_spacing = paper->c_variable ("markup-markup-spacing");
last_bottom_spacing = paper->c_variable ("last-bottom-spacing");
top_system_spacing = paper->c_variable ("top-system-spacing");
- if (scm_is_pair (systems) && Prob::unsmob (scm_car (systems)))
+ if (scm_is_pair (systems) && Prob::is_smob (scm_car (systems)))
top_system_spacing = paper->c_variable ("top-markup-spacing");
// Note: the page height here does _not_ reserve space for headers and
top_system_spacing = paper->c_variable ("top-markup-spacing");
// Note: the page height here does _not_ reserve space for headers and
paper_->self_scm (),
scopes);
paper_->self_scm (),
scopes);
- if (Stencil::unsmob (tit))
+ if (Stencil::is_smob (tit))
title = *Stencil::unsmob (tit);
if (!title.is_empty ())
title = *Stencil::unsmob (tit);
if (!title.is_empty ())
paper_->self_scm (),
scopes);
paper_->self_scm (),
scopes);
- if (Stencil::unsmob (tit))
+ if (Stencil::is_smob (tit))
title = *Stencil::unsmob (tit);
if (!title.is_empty ())
title = *Stencil::unsmob (tit);
if (!title.is_empty ())
if (scm_is_pair (system_specs))
set_system_penalty (scm_car (system_specs), header);
if (scm_is_pair (system_specs))
set_system_penalty (scm_car (system_specs), header);
- if (Prob::unsmob (title))
+ if (Prob::is_smob (title))
{
system_specs = scm_cons (title, system_specs);
Prob::unsmob (title)->unprotect ();
{
system_specs = scm_cons (title, system_specs);
Prob::unsmob (title)->unprotect ();
if (!elem->get_parent (X_AXIS))
elem->set_parent (col, X_AXIS);
if (!elem->get_parent (X_AXIS))
elem->set_parent (col, X_AXIS);
- if (!Grob::unsmob (elem->get_object ("axis-group-parent-X")))
+ if (!Grob::is_smob (elem->get_object ("axis-group-parent-X")))
elem->set_object ("axis-group-parent-X", col->self_scm ());
if (Accidental_placement::has_interface (elem)
elem->set_object ("axis-group-parent-X", col->self_scm ());
if (Accidental_placement::has_interface (elem)
SCM mpos = get_property ("measurePosition");
SCM barnum = get_property ("internalBarNumber");
SCM mpos = get_property ("measurePosition");
SCM barnum = get_property ("internalBarNumber");
- if (Moment::unsmob (mpos)
+ if (Moment::is_smob (mpos)
&& scm_is_integer (barnum))
{
SCM where = scm_cons (barnum,
&& scm_is_integer (barnum))
{
SCM where = scm_cons (barnum,
scm_is_pair (s); s = scm_cdr (s))
{
Spring *sp = Spring::unsmob (scm_caar (s));
scm_is_pair (s); s = scm_cdr (s))
{
Spring *sp = Spring::unsmob (scm_caar (s));
- if (!Grob::unsmob (scm_cdar (s))
+ if (!Grob::is_smob (scm_cdar (s))
|| !Grob::unsmob (scm_cdar (s))->get_system ())
continue;
|| !Grob::unsmob (scm_cdar (s))->get_system ())
continue;
"Return vector of @code{paper_system} objects from"
" @var{paper-score}.")
{
"Return vector of @code{paper_system} objects from"
" @var{paper-score}.")
{
- LY_ASSERT_TYPE (Paper_score::unsmob, paper_score, 1);
+ LY_ASSERT_SMOB (Paper_score, paper_score, 1);
Paper_score *pscore = dynamic_cast<Paper_score *> (Music_output::unsmob (paper_score));
return pscore->get_paper_systems ();
Paper_score *pscore = dynamic_cast<Paper_score *> (Music_output::unsmob (paper_score));
return pscore->get_paper_systems ();
{
SCM proc = parser->lexer_->lookup_identifier ("toplevel-text-handler");
scm_call_2 (proc, parser->self_scm (), out);
{
SCM proc = parser->lexer_->lookup_identifier ("toplevel-text-handler");
scm_call_2 (proc, parser->self_scm (), out);
- } else if (Score::unsmob ($1))
+ } else if (Score::is_smob ($1))
{
SCM proc = parser->lexer_->lookup_identifier ("toplevel-score-handler");
scm_call_2 (proc, parser->self_scm (), $1);
{
SCM proc = parser->lexer_->lookup_identifier ("toplevel-score-handler");
scm_call_2 (proc, parser->self_scm (), $1);
| multiplied_duration
| music_embedded music_embedded music_list {
$3 = scm_reverse_x ($3, SCM_EOL);
| multiplied_duration
| music_embedded music_embedded music_list {
$3 = scm_reverse_x ($3, SCM_EOL);
- if (Music::unsmob ($2))
+ if (Music::is_smob ($2))
- if (Music::unsmob ($1))
+ if (Music::is_smob ($1))
$3 = scm_cons ($1, $3);
$$ = MAKE_SYNTAX ("sequential-music", @$, $3);
}
$3 = scm_cons ($1, $3);
$$ = MAKE_SYNTAX ("sequential-music", @$, $3);
}
$$ = Context_def::make_scm ();
td = Context_def::unsmob ($$);
}
$$ = Context_def::make_scm ();
td = Context_def::unsmob ($$);
}
- if (Music::unsmob ($2)) {
+ if (Music::is_smob ($2)) {
SCM proc = parser->lexer_->lookup_identifier ("context-mod-music-handler");
$2 = scm_call_2 (proc, parser->self_scm (), $2);
}
SCM proc = parser->lexer_->lookup_identifier ("context-mod-music-handler");
$2 = scm_call_2 (proc, parser->self_scm (), $2);
}
{
SCM proc = parser->lexer_->lookup_identifier ("book-text-handler");
scm_call_2 (proc, $1, out);
{
SCM proc = parser->lexer_->lookup_identifier ("book-text-handler");
scm_call_2 (proc, $1, out);
- } else if (Score::unsmob ($2))
+ } else if (Score::is_smob ($2))
{
SCM proc = parser->lexer_->lookup_identifier ("book-score-handler");
scm_call_2 (proc, $1, $2);
{
SCM proc = parser->lexer_->lookup_identifier ("book-score-handler");
scm_call_2 (proc, $1, $2);
{
SCM proc = parser->lexer_->lookup_identifier ("bookpart-text-handler");
scm_call_2 (proc, $1, out);
{
SCM proc = parser->lexer_->lookup_identifier ("bookpart-text-handler");
scm_call_2 (proc, $1, out);
- } else if (Score::unsmob ($2))
+ } else if (Score::is_smob ($2))
{
SCM proc = parser->lexer_->lookup_identifier ("bookpart-score-handler");
scm_call_2 (proc, $1, $2);
{
SCM proc = parser->lexer_->lookup_identifier ("bookpart-score-handler");
scm_call_2 (proc, $1, $2);
score_body:
score_items {
score_body:
score_items {
- if (!Score::unsmob ($1)) {
+ if (!Score::is_smob ($1)) {
parser->parser_error (@1, _("Missing music in \\score"));
$$ = (new Score)->unprotect ();
if (scm_is_pair ($1) && ly_is_module (scm_car ($1)))
parser->parser_error (@1, _("Missing music in \\score"));
$$ = (new Score)->unprotect ();
if (scm_is_pair ($1) && ly_is_module (scm_car ($1)))
od = 0;
$2 = SCM_UNSPECIFIED;
}
od = 0;
$2 = SCM_UNSPECIFIED;
}
- } else if (!Score::unsmob ($$)) {
- if (Music::unsmob ($2)) {
+ } else if (!Score::is_smob ($$)) {
+ if (Music::is_smob ($2)) {
SCM scorify = ly_lily_module_constant ("scorify-music");
$2 = scm_call_2 (scorify, $2, parser->self_scm ());
}
SCM scorify = ly_lily_module_constant ("scorify-music");
$2 = scm_call_2 (scorify, $2, parser->self_scm ());
}
- if (Score::unsmob ($2))
+ if (Score::is_smob ($2))
{
$$ = $2;
$2 = SCM_UNSPECIFIED;
{
$$ = $2;
$2 = SCM_UNSPECIFIED;
} else
$1 = scm_car ($1);
}
} else
$1 = scm_car ($1);
}
- if (Context_def::unsmob ($2))
+ if (Context_def::is_smob ($2))
assign_context_def (Output_def::unsmob ($1), $2);
// Seems unlikely, but let's be complete:
assign_context_def (Output_def::unsmob ($1), $2);
// Seems unlikely, but let's be complete:
- else if (Music::unsmob ($2))
+ else if (Music::is_smob ($2))
{
SCM proc = parser->lexer_->lookup_identifier
("output-def-music-handler");
{
SCM proc = parser->lexer_->lookup_identifier
("output-def-music-handler");
} music_or_context_def
{
parser->lexer_->pop_state ();
} music_or_context_def
{
parser->lexer_->pop_state ();
- if (Context_def::unsmob ($3))
+ if (Context_def::is_smob ($3))
assign_context_def (Output_def::unsmob ($1), $3);
else {
assign_context_def (Output_def::unsmob ($1), $3);
else {
$$ = SCM_EOL;
}
| music_list music_embedded {
$$ = SCM_EOL;
}
| music_list music_embedded {
- if (Music::unsmob ($2))
+ if (Music::is_smob ($2))
$$ = scm_cons ($2, $1);
}
| music_list error {
$$ = scm_cons ($2, $1);
}
| music_list error {
pitch_or_music
{
$$ = make_music_from_simple (parser, @1, $1);
pitch_or_music
{
$$ = make_music_from_simple (parser, @1, $1);
- if (!Music::unsmob ($$))
+ if (!Music::is_smob ($$))
{
parser->parser_error (@1, _ ("music expected"));
$$ = MAKE_SYNTAX ("void-music", @$);
{
parser->parser_error (@1, _ ("music expected"));
$$ = MAKE_SYNTAX ("void-music", @$);
}
| WITH context_modification_arg
{
}
| WITH context_modification_arg
{
- if (Music::unsmob ($2)) {
+ if (Music::is_smob ($2)) {
SCM proc = parser->lexer_->lookup_identifier ("context-mod-music-handler");
$2 = scm_call_2 (proc, parser->self_scm (), $2);
}
SCM proc = parser->lexer_->lookup_identifier ("context-mod-music-handler");
$2 = scm_call_2 (proc, parser->self_scm (), $2);
}
- if (Context_mod::unsmob ($2))
+ if (Context_mod::is_smob ($2))
$$ = $2;
else {
parser->parser_error (@2, _ ("not a context mod"));
$$ = $2;
else {
parser->parser_error (@2, _ ("not a context mod"));
| context_mod_list context_mod_arg {
if (scm_is_eq ($2, SCM_UNSPECIFIED))
;
| context_mod_list context_mod_arg {
if (scm_is_eq ($2, SCM_UNSPECIFIED))
;
- else if (Music::unsmob ($2)) {
+ else if (Music::is_smob ($2)) {
SCM proc = parser->lexer_->lookup_identifier ("context-mod-music-handler");
$2 = scm_call_2 (proc, parser->self_scm (), $2);
}
SCM proc = parser->lexer_->lookup_identifier ("context-mod-music-handler");
$2 = scm_call_2 (proc, parser->self_scm (), $2);
}
- if (Context_mod::unsmob ($2))
+ if (Context_mod::is_smob ($2))
Context_mod::unsmob ($$)->add_context_mods
(Context_mod::unsmob ($2)->get_mods ());
else {
Context_mod::unsmob ($$)->add_context_mods
(Context_mod::unsmob ($2)->get_mods ());
else {
if (!parser->lexer_->is_chord_state ())
parser->parser_error (@1, _ ("have to be in Chord mode for chords"));
if (scm_is_pair ($2)) {
if (!parser->lexer_->is_chord_state ())
parser->parser_error (@1, _ ("have to be in Chord mode for chords"));
if (scm_is_pair ($2)) {
- if (Pitch::unsmob ($1))
+ if (Pitch::is_smob ($1))
$1 = make_chord_elements (@1,
$1,
parser->default_duration_.smobbed_copy (),
$1 = make_chord_elements (@1,
$1,
parser->default_duration_.smobbed_copy (),
SCM elts = ly_append2 ($1, scm_reverse_x ($2, SCM_EOL));
$$ = MAKE_SYNTAX ("event-chord", @1, elts);
SCM elts = ly_append2 ($1, scm_reverse_x ($2, SCM_EOL));
$$ = MAKE_SYNTAX ("event-chord", @1, elts);
- } else if (!Pitch::unsmob ($1))
+ } else if (!Pitch::is_smob ($1))
$$ = MAKE_SYNTAX ("event-chord", @1, $1);
// A mere pitch drops through.
} %prec ':'
$$ = MAKE_SYNTAX ("event-chord", @1, $1);
// A mere pitch drops through.
} %prec ':'
int
Lily_lexer::try_special_identifiers (SCM *destination, SCM sid)
{
int
Lily_lexer::try_special_identifiers (SCM *destination, SCM sid)
{
- if (Book::unsmob (sid)) {
+ if (Book::is_smob (sid)) {
Book *book = Book::unsmob (sid)->clone ();
*destination = book->self_scm ();
book->unprotect ();
Book *book = Book::unsmob (sid)->clone ();
*destination = book->self_scm ();
book->unprotect ();
} else if (scm_is_number (sid)) {
*destination = sid;
return NUMBER_IDENTIFIER;
} else if (scm_is_number (sid)) {
*destination = sid;
return NUMBER_IDENTIFIER;
- } else if (Context_def::unsmob (sid))
+ } else if (Context_def::is_smob (sid))
{
*destination = Context_def::unsmob (sid)->clone ()->unprotect ();
return SCM_IDENTIFIER;
{
*destination = Context_def::unsmob (sid)->clone ()->unprotect ();
return SCM_IDENTIFIER;
- } else if (Context_mod::unsmob (sid)) {
+ } else if (Context_mod::is_smob (sid)) {
*destination = Context_mod::unsmob (sid)->smobbed_copy ();
return CONTEXT_MOD_IDENTIFIER;
} else if (Music *mus = Music::unsmob (sid)) {
*destination = Context_mod::unsmob (sid)->smobbed_copy ();
return CONTEXT_MOD_IDENTIFIER;
} else if (Music *mus = Music::unsmob (sid)) {
bool is_event = mus->is_mus_type ("post-event");
mus->unprotect ();
return is_event ? EVENT_IDENTIFIER : MUSIC_IDENTIFIER;
bool is_event = mus->is_mus_type ("post-event");
mus->unprotect ();
return is_event ? EVENT_IDENTIFIER : MUSIC_IDENTIFIER;
- } else if (Pitch::unsmob (sid)) {
+ } else if (Pitch::is_smob (sid)) {
*destination = Pitch::unsmob (sid)->smobbed_copy ();
return PITCH_IDENTIFIER;
*destination = Pitch::unsmob (sid)->smobbed_copy ();
return PITCH_IDENTIFIER;
- } else if (Duration::unsmob (sid)) {
+ } else if (Duration::is_smob (sid)) {
*destination = Duration::unsmob (sid)->smobbed_copy ();
return DURATION_IDENTIFIER;
*destination = Duration::unsmob (sid)->smobbed_copy ();
return DURATION_IDENTIFIER;
- } else if (Output_def::unsmob (sid)) {
+ } else if (Output_def::is_smob (sid)) {
*destination = Output_def::unsmob (sid)->clone ()->unprotect ();
return SCM_IDENTIFIER;
*destination = Output_def::unsmob (sid)->clone ()->unprotect ();
return SCM_IDENTIFIER;
- } else if (Score::unsmob (sid)) {
+ } else if (Score::is_smob (sid)) {
*destination = Score::unsmob (sid)->clone ()->unprotect ();
return SCM_IDENTIFIER;
}
*destination = Score::unsmob (sid)->clone ()->unprotect ();
return SCM_IDENTIFIER;
}
SCM
make_music_from_simple (Lily_parser *parser, Input loc, SCM simple)
{
SCM
make_music_from_simple (Lily_parser *parser, Input loc, SCM simple)
{
- if (Music::unsmob (simple))
+ if (Music::is_smob (simple))
return simple;
if (parser->lexer_->is_note_state ()) {
if (scm_is_symbol (simple)) {
return simple;
if (parser->lexer_->is_note_state ()) {
if (scm_is_symbol (simple)) {
n->set_property ("drum-type", simple);
return n->unprotect ();
}
n->set_property ("drum-type", simple);
return n->unprotect ();
}
- if (Pitch::unsmob (simple)) {
+ if (Pitch::is_smob (simple)) {
Music *n = MY_MAKE_MUSIC ("NoteEvent", loc);
n->set_property ("duration", parser->default_duration_.smobbed_copy ());
n->set_property ("pitch", simple);
Music *n = MY_MAKE_MUSIC ("NoteEvent", loc);
n->set_property ("duration", parser->default_duration_.smobbed_copy ());
n->set_property ("pitch", simple);
return MAKE_SYNTAX ("lyric-event", loc, simple,
parser->default_duration_.smobbed_copy ());
} else if (parser->lexer_->is_chord_state ()) {
return MAKE_SYNTAX ("lyric-event", loc, simple,
parser->default_duration_.smobbed_copy ());
} else if (parser->lexer_->is_chord_state ()) {
- if (Pitch::unsmob (simple))
+ if (Pitch::is_smob (simple))
return MAKE_SYNTAX
("event-chord",
loc,
return MAKE_SYNTAX
("event-chord",
loc,
2, 0, 0, (SCM performance, SCM filename),
"Write @var{performance} to @var{filename}.")
{
2, 0, 0, (SCM performance, SCM filename),
"Write @var{performance} to @var{filename}.")
{
- LY_ASSERT_TYPE (Performance::unsmob, performance, 1);
+ LY_ASSERT_SMOB (Performance, performance, 1);
LY_ASSERT_TYPE (scm_is_string, filename, 2);
Performance::unsmob (performance)->write_output (ly_scm2string (filename));
LY_ASSERT_TYPE (scm_is_string, filename, 2);
Performance::unsmob (performance)->write_output (ly_scm2string (filename));
if (ev
&& ev->in_event_class ("trill-span-event")
&& to_dir (ev->get_property ("span-direction")) == START
if (ev
&& ev->in_event_class ("trill-span-event")
&& to_dir (ev->get_property ("span-direction")) == START
- && Pitch::unsmob (ev->get_property ("pitch")))
+ && Pitch::is_smob (ev->get_property ("pitch")))
3, 0, 0, (SCM grob, SCM sym, SCM grob_element),
"Add @var{grob-element} to @var{grob}'s @var{sym} grob array.")
{
3, 0, 0, (SCM grob, SCM sym, SCM grob_element),
"Add @var{grob-element} to @var{grob}'s @var{sym} grob array.")
{
- LY_ASSERT_TYPE (Grob::unsmob, grob, 1);
+ LY_ASSERT_SMOB (Grob, grob, 1);
LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
- LY_ASSERT_TYPE (Grob::unsmob, grob_element, 3);
+ LY_ASSERT_SMOB (Grob, grob_element, 3);
Pointer_group_interface::add_grob (Grob::unsmob (grob),
sym,
Pointer_group_interface::add_grob (Grob::unsmob (grob),
sym,
SCM aval = scm_cdar (aprop);
SCM bval = scm_cdar (bprop);
if (scm_caar (aprop) != scm_caar (bprop)
SCM aval = scm_cdar (aprop);
SCM bval = scm_cdar (bprop);
if (scm_caar (aprop) != scm_caar (bprop)
- || (!(Input::unsmob (aval) && Input::unsmob (bval))
+ || (!(Input::is_smob (aval) && Input::is_smob (bval))
&&
!to_boolean (scm_equal_p (aval, bval))))
return SCM_BOOL_F;
&&
!to_boolean (scm_equal_p (aval, bval))))
return SCM_BOOL_F;
new_elts.insert (new_elts.end (), elts.begin (), elts.end ());
SCM neighbors_scm = me->get_object ("neighbors");
new_elts.insert (new_elts.end (), elts.begin (), elts.end ());
SCM neighbors_scm = me->get_object ("neighbors");
- if (Grob_array::unsmob (neighbors_scm))
+ if (Grob_array::is_smob (neighbors_scm))
{
vector<Grob *> &arr
= Grob_array::unsmob (neighbors_scm)->array_reference ();
{
vector<Grob *> &arr
= Grob_array::unsmob (neighbors_scm)->array_reference ();
int
Scheme_hash_table::print_smob (SCM s, SCM p, scm_print_state *)
{
int
Scheme_hash_table::print_smob (SCM s, SCM p, scm_print_state *)
{
scm_puts ("#<Scheme_hash_table ", p);
Scheme_hash_table *me = (Scheme_hash_table *) SCM_CELL_WORD_1 (s);
scm_display (me->hash_tab_, p);
scm_puts ("#<Scheme_hash_table ", p);
Scheme_hash_table *me = (Scheme_hash_table *) SCM_CELL_WORD_1 (s);
scm_display (me->hash_tab_, p);
void
Score::set_music (SCM music)
{
void
Score::set_music (SCM music)
{
- if (Music::unsmob (music_))
+ if (Music::is_smob (music_))
{
Music::unsmob (music)->origin ()->error (_ ("already have music in score"));
Music::unsmob (music_)->origin ()->error (_ ("this is the previous music"));
{
Music::unsmob (music)->origin ()->error (_ ("already have music in score"));
Music::unsmob (music_)->origin ()->error (_ ("this is the previous music"));
- if (Skyline_pair::unsmob (skyp))
+ if (Skyline_pair::is_smob (skyp))
{
// for spanner pure heights, we don't know horizontal spacing,
// so a spanner can never have a meaningful x coordiante
{
// for spanner pure heights, we don't know horizontal spacing,
// so a spanner can never have a meaningful x coordiante
- if (Skyline_pair::unsmob (sp))
+ if (Skyline_pair::is_smob (sp))
{
Real xc = pure && dynamic_cast<Spanner *> (e)
? e->get_parent (X_AXIS)->relative_coordinate (common[X_AXIS], X_AXIS)
{
Real xc = pure && dynamic_cast<Spanner *> (e)
? e->get_parent (X_AXIS)->relative_coordinate (common[X_AXIS], X_AXIS)
if (Simple_closure *sc = Simple_closure::unsmob (expr))
{
SCM inside = sc->expression ();
if (Simple_closure *sc = Simple_closure::unsmob (expr))
{
SCM inside = sc->expression ();
- SCM proc = !pure && Unpure_pure_container::unsmob (scm_car (inside))
+ SCM proc = !pure && Unpure_pure_container::is_smob (scm_car (inside))
? Unpure_pure_container::unsmob (scm_car (inside))->unpure_part ()
: scm_car (inside);
SCM args = scm_cons (delayed_argument,
? Unpure_pure_container::unsmob (scm_car (inside))->unpure_part ()
: scm_car (inside);
SCM args = scm_cons (delayed_argument,
return expr;
else if (scm_car (expr) == ly_symbol2scm ("quote"))
return scm_cadr (expr);
return expr;
else if (scm_car (expr) == ly_symbol2scm ("quote"))
return scm_cadr (expr);
- else if (Unpure_pure_container::unsmob (scm_car (expr))
+ else if (Unpure_pure_container::is_smob (scm_car (expr))
|| ly_is_procedure (scm_car (expr)))
{
|| ly_is_procedure (scm_car (expr)))
{
- SCM proc = !pure && Unpure_pure_container::unsmob (scm_car (expr))
+ SCM proc = !pure && Unpure_pure_container::is_smob (scm_car (expr))
? Unpure_pure_container::unsmob (scm_car (expr))->unpure_part ()
: scm_car (expr);
SCM args = evaluate_args (delayed_argument, scm_cdr (expr), pure, start, end);
? Unpure_pure_container::unsmob (scm_car (expr))->unpure_part ()
: scm_car (expr);
SCM args = evaluate_args (delayed_argument, scm_cdr (expr), pure, start, end);
}
SCM encompass_scm = me->get_object ("encompass-objects");
}
SCM encompass_scm = me->get_object ("encompass-objects");
- if (Grob_array::unsmob (encompass_scm))
+ if (Grob_array::is_smob (encompass_scm))
{
vector<Grob *> &arr
= Grob_array::unsmob (encompass_scm)->array_reference ();
{
vector<Grob *> &arr
= Grob_array::unsmob (encompass_scm)->array_reference ();
{
if (scm_is_pair (scm_car (s))
&& Grob::unsmob (scm_cdar (s)) == next_col
{
if (scm_is_pair (scm_car (s))
&& Grob::unsmob (scm_cdar (s)) == next_col
- && Spring::unsmob (scm_caar (s)))
+ && Spring::is_smob (scm_caar (s)))
spring = Spring::unsmob (scm_caar (s));
}
spring = Spring::unsmob (scm_caar (s));
}
Moment shortest_playing_len = 0;
SCM s = lc->get_property ("shortest-playing-duration");
Moment shortest_playing_len = 0;
SCM s = lc->get_property ("shortest-playing-duration");
- if (Moment::unsmob (s))
+ if (Moment::is_smob (s))
shortest_playing_len = *Moment::unsmob (s);
if (! shortest_playing_len.to_bool ())
shortest_playing_len = *Moment::unsmob (s);
if (! shortest_playing_len.to_bool ())
if (!Paper_column::is_breakable (it) && !Paper_column::is_musical (it))
continue;
if (!Paper_column::is_breakable (it) && !Paper_column::is_musical (it))
continue;
- if (i && !Grob::unsmob (cols[i]->get_object ("left-neighbor")))
+ if (i && !Grob::is_smob (cols[i]->get_object ("left-neighbor")))
cols[i]->set_object ("left-neighbor", cols[i - 1]->self_scm ());
cols[i]->set_object ("left-neighbor", cols[i - 1]->self_scm ());
- if (i + 1 < cols.size () && !Grob::unsmob (cols[i]->get_object ("right-neighbor")))
+ if (i + 1 < cols.size () && !Grob::is_smob (cols[i]->get_object ("right-neighbor")))
cols[i]->set_object ("right-neighbor", cols[i + 1]->self_scm ());
}
}
cols[i]->set_object ("right-neighbor", cols[i + 1]->self_scm ());
}
}
->set_object ("spacing", spacing_->self_scm ());
SCM proportional = get_property ("proportionalNotationDuration");
->set_object ("spacing", spacing_->self_scm ());
SCM proportional = get_property ("proportionalNotationDuration");
- if (Moment::unsmob (proportional))
+ if (Moment::is_smob (proportional))
{
musical_column->set_property ("shortest-playing-duration", proportional);
musical_column->set_property ("shortest-starter-duration", proportional);
{
musical_column->set_property ("shortest-playing-duration", proportional);
musical_column->set_property ("shortest-starter-duration", proportional);
"Get one of the bounds of @var{spanner}. @var{dir} is @w{@code{-1}}"
" for left, and @code{1} for right.")
{
"Get one of the bounds of @var{spanner}. @var{dir} is @w{@code{-1}}"
" for left, and @code{1} for right.")
{
- LY_ASSERT_TYPE (Spanner::unsmob, spanner, 1);
+ LY_ASSERT_SMOB (Spanner, spanner, 1);
LY_ASSERT_TYPE (is_direction, dir, 2);
Item *bound = Spanner::unsmob (spanner)->get_bound (to_dir (dir));
return bound ? bound->self_scm () : SCM_EOL;
LY_ASSERT_TYPE (is_direction, dir, 2);
Item *bound = Spanner::unsmob (spanner)->get_bound (to_dir (dir));
return bound ? bound->self_scm () : SCM_EOL;
"Set grob @var{item} as bound in direction @var{dir} for"
" @var{spanner}.")
{
"Set grob @var{item} as bound in direction @var{dir} for"
" @var{spanner}.")
{
- LY_ASSERT_TYPE (Spanner::unsmob, spanner, 1);
+ LY_ASSERT_SMOB (Spanner, spanner, 1);
LY_ASSERT_TYPE (is_direction, dir, 2);
LY_ASSERT_TYPE (is_direction, dir, 2);
- LY_ASSERT_TYPE (Item::unsmob, item, 3);
+ LY_ASSERT_SMOB (Item, item, 3);
Spanner::unsmob (spanner)->set_bound (to_dir (dir), Item::unsmob (item));
return SCM_UNSPECIFIED;
Spanner::unsmob (spanner)->set_bound (to_dir (dir), Item::unsmob (item));
return SCM_UNSPECIFIED;
Stem_engraver::kill_unused_flags ()
{
for (vsize i = 0; i < maybe_flags_.size (); i++)
Stem_engraver::kill_unused_flags ()
{
for (vsize i = 0; i < maybe_flags_.size (); i++)
- if (Grob::unsmob (maybe_flags_[i]->get_parent (X_AXIS)->get_object ("beam")))
+ if (Grob::is_smob (maybe_flags_[i]->get_parent (X_AXIS)->get_object ("beam")))
maybe_flags_[i]->suicide ();
}
maybe_flags_[i]->suicide ();
}
/* Tremolo stuff. */
Grob *t_flag = Grob::unsmob (me->get_object ("tremolo-flag"));
/* Tremolo stuff. */
Grob *t_flag = Grob::unsmob (me->get_object ("tremolo-flag"));
- if (t_flag && (!Grob::unsmob (me->get_object ("beam")) || !calc_beam))
+ if (t_flag && (!Grob::is_smob (me->get_object ("beam")) || !calc_beam))
{
/* Crude hack: add extra space if tremolo flag is there.
{
/* Crude hack: add extra space if tremolo flag is there.
If there is a beam but no stem, slope calculations depend on this
routine to return where the stem end /would/ be.
*/
If there is a beam but no stem, slope calculations depend on this
routine to return where the stem end /would/ be.
*/
- if (calc_beam && !beam && !Stencil::unsmob (me->get_property ("stencil")))
+ if (calc_beam && !beam && !Stencil::is_smob (me->get_property ("stencil")))
return Interval ();
Real y1 = robust_scm2double ((calc_beam
return Interval ();
Real y1 = robust_scm2double ((calc_beam
Stem::calc_length (SCM smob)
{
Grob *me = Grob::unsmob (smob);
Stem::calc_length (SCM smob)
{
Grob *me = Grob::unsmob (smob);
- if (Grob::unsmob (me->get_object ("beam")))
+ if (Grob::is_smob (me->get_object ("beam")))
{
me->programming_error ("ly:stem::calc-length called but will not be used for beamed stem.");
return scm_from_double (0.0);
{
me->programming_error ("ly:stem::calc-length called but will not be used for beamed stem.");
return scm_from_double (0.0);
1, 0, 0, (SCM obj),
"Is @code{@var{obj}} a @code{Stream_event} object?")
{
1, 0, 0, (SCM obj),
"Is @code{@var{obj}} a @code{Stream_event} object?")
{
- return scm_from_bool (Stream_event::unsmob (obj));
+ return scm_from_bool (Stream_event::is_smob (obj));
}
LY_DEFINE (ly_make_stream_event, "ly:make-stream-event",
}
LY_DEFINE (ly_make_stream_event, "ly:make-stream-event",
" If @var{sym} is undefined, return @var{val} or"
" @code{'()} if @var{val} is not specified.")
{
" If @var{sym} is undefined, return @var{val} or"
" @code{'()} if @var{val} is not specified.")
{
- LY_ASSERT_TYPE (Stream_event::unsmob, sev, 1)
+ LY_ASSERT_SMOB (Stream_event, sev, 1)
return ly_prob_property (sev, sym, val);
}
return ly_prob_property (sev, sym, val);
}
3, 0, 0, (SCM ev, SCM sym, SCM val),
"Set property @var{sym} in event @var{ev} to @var{val}.")
{
3, 0, 0, (SCM ev, SCM sym, SCM val),
"Set property @var{sym} in event @var{ev} to @var{val}.")
{
- LY_ASSERT_TYPE (Stream_event::unsmob, ev, 1);
+ LY_ASSERT_SMOB (Stream_event, ev, 1);
LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
return ly_prob_set_property_x (ev, sym, val);
LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
return ly_prob_set_property_x (ev, sym, val);
SCM prop = scm_car (entry);
SCM val = scm_cdr (entry);
SCM prop = scm_car (entry);
SCM val = scm_cdr (entry);
- if ((Pitch::unsmob (val)
- || (prop == ly_symbol2scm ("element") && Music::unsmob (val))
+ if ((Pitch::is_smob (val)
+ || (prop == ly_symbol2scm ("element") && Music::is_smob (val))
|| (prop == ly_symbol2scm ("elements") && scm_is_pair (val))
|| (prop == ly_symbol2scm ("pitch-alist") && scm_is_pair (val)))
&& scm_is_false (scm_assq (prop, mutable_property_alist_)))
|| (prop == ly_symbol2scm ("elements") && scm_is_pair (val))
|| (prop == ly_symbol2scm ("pitch-alist") && scm_is_pair (val)))
&& scm_is_false (scm_assq (prop, mutable_property_alist_)))
Tempo_performer::process_music ()
{
SCM w = get_property ("tempoWholesPerMinute");
Tempo_performer::process_music ()
{
SCM w = get_property ("tempoWholesPerMinute");
+ if (Moment::is_smob (w)
&& !ly_is_equal (w, last_tempo_))
{
Rational r = Moment::unsmob (w)->main_part_;
&& !ly_is_equal (w, last_tempo_))
{
Rational r = Moment::unsmob (w)->main_part_;
Grob *yparent = me->get_parent (Y_AXIS);
if ((Tie_column::has_interface (yparent)
|| Semi_tie_column::has_interface (yparent))
Grob *yparent = me->get_parent (Y_AXIS);
if ((Tie_column::has_interface (yparent)
|| Semi_tie_column::has_interface (yparent))
- && Grob_array::unsmob (yparent->get_object ("ties"))
+ && Grob_array::is_smob (yparent->get_object ("ties"))
// && Grob_array::unsmob (yparent->get_object ("ties"))->size () > 1
)
{
// && Grob_array::unsmob (yparent->get_object ("ties"))->size () > 1
)
{
Grob *yparent = me->get_parent (Y_AXIS);
if ((Tie_column::has_interface (yparent)
|| Semi_tie_column::has_interface (yparent))
Grob *yparent = me->get_parent (Y_AXIS);
if ((Tie_column::has_interface (yparent)
|| Semi_tie_column::has_interface (yparent))
- && Grob_array::unsmob (yparent->get_object ("ties")))
+ && Grob_array::is_smob (yparent->get_object ("ties")))
{
extract_grob_set (yparent, "ties", ties);
if (me->original () && ties.size () == 1
{
extract_grob_set (yparent, "ties", ties);
if (me->original () && ties.size () == 1
SCM measureLength = timing->get_property ("measureLength");
SCM measureLength = timing->get_property ("measureLength");
- if (!Moment::unsmob (measureLength))
+ if (!Moment::is_smob (measureLength))
{
measureLength =
Moment (ly_scm2rational
{
measureLength =
Moment (ly_scm2rational
context ()->set_property ("beamExceptions", beamExceptions);
SCM baseMoment = timing->get_property ("baseMoment");
context ()->set_property ("beamExceptions", beamExceptions);
SCM baseMoment = timing->get_property ("baseMoment");
- if (!Moment::unsmob (baseMoment))
+ if (!Moment::is_smob (baseMoment))
{
baseMoment =
Moment (ly_scm2rational
{
baseMoment =
Moment (ly_scm2rational
Timing_translator::measure_length () const
{
SCM l = get_property ("measureLength");
Timing_translator::measure_length () const
{
SCM l = get_property ("measureLength");
- if (Moment::unsmob (l))
+ if (Moment::is_smob (l))
return Moment::unsmob (l)->main_part_;
else
return Rational (1);
return Moment::unsmob (l)->main_part_;
else
return Rational (1);
Moment measposp;
SCM s = get_property ("measurePosition");
Moment measposp;
SCM s = get_property ("measurePosition");
- if (Moment::unsmob (s))
+ if (Moment::is_smob (s))
measposp = *Moment::unsmob (s);
else
{
measposp = *Moment::unsmob (s);
else
{
SCM *tail = ℓ
for (SCM p = ell; scm_is_pair (p); p = scm_cdr (p))
{
SCM *tail = ℓ
for (SCM p = ell; scm_is_pair (p); p = scm_cdr (p))
{
- if (Performer::unsmob (scm_car (*tail)))
+ if (Performer::is_smob (scm_car (*tail)))
*tail = scm_cdr (*tail);
else
tail = SCM_CDRLOC (*tail);
*tail = scm_cdr (*tail);
else
tail = SCM_CDRLOC (*tail);
SCM *tail = ℓ
for (SCM p = ell; scm_is_pair (p); p = scm_cdr (p))
{
SCM *tail = ℓ
for (SCM p = ell; scm_is_pair (p); p = scm_cdr (p))
{
- if (Engraver::unsmob (scm_car (*tail)))
+ if (Engraver::is_smob (scm_car (*tail)))
*tail = scm_cdr (*tail);
else
tail = SCM_CDRLOC (*tail);
*tail = scm_cdr (*tail);
else
tail = SCM_CDRLOC (*tail);
// assume that if a script is avoiding slurs, it should not get placed
// under a tuplet bracket
// assume that if a script is avoiding slurs, it should not get placed
// under a tuplet bracket
- if (Grob::unsmob (scripts[i]->get_object ("slur")))
+ if (Grob::is_smob (scripts[i]->get_object ("slur")))
continue;
Interval script_x (scripts[i]->extent (commonx, X_AXIS));
continue;
Interval script_x (scripts[i]->extent (commonx, X_AXIS));
for (int i = 0; i < rep_count; i++)
{
for (int i = 0; i < rep_count; i++)
{
- if (Music::unsmob (body))
+ if (Music::is_smob (body))
*tail = scm_cons (body, SCM_EOL);
tail = SCM_CDRLOC (*tail);
*tail = scm_cons (body, SCM_EOL);
tail = SCM_CDRLOC (*tail);
1, 0, 0, (SCM pc),
"Return the unpure part of @var{pc}.")
{
1, 0, 0, (SCM pc),
"Return the unpure part of @var{pc}.")
{
- LY_ASSERT_TYPE (Unpure_pure_container::unsmob, pc, 1);
+ LY_ASSERT_SMOB (Unpure_pure_container, pc, 1);
return Unpure_pure_container::unsmob (pc)->unpure_part ();
}
return Unpure_pure_container::unsmob (pc)->unpure_part ();
}
1, 0, 0, (SCM pc),
"Return the pure part of @var{pc}.")
{
1, 0, 0, (SCM pc),
"Return the pure part of @var{pc}.")
{
- LY_ASSERT_TYPE (Unpure_pure_container::unsmob, pc, 1);
+ LY_ASSERT_SMOB (Unpure_pure_container, pc, 1);
return Unpure_pure_container::unsmob (pc)->pure_part ();
}
return Unpure_pure_container::unsmob (pc)->pure_part ();
}
else if (qualifies (i))
{
Pointer_group_interface::add_grob (valign_, ly_symbol2scm ("elements"), i.grob ());
else if (qualifies (i))
{
Pointer_group_interface::add_grob (valign_, ly_symbol2scm ("elements"), i.grob ());
- if (!Grob::unsmob (i.grob ()->get_object ("staff-grouper")))
+ if (!Grob::is_smob (i.grob ()->get_object ("staff-grouper")))
i.grob ()->set_object ("staff-grouper", valign_->self_scm ());
}
}
i.grob ()->set_object ("staff-grouper", valign_->self_scm ());
}
}
SCM l (get_property ("voltaSpannerDuration"));
Moment now = now_mom ();
SCM l (get_property ("voltaSpannerDuration"));
Moment now = now_mom ();
- bool early_stop = Moment::unsmob (l)
+ bool early_stop = Moment::is_smob (l)
&& *Moment::unsmob (l) <= now - started_mom_;
end = end || early_stop;
&& *Moment::unsmob (l) <= now - started_mom_;
end = end || early_stop;