Stream_event *note = accidentals_[i].melodic_;
Context *origin = accidentals_[i].origin_;
- Pitch *pitch = unsmob_pitch (note->get_property ("pitch"));
+ Pitch *pitch = Pitch::unsmob (note->get_property ("pitch"));
if (!pitch)
continue;
Grob *a = trans->make_item ("AccidentalSuggestion", note_head->self_scm ());
Side_position_interface::add_support (a, note_head);
- if (Grob *stem = unsmob_grob (a->get_object ("stem")))
+ if (Grob *stem = Grob::unsmob (a->get_object ("stem")))
Side_position_interface::add_support (a, stem);
a->set_parent (note_head, X_AXIS);
int barnum = measure_number (origin);
- Pitch *pitch = unsmob_pitch (note->get_property ("pitch"));
+ Pitch *pitch = Pitch::unsmob (note->get_property ("pitch"));
if (!pitch)
continue;
SCM key = scm_cons (scm_from_int (o), scm_from_int (n));
Moment end_mp = measure_position (context (),
- unsmob_duration (note->get_property ("duration")));
+ Duration::unsmob (note->get_property ("duration")));
SCM position = scm_cons (scm_from_int (barnum), end_mp.smobbed_copy ());
SCM localsig = SCM_EOL;
return 0;
}
- return unsmob_pitch (mcause->get_property ("pitch"));
+ return Pitch::unsmob (mcause->get_property ("pitch"));
}
void
acs = scm_cdr (acs))
for (SCM s = scm_cdar (acs); scm_is_pair (s); s = scm_cdr (s))
{
- Grob *a = unsmob_grob (scm_car (s));
+ Grob *a = Grob::unsmob (scm_car (s));
- if (unsmob_grob (a->get_object ("tie"))
+ if (Grob::unsmob (a->get_object ("tie"))
&& !to_boolean (a->get_property ("forced")))
break_reminder->push_back (a);
else
Accidental_placement_entry *ape = new Accidental_placement_entry;
for (SCM t = scm_cdar (s); scm_is_pair (t); t = scm_cdr (t))
- ape->grobs_.push_back (unsmob_grob (scm_car (t)));
+ ape->grobs_.push_back (Grob::unsmob (scm_car (t)));
apes.push_back (ape);
}
SCM
Accidental_placement::calc_positioning_done (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
if (!me->is_live ())
return SCM_BOOL_T;
static SCM
get_extent (Grob *me, Axis a)
{
- Stencil *s = unsmob_stencil (Accidental_interface::get_stencil (me));
+ Stencil *s = Stencil::unsmob (Accidental_interface::get_stencil (me));
if (s)
return ly_interval2scm (s->extent (a));
SCM
Accidental_interface::height (SCM smob)
{
- return get_extent (unsmob_grob (smob), Y_AXIS);
+ return get_extent (Grob::unsmob (smob), Y_AXIS);
}
MAKE_SCHEME_CALLBACK (Accidental_interface, width, 1);
SCM
Accidental_interface::width (SCM smob)
{
- return get_extent (unsmob_grob (smob), X_AXIS);
+ return get_extent (Grob::unsmob (smob), X_AXIS);
}
MAKE_SCHEME_CALLBACK (Accidental_interface, horizontal_skylines, 1);
SCM
Accidental_interface::horizontal_skylines (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
if (!me->is_live ())
return Skyline_pair ().smobbed_copy ();
* before line breaking. It is therefore `unpure' (c).
* We use the more basic get_stencil.
*/
- Stencil *my_stencil = unsmob_stencil (get_stencil (me));
+ Stencil *my_stencil = Stencil::unsmob (get_stencil (me));
if (!my_stencil)
return Skyline_pair ().smobbed_copy ();
SCM
Accidental_interface::pure_height (SCM smob, SCM start_scm, SCM)
{
- Item *me = dynamic_cast<Item *> (unsmob_grob (smob));
+ Item *me = dynamic_cast<Item *> (Grob::unsmob (smob));
int start = scm_to_int (start_scm);
int rank = me->get_column ()->get_rank ();
if (to_boolean (me->get_property ("forced"))
- || !unsmob_grob (me->get_object ("tie"))
+ || !Grob::unsmob (me->get_object ("tie"))
|| (rank == start + 1 && /* we are at the start of a line */
!to_boolean (me->get_property ("hide-tied-accidental-after-break"))))
{
- Stencil *s = unsmob_stencil (get_stencil (me));
+ Stencil *s = Stencil::unsmob (get_stencil (me));
if (s)
return ly_interval2scm (s->extent (Y_AXIS));
}
SCM
Accidental_interface::print (SCM smob)
{
- Grob *me = unsmob_grob (smob);
- Grob *tie = unsmob_grob (me->get_object ("tie"));
+ Grob *me = Grob::unsmob (smob);
+ Grob *tie = Grob::unsmob (me->get_object ("tie"));
if (tie
&& (to_boolean (me->get_property ("hide-tied-accidental-after-break"))
SCM
Align_interface::align_to_minimum_distances (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
me->set_property ("positioning-done", SCM_BOOL_T);
SCM
Align_interface::align_to_ideal_distances (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
me->set_property ("positioning-done", SCM_BOOL_T);
Align_interface::set_ordered (Grob *me)
{
SCM ga_scm = me->get_object ("elements");
- Grob_array *ga = unsmob_grob_array (ga_scm);
+ Grob_array *ga = Grob_array::unsmob (ga_scm);
if (!ga)
{
ga_scm = Grob_array::make_array ();
- ga = unsmob_grob_array (ga_scm);
+ ga = Grob_array::unsmob (ga_scm);
me->set_object ("elements", ga_scm);
}
scm_from_double (1.0));
}
g_free (pango_fn);
- return dynamic_cast<Pango_font *> (unsmob_metrics (val));
+ return dynamic_cast<Pango_font *> (Font_metric::unsmob (val));
}
#endif
debug_output ("]", false);
- unsmob_metrics (val)->file_name_ = file_name;
+ Font_metric::unsmob (val)->file_name_ = file_name;
SCM name_string = ly_string2scm (name);
- unsmob_metrics (val)->description_ = scm_cons (name_string,
+ Font_metric::unsmob (val)->description_ = scm_cons (name_string,
scm_from_double (1.0));
otf_dict_->set (sname, val);
- unsmob_metrics (val)->unprotect ();
+ Font_metric::unsmob (val)->unprotect ();
}
- return dynamic_cast<Open_type_font *> (unsmob_metrics (val));
+ return dynamic_cast<Open_type_font *> (Font_metric::unsmob (val));
}
Font_metric *
If the engraver is added to a percussion context,
filter out unpitched note heads.
*/
- if (!unsmob_pitch (p))
+ if (!Pitch::unsmob (p))
return;
- Pitch pitch = *unsmob_pitch (p);
+ Pitch pitch = *Pitch::unsmob (p);
Drul_array<bool> expands = pitch_interval_.add_point (pitch);
if (expands[UP])
causes_[UP] = nr;
SCM
Arpeggio::calc_cross_staff (SCM grob)
{
- Grob *me = unsmob_grob (grob);
+ Grob *me = Grob::unsmob (grob);
extract_grob_set (me, "stems", stems);
Grob *vag = 0;
SCM
Arpeggio::calc_positions (SCM grob)
{
- Grob *me = unsmob_grob (grob);
+ Grob *me = Grob::unsmob (grob);
Grob *common = get_common_y (me);
/*
SCM
Arpeggio::print (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Interval heads = robust_scm2interval (me->get_property ("positions"),
Interval ())
* Staff_symbol_referencer::staff_space (me);
SCM
Arpeggio::brew_chord_bracket (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Interval heads = robust_scm2interval (me->get_property ("positions"),
Interval ())
* Staff_symbol_referencer::staff_space (me);
SCM
Arpeggio::brew_chord_slur (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
SCM dash_definition = me->get_property ("dash-definition");
Interval heads = robust_scm2interval (me->get_property ("positions"),
Interval ())
SCM
Arpeggio::width (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
return ly_interval2scm (get_squiggle (me).extent (X_AXIS));
}
SCM
Arpeggio::pure_height (SCM smob, SCM, SCM)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
if (to_boolean (me->get_property ("cross-staff")))
return ly_interval2scm (Interval ());
return;
}
- int durlog = unsmob_duration (ev->get_property ("duration"))->duration_log ();
+ int durlog = Duration::unsmob (ev->get_property ("duration"))->duration_log ();
if (durlog <= 2)
{
if (!is_same_grace_state (beam_start_location_, now))
return;
- Duration *stem_duration = unsmob_duration (ev->get_property ("duration"));
+ Duration *stem_duration = Duration::unsmob (ev->get_property ("duration"));
Moment dur = stem_duration->get_length ();
- //Moment dur = unsmob_duration (ev->get_property ("duration"))->get_length ();
+ //Moment dur = Duration::unsmob (ev->get_property ("duration"))->get_length ();
Moment measure_now = measure_position (context ());
bool recheck_needed = false;
for (; scm_is_pair (split_list_); split_list_ = scm_cdr (split_list_))
{
- splitm = unsmob_moment (scm_caar (split_list_));
+ splitm = Moment::unsmob (scm_caar (split_list_));
if ((*splitm + start_moment_) > now)
break;
if (!staffline_ && active_)
{
staffline_ = get_spanner ();
- Grob *it = unsmob_grob (get_property ("currentCommandColumn"));
+ Grob *it = Grob::unsmob (get_property ("currentCommandColumn"));
staffline_->set_bound (LEFT, it);
}
interesting_ = get_property ("keepAliveInterfaces");
{
if (staffline_)
{
- Grob *it = unsmob_grob (get_property ("currentCommandColumn"));
+ Grob *it = Grob::unsmob (get_property ("currentCommandColumn"));
staffline_->set_bound (RIGHT, it);
Pointer_group_interface::set_ordered (staffline_, ly_symbol2scm ("elements"), false);
for (vsize i = 0; i < elts_.size (); i++)
{
- if (!unsmob_grob (elts_[i]->get_object ("axis-group-parent-Y")))
+ if (!Grob::unsmob (elts_[i]->get_object ("axis-group-parent-Y")))
{
if (staffline_->get_parent (Y_AXIS)
&& staffline_->get_parent (Y_AXIS) == elts_[i])
"Determine the extent of @var{elements} relative to @var{common} in the"
" @var{axis} direction.")
{
- Grob_array *ga = unsmob_grob_array (elements);
+ Grob_array *ga = Grob_array::unsmob (elements);
SCM_ASSERT_TYPE (ga || scm_is_pair (elements), elements, SCM_ARG1, __FUNCTION__, "list or Grob_array");
LY_ASSERT_SMOB (Grob, common, 2);
if (!ga)
{
for (SCM s = elements; scm_is_pair (s); s = scm_cdr (s))
- elts.push_back (unsmob_grob (scm_car (s)));
+ elts.push_back (Grob::unsmob (scm_car (s)));
}
Interval ext = Axis_group_interface::relative_group_extent (ga ? ga->array () : elts,
- unsmob_grob (common),
+ Grob::unsmob (common),
(Axis) scm_to_int (axis));
return ly_interval2scm (ext);
}
LY_ASSERT_SMOB (Grob, grob, 1);
LY_ASSERT_SMOB (Grob, common, 2);
- Interval ext = Axis_group_interface::generic_bound_extent (unsmob_grob (grob), unsmob_grob (common), X_AXIS);
+ Interval ext = Axis_group_interface::generic_bound_extent (Grob::unsmob (grob), Grob::unsmob (common), X_AXIS);
return ly_interval2scm (ext);
}
{
LY_ASSERT_SMOB (Grob, grob, 1);
LY_ASSERT_SMOB (Grob, grob_element, 2);
- Axis_group_interface::add_element (unsmob_grob (grob), unsmob_grob (grob_element));
+ Axis_group_interface::add_element (Grob::unsmob (grob), Grob::unsmob (grob_element));
return SCM_UNSPECIFIED;
}
SCM
Axis_group_interface::adjacent_pure_heights (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
- Grob *common = unsmob_grob (me->get_object ("pure-Y-common"));
+ Grob *common = Grob::unsmob (me->get_object ("pure-Y-common"));
extract_grob_set (me, "pure-relevant-grobs", elts);
Paper_score *ps = get_root_system (me)->paper_score ();
if (p && Align_interface::has_interface (p))
return Axis_group_interface::sum_partial_pure_heights (me, start, end);
- Grob *common = unsmob_grob (me->get_object ("pure-Y-common"));
+ Grob *common = Grob::unsmob (me->get_object ("pure-Y-common"));
extract_grob_set (me, "pure-relevant-grobs", elts);
Interval r;
SCM
Axis_group_interface::width (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
return generic_group_extent (me, X_AXIS);
}
SCM
Axis_group_interface::height (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
return generic_group_extent (me, Y_AXIS);
}
{
int start = robust_scm2int (start_scm, 0);
int end = robust_scm2int (end_scm, INT_MAX);
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
/* Maybe we are in the second pass of a two-pass spacing run. In that
case, the Y-extent of a system is already given to us */
SCM
Axis_group_interface::calc_skylines (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Skyline_pair skylines = skyline_spacing (me);
return skylines.smobbed_copy ();
}
SCM
Axis_group_interface::combine_skylines (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
extract_grob_set (me, "elements", elements);
Grob *y_common = common_refpoint_of_array (elements, me, Y_AXIS);
Grob *x_common = common_refpoint_of_array (elements, me, X_AXIS);
SCM
Axis_group_interface::calc_pure_relevant_grobs (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
/* TODO: Filter out elements that belong to a different Axis_group,
such as the tie in
<< \new Staff=A { c'1~ \change Staff=B c'}
vector_sort (relevant_grobs, pure_staff_priority_less);
SCM grobs_scm = Grob_array::make_array ();
- unsmob_grob_array (grobs_scm)->set_array (relevant_grobs);
+ Grob_array::unsmob (grobs_scm)->set_array (relevant_grobs);
return grobs_scm;
}
SCM
Axis_group_interface::calc_pure_y_common (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
extract_grob_set (me, "pure-relevant-grobs", elts);
Grob *common = common_refpoint_of_array (elts, me, Y_AXIS);
SCM
Axis_group_interface::calc_x_common (SCM grob)
{
- return calc_common (unsmob_grob (grob), X_AXIS);
+ return calc_common (Grob::unsmob (grob), X_AXIS);
}
MAKE_SCHEME_CALLBACK (Axis_group_interface, calc_y_common, 1);
SCM
Axis_group_interface::calc_y_common (SCM grob)
{
- return calc_common (unsmob_grob (grob), Y_AXIS);
+ return calc_common (Grob::unsmob (grob), Y_AXIS);
}
Interval
Axis_group_interface::pure_group_height (Grob *me, int start, int end)
{
- Grob *common = unsmob_grob (me->get_object ("pure-Y-common"));
+ Grob *common = Grob::unsmob (me->get_object ("pure-Y-common"));
if (!common)
{
static void
add_interior_skylines (Grob *me, Grob *x_common, Grob *y_common, vector<Skyline_pair> *skylines)
{
- if (Grob_array *elements = unsmob_grob_array (me->get_object ("elements")))
+ if (Grob_array *elements = Grob_array::unsmob (me->get_object ("elements")))
{
for (vsize i = 0; i < elements->size (); i++)
add_interior_skylines (elements->grob (i), x_common, y_common, skylines);
if (!debug_skylines)
return SCM_BOOL_F;
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Stencil ret;
if (Skyline_pair *s = Skyline_pair::unsmob (me->get_property ("vertical-skylines")))
{
SCM
Axis_group_interface::calc_pure_staff_staff_spacing (SCM smob, SCM start, SCM end)
{
- return calc_maybe_pure_staff_staff_spacing (unsmob_grob (smob),
+ return calc_maybe_pure_staff_staff_spacing (Grob::unsmob (smob),
true,
scm_to_int (start),
scm_to_int (end));
SCM
Axis_group_interface::calc_staff_staff_spacing (SCM smob)
{
- return calc_maybe_pure_staff_staff_spacing (unsmob_grob (smob),
+ return calc_maybe_pure_staff_staff_spacing (Grob::unsmob (smob),
false,
0,
INT_MAX);
SCM
Axis_group_interface::calc_maybe_pure_staff_staff_spacing (Grob *me, bool pure, int start, int end)
{
- Grob *grouper = unsmob_grob (me->get_object ("staff-grouper"));
+ Grob *grouper = Grob::unsmob (me->get_object ("staff-grouper"));
if (grouper)
{
SCM
Balloon_interface::print (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
if (Item *item = dynamic_cast<Item *> (me))
if (!Item::break_visible (item))
SCM chain = Font_interface::text_font_alist_chain (me);
SCM stencil = Text_interface::interpret_markup (me->layout ()->self_scm (),
chain, bt);
- Stencil *text_stil = unsmob_stencil (stencil);
+ Stencil *text_stil = Stencil::unsmob (stencil);
Offset z1;
SCM mp = tr->get_property ("measurePosition");
SCM sync = tr->get_property ("barCheckSynchronize");
- Moment *where = unsmob_moment (mp);
+ Moment *where = Moment::unsmob (mp);
if (!where)
return;
else
{
SCM lf = tr->get_property ("barCheckLastFail");
- if (unsmob_moment (lf)
- && *unsmob_moment (lf) == *where)
+ if (Moment::unsmob (lf)
+ && *Moment::unsmob (lf) == *where)
warn = false;
else
tr->set_property ("barCheckLastFail", mp);
{
// Do not consider note heads attached to the beam.
if (Stem::has_interface (covered_grob))
- if (unsmob_grob (covered_grob->get_object ("beam")))
+ if (Grob::unsmob (covered_grob->get_object ("beam")))
continue;
- if (Grob *stem = unsmob_grob (covered_grob->get_object ("stem")))
- if (Grob *beam = unsmob_grob (stem->get_object ("beam")))
+ if (Grob *stem = Grob::unsmob (covered_grob->get_object ("stem")))
+ if (Grob *beam = Grob::unsmob (stem->get_object ("beam")))
if (beam == beam_grob)
continue;
last_stem_added_at_ = now;
- Duration *stem_duration = unsmob_duration (ev->get_property ("duration"));
+ Duration *stem_duration = Duration::unsmob (ev->get_property ("duration"));
int durlog = stem_duration->duration_log ();
- //int durlog = unsmob_duration (ev->get_property ("duration"))->duration_log ();
+ //int durlog = Duration::unsmob (ev->get_property ("duration"))->duration_log ();
if (durlog <= 2)
{
ev->origin ()->warning (_ ("stem does not fit in beam"));
for (LEFT_and_RIGHT (d))
add_collision (b[X_AXIS][d], b[Y_AXIS], width_factor);
- Grob *stem = unsmob_grob (collisions[j]->get_object ("stem"));
+ Grob *stem = Grob::unsmob (collisions[j]->get_object ("stem"));
if (stem && Stem::has_interface (stem) && Stem::is_normal_stem (stem))
{
colliding_stems.insert (stem);
- my_y;
Real factor = parameters_.STEM_COLLISION_FACTOR;
- if (!unsmob_grob (s->get_object ("beam")))
+ if (!Grob::unsmob (s->get_object ("beam")))
factor = 1.0;
add_collision (x, y, factor);
}
SCM
Beam::calc_normal_stems (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
extract_grob_set (me, "stems", stems);
SCM val = Grob_array::make_array ();
- Grob_array *ga = unsmob_grob_array (val);
+ Grob_array *ga = Grob_array::unsmob (val);
for (vsize i = 0; i < stems.size (); i++)
if (Stem::is_normal_stem (stems[i]))
ga->add (stems[i]);
SCM
Beam::calc_direction (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
/* Beams with less than 2 two stems don't make much sense, but could happen
when you do
SCM
Beam::calc_beaming (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
extract_grob_set (me, "stems", stems);
{
/* ugh, this has a side-effect that we need to ensure that
Stem #'beaming is correct */
- Grob *me_grob = unsmob_grob (smob);
+ Grob *me_grob = Grob::unsmob (smob);
(void) me_grob->get_property ("beaming");
Spanner *me = dynamic_cast<Spanner *> (me_grob);
Direction stem_dir = stems.size () ? to_dir (stems[0]->get_property ("direction")) : UP;
- Stencil score = *unsmob_stencil (Text_interface::interpret_markup
+ Stencil score = *Stencil::unsmob (Text_interface::interpret_markup
(me->layout ()->self_scm (), properties, annotation));
if (!score.is_empty ())
SCM
Beam::calc_stem_shorten (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
/*
shortening looks silly for x staff beams
SCM
Beam::quanting (SCM smob, SCM ys_scm, SCM align_broken_intos)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Drul_array<Real> ys = robust_scm2drul (ys_scm, Drul_array<Real> (infinity_f, -infinity_f));
bool cbs = to_boolean (align_broken_intos);
SCM
Beam::set_stem_lengths (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
/* trigger callbacks. */
(void) me->get_property ("direction");
SCM
Beam::rest_collision_callback (SCM smob, SCM prev_offset)
{
- Grob *rest = unsmob_grob (smob);
+ Grob *rest = Grob::unsmob (smob);
if (scm_is_number (rest->get_property ("staff-position")))
return scm_from_int (0);
Real offset = robust_scm2double (prev_offset, 0.0);
- Grob *st = unsmob_grob (rest->get_object ("stem"));
+ Grob *st = Grob::unsmob (rest->get_object ("stem"));
Grob *stem = st;
if (!stem)
return scm_from_double (0.0);
- Grob *beam = unsmob_grob (stem->get_object ("beam"));
+ Grob *beam = Grob::unsmob (stem->get_object ("beam"));
if (!beam
|| !Beam::has_interface (beam)
|| !Beam::normal_stem_count (beam))
{
Real previous = robust_scm2double (prev_offset, 0.0);
- Grob *me = unsmob_grob (smob);
- Grob *stem = unsmob_grob (me->get_object ("stem"));
+ Grob *me = Grob::unsmob (smob);
+ Grob *stem = Grob::unsmob (me->get_object ("stem"));
if (!stem)
return scm_from_double (previous);
- Grob *beam = unsmob_grob (stem->get_object ("beam"));
+ Grob *beam = Grob::unsmob (stem->get_object ("beam"));
if (!beam
|| !Beam::normal_stem_count (beam)
|| !is_direction (beam->get_property_data ("direction")))
SCM
Beam::calc_cross_staff (SCM smob)
{
- return scm_from_bool (is_cross_staff (unsmob_grob (smob)));
+ return scm_from_bool (is_cross_staff (Grob::unsmob (smob)));
}
int
// We shouldn't end a spanner on the last musical column of a piece because then
// it would extend past the last breakable column of the piece.
if (last_fall_)
- last_fall_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
+ last_fall_->set_bound (RIGHT, Grob::unsmob (get_property ("currentCommandColumn")));
}
void
{
bool bar = scm_is_string (get_property ("whichBar"));
- fall_->set_bound (RIGHT, unsmob_grob (bar
+ fall_->set_bound (RIGHT, Grob::unsmob (bar
? get_property ("currentCommandColumn")
: get_property ("currentMusicalColumn")));
last_fall_ = fall_;
"Make a @code{\\book} of @var{paper} and @var{header}"
" (which may be @code{#f} as well) containing @code{\\scores}.")
{
- Output_def *odef = unsmob_output_def (paper);
+ Output_def *odef = Output_def::unsmob (paper);
LY_ASSERT_SMOB (Output_def, paper, 1);
Book *book = new Book;
" For example, it may be a string (for file based outputs)"
" or a socket (for network based output).")
{
- Book *book = unsmob_book (book_smob);
+ Book *book = Book::unsmob (book_smob);
LY_ASSERT_SMOB (Book, book_smob, 1);
LY_ASSERT_SMOB (Output_def, default_paper, 2);
LY_ASSERT_SMOB (Output_def, default_layout, 3);
- Paper_book *pb = book->process (unsmob_output_def (default_paper),
- unsmob_output_def (default_layout));
+ Paper_book *pb = book->process (Output_def::unsmob (default_paper),
+ Output_def::unsmob (default_layout));
if (pb)
{
pb->output (output);
LY_ASSERT_SMOB (Output_def, default_paper, 2);
LY_ASSERT_SMOB (Output_def, default_layout, 3);
- Book *book = unsmob_book (book_smob);
+ Book *book = Book::unsmob (book_smob);
- Paper_book *pb = book->process (unsmob_output_def (default_paper),
- unsmob_output_def (default_layout));
+ Paper_book *pb = book->process (Output_def::unsmob (default_paper),
+ Output_def::unsmob (default_layout));
if (pb)
{
pb->classic_output (output);
"Add @var{score} to @var{book-smob} score list.")
{
LY_ASSERT_SMOB (Book, book_smob, 1);
- Book *book = unsmob_book (book_smob);
+ Book *book = Book::unsmob (book_smob);
book->add_score (score);
return SCM_UNSPECIFIED;
}
"Add @var{book-part} to @var{book-smob} book part list.")
{
LY_ASSERT_SMOB (Book, book_smob, 1);
- Book *book = unsmob_book (book_smob);
+ Book *book = Book::unsmob (book_smob);
book->add_bookpart (book_part);
return SCM_UNSPECIFIED;
}
"Return book parts in @var{book}.")
{
LY_ASSERT_SMOB (Book, book, 1);
- Book *b = unsmob_book (book);
+ Book *b = Book::unsmob (book);
return b->bookparts_;
}
"Return paper in @var{book}.")
{
LY_ASSERT_SMOB (Book, book, 1);
- Book *b = unsmob_book (book);
+ Book *b = Book::unsmob (book);
return b->paper_ ? b->paper_->self_scm () : SCM_BOOL_F;
}
"Return header in @var{book}.")
{
LY_ASSERT_SMOB (Book, book, 1);
- Book *b = unsmob_book (book);
+ Book *b = Book::unsmob (book);
return b->header_ ? b->header_ : SCM_BOOL_F;
}
SCM_ASSERT_TYPE (ly_is_module (module), module, SCM_ARG2, __FUNCTION__,
"module");
- Book *b = unsmob_book (book);
+ Book *b = Book::unsmob (book);
b->header_ = (module);
return SCM_UNSPECIFIED;
}
"Return scores in @var{book}.")
{
LY_ASSERT_SMOB (Book, book, 1);
- Book *b = unsmob_book (book);
+ Book *b = Book::unsmob (book);
return b->scores_;
}
{
SCM entry = scm_car (p);
- if (Score *newscore = unsmob_score (entry))
+ if (Score *newscore = Score::unsmob (entry))
* t = scm_cons (newscore->clone ()->unprotect (), SCM_EOL);
- else if (Page_marker *marker = unsmob_page_marker (entry))
+ else if (Page_marker *marker = Page_marker::unsmob (entry))
* t = scm_cons (marker->clone ()->unprotect (), SCM_EOL);
else
{
t = &bookparts_;
for (SCM p = s.bookparts_; scm_is_pair (p); p = scm_cdr (p))
{
- Book *newpart = unsmob_book (scm_car (p))->clone ();
+ Book *newpart = Book::unsmob (scm_car (p))->clone ();
*t = scm_cons (newpart->self_scm (), SCM_EOL);
t = SCM_CDRLOC (*t);
Book::add_bookpart (SCM b)
{
add_scores_to_bookpart ();
- Book *part = unsmob_book (b);
+ Book *part = Book::unsmob (b);
part->set_parent (this);
bookparts_ = scm_cons (b, bookparts_);
}
Book::error_found ()
{
for (SCM s = scores_; scm_is_pair (s); s = scm_cdr (s))
- if (Score *score = unsmob_score (scm_car (s)))
+ if (Score *score = Score::unsmob (scm_car (s)))
if (score->error_found_)
return true;
for (SCM part = bookparts_; scm_is_pair (part); part = scm_cdr (part))
- if (Book *bookpart = unsmob_book (scm_car (part)))
+ if (Book *bookpart = Book::unsmob (scm_car (part)))
if (bookpart->error_found ())
return true;
add_scores_to_bookpart ();
for (SCM p = scm_reverse (bookparts_); scm_is_pair (p); p = scm_cdr (p))
{
- if (Book *book = unsmob_book (scm_car (p)))
+ if (Book *book = Book::unsmob (scm_car (p)))
{
Paper_book *paper_book_part = book->process (paper, layout, output_paper_book);
if (paper_book_part)
void
Book::process_score (SCM s, Paper_book *output_paper_book, Output_def *layout)
{
- if (Score *score = unsmob_score (scm_car (s)))
+ if (Score *score = Score::unsmob (scm_car (s)))
{
SCM outputs = score
->book_rendering (output_paper_book->paper_, layout);
while (scm_is_pair (outputs))
{
- Music_output *output = unsmob_music_output (scm_car (outputs));
+ Music_output *output = Music_output::unsmob (scm_car (outputs));
if (Performance *perf = dynamic_cast<Performance *> (output))
output_paper_book->add_performance (perf->self_scm ());
}
}
else if (Text_interface::is_markup_list (scm_car (s))
- || unsmob_page_marker (scm_car (s)))
+ || Page_marker::unsmob (scm_car (s)))
output_paper_book->add_score (scm_car (s));
else
assert (0);
Context *origin = inf.origin_contexts (this)[0];
Translator_group *tg = origin->implementation ();
- Engraver *random_source = dynamic_cast<Engraver *> (unsmob_translator (scm_car (tg->get_simple_trans_list ())));
+ Engraver *random_source = dynamic_cast<Engraver *> (Translator::unsmob (scm_car (tg->get_simple_trans_list ())));
if (!random_source)
random_source = this;
if (s != SCM_BOOL_F)
{
- Grob *e = unsmob_grob (scm_cdr (s));
+ Grob *e = Grob::unsmob (scm_cdr (s));
group = dynamic_cast<Item *> (e);
}
else
SCM
Break_alignment_interface::calc_positioning_done (SCM smob)
{
- Grob *grob = unsmob_grob (smob);
+ Grob *grob = Grob::unsmob (smob);
Item *me = dynamic_cast<Item *> (grob);
me->set_property ("positioning-done", SCM_BOOL_T);
sym_string = ly_symbol2string (rsym);
string orig_string;
- if (unsmob_grob (l->get_property ("cause")))
- orig_string = unsmob_grob (l->get_property ("cause"))->name ();
+ if (Grob::unsmob (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.c_str (),
SCM
Break_alignable_interface::self_align_callback (SCM grob)
{
- Grob *me = unsmob_grob (grob);
+ Grob *me = Grob::unsmob (grob);
Item *alignment = dynamic_cast<Item *> (me->get_parent (X_AXIS));
if (!Break_alignment_interface::has_interface (alignment))
return scm_from_int (0);
SCM
Break_aligned_interface::calc_average_anchor (SCM grob)
{
- Grob *me = unsmob_grob (grob);
+ Grob *me = Grob::unsmob (grob);
Real avg = 0.0;
int count = 0;
SCM
Break_aligned_interface::calc_extent_aligned_anchor (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Real alignment = robust_scm2double (me->get_property ("break-align-anchor-alignment"), 0.0);
Interval iv = me->extent (me, X_AXIS);
Break_aligned_interface::calc_break_visibility (SCM smob)
{
/* a BreakAlignGroup is break-visible if it has one element that is break-visible */
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
SCM ret = scm_c_make_vector (3, SCM_EOL);
extract_grob_set (me, "elements", elts);
for (int dir = 0; dir <= 2; dir++)
else
{
System *line
- = dynamic_cast<System *> (unsmob_grob (break_criterion));
+ = dynamic_cast<System *> (Grob::unsmob (break_criterion));
if (sc->get_system () != line)
sc = sc->find_broken_piece (line);
{
again:
- if (unsmob_grob (src))
+ if (Grob::unsmob (src))
{
- Grob *new_ptr = substitute_grob (unsmob_grob (src));
+ Grob *new_ptr = substitute_grob (Grob::unsmob (src));
return new_ptr ? new_ptr->self_scm () : SCM_UNDEFINED;
}
else if (scm_is_vector (src))
set_break_subsititution (l ? l->self_scm () : SCM_UNDEFINED);
SCM newval = sc->internal_get_object (sym);
- if (!unsmob_grob_array (newval))
+ if (!Grob_array::unsmob (newval))
{
newval = Grob_array::make_array ();
sc->set_object (sym, newval);
}
- Grob_array *new_array = unsmob_grob_array (newval);
+ Grob_array *new_array = Grob_array::unsmob (newval);
for (int k = 0; k < 2; k++)
for (int j = (*arrs[k])[i][LEFT]; j <= (*arrs[k])[i][RIGHT]; j++)
{
SCM sym = scm_caar (s);
SCM val = scm_cdar (s);
- if (Grob_array *orig = unsmob_grob_array (val))
+ if (Grob_array *orig = Grob_array::unsmob (val))
{
SCM handle = scm_assq (sym, dest);
SCM newval
? scm_cdr (handle)
: Grob_array::make_array ();
- Grob_array *new_arr = unsmob_grob_array (newval);
+ Grob_array *new_arr = Grob_array::unsmob (newval);
substitute_grob_array (orig, new_arr);
val = newval;
Spanner *s = this;
bool fast_done = false;
- Grob_array *grob_array = unsmob_grob_array (val);
+ Grob_array *grob_array = Grob_array::unsmob (val);
if (grob_array)
fast_done = s->fast_substitute_grob_array (sym, grob_array);
if (grob_array)
{
SCM newval = sc->internal_get_object (sym);
- if (!unsmob_grob_array (newval))
+ if (!Grob_array::unsmob (newval))
{
newval = Grob_array::make_array ();
sc->set_object (sym, newval);
}
- substitute_grob_array (grob_array, unsmob_grob_array (newval));
+ substitute_grob_array (grob_array, Grob_array::unsmob (newval));
}
else
{
SCM
Breathing_sign::divisio_minima (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Real staff_space = Staff_symbol_referencer::staff_space (me);
Real thickness = Staff_symbol_referencer::line_thickness (me);
SCM
Breathing_sign::divisio_maior (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Real thickness = Staff_symbol_referencer::line_thickness (me);
thickness *= robust_scm2double (me->get_property ("thickness"), 1.0);
SCM
Breathing_sign::divisio_maxima (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Real staff_space = Staff_symbol_referencer::staff_space (me);
Real thickness = Staff_symbol_referencer::line_thickness (me);
thickness *= robust_scm2double (me->get_property ("thickness"), 1.0);
SCM
Breathing_sign::finalis (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Real staff_space = Staff_symbol_referencer::staff_space (me);
Real thickness = Staff_symbol_referencer::line_thickness (me);
thickness *= robust_scm2double (me->get_property ("thickness"), 1.0);
SCM
Breathing_sign::offset_callback (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Direction d = get_grob_direction (me);
if (!d)
{
Stream_event *n = notes_[i];
SCM p = n->get_property ("pitch");
- if (!unsmob_pitch (p))
+ if (!Pitch::unsmob (p))
continue;
if (n->get_property ("bass") == SCM_BOOL_T)
SCM oct = n->get_property ("octavation");
if (scm_is_number (oct))
{
- Pitch orig = unsmob_pitch (p)->transposed (Pitch (-scm_to_int (oct), 0));
+ Pitch orig = Pitch::unsmob (p)->transposed (Pitch (-scm_to_int (oct), 0));
pitches = scm_cons (orig.smobbed_copy (), pitches);
}
else
scm_call_1 (fun, context->self_scm ());
for (SCM s = context->children_contexts ();
scm_is_pair (s); s = scm_cdr (s))
- apply_on_children (unsmob_context (scm_car (s)), fun);
+ apply_on_children (Context::unsmob (scm_car (s)), fun);
}
void
SCM
Clef::print (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
SCM glyph_scm = me->get_property ("glyph-name");
if (!scm_is_string (glyph_scm))
return SCM_EOL;
for (vsize i = 0; i < cluster_notes_.size (); i++)
{
- Pitch *pit = unsmob_pitch (cluster_notes_[i]->get_property ("pitch"));
+ Pitch *pit = Pitch::unsmob (cluster_notes_[i]->get_property ("pitch"));
int p = (pit ? pit->steps () : 0) + c0;
SCM
Cluster::calc_cross_staff (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
extract_grob_set (me, "columns", cols);
Grob *commony = common_refpoint_of_array (cols, me, Y_AXIS);
SCM
Cluster::print (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Spanner *spanner = dynamic_cast<Spanner *> (me);
if (!spanner)
SCM
Cluster_beacon::height (SCM g)
{
- Grob *me = unsmob_grob (g);
+ Grob *me = Grob::unsmob (g);
Interval v = robust_scm2interval (me->get_property ("positions"),
Interval (0, 0));
return ly_interval2scm (Staff_symbol_referencer::staff_space (me) * 0.5 * v);
primitive = dynamic_cast<Item *> (primitives[i].grob ());
Stream_event *cause = primitives[i].event_cause ();
int pitch
- = unsmob_pitch (cause->get_property ("pitch"))->steps ();
+ = Pitch::unsmob (cause->get_property ("pitch"))->steps ();
if (prev_primitive)
{
delta_pitch = pitch - prev_pitch;
Moment
Completion_heads_engraver::next_moment (Rational const ¬e_len)
{
- Moment *e = unsmob_moment (get_property ("measurePosition"));
- Moment *l = unsmob_moment (get_property ("measureLength"));
+ Moment *e = Moment::unsmob (get_property ("measurePosition"));
+ Moment *l = Moment::unsmob (get_property ("measureLength"));
if (!e || !l || !to_boolean (get_property ("timing")))
{
return Moment (0, 0);
+ e->to_string () + " of " + l->to_string ());
return 0;
}
- Moment const *unit = unsmob_moment (get_property ("completionUnit"));
+ Moment const *unit = Moment::unsmob (get_property ("completionUnit"));
if (unit)
{
Completion_heads_engraver::make_note_head (Stream_event *ev)
{
Item *note = make_item ("NoteHead", ev->self_scm ());
- Pitch *pit = unsmob_pitch (ev->get_property ("pitch"));
+ Pitch *pit = Pitch::unsmob (ev->get_property ("pitch"));
int pos = pit->steps ();
SCM c0 = get_property ("middleCPosition");
}
else
{
- orig = unsmob_duration (note_events_[0]->get_property ("duration"));
+ orig = Duration::unsmob (note_events_[0]->get_property ("duration"));
note_dur = *orig;
SCM factor = get_property ("completionFactor");
if (ly_is_procedure (factor))
Moment
Completion_rest_engraver::next_moment (Rational const ¬e_len)
{
- Moment *e = unsmob_moment (get_property ("measurePosition"));
- Moment *l = unsmob_moment (get_property ("measureLength"));
+ Moment *e = Moment::unsmob (get_property ("measurePosition"));
+ Moment *l = Moment::unsmob (get_property ("measureLength"));
if (!e || !l || !to_boolean (get_property ("timing")))
{
return Moment (0, 0);
}
Moment result = *l - *e;
- Moment const *unit = unsmob_moment (get_property ("completionUnit"));
+ Moment const *unit = Moment::unsmob (get_property ("completionUnit"));
if (unit)
{
Completion_rest_engraver::make_rest (Stream_event *ev)
{
Item *rest = make_item ("Rest", ev->self_scm ());
- if (Pitch *p = unsmob_pitch (ev->get_property ("pitch")))
+ if (Pitch *p = Pitch::unsmob (ev->get_property ("pitch")))
{
int pos = p->steps ();
SCM c0 = get_property ("middleCPosition");
}
else
{
- orig = unsmob_duration (rest_events_[0]->get_property ("duration"));
+ orig = Duration::unsmob (rest_events_[0]->get_property ("duration"));
rest_dur = *orig;
SCM factor = get_property ("completionFactor");
if (ly_is_procedure (factor))
if (scm_is_pair (footnotes))
for (SCM s = footnotes; scm_is_pair (s); s = scm_cdr (s))
{
- Stencil *sten = unsmob_stencil (scm_caddar (s));
+ Stencil *sten = Stencil::unsmob (scm_caddar (s));
if (!sten)
{
programming_error ("expecting stencil, got empty pointer");
last_column_ = 0;
force_ = 0;
- Stencil *st = unsmob_stencil (pb->get_property ("stencil"));
+ Stencil *st = Stencil::unsmob (pb->get_property ("stencil"));
Interval stencil_extent = st->is_empty (Y_AXIS) ? Interval (0, 0)
: st->extent (Y_AXIS);
shape_ = Line_shape (stencil_extent, stencil_extent); // pretend it goes all the way across
vector<Context_def *> accepteds;
for (SCM s = accepted; scm_is_pair (s); s = scm_cdr (s))
- if (Context_def *t = unsmob_context_def (find_context_def (odef,
+ if (Context_def *t = Context_def::unsmob (find_context_def (odef,
scm_car (s))))
accepteds.push_back (t);
" @samp{property-ops}, @samp{context-name}, @samp{group-type}.")
{
LY_ASSERT_SMOB (Context_def, def, 1);
- Context_def *cd = unsmob_context_def (def);
+ Context_def *cd = Context_def::unsmob (def);
LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
SCM res = cd->lookup (sym);
LY_ASSERT_SMOB (Context_def, def, 1);
LY_ASSERT_SMOB (Context_mod, mod, 2);
- Context_def *cd = unsmob_context_def (def)->clone ();
+ Context_def *cd = Context_def::unsmob (def)->clone ();
- for (SCM s = unsmob_context_mod (mod)->get_mods ();
+ for (SCM s = Context_mod::unsmob (mod)->get_mods ();
scm_is_pair (s);
s = scm_cdr (s))
cd->add_context_mod (scm_car (s));
"Returns the list of context modifications stored in"
" @var{contextmod}.")
{
- Context_mod *tr = unsmob_context_mod (contextmod);
+ Context_mod *tr = Context_mod::unsmob (contextmod);
LY_ASSERT_SMOB (Context_mod, contextmod, 1);
return tr->get_mods ();
}
"Adds the given context @var{modification} to the list"
" @var{contextmods} of context modifications.")
{
- Context_mod *ctxmod = unsmob_context_mod (contextmods);
+ Context_mod *ctxmod = Context_mod::unsmob (contextmods);
LY_ASSERT_SMOB (Context_mod, contextmods, 1);
ctxmod->add_context_mod (modification);
return SCM_UNSPECIFIED;
LY_ASSERT_SMOB (Context, context, 1);
LY_ASSERT_SMOB (Context_mod, mod, 2);
- apply_property_operations (unsmob_context (context),
- unsmob_context_mod (mod)->get_mods ());
+ apply_property_operations (Context::unsmob (context),
+ Context_mod::unsmob (mod)->get_mods ());
scm_remember_upto_here_1 (context);
return SCM_UNSPECIFIED;
}
1, 0, 0, (SCM context),
"Return the current moment of @var{context}.")
{
- Context *tr = unsmob_context (context);
+ Context *tr = Context::unsmob (context);
LY_ASSERT_SMOB (Context, context, 1);
" i.e., for @code{\\context Voice = \"one\" @dots{}}"
" return the string @code{one}.")
{
- Context *tr = unsmob_context (context);
+ Context *tr = Context::unsmob (context);
LY_ASSERT_SMOB (Context, context, 1);
{
LY_ASSERT_SMOB (Context, context, 1);
- Context *tr = unsmob_context (context);
+ Context *tr = Context::unsmob (context);
return ly_symbol2scm (tr->context_name ().c_str ());
}
"Return the definition of @var{name} (a symbol) within"
" @var{context} as an alist.")
{
- Context *tr = unsmob_context (context);
+ Context *tr = Context::unsmob (context);
LY_ASSERT_SMOB (Context, context, 1);
LY_ASSERT_TYPE (ly_is_symbol, name, 2);
" with @var{eltprop} (if @var{val} is specified) or reverted"
" (if unspecified).")
{
- Context *tg = unsmob_context (context);
+ Context *tg = Context::unsmob (context);
LY_ASSERT_SMOB (Context, context, 1);
LY_ASSERT_TYPE (ly_is_symbol, grob, 2);
LY_ASSERT_SMOB (Context, context, 1);
LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
- Context *t = unsmob_context (context);
+ Context *t = Context::unsmob (context);
SCM result = t->internal_get_property (sym);
return def != SCM_UNDEFINED && scm_is_null (result) ? def : result;
}
LY_ASSERT_SMOB (Context, context, 1);
LY_ASSERT_TYPE (ly_is_symbol, name, 2);
- Context *tr = unsmob_context (context);
+ Context *tr = Context::unsmob (context);
tr->set_property (name, val);
LY_ASSERT_SMOB (Context, context, 1);
LY_ASSERT_TYPE (ly_is_symbol, name, 2);
- Context *tr = unsmob_context (context);
+ Context *tr = Context::unsmob (context);
SCM val;
tr = tr->where_defined (name, &val);
{
LY_ASSERT_SMOB (Context, context, 1);
LY_ASSERT_TYPE (ly_is_symbol, name, 2);
- Context *tr = unsmob_context (context);
+ Context *tr = Context::unsmob (context);
tr->unset_property (name);
return SCM_UNSPECIFIED;
"Return the parent of @var{context}, @code{#f} if none.")
{
LY_ASSERT_SMOB (Context, context, 1);
- Context *tr = unsmob_context (context);
+ Context *tr = Context::unsmob (context);
tr = tr->get_parent_context ();
if (tr)
{
LY_ASSERT_SMOB (Context, context, 1);
LY_ASSERT_TYPE (ly_is_symbol, name, 2);
- Context *tr = unsmob_context (context);
+ Context *tr = Context::unsmob (context);
while (tr)
{
"Return @code{now-moment} of context @var{context}.")
{
LY_ASSERT_SMOB (Context, context, 1);
- Context *ctx = unsmob_context (context);
+ Context *ctx = Context::unsmob (context);
return ctx->now_mom ().smobbed_copy ();
}
"Return @code{event-source} of context @var{context}.")
{
LY_ASSERT_SMOB (Context, context, 1);
- Context *ctx = unsmob_context (context);
+ Context *ctx = Context::unsmob (context);
return ctx->event_source ()->self_scm ();
}
" from @var{context} and all its subcontexts.")
{
LY_ASSERT_SMOB (Context, context, 1);
- Context *ctx = unsmob_context (context);
+ Context *ctx = Context::unsmob (context);
return ctx->events_below ()->self_scm ();
}
{
for (SCM p = context_list_; scm_is_pair (p); p = scm_cdr (p))
{
- Context *ctx = unsmob_context (scm_car (p));
+ Context *ctx = Context::unsmob (scm_car (p));
ctx->check_removal ();
if (ctx->is_removable ())
SCM score_name = default_child_context_name ();
SCM score_def = find_context_def (get_output_def (), score_name);
- if (Context_def *cd = unsmob_context_def (score_def))
+ if (Context_def *cd = Context_def::unsmob (score_def))
{
if (cd->is_alias (n))
return create_context (cd, id, operations);
new_context->unprotect ();
- Context_def *td = unsmob_context_def (new_context->definition_);
+ Context_def *td = Context_def::unsmob (new_context->definition_);
/* This cannot move before add_context (), because \override
operations require that we are in the hierarchy. */
accepts = scm_cons (elt, accepts);
}
- return unsmob_context_def (definition_)->path_to_acceptable_context (name,
+ return Context_def::unsmob (definition_)->path_to_acceptable_context (name,
get_output_def (),
scm_reverse_x (accepts, SCM_EOL));
assert (infant_event_);
SCM infant_scm = infant_event_->get_property ("context");
- Context *infant = unsmob_context (infant_scm);
+ Context *infant = Context::unsmob (infant_scm);
if (!infant || infant->get_parent_context () != this)
{
SCM st = find_context_def (get_output_def (), nm);
string name = ly_symbol2string (nm);
- Context_def *t = unsmob_context_def (st);
+ Context_def *t = Context_def::unsmob (st);
if (!t)
{
warning (_f ("cannot find or create: `%s'", name.c_str ()));
- t = unsmob_context_def (this->definition_);
+ t = Context_def::unsmob (this->definition_);
}
if (scm_is_symbol (t->get_default_child (SCM_EOL)))
{
Context::change_parent (SCM sev)
{
Stream_event *ev = unsmob_stream_event (sev);
- Context *to = unsmob_context (ev->get_property ("context"));
+ Context *to = Context::unsmob (ev->get_property ("context"));
disconnect_from_parent ();
to->add_context (this);
for (SCM s = where->children_contexts ();
!found && scm_is_pair (s); s = scm_cdr (s))
{
- Context *tr = unsmob_context (scm_car (s));
+ Context *tr = Context::unsmob (scm_car (s));
found = find_context_below (tr, type, id);
}
SCM
Context::context_name_symbol () const
{
- Context_def *td = unsmob_context_def (definition_);
+ Context_def *td = Context_def::unsmob (definition_);
return td->get_context_name ();
}
scm_puts ("#<", port);
scm_puts (sc->class_name (), port);
- if (Context_def *d = unsmob_context_def (sc->definition_))
+ if (Context_def *d = Context_def::unsmob (sc->definition_))
{
scm_puts (" ", port);
scm_display (d->get_context_name (), port);
{
SCM l = context->get_property ("measureLength");
Rational length (1);
- if (unsmob_moment (l))
- length = unsmob_moment (l)->main_part_;
+ if (Moment::unsmob (l))
+ length = Moment::unsmob (l)->main_part_;
return length;
}
SCM sm = context->get_property ("measurePosition");
Moment m = 0;
- if (unsmob_moment (sm))
+ if (Moment::unsmob (sm))
{
- m = *unsmob_moment (sm);
+ m = *Moment::unsmob (sm);
if (m.main_part_ < Rational (0))
{
trans->set_property (sym, ly_deep_copy (val));
for (SCM p = trans->children_contexts (); scm_is_pair (p); p = scm_cdr (p))
{
- Context *trg = unsmob_context (scm_car (p));
+ Context *trg = Context::unsmob (scm_car (p));
set_context_property_on_children (trg, sym, ly_deep_copy (val));
}
}
don't look at the staff-position, since we can't be sure
whether Clef_engraver already applied a vertical shift.
*/
- pitches_.push_back (*unsmob_pitch (ev->get_property ("pitch")));
+ pitches_.push_back (*Pitch::unsmob (ev->get_property ("pitch")));
}
}
SCM
Custos::print (SCM smob)
{
- Item *me = (Item *)unsmob_grob (smob);
+ Item *me = (Item *)Grob::unsmob (smob);
SCM scm_style = me->get_property ("style");
string style;
2, 0, 0, (SCM to, SCM from),
"Make the dispatcher @var{to} listen to events from @var{from}.")
{
- Dispatcher *t = unsmob_dispatcher (to);
- Dispatcher *f = unsmob_dispatcher (from);
+ Dispatcher *t = Dispatcher::unsmob (to);
+ Dispatcher *f = Dispatcher::unsmob (from);
LY_ASSERT_SMOB (Dispatcher, to, 1);
LY_ASSERT_SMOB (Dispatcher, from, 2);
" Whenever @var{disp} hears an event of class @var{cl},"
" it is forwarded to @var{list}.")
{
- Listener *l = unsmob_listener (list);
- Dispatcher *d = unsmob_dispatcher (disp);
+ Listener *l = Listener::unsmob (list);
+ Dispatcher *d = Dispatcher::unsmob (disp);
LY_ASSERT_SMOB (Listener, list, 1);
LY_ASSERT_SMOB (Dispatcher, disp, 2);
{
LY_ASSERT_SMOB (Dispatcher, disp, 1);
- SCM result = unsmob_dispatcher (disp)->listened_types ();
+ SCM result = Dispatcher::unsmob (disp)->listened_types ();
scm_remember_upto_here_1 (disp);
LY_ASSERT_SMOB (Dispatcher, disp, 1);
LY_ASSERT_TYPE (scm_is_pair, cl, 2);
- bool result = unsmob_dispatcher (disp)->is_listened_class (cl);
+ bool result = Dispatcher::unsmob (disp)->is_listened_class (cl);
scm_remember_upto_here_1 (disp);
2, 0, 0, (SCM disp, SCM ev),
"Send the stream event @var{ev} to the dispatcher @var{disp}.")
{
- Dispatcher *d = unsmob_dispatcher (disp);
+ Dispatcher *d = Dispatcher::unsmob (disp);
Stream_event *e = unsmob_stream_event (ev);
LY_ASSERT_SMOB (Dispatcher, disp, 1);
assert (lists[0].prio > last_priority);
last_priority = lists[0].prio;
- Listener *l = unsmob_listener (scm_cdar (lists[0].list));
+ Listener *l = Listener::unsmob (scm_cdar (lists[0].list));
l->listen (ev->self_scm ());
#if 0
sent = true;
for (SCM disp = dispatchers_; scm_is_pair (disp); disp = scm_cdr (disp))
{
int priority = scm_to_int (scm_cdar (disp));
- Dispatcher *d = unsmob_dispatcher (scm_caar (disp));
+ Dispatcher *d = Dispatcher::unsmob (scm_caar (disp));
d->internal_add_listener (GET_LISTENER (dispatch), ev_class, priority);
}
listen_classes_ = scm_cons (ev_class, listen_classes_);
SCM dummy = scm_cons (SCM_EOL, list);
SCM e = dummy;
while (scm_is_pair (scm_cdr (e)))
- if (*unsmob_listener (scm_cdadr (e)) == l && first)
+ if (*Listener::unsmob (scm_cdadr (e)) == l && first)
{
scm_set_cdr_x (e, scm_cddr (e));
first = false;
/* Unregister with all dispatchers. */
for (SCM disp = dispatchers_; scm_is_pair (disp); disp = scm_cdr (disp))
{
- Dispatcher *d = unsmob_dispatcher (scm_caar (disp));
+ Dispatcher *d = Dispatcher::unsmob (scm_caar (disp));
d->remove_listener (GET_LISTENER (dispatch), ev_class);
}
listen_classes_ = scm_delq_x (ev_class, listen_classes_);
void
Dot_column_engraver::acknowledge_rhythmic_head (Grob_info info)
{
- Grob *d = unsmob_grob (info.grob ()->get_object ("dot"));
+ Grob *d = Grob::unsmob (info.grob ()->get_object ("dot"));
if (d)
{
if (!dotcol_)
SCM
Dot_column::calc_positioning_done (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
/*
Trigger note collision resolution first, since that may kill off
dots when merging.
*/
- if (Grob *collision = unsmob_grob (me->get_object ("note-collision")))
+ if (Grob *collision = Grob::unsmob (me->get_object ("note-collision")))
(void) collision->get_property ("positioning-done");
me->set_property ("positioning-done", SCM_BOOL_T);
Grob *n = dots[i]->get_parent (Y_AXIS);
commonx = n->common_refpoint (commonx, X_AXIS);
- if (Grob *stem = unsmob_grob (n->get_object ("stem")))
+ if (Grob *stem = Grob::unsmob (n->get_object ("stem")))
{
commonx = stem->common_refpoint (commonx, X_AXIS);
Box b (s->extent (commonx, X_AXIS), y);
boxes.push_back (b);
- if (Grob *stem = unsmob_grob (s->get_object ("stem")))
+ if (Grob *stem = Grob::unsmob (s->get_object ("stem")))
stems.insert (stem);
}
// Sort dots by stem, then check for dots above the limit for each stem
vector <vector <Grob *> > dots_each_stem (parent_stems.size ());
for (vsize i = 0; i < dots.size (); i++)
- if (Grob *stem = unsmob_grob (dots[i]->get_parent (Y_AXIS)
+ if (Grob *stem = Grob::unsmob (dots[i]->get_parent (Y_AXIS)
-> get_object ("stem")))
for (vsize j = 0; j < parent_stems.size (); j++)
if (stem == parent_stems[j])
void
Dot_column::add_head (Grob *me, Grob *head)
{
- Grob *d = unsmob_grob (head->get_object ("dot"));
+ Grob *d = Grob::unsmob (head->get_object ("dot"));
if (d)
{
Side_position_interface::add_support (me, head);
return;
Grob *note = gi.grob ();
- if (unsmob_grob (note->get_object ("dot")))
+ if (Grob::unsmob (note->get_object ("dot")))
return;
- Duration *dur = unsmob_duration (cause->get_property ("duration"));
+ Duration *dur = Duration::unsmob (cause->get_property ("duration"));
if (dur && dur->dot_count ())
{
Item *d = make_item ("Dots", note->self_scm ());
SCM
Dots::print (SCM d)
{
- Grob *sc = unsmob_grob (d);
+ Grob *sc = Grob::unsmob (d);
Stencil mol;
SCM c = sc->get_property ("dot-count");
&& (scm_hash_table_p (tab) == SCM_BOOL_T))
defn = scm_hashq_ref (tab, sym, SCM_EOL);
- if (Pitch *pit = unsmob_pitch (defn))
+ if (Pitch *pit = Pitch::unsmob (defn))
{
SCM articulations = n->get_property ("articulations");
Stream_event *tie_event = 0;
SCM
Duration::less_p (SCM p1, SCM p2)
{
- Duration *a = unsmob_duration (p1);
- Duration *b = unsmob_duration (p2);
+ Duration *a = Duration::unsmob (p1);
+ Duration *b = Duration::unsmob (p2);
if (compare (*a, *b) < 0)
return SCM_BOOL_T;
LY_ASSERT_SMOB (Duration, p1, 1);
LY_ASSERT_SMOB (Duration, p2, 2);
- Duration *a = unsmob_duration (p1);
- Duration *b = unsmob_duration (p2);
+ Duration *a = Duration::unsmob (p1);
+ Duration *b = Duration::unsmob (p2);
if (Duration::compare (*a, *b) < 0)
return SCM_BOOL_T;
"Extract the duration log from @var{dur}.")
{
LY_ASSERT_SMOB (Duration, dur, 1);
- return scm_from_int (unsmob_duration (dur)->duration_log ());
+ return scm_from_int (Duration::unsmob (dur)->duration_log ());
}
LY_DEFINE (ly_duration_dot_count, "ly:duration-dot-count",
"Extract the dot count from @var{dur}.")
{
LY_ASSERT_SMOB (Duration, dur, 1);
- return scm_from_int (unsmob_duration (dur)->dot_count ());
+ return scm_from_int (Duration::unsmob (dur)->dot_count ());
}
LY_DEFINE (ly_intlog2, "ly:intlog2",
"The length of the duration as a @code{moment}.")
{
LY_ASSERT_SMOB (Duration, dur, 1);
- return Moment (unsmob_duration (dur)->get_length ()).smobbed_copy ();
+ return Moment (Duration::unsmob (dur)->get_length ()).smobbed_copy ();
}
LY_DEFINE (ly_duration_2_string, "ly:duration->string",
"Convert @var{dur} to a string.")
{
LY_ASSERT_SMOB (Duration, dur, 1);
- return ly_string2scm (unsmob_duration (dur)->to_string ());
+ return ly_string2scm (Duration::unsmob (dur)->to_string ());
}
LY_DEFINE (ly_duration_factor, "ly:duration-factor",
" Return it as a pair.")
{
LY_ASSERT_SMOB (Duration, dur, 1);
- Rational r = unsmob_duration (dur)->factor ();
+ Rational r = Duration::unsmob (dur)->factor ();
return scm_cons (scm_from_int64 (r.num ()), scm_from_int64 (r.den ()));
}
" Return it as a rational.")
{
LY_ASSERT_SMOB (Duration, dur, 1);
- Rational r = unsmob_duration (dur)->factor ();
+ Rational r = Duration::unsmob (dur)->factor ();
return ly_rational2scm (r);
}
bound = spanners[0]->get_bound (d);
else
{
- bound = unsmob_grob (get_property ("currentMusicalColumn"));
+ bound = Grob::unsmob (get_property ("currentMusicalColumn"));
programming_error ("started DynamicLineSpanner but have no left bound");
}
if (finished_spanner_ && !finished_spanner_->get_bound (RIGHT))
finished_spanner_
->set_bound (RIGHT,
- unsmob_grob (get_property ("currentMusicalColumn")));
+ Grob::unsmob (get_property ("currentMusicalColumn")));
if (current_spanner_ && !current_spanner_->get_bound (LEFT))
current_spanner_
->set_bound (LEFT,
- unsmob_grob (get_property ("currentMusicalColumn")));
+ Grob::unsmob (get_property ("currentMusicalColumn")));
script_ = 0;
script_event_ = 0;
accepted_spanevents_drul_.set (0, 0);
*/
Grob *x_parent = (heads.size ()
? info.grob ()
- : unsmob_grob (info.grob ()->get_object ("rest")));
+ : Grob::unsmob (info.grob ()->get_object ("rest")));
if (x_parent)
script_->set_parent (x_parent, X_AXIS);
}
/*
UGH. cut & paste code.
*/
- Grob *me = unsmob_grob (grob);
+ Grob *me = Grob::unsmob (grob);
extract_grob_set (me, "elements", elements);
if (elements.empty ())
{
SCM
Enclosing_bracket::print (SCM grob)
{
- Grob *me = unsmob_grob (grob);
+ Grob *me = Grob::unsmob (grob);
extract_grob_set (me, "elements", elements);
if (elements.empty ())
{
for (SCM s = context_->children_contexts ();
scm_is_pair (s); s = scm_cdr (s))
{
- Context *c = unsmob_context (scm_car (s));
+ Context *c = Context::unsmob (scm_car (s));
Engraver_group *group
= dynamic_cast<Engraver_group *> (c->implementation ());
for (SCM s = context ()->children_contexts ();
scm_is_pair (s); s = scm_cdr (s))
{
- Context *c = unsmob_context (scm_car (s));
+ Context *c = Context::unsmob (scm_car (s));
Engraver_group *group
= dynamic_cast<Engraver_group *> (c->implementation ());
if (group)
LY_ASSERT_TYPE (ly_is_grob_cause, cause, 3);
unsmob_engraver (engraver)->
- announce_end_grob (unsmob_grob (grob), cause);
+ announce_end_grob (Grob::unsmob (grob), cause);
return SCM_UNSPECIFIED;
}
cause = m->to_event ()->unprotect ();
}
if (e->get_property ("cause") == SCM_EOL
- && (unsmob_stream_event (cause) || unsmob_grob (cause)))
+ && (unsmob_stream_event (cause) || Grob::unsmob (cause)))
e->set_property ("cause", cause);
return Grob_info (this, e);
Engraver *
unsmob_engraver (SCM eng)
{
- return dynamic_cast<Engraver *> (unsmob_translator (eng));
+ return dynamic_cast<Engraver *> (Translator::unsmob (eng));
}
bool
ly_is_grob_cause (SCM obj)
{
- return unsmob_grob (obj) || unsmob_stream_event (obj) || (obj == SCM_EOL);
+ return Grob::unsmob (obj) || unsmob_stream_event (obj) || (obj == SCM_EOL);
}
#include "translator.icc"
{
Grob *col = (note_columns_.size ()
? note_columns_.back ()
- : unsmob_grob (get_property ("currentMusicalColumn")));
+ : Grob::unsmob (get_property ("currentMusicalColumn")));
finished_->set_bound (RIGHT, col);
}
finished_ = 0;
{
Grob *col = (note_columns_.size ()
? note_columns_.front ()
- : unsmob_grob (get_property ("currentMusicalColumn")));
+ : Grob::unsmob (get_property ("currentMusicalColumn")));
span_->set_bound (LEFT, col);
}
SCM
Figured_bass_continuation::center_on_figures (SCM grob)
{
- Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (grob));
+ Spanner *me = dynamic_cast<Spanner *> (Grob::unsmob (grob));
extract_grob_set (me, "figures", figures);
if (figures.empty ())
return scm_from_double (0.0);
SCM
Figured_bass_continuation::print (SCM grob)
{
- Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (grob));
+ Spanner *me = dynamic_cast<Spanner *> (Grob::unsmob (grob));
Real thick
= me->layout ()->get_dimension (ly_symbol2scm ("line-thickness"))
left_figs.push_back (consecutive_lines[j]->get_bound (LEFT));
SCM ga = Grob_array::make_array ();
- unsmob_grob_array (ga)->set_array (left_figs);
+ Grob_array::unsmob (ga)->set_array (left_figs);
for (vsize j = consecutive_lines.size (); j--;)
consecutive_lines[j]->set_object ("figures",
- unsmob_grob_array (ga)->smobbed_copy ());
+ Grob_array::unsmob (ga)->smobbed_copy ());
}
void
Figured_bass_engraver::create_grobs ()
{
Grob *muscol
- = dynamic_cast<Item *> (unsmob_grob (get_property ("currentMusicalColumn")));
+ = dynamic_cast<Item *> (Grob::unsmob (get_property ("currentMusicalColumn")));
if (!alignment_)
{
alignment_ = make_spanner ("BassFigureAlignment", SCM_EOL);
SCM
Fingering_column::calc_positioning_done (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
if (!me->is_live ())
return SCM_BOOL_T;
junkme.
*/
SCM pitch = r->get_property ("pitch");
- if (unsmob_pitch (pitch))
+ if (Pitch::unsmob (pitch))
fingering->set_property ("pitch", pitch);
/*
SCM
Flag::width (SCM smob)
{
- Grob *me = unsmob_grob (smob);
- Stencil *sten = unsmob_stencil (me->get_property ("stencil"));
+ Grob *me = Grob::unsmob (smob);
+ Stencil *sten = Stencil::unsmob (me->get_property ("stencil"));
if (!sten)
return ly_interval2scm (Interval (0.0, 0.0));
SCM
Flag::glyph_name (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Grob *stem = me->get_parent (X_AXIS);
Direction d = get_grob_direction (stem);
SCM
Flag::print (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Grob *stem = me->get_parent (X_AXIS);
Direction d = get_grob_direction (stem);
SCM
Flag::internal_calc_y_offset (SCM smob, bool pure)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Grob *stem = me->get_parent (X_AXIS);
Direction d = get_grob_direction (stem);
SCM
Flag::calc_x_offset (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Grob *stem = me->get_parent (X_AXIS);
return scm_from_double (stem->extent (stem, X_AXIS)[RIGHT]);
}
Font_metric *
Font_interface::get_default_font (Grob *me)
{
- Font_metric *fm = unsmob_metrics (me->get_property ("font"));
+ Font_metric *fm = Font_metric::unsmob (me->get_property ("font"));
if (!fm)
{
SCM chain = music_font_alist_chain (me);
" to the font encodings @code{fetaMusic} and @code{fetaBraces},"
" respectively.")
{
- Font_metric *fm = unsmob_metrics (font);
+ Font_metric *fm = Font_metric::unsmob (font);
LY_ASSERT_SMOB (Font_metric, font, 1);
LY_ASSERT_TYPE (scm_is_string, name, 2);
" to the font encodings @code{fetaMusic} and @code{fetaBraces},"
" respectively.")
{
- Font_metric *fm = unsmob_metrics (font);
+ Font_metric *fm = Font_metric::unsmob (font);
LY_ASSERT_SMOB (Font_metric, font, 1);
LY_ASSERT_TYPE (scm_is_string, name, 2);
" to the font encodings @code{fetaMusic} and @code{fetaBraces},"
" respectively.")
{
- Font_metric *fm = unsmob_metrics (font);
+ Font_metric *fm = Font_metric::unsmob (font);
LY_ASSERT_SMOB (Font_metric, font, 1);
LY_ASSERT_TYPE (scm_is_integer, index, 2);
" to the font encodings @code{fetaMusic} and @code{fetaBraces},"
" respectively.")
{
- Font_metric *fm = unsmob_metrics (font);
+ Font_metric *fm = Font_metric::unsmob (font);
LY_ASSERT_SMOB (Font_metric, font, 1);
LY_ASSERT_TYPE (scm_is_string, name, 2);
{
LY_ASSERT_SMOB (Font_metric, font, 1);
- Font_metric *fm = unsmob_metrics (font);
+ Font_metric *fm = Font_metric::unsmob (font);
SCM name = fm->font_file_name ();
return name;
" return the corresponding name.")
{
LY_ASSERT_SMOB (Font_metric, font, 1);
- Font_metric *fm = unsmob_metrics (font);
+ Font_metric *fm = Font_metric::unsmob (font);
return ly_string2scm (fm->font_name ());
}
{
LY_ASSERT_SMOB (Font_metric, font, 1);
- Font_metric *fm = unsmob_metrics (font);
+ Font_metric *fm = Font_metric::unsmob (font);
return scm_cdr (fm->description_);
}
{
LY_ASSERT_SMOB (Font_metric, font, 1);
- Font_metric *fm = unsmob_metrics (font);
+ Font_metric *fm = Font_metric::unsmob (font);
return scm_from_double (fm->design_size ());
}
int
Font_metric::print_smob (SCM s, SCM port, scm_print_state *)
{
- Font_metric *m = unsmob_metrics (s);
+ Font_metric *m = Font_metric::unsmob (s);
scm_puts ("#<", port);
scm_puts (m->class_name (), port);
scm_puts (" ", port);
if (scm_promise_p (entry) == SCM_BOOL_T)
{
- Font_metric *fm = unsmob_metrics (scm_force (entry));
+ Font_metric *fm = Font_metric::unsmob (scm_force (entry));
size = fm->design_size ();
}
#if HAVE_PANGO_FT2
#endif
}
else
- fm = unsmob_metrics (scm_force (scm_c_vector_ref (font_vector, i)));
+ fm = Font_metric::unsmob (scm_force (scm_c_vector_ref (font_vector, i)));
return find_scaled_font (layout, fm, requested / size);
}
Spanner *b = make_spanner ("FootnoteSpanner", cause);
b->set_parent (s, Y_AXIS);
b->set_parent (s, X_AXIS);
- Grob *bound = unsmob_grob (get_property ("currentMusicalColumn"));
+ Grob *bound = Grob::unsmob (get_property ("currentMusicalColumn"));
b->set_bound (LEFT, bound);
annotated_spanners_.push_back (Drul_array<Spanner *> (s, b));
}
{
if (annotated_spanners_[i][LEFT] == s)
{
- Grob *bound = unsmob_grob (get_property ("currentMusicalColumn"));
+ Grob *bound = Grob::unsmob (get_property ("currentMusicalColumn"));
annotated_spanners_[i][RIGHT]->set_bound (RIGHT, bound);
break;
}
SCM busy = get_property ("busyGrobs");
Moment now = now_mom ();
- while (scm_is_pair (busy) && unsmob_moment (scm_caar (busy))->main_part_ == now.main_part_)
+ while (scm_is_pair (busy) && Moment::unsmob (scm_caar (busy))->main_part_ == now.main_part_)
busy = scm_cdr (busy);
while (scm_is_pair (busy))
{
- Grob *g = unsmob_grob (scm_cdar (busy));
+ Grob *g = Grob::unsmob (scm_cdar (busy));
if (g->internal_has_interface (ly_symbol2scm ("rhythmic-grob-interface")))
context ()->get_score_context ()->set_property ("forbidBreak", SCM_BOOL_T);
busy = scm_cdr (busy);
ly_add_type_predicate ((void *) &ly_cheap_is_list, "list");
ly_add_type_predicate ((void *) &unsmob_global_context, "Global_context");
ly_add_type_predicate ((void *) &unsmob_input, "Input");
- ly_add_type_predicate ((void *) &unsmob_moment, "Moment");
+ ly_add_type_predicate ((void *) &Moment::unsmob, "Moment");
ly_add_type_predicate ((void *) &unsmob_paper_score, "Paper_score");
ly_add_type_predicate ((void *) &unsmob_performance, "Performance");
ly_add_type_predicate ((void *) &is_unpure_pure_container, "unpure pure container");
" process it and return the @code{Music_output} object"
" in its final state.")
{
- Global_context *g = dynamic_cast<Global_context *> (unsmob_context (context));
+ Global_context *g = dynamic_cast<Global_context *> (Context::unsmob (context));
LY_ASSERT_TYPE (unsmob_global_context, context, 1);
SCM output = g->get_output ();
progress_indication ("\n");
- if (Music_output *od = unsmob_music_output (output))
+ if (Music_output *od = Music_output::unsmob (output))
od->process ();
return output;
"Create a translator group and connect it to the global context"
" @var{global}. The translator group is returned.")
{
- Global_context *g = dynamic_cast<Global_context *> (unsmob_context (global));
+ Global_context *g = dynamic_cast<Global_context *> (Context::unsmob (global));
LY_ASSERT_TYPE (unsmob_global_context, global, 1);
Translator_group *tg = new Translator_group ();
" block @var{output-def}. The context is returned.")
{
LY_ASSERT_SMOB (Output_def, output_def, 1);
- Output_def *odef = unsmob_output_def (output_def);
+ Output_def *odef = Output_def::unsmob (output_def);
Global_context *glob = new Global_context (odef);
return SCM_BOOL_F;
}
- Global_context *g = dynamic_cast<Global_context *> (unsmob_context (ctx));
+ Global_context *g = dynamic_cast<Global_context *> (Context::unsmob (ctx));
Cpu_timer timer;
message (_ ("Interpreting music..."));
SCM protected_iter = Music_iterator::get_static_get_iterator (music);
- Music_iterator *iter = unsmob_iterator (protected_iter);
+ Music_iterator *iter = Music_iterator::unsmob (protected_iter);
iter->init_context (music, g);
iter->construct_children ();
ly_symbol2scm ("Prepare"));
events_below ()->register_as_listener (event_source_);
- Context_def *globaldef = unsmob_context_def (definition_);
+ Context_def *globaldef = Context_def::unsmob (definition_);
if (!globaldef)
programming_error ("no `Global' context found");
else
Global_context::prepare (SCM sev)
{
Stream_event *ev = unsmob_stream_event (sev);
- Moment *mom = unsmob_moment (ev->get_property ("moment"));
+ Moment *mom = Moment::unsmob (ev->get_property ("moment"));
assert (mom);
Global_context::get_score_context () const
{
return (scm_is_pair (context_list_))
- ? unsmob_context (scm_car (context_list_))
+ ? Context::unsmob (scm_car (context_list_))
: 0;
}
Global_context *
unsmob_global_context (SCM x)
{
- return dynamic_cast<Global_context *> (unsmob_context (x));
+ return dynamic_cast<Global_context *> (Context::unsmob (x));
}
SCM grob = scm_cadr (entry);
SCM sym = scm_caddr (entry);
- execute_pushpop_property (unsmob_context (context),
+ execute_pushpop_property (Context::unsmob (context),
grob, sym, SCM_UNDEFINED);
}
SCM
Grace_music::start_callback (SCM m)
{
- Moment *l = unsmob_moment (Music_wrapper::length_callback (m));
+ Moment *l = Moment::unsmob (Music_wrapper::length_callback (m));
Moment gl;
gl.grace_part_ = -(l->main_part_ + l->grace_part_);
return gl.smobbed_copy ();
if (grace_spacing_ && (now.grace_part_ || last_moment_.grace_part_))
{
- Grob *column = unsmob_grob (get_property ("currentMusicalColumn"));
+ Grob *column = Grob::unsmob (get_property ("currentMusicalColumn"));
Pointer_group_interface::add_grob (grace_spacing_,
ly_symbol2scm ("columns"),
column);
Grob *primitive = primitives[i].grob ();
Stream_event *event_cause = primitives[i].event_cause ();
int context_info = 0;
- int pitch = unsmob_pitch (event_cause->get_property ("pitch"))->steps ();
+ int pitch = Pitch::unsmob (event_cause->get_property ("pitch"))->steps ();
int prefix_set = scm_to_int (primitive->get_property ("prefix-set"));
if (prefix_set & PES_OR_FLEXA)
SCM
Grid_line_interface::print (SCM smobbed_me)
{
- Grob *me = unsmob_grob (smobbed_me);
+ Grob *me = Grob::unsmob (smobbed_me);
extract_grob_set (me, "elements", elts);
/* compute common refpoint of elements */
SCM
Grid_line_interface::width (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Real staffline = me->layout ()->get_dimension (ly_symbol2scm ("line-thickness"));
Real thick = robust_scm2double (me->get_property ("thickness"), 1.0)
Grid_point_engraver::process_music ()
{
SCM grid_interval = get_property ("gridInterval");
- if (Moment *mom = unsmob_moment (grid_interval))
+ if (Moment *mom = Moment::unsmob (grid_interval))
{
Moment now = now_mom ();
{
LY_ASSERT_SMOB (Grob_array, grob_arr, 1);
- Grob_array *me = unsmob_grob_array (grob_arr);
+ Grob_array *me = Grob_array::unsmob (grob_arr);
return scm_from_int (me->size ());
}
(SCM grob_arr, SCM index),
"Retrieve the @var{index}th element of @var{grob-arr}.")
{
- Grob_array *me = unsmob_grob_array (grob_arr);
+ Grob_array *me = Grob_array::unsmob (grob_arr);
LY_ASSERT_SMOB (Grob_array, grob_arr, 1);
LY_ASSERT_TYPE (scm_is_integer, index, 2);
(SCM grob_arr),
"Return the elements of @var{grob-arr} as a Scheme list.")
{
- Grob_array *me = unsmob_grob_array (grob_arr);
+ Grob_array *me = Grob_array::unsmob (grob_arr);
LY_ASSERT_SMOB (Grob_array, grob_arr, 1);
return grob_array_to_list (me);
(void) s;
#if 0 /* see System::derived_mark () const */
- Grob_array *ga = unsmob_grob_array (s);
+ Grob_array *ga = Grob_array::unsmob (s);
for (vsize i = 0; i < ga->grobs_.size (); i++)
scm_gc_mark (ga->grobs_[i]->self_scm ());
#endif
grob_list_to_grob_array (SCM lst)
{
SCM arr_scm = Grob_array::make_array ();
- Grob_array *ga = unsmob_grob_array (arr_scm);
+ Grob_array *ga = Grob_array::unsmob (arr_scm);
for (SCM s = lst; scm_is_pair (s); s = scm_cdr (s))
- ga->add (unsmob_grob (scm_car (s)));
+ ga->add (Grob::unsmob (scm_car (s)));
return arr_scm;
}
Grob_info::ultimate_event_cause () const
{
SCM cause = grob_->self_scm ();
- while (unsmob_grob (cause))
+ while (Grob::unsmob (cause))
{
- cause = unsmob_grob (cause)->get_property ("cause");
+ cause = Grob::unsmob (cause)->get_property ("cause");
}
return unsmob_stream_event (cause);
}
"Compare two grob priority queue entries."
" This is an internal function.")
{
- if (Moment::compare (*unsmob_moment (scm_car (a)),
- *unsmob_moment (scm_car (b))) < 0)
+ if (Moment::compare (*Moment::unsmob (scm_car (a)),
+ *Moment::unsmob (scm_car (b))) < 0)
return SCM_BOOL_T;
else
return SCM_BOOL_F;
Moment now = now_mom ();
SCM start_busy = get_property ("busyGrobs");
SCM busy = start_busy;
- while (scm_is_pair (busy) && *unsmob_moment (scm_caar (busy)) == now)
+ while (scm_is_pair (busy) && *Moment::unsmob (scm_caar (busy)) == now)
busy = scm_cdr (busy);
}
SCM start_busy = get_property ("busyGrobs");
SCM busy = start_busy;
- while (scm_is_pair (busy) && *unsmob_moment (scm_caar (busy)) < now)
+ while (scm_is_pair (busy) && *Moment::unsmob (scm_caar (busy)) < now)
{
/*
The grob-pq-engraver is not water tight, and stuff like
"Return the value for property @var{sym} of @var{grob},"
" but do not process callbacks.")
{
- Grob *sc = unsmob_grob (grob);
+ Grob *sc = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
3, 0, 0, (SCM grob, SCM sym, SCM val),
"Set @var{sym} in grob @var{grob} to value @var{val}.")
{
- Grob *sc = unsmob_grob (grob);
+ Grob *sc = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
3, 0, 0, (SCM grob, SCM symlist, SCM val),
"Set nested property @var{symlist} in grob @var{grob} to value @var{val}.")
{
- Grob *sc = unsmob_grob (grob);
+ Grob *sc = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
" If no value is found, return @var{val} or @code{'()}"
" if @var{val} is not specified.")
{
- Grob *sc = unsmob_grob (grob);
+ Grob *sc = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
" If no value is found, return @var{val} or @code{'()}"
" if @var{val} is not specified.")
{
- Grob *sc = unsmob_grob (grob);
- Grob *ref = unsmob_grob (refp);
+ Grob *sc = Grob::unsmob (grob);
+ Grob *ref = Grob::unsmob (refp);
LY_ASSERT_SMOB (Grob, grob, 1);
LY_ASSERT_SMOB (Grob, refp, 2);
" If no value is found, return @var{val} or @code{'()}"
" if @var{val} is not specified.")
{
- Grob *sc = unsmob_grob (grob);
+ Grob *sc = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
1, 0, 0, (SCM grob),
"Return the interfaces list of grob @var{grob}.")
{
- Grob *sc = unsmob_grob (grob);
+ Grob *sc = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
" @var{sym}. It returns @code{'()} (end-of-list) if @var{sym}"
" is undefined in @var{grob}.")
{
- Grob *sc = unsmob_grob (grob);
+ Grob *sc = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
3, 0, 0, (SCM grob, SCM sym, SCM val),
"Set @var{sym} in grob @var{grob} to value @var{val}.")
{
- Grob *sc = unsmob_grob (grob);
+ Grob *sc = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
1, 0, 0, (SCM grob),
"Get @code{\\layout} definition from grob @var{grob}.")
{
- Grob *sc = unsmob_grob (grob);
+ Grob *sc = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
" the global default. If unspecified, @code{font-defaults}"
" from the layout block is taken.")
{
- Grob *sc = unsmob_grob (grob);
+ Grob *sc = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
"Get the extent in @var{axis} direction of @var{grob} relative to"
" the grob @var{refp}.")
{
- Grob *sc = unsmob_grob (grob);
- Grob *ref = unsmob_grob (refp);
+ Grob *sc = Grob::unsmob (grob);
+ Grob *ref = Grob::unsmob (refp);
LY_ASSERT_SMOB (Grob, grob, 1);
LY_ASSERT_SMOB (Grob, refp, 2);
"Get the extent in @var{axis} direction of @var{grob} relative to"
" the grob @var{refp}, or @code{(0,0)} if empty.")
{
- Grob *sc = unsmob_grob (grob);
- Grob *ref = unsmob_grob (refp);
+ Grob *sc = Grob::unsmob (grob);
+ Grob *ref = Grob::unsmob (refp);
LY_ASSERT_SMOB (Grob, grob, 1);
LY_ASSERT_SMOB (Grob, refp, 2);
"Get the coordinate in @var{axis} direction of @var{grob} relative"
" to the grob @var{refp}.")
{
- Grob *sc = unsmob_grob (grob);
- Grob *ref = unsmob_grob (refp);
+ Grob *sc = Grob::unsmob (grob);
+ Grob *ref = Grob::unsmob (refp);
LY_ASSERT_SMOB (Grob, grob, 1);
LY_ASSERT_SMOB (Grob, refp, 2);
"Get the parent of @var{grob}. @var{axis} is 0 for the X-axis,"
" 1@tie{}for the Y-axis.")
{
- Grob *sc = unsmob_grob (grob);
+ Grob *sc = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
LY_ASSERT_TYPE (is_axis, axis, 2);
3, 0, 0, (SCM grob, SCM axis, SCM parent_grob),
"Set @var{parent-grob} the parent of grob @var{grob} in axis @var{axis}.")
{
- Grob *gr = unsmob_grob (grob);
- Grob *parent = unsmob_grob (parent_grob);
+ Grob *gr = Grob::unsmob (grob);
+ Grob *parent = Grob::unsmob (parent_grob);
LY_ASSERT_SMOB (Grob, grob, 1);
LY_ASSERT_TYPE (is_axis, axis, 2);
1, 0, 0, (SCM grob),
"Get the mutable properties of @var{grob}.")
{
- Grob *g = unsmob_grob (grob);
+ Grob *g = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
1, 0, 0, (SCM grob),
"Get the immutable properties of @var{grob}.")
{
- Grob *g = unsmob_grob (grob);
+ Grob *g = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
1, 0, 0, (SCM grob),
"Return the system grob of @var{grob}.")
{
- Grob *me = unsmob_grob (grob);
+ Grob *me = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
1, 0, 0, (SCM grob),
"Return the unbroken original grob of @var{grob}.")
{
- Grob *me = unsmob_grob (grob);
+ Grob *me = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
return me->original () ? me->original ()->self_scm () : me->self_scm ();
1, 0, 0, (SCM grob),
"Kill @var{grob}.")
{
- Grob *me = unsmob_grob (grob);
+ Grob *me = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
"Translate @var{grob} on axis@tie{}@var{a} over"
" distance@tie{}@var{d}.")
{
- Grob *me = unsmob_grob (grob);
+ Grob *me = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
LY_ASSERT_TYPE (scm_is_number, d, 2);
1, 0, 0, (SCM grob),
"Return the default font for grob @var{grob}.")
{
- Grob *gr = unsmob_grob (grob);
+ Grob *gr = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
" for @var{axis}.")
{
- Grob *gr = unsmob_grob (grob);
+ Grob *gr = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
LY_ASSERT_SMOB (Grob, other, 2);
- Grob *o = unsmob_grob (other);
+ Grob *o = Grob::unsmob (other);
LY_ASSERT_TYPE (is_axis, axis, 3);
"Find the common refpoint of @var{grob} and @var{others}"
" (a grob-array) for @var{axis}.")
{
- Grob *gr = unsmob_grob (grob);
+ Grob *gr = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
LY_ASSERT_SMOB (Grob_array, others, 2);
- Grob_array *ga = unsmob_grob_array (others);
+ Grob_array *ga = Grob_array::unsmob (others);
LY_ASSERT_TYPE (is_axis, axis, 3);
Grob *refp = common_refpoint_of_array (ga->array (), gr, Axis (scm_to_int (axis)));
" to the head of this, meaning that it is called"
" using @var{grob} and the previous callback's result.")
{
- Grob *gr = unsmob_grob (grob);
+ Grob *gr = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
SCM_ASSERT_TYPE (ly_is_procedure (proc) || is_unpure_pure_container (proc), proc, SCM_ARG2, __FUNCTION__, "procedure or unpure pure container");
LY_ASSERT_SMOB (Grob, a, 1);
LY_ASSERT_SMOB (Grob, b, 2);
- Grob *ga = unsmob_grob (a);
- Grob *gb = unsmob_grob (b);
+ Grob *ga = Grob::unsmob (a);
+ Grob *gb = Grob::unsmob (b);
return ly_bool2scm (Grob::vertical_less (ga, gb));
}
"Get the index of the vertical axis group the grob @var{grob} belongs to;"
" return @code{-1} if none is found.")
{
- Grob *gr = unsmob_grob (grob);
+ Grob *gr = Grob::unsmob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
return 0;
SCM stil = get_property ("stencil");
- return unsmob_stencil (stil);
+ return Stencil::unsmob (stil);
}
Stencil
SCM stil = get_property ("stencil");
Stencil retval;
- if (Stencil *m = unsmob_stencil (stil))
+ if (Stencil *m = Stencil::unsmob (stil))
{
retval = *m;
bool transparent = to_boolean (get_property ("transparent"));
/* Call the scheme procedure stencil-whiteout in scm/stencils.scm */
/* to add a round-filled-box stencil to the stencil list */
retval
- = *unsmob_stencil (scm_call_1 (ly_lily_module_constant ("stencil-whiteout"),
+ = *Stencil::unsmob (scm_call_1 (ly_lily_module_constant ("stencil-whiteout"),
retval.smobbed_copy ()));
}
Grob::programming_error (const string &s) const
{
SCM cause = self_scm ();
- while (Grob *g = unsmob_grob (cause))
+ while (Grob *g = Grob::unsmob (cause))
cause = g->get_property ("cause");
/* ES TODO: cause can't be Music*/
Grob::warning (const string &s) const
{
SCM cause = self_scm ();
- while (Grob *g = unsmob_grob (cause))
+ while (Grob *g = Grob::unsmob (cause))
cause = g->get_property ("cause");
/* ES TODO: cause can't be Music*/
SCM
Grob::stencil_height (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
return grob_stencil_extent (me, Y_AXIS);
}
SCM
Grob::pure_stencil_height (SCM smob, SCM /* beg */, SCM /* end */)
{
- Grob *me = unsmob_grob (smob);
- if (unsmob_stencil (me->get_property_data ("stencil")))
+ Grob *me = Grob::unsmob (smob);
+ if (Stencil::unsmob (me->get_property_data ("stencil")))
return grob_stencil_extent (me, Y_AXIS);
return ly_interval2scm (Interval ());
SCM
Grob::y_parent_positioning (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Grob *par = me->get_parent (Y_AXIS);
if (par)
(void) par->get_property ("positioning-done");
SCM
Grob::x_parent_positioning (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Grob *par = me->get_parent (X_AXIS);
if (par)
SCM
Grob::stencil_width (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
return grob_stencil_extent (me, X_AXIS);
}
common_refpoint_of_list (SCM elist, Grob *common, Axis a)
{
for (; scm_is_pair (elist); elist = scm_cdr (elist))
- if (Grob *s = unsmob_grob (scm_car (elist)))
+ if (Grob *s = Grob::unsmob (scm_car (elist)))
{
if (common)
common = common->common_refpoint (s, a);
SCM
Hairpin::pure_height (SCM smob, SCM, SCM)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Real height = robust_scm2double (me->get_property ("height"), 0.0)
* Staff_symbol_referencer::staff_space (me);
if (!scm_is_pair (hsb))
break;
- span_bars[d] = unsmob_grob ((d == UP ? scm_car : scm_cdr) (hsb));
+ span_bars[d] = Grob::unsmob ((d == UP ? scm_car : scm_cdr) (hsb));
break;
}
SCM
Hara_kiri_group_spanner::y_extent (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
consider_suicide (me);
return Axis_group_interface::generic_group_extent (me, Y_AXIS);
}
SCM
Hara_kiri_group_spanner::calc_skylines (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
consider_suicide (me);
return Axis_group_interface::calc_skylines (smob);
}
SCM
Hara_kiri_group_spanner::pure_height (SCM smob, SCM start_scm, SCM end_scm)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
int start = robust_scm2int (start_scm, 0);
int end = robust_scm2int (end_scm, INT_MAX);
SCM
Hara_kiri_group_spanner::force_hara_kiri_callback (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
consider_suicide (me);
return scm_from_double (0.0);
}
SCM
Hara_kiri_group_spanner::force_hara_kiri_in_y_parent_callback (SCM smob)
{
- Grob *daughter = unsmob_grob (smob);
+ Grob *daughter = Grob::unsmob (smob);
force_hara_kiri_callback (daughter->get_parent (Y_AXIS)->self_scm ());
return scm_from_double (0.0);
}
Output_def *layout);
};
-DECLARE_UNSMOB (Book, book);
#endif /* BOOK_HH */
Box (Interval ix, Interval iy);
};
-DECLARE_UNSMOB (Box, box);
#endif
Context_def (Context_def const &);
};
-DECLARE_UNSMOB (Context_def, context_def);
#endif /* CONTEXT_DEF_HH */
DECLARE_SIMPLE_SMOBS (Context_mod);
};
-DECLARE_UNSMOB (Context_mod, context_mod);
#endif /* CONTEXT_MOD_HH */
Context *get_voice_to_lyrics (Context *lyrics);
Grob *get_current_note_head (Context *voice, bool include_grace_notes);
Grob *get_current_rest (Context *voice);
-DECLARE_UNSMOB (Context, context);
Moment measure_position (Context const *context);
Moment measure_position (Context const *context, Duration const *dur);
DECLARE_SMOBS (Dispatcher);
};
-DECLARE_UNSMOB (Dispatcher, dispatcher);
#endif // DISPATCHER_HH
};
INSTANTIATE_COMPARE (Duration, Duration::compare);
-DECLARE_UNSMOB (Duration, duration);
extern SCM Duration_type_p_proc;
Font_metric ();
};
-DECLARE_UNSMOB (Font_metric, metrics);
char *pfb2pfa (Byte const *pfb, int length);
static SCM make_array ();
};
-DECLARE_UNSMOB (Grob_array, grob_array);
vector<Grob *> const &ly_scm2link_array (SCM x);
SCM grob_list_to_grob_array (SCM lst);
};
/* smob utilities */
-DECLARE_UNSMOB (Grob, grob);
Spanner *unsmob_spanner (SCM);
Item *unsmob_item (SCM);
SCM make_scope () const;
};
-DECLARE_UNSMOB (Lily_parser, lily_parser);
Output_def *get_layout (Lily_parser *parser);
Output_def *get_midi (Lily_parser *parser);
DECLARE_SIMPLE_SMOBS (Listener);
};
-DECLARE_UNSMOB (Listener, listener);
#define IMPLEMENT_LISTENER(cl, method) \
void \
IMPLEMENT_ARITHMETIC_OPERATOR (Moment, *);
IMPLEMENT_ARITHMETIC_OPERATOR (Moment, % );
-DECLARE_UNSMOB (Moment, moment);
int compare (Moment const &, Moment const &);
INSTANTIATE_COMPARE (Moment const &, Moment::compare);
return c->unprotect (); \
}
-DECLARE_UNSMOB (Music_iterator, iterator);
#endif // MUSIC_ITERATOR_HH
virtual void process ();
};
-DECLARE_UNSMOB (Music_output, music_output);
Paper_score *unsmob_paper_score (SCM);
Performance *unsmob_performance (SCM);
#endif /* MUSIC_OUTPUT_HH */
Font_metric *select_encoded_font (Output_def *layout, SCM chain);
Font_metric *select_font (Output_def *layout, SCM chain);
-DECLARE_UNSMOB (Output_def, output_def);
Font_metric* find_pango_font (Output_def *layout, SCM descr, Real factor);
SCM label ();
};
-DECLARE_UNSMOB (Page_marker, page_marker)
#endif /* PAGE_MARKER_HH */
long *first_performance_number);
};
-DECLARE_UNSMOB (Paper_book, paper_book)
#endif /* PAPER_BOOK_HH */
SCM scheme_to_string (SCM);
};
-DECLARE_UNSMOB (Paper_outputter, outputter);
#endif /* PAPER_OUTPUTTER_HH */
SCM ly_pitch_diff (SCM pitch, SCM root);
SCM ly_pitch_transpose (SCM p, SCM delta);
-DECLARE_UNSMOB (Pitch, pitch);
INSTANTIATE_COMPARE (Pitch, Pitch::compare);
void internal_set_property (SCM sym, SCM val);
};
-DECLARE_UNSMOB (Prob, prob);
SCM ly_prob_set_property_x (SCM system, SCM sym, SCM value);
SCM ly_prob_property (SCM prob, SCM sym, SCM val);
void set_header (SCM module);
};
-DECLARE_UNSMOB (Score, score);
SCM ly_run_translator (SCM, SCM);
void operator *= (Real);
bool operator > (Spring const &) const;
};
-DECLARE_UNSMOB (Spring, spring);
Spring merge_springs (vector<Spring> const &springs);
efficient to add "fresh" stencils to what you're going to build.
* Do not create Stencil objects on the heap. That includes passing
- around Stencil* which are produced by unsmob_stencil(). Either
+ around Stencil* which are produced by Stencil::unsmob(). Either
copy Stencil objects, or use SCM references.
* Empty stencils have empty dimensions. If add_at_edge is used to
static SCM skylines_from_stencil (SCM, Real, Axis);
};
-DECLARE_UNSMOB (Stencil, stencil);
void interpret_stencil_expression (SCM expr,
SCM (*func) (void *, SCM),
#define foobar
#define ADD_TRANSLATOR_GROUP(classname, desc, grobs, read, write) foobar
-DECLARE_UNSMOB (Translator_group, translator_group);
#endif // TRANSLATOR_GROUP_HH
Translator *get_translator (SCM s);
Moment get_event_length (Stream_event *s, Moment now);
Moment get_event_length (Stream_event *s);
-DECLARE_UNSMOB (Translator, translator);
/*
This helper is only meaningful inside listen_* methods.
{
text_spanner_ = make_spanner ("InstrumentName", SCM_EOL);
- Grob *col = unsmob_grob (get_property ("currentCommandColumn"));
+ Grob *col = Grob::unsmob (get_property ("currentCommandColumn"));
text_spanner_->set_bound (LEFT, col);
text_spanner_->set_property ("text", short_text_);
text_spanner_->set_property ("long-text", long_text_);
/*
UGH, should handle this in Score_engraver.
*/
- Grob *system = unsmob_grob (get_property ("rootSystem"));
+ Grob *system = Grob::unsmob (get_property ("rootSystem"));
if (system)
Axis_group_interface::add_element (system, text_spanner_);
else
axis_groups_[i]);
text_spanner_->set_bound (RIGHT,
- unsmob_grob (get_property ("currentCommandColumn")));
+ Grob::unsmob (get_property ("currentCommandColumn")));
Pointer_group_interface::set_ordered (text_spanner_,
ly_symbol2scm ("elements"),
1, 0, 0, (SCM g),
"Is @var{g} an @code{Item} object?")
{
- Grob *me = unsmob_grob (g);
+ Grob *me = Grob::unsmob (g);
bool b = dynamic_cast<Item *> (me);
return ly_bool2scm (b);
}
Item *
unsmob_item (SCM s)
{
- return dynamic_cast<Item *> (unsmob_grob (s));
+ return dynamic_cast<Item *> (Grob::unsmob (s));
}
Interval
for (vsize i = 0; i < group_spanners_.size (); ++i)
{
SCM grob_array_scm = Grob_array::make_array ();
- Grob_array *ga = unsmob_grob_array (grob_array_scm);
+ Grob_array *ga = Grob_array::unsmob (grob_array_scm);
// It would make Hara_kiri_group_spanner::request_suicide a _little_
// faster if we removed each grob from its own array. It seems
SCM
Key_signature_interface::print (SCM smob)
{
- Item *me = dynamic_cast<Item *> (unsmob_grob (smob));
+ Item *me = dynamic_cast<Item *> (Grob::unsmob (smob));
Real inter = Staff_symbol_referencer::staff_space (me) / 2.0;
first = current;
// must keep track of accidentals in spacing problem
- Grob *acc_gr = unsmob_grob (current->get_object ("accidental-grob"));
+ Grob *acc_gr = Grob::unsmob (current->get_object ("accidental-grob"));
if (acc_gr && i > 0)
{
Interval acc_ext = acc_gr->extent (acc_gr, X_AXIS);
if (i < primitives.size () - 1)
{
Item *next = dynamic_cast<Item *> (primitives[i + 1].grob ());
- Grob *acc_gr = unsmob_grob (next->get_object ("accidental-grob"));
+ Grob *acc_gr = Grob::unsmob (next->get_object ("accidental-grob"));
if (acc_gr)
{
Interval acc_ext = acc_gr->extent (acc_gr, X_AXIS);
assert (!span_);
span_ = make_spanner ("LedgerLineSpanner", SCM_EOL);
- span_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
+ span_->set_bound (LEFT, Grob::unsmob (get_property ("currentCommandColumn")));
}
void
{
if (span_)
{
- span_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
+ span_->set_bound (RIGHT, Grob::unsmob (get_property ("currentCommandColumn")));
span_ = 0;
}
}
SCM
Ledger_line_spanner::set_spacing_rods (SCM smob)
{
- Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
+ Spanner *me = dynamic_cast<Spanner *> (Grob::unsmob (smob));
// find size of note heads.
Grob *staff = Staff_symbol_referencer::get_staff_symbol (me);
SCM
Ledger_line_spanner::print (SCM smob)
{
- Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
+ Spanner *me = dynamic_cast<Spanner *> (Grob::unsmob (smob));
extract_grob_set (me, "note-heads", heads);
Axis a = Axis (i);
common[a] = common_refpoint_of_array (heads, me, a);
for (vsize i = heads.size (); i--;)
- if (Grob *g = unsmob_grob (me->get_object ("accidental-grob")))
+ if (Grob *g = Grob::unsmob (me->get_object ("accidental-grob")))
common[a] = common[a]->common_refpoint (g, a);
}
Interval x_extent = ledger_size;
if (i == 0)
- if (Grob *g = unsmob_grob (h->get_object ("accidental-grob")))
+ if (Grob *g = Grob::unsmob (h->get_object ("accidental-grob")))
{
Interval accidental_size = g->extent (common[X_AXIS], X_AXIS);
Real d
if (scm_is_pair (handle)) {
yylval = scm_cdr (handle);
- if (unsmob_pitch (yylval))
+ if (Pitch::unsmob (yylval))
return (YYSTATE == notes) ? NOTENAME_PITCH : TONICNAME_PITCH;
else if (scm_is_symbol (yylval))
return DRUM_PITCH;
primitives_.clear ();
ligature_ = 0;
}
- last_bound_ = unsmob_grob (get_property ("currentMusicalColumn"));
+ last_bound_ = Grob::unsmob (get_property ("currentMusicalColumn"));
if (ligature_)
{
prev_start_event_ = events_drul_[START];
ligature_ = create_ligature_spanner ();
- Grob *bound = unsmob_grob (get_property ("currentMusicalColumn"));
+ Grob *bound = Grob::unsmob (get_property ("currentMusicalColumn"));
if (!bound)
events_drul_[START]->origin ()->warning (_ ("no left bound"));
else
1, 0, 0, (SCM parser_smob),
"Return the lexer for @var{parser-smob}.")
{
- Lily_parser *parser = unsmob_lily_parser (parser_smob);
+ Lily_parser *parser = Lily_parser::unsmob (parser_smob);
return parser->lexer_->self_scm ();
}
" it becomes the source of all music expressions inside.")
{
LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
- Lily_parser *parser = unsmob_lily_parser (parser_smob);
+ Lily_parser *parser = Lily_parser::unsmob (parser_smob);
if (SCM_UNBNDP (closures))
closures = SCM_EOL;
else
{
LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
- Lily_parser *parser = unsmob_lily_parser (parser_smob);
+ Lily_parser *parser = Lily_parser::unsmob (parser_smob);
LY_ASSERT_TYPE (ly_is_symbol, symbol, 2);
{
LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
- Lily_parser *parser = unsmob_lily_parser (parser_smob);
+ Lily_parser *parser = Lily_parser::unsmob (parser_smob);
LY_ASSERT_TYPE (ly_is_symbol, symbol, 2);
" Upon failure, throw @code{ly-file-failed} key.")
{
LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
- Lily_parser *parser = unsmob_lily_parser (parser_smob);
+ Lily_parser *parser = Lily_parser::unsmob (parser_smob);
LY_ASSERT_TYPE (scm_is_string, ly_code, 2);
if (!parser->lexer_->is_clean ())
" @var{filename} and @var{line} are optional source indicators.")
{
LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
- Lily_parser *parser = unsmob_lily_parser (parser_smob);
+ Lily_parser *parser = Lily_parser::unsmob (parser_smob);
LY_ASSERT_TYPE (scm_is_string, ly_code, 2);
string fn;
if (SCM_UNBNDP (filename) || !scm_is_string (filename))
" Scheme expressions (@code{$} instead of @code{#}).")
{
LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
- Lily_parser *parser = unsmob_lily_parser (parser_smob);
+ Lily_parser *parser = Lily_parser::unsmob (parser_smob);
LY_ASSERT_TYPE (scm_is_string, ly_code, 2);
parser->include_string (ly_scm2string (ly_code));
" if the current mode is notes.")
{
LY_ASSERT_SMOB (Lily_parser, parser, 1);
- Lily_parser *p = unsmob_lily_parser (parser);
+ Lily_parser *p = Lily_parser::unsmob (parser);
if (p->lexer_->is_note_state ())
{
"Return the base name of the output file.")
{
LY_ASSERT_SMOB (Lily_parser, parser, 1);
- Lily_parser *p = unsmob_lily_parser (parser);
+ Lily_parser *p = Lily_parser::unsmob (parser);
return ly_string2scm (p->output_basename_);
}
"Display an error message and make the parser fail.")
{
LY_ASSERT_SMOB (Lily_parser, parser, 1);
- Lily_parser *p = unsmob_lily_parser (parser);
+ Lily_parser *p = Lily_parser::unsmob (parser);
LY_ASSERT_TYPE (scm_is_string, msg, 2);
string s = ly_scm2string (msg);
"Clear the error flag for the parser.")
{
LY_ASSERT_SMOB (Lily_parser, parser, 1);
- Lily_parser *p = unsmob_lily_parser (parser);
+ Lily_parser *p = Lily_parser::unsmob (parser);
p->error_level_ = 0;
p->lexer_->error_level_ = 0;
"Does @var{parser} have an error flag?")
{
LY_ASSERT_SMOB (Lily_parser, parser, 1);
- Lily_parser *p = unsmob_lily_parser (parser);
+ Lily_parser *p = Lily_parser::unsmob (parser);
return scm_from_bool (p->error_level_ || p->lexer_->error_level_);
}
get_layout (Lily_parser *parser)
{
SCM id = parser->lexer_->lookup_identifier ("$defaultlayout");
- Output_def *layout = unsmob_output_def (id);
+ Output_def *layout = Output_def::unsmob (id);
layout = layout ? layout->clone () : new Output_def;
layout->set_variable (ly_symbol2scm ("is-layout"), SCM_BOOL_T);
get_midi (Lily_parser *parser)
{
SCM id = parser->lexer_->lookup_identifier ("$defaultmidi");
- Output_def *layout = unsmob_output_def (id);
+ Output_def *layout = Output_def::unsmob (id);
layout = layout ? layout->clone () : new Output_def;
layout->set_variable (ly_symbol2scm ("is-midi"), SCM_BOOL_T);
return layout;
{
SCM papers = parser->lexer_->lookup_identifier ("$papers");
Output_def *layout = ((papers == SCM_UNDEFINED) || scm_is_null (papers))
- ? 0 : unsmob_output_def (scm_car (papers));
+ ? 0 : Output_def::unsmob (scm_car (papers));
SCM default_paper = parser->lexer_->lookup_identifier ("$defaultpaper");
- layout = layout ? layout : unsmob_output_def (default_paper);
+ layout = layout ? layout : Output_def::unsmob (default_paper);
layout = layout ? dynamic_cast<Output_def *> (layout->clone ()) : new Output_def;
layout->set_variable (ly_symbol2scm ("is-paper"), SCM_BOOL_T);
? Axis_group_interface::generic_bound_extent (bound_grob, commonx, X_AXIS)
: robust_relative_extent (bound_grob, commonx, X_AXIS)).linear_combination (attach);
- Grob *acc = unsmob_grob (bound_grob->get_object ("accidental-grob"));
+ Grob *acc = Grob::unsmob (bound_grob->get_object ("accidental-grob"));
if (acc && to_boolean (ly_assoc_get (ly_symbol2scm ("end-on-accidental"), details, SCM_BOOL_F)))
x_coord = robust_relative_extent (acc, commonx, X_AXIS).linear_combination (attach);
SCM
Line_spanner::print (SCM smob)
{
- Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
+ Spanner *me = dynamic_cast<Spanner *> (Grob::unsmob (smob));
// Triggers simple-Y calculations
bool simple_y = to_boolean (me->get_property ("simple-Y")) && !to_boolean (me->get_property ("cross-staff"));
bounds[d], SCM_BOOL_F), 0.0);
arrows[d] = to_boolean (ly_assoc_get (ly_symbol2scm ("arrow"),
bounds[d], SCM_BOOL_F));
- stencils[d] = unsmob_stencil (ly_assoc_get (ly_symbol2scm ("stencil"),
+ stencils[d] = Stencil::unsmob (ly_assoc_get (ly_symbol2scm ("stencil"),
bounds[d], SCM_BOOL_F));
- common_y[d] = unsmob_grob (ly_assoc_get (ly_symbol2scm ("common-Y"),
+ common_y[d] = Grob::unsmob (ly_assoc_get (ly_symbol2scm ("common-Y"),
bounds[d], SCM_BOOL_F));
if (!common_y[d])
common_y[d] = me;
SCM
Listener::equal_p (SCM a, SCM b)
{
- Listener *l1 = unsmob_listener (a);
- Listener *l2 = unsmob_listener (b);
+ Listener *l1 = Listener::unsmob (a);
+ Listener *l2 = Listener::unsmob (b);
return (*l1 == *l2) ? SCM_BOOL_T : SCM_BOOL_F;
}
Lyric_combine_music_iterator::construct_children ()
{
Music *m = unsmob_music (get_music ()->get_property ("element"));
- lyric_iter_ = unsmob_iterator (get_iterator (m));
+ lyric_iter_ = Music_iterator::unsmob (get_iterator (m));
if (!lyric_iter_)
return;
lyrics_context_ = find_context_below (lyric_iter_->get_outlet (),
bool searchForVoice = to_boolean (lyrics->get_property ("searchForVoice"));
SCM avc = lyrics->get_property ("associatedVoiceContext");
- if (Context *c = unsmob_context (avc))
+ if (Context *c = Context::unsmob (avc))
return c;
SCM voice_name = lyrics->get_property ("associatedVoice");
for (SCM s = voice->get_property ("busyGrobs");
scm_is_pair (s); s = scm_cdr (s))
{
- Grob *g = unsmob_grob (scm_cdar (s));;
- Moment *end_mom = unsmob_moment (scm_caar (s));
+ Grob *g = Grob::unsmob (scm_cdar (s));;
+ Moment *end_mom = Moment::unsmob (scm_caar (s));
if (!end_mom || !g)
{
programming_error ("busyGrobs invalid");
SCM
Lyric_hyphen::set_spacing_rods (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Rod r;
Spanner *sp = dynamic_cast<Spanner *> (me);
{
if (grouping_)
{
- grouping_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
+ grouping_->set_bound (RIGHT, Grob::unsmob (get_property ("currentCommandColumn")));
grouping_->suicide ();
grouping_ = 0;
}
if (grouping_ && now.main_part_ >= stop_grouping_mom_ && !now.grace_part_)
{
grouping_->set_bound (RIGHT,
- unsmob_grob (get_property ("currentMusicalColumn")));
+ Grob::unsmob (get_property ("currentMusicalColumn")));
grouping_ = 0;
}
SCM grouping = get_property ("beatStructure");
if (scm_is_pair (grouping))
{
- Moment *measpos = unsmob_moment (get_property ("measurePosition"));
+ Moment *measpos = Moment::unsmob (get_property ("measurePosition"));
Rational mp = measpos->main_part_;
- Moment *base_mom = unsmob_moment (get_property ("baseMoment"));
+ Moment *base_mom = Moment::unsmob (get_property ("baseMoment"));
Rational base_moment = base_mom->main_part_;
Rational where (0);
if (grouplen > 1)
{
grouping_ = make_spanner ("MeasureGrouping", SCM_EOL);
- grouping_->set_bound (LEFT, unsmob_grob (get_property ("currentMusicalColumn")));
+ grouping_->set_bound (LEFT, Grob::unsmob (get_property ("currentMusicalColumn")));
stop_grouping_mom_ = now.main_part_ + Rational (grouplen - 1) * base_moment;
get_global_context ()->add_moment_to_process (Moment (stop_grouping_mom_));
SCM
Measure_grouping::print (SCM grob)
{
- Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (grob));
+ Spanner *me = dynamic_cast<Spanner *> (Grob::unsmob (grob));
SCM which = me->get_property ("style");
Real height = robust_scm2double (me->get_property ("height"), 1);
SCM
Melody_spanner::calc_neutral_stem_direction (SCM smob)
{
- Grob *stem = unsmob_grob (smob);
- Grob *me = unsmob_grob (stem->get_object ("melody-spanner"));
+ Grob *stem = Grob::unsmob (smob);
+ Grob *me = Grob::unsmob (stem->get_object ("melody-spanner"));
if (!me || !me->is_live ())
return scm_from_int (DOWN);
continue;
}
- int pitch = unsmob_pitch (nr->get_property ("pitch"))->steps ();
+ int pitch = Pitch::unsmob (nr->get_property ("pitch"))->steps ();
int prim = 0;
if (at_beginning)
}
// b. descendens longa or brevis
else if (i < s - 1
- && (unsmob_pitch (primitives[i + 1].event_cause ()
+ && (Pitch::unsmob (primitives[i + 1].event_cause ()
->get_property ("pitch"))->steps () < pitch)
&& duration_log > -3)
{
/*
breve: check whether descending
*/
- int const next_pitch = unsmob_pitch
+ int const next_pitch = Pitch::unsmob
(next_info.event_cause ()->get_property ("pitch"))->steps ();
if (next_pitch < pitch)
/*
SCM
Mensural_ligature::brew_ligature_primitive (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
return internal_brew_primitive (me).smobbed_copy ();
}
first notational element of the measure if no time
signature is present in that measure).
*/
- if (Grob *mc = unsmob_grob (get_property ("currentMusicalColumn")))
+ if (Grob *mc = Grob::unsmob (get_property ("currentMusicalColumn")))
text_->set_parent (mc, X_AXIS);
- else if (Grob *cc = unsmob_grob (get_property ("currentCommandColumn")))
+ else if (Grob *cc = Grob::unsmob (get_property ("currentCommandColumn")))
text_->set_parent (cc, X_AXIS);
}
text_->set_object ("side-support-elements",
LY_ASSERT_SMOB (Moment, a, 1);
LY_ASSERT_SMOB (Moment, b, 2);
- Moment *ma = unsmob_moment (a);
- Moment *mb = unsmob_moment (b);
+ Moment *ma = Moment::unsmob (a);
+ Moment *mb = Moment::unsmob (b);
return (*ma - *mb).smobbed_copy ();
}
LY_ASSERT_SMOB (Moment, a, 1);
LY_ASSERT_SMOB (Moment, b, 2);
- Moment *ma = unsmob_moment (a);
- Moment *mb = unsmob_moment (b);
+ Moment *ma = Moment::unsmob (a);
+ Moment *mb = Moment::unsmob (b);
return (*ma + *mb).smobbed_copy ();
}
LY_ASSERT_SMOB (Moment, a, 1);
LY_ASSERT_SMOB (Moment, b, 2);
- Moment *ma = unsmob_moment (a);
- Moment *mb = unsmob_moment (b);
+ Moment *ma = Moment::unsmob (a);
+ Moment *mb = Moment::unsmob (b);
return (*ma * * mb).smobbed_copy ();
}
LY_ASSERT_SMOB (Moment, a, 1);
LY_ASSERT_SMOB (Moment, b, 2);
- Moment *ma = unsmob_moment (a);
- Moment *mb = unsmob_moment (b);
+ Moment *ma = Moment::unsmob (a);
+ Moment *mb = Moment::unsmob (b);
return (*ma / * mb).smobbed_copy ();
}
LY_ASSERT_SMOB (Moment, a, 1);
LY_ASSERT_SMOB (Moment, b, 2);
- Moment *ma = unsmob_moment (a);
- Moment *mb = unsmob_moment (b);
+ Moment *ma = Moment::unsmob (a);
+ Moment *mb = Moment::unsmob (b);
return (*ma % * mb).smobbed_copy ();
}
{
LY_ASSERT_SMOB (Moment, mom, 1);
- return ly_rational2scm (unsmob_moment (mom)->grace_part_);
+ return ly_rational2scm (Moment::unsmob (mom)->grace_part_);
}
LY_DEFINE (ly_moment_grace_numerator, "ly:moment-grace-numerator",
{
LY_ASSERT_SMOB (Moment, mom, 1);
- Moment *ma = unsmob_moment (mom);
+ Moment *ma = Moment::unsmob (mom);
return scm_from_int64 (ma->grace_part_.numerator ());
}
"Extract denominator from grace timing.")
{
LY_ASSERT_SMOB (Moment, mom, 1);
- Moment *ma = unsmob_moment (mom);
+ Moment *ma = Moment::unsmob (mom);
return scm_from_int64 (ma->grace_part_.denominator ());
}
{
LY_ASSERT_SMOB (Moment, mom, 1);
- return ly_rational2scm (unsmob_moment (mom)->main_part_);
+ return ly_rational2scm (Moment::unsmob (mom)->main_part_);
}
LY_DEFINE (ly_moment_main_numerator, "ly:moment-main-numerator",
"Extract numerator from main timing.")
{
LY_ASSERT_SMOB (Moment, mom, 1);
- Moment *ma = unsmob_moment (mom);
+ Moment *ma = Moment::unsmob (mom);
return scm_from_int64 (ma->main_part_.numerator ());
}
"Extract denominator from main timing.")
{
LY_ASSERT_SMOB (Moment, mom, 1);
- Moment *ma = unsmob_moment (mom);
+ Moment *ma = Moment::unsmob (mom);
return scm_from_int64 (ma->main_part_.denominator ());
}
LY_ASSERT_SMOB (Moment, a, 1);
LY_ASSERT_SMOB (Moment, b, 2);
- Moment *ma = unsmob_moment (a);
- Moment *mb = unsmob_moment (b);
+ Moment *ma = Moment::unsmob (a);
+ Moment *mb = Moment::unsmob (b);
return ly_bool2scm (*ma < *mb);
}
SCM
Moment::equal_p (SCM a, SCM b)
{
- Moment *m1 = unsmob_moment (a);
- Moment *m2 = unsmob_moment (b);
+ Moment *m1 = Moment::unsmob (a);
+ Moment *m2 = Moment::unsmob (b);
return (*m1 == *m2) ? SCM_BOOL_T : SCM_BOOL_F;
}
Moment
robust_scm2moment (SCM m, Moment d)
{
- Moment *p = unsmob_moment (m);
+ Moment *p = Moment::unsmob (m);
if (!p)
return d;
else
bool
moment_less (SCM a, SCM b)
{
- return *unsmob_moment (a) < *unsmob_moment (b);
+ return *Moment::unsmob (a) < *Moment::unsmob (b);
}
-- jneem */
if (bar_seen_)
{
- Grob *cmc = unsmob_grob (get_property ("currentCommandColumn"));
+ Grob *cmc = Grob::unsmob (get_property ("currentCommandColumn"));
/* Ugh, this is a kludge - need this for multi-measure-rest-grace.ly */
last_command_item_ = dynamic_cast<Item *> (cmc);
SCM
Multi_measure_rest::percent (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Spanner *sp = dynamic_cast<Spanner *> (me);
Stencil r = Percent_repeat_item_interface::x_percent (me, 1);
SCM
Multi_measure_rest::print (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Spanner *sp = dynamic_cast<Spanner *> (me);
Interval sp_iv = bar_width (sp);
SCM
Multi_measure_rest::height (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Real space = 1000000; // something very large...
{
SCM sml = dynamic_cast<Spanner *> (me)->get_bound (LEFT)
->get_property ("measure-length");
- Rational ml = (unsmob_moment (sml)) ? unsmob_moment (sml)->main_part_
+ Rational ml = (Moment::unsmob (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 ()),
Stencil mol;
for (SCM s = mols; scm_is_pair (s); s = scm_cdr (s))
- mol.add_at_edge (X_AXIS, LEFT, *unsmob_stencil (scm_car (s)),
+ mol.add_at_edge (X_AXIS, LEFT, *Stencil::unsmob (scm_car (s)),
inner_padding);
mol.align_to (X_AXIS, LEFT);
mol.translate_axis (outer_padding_factor * inner_padding, X_AXIS);
Item *ri = sp->get_bound (RIGHT)->get_column ();
Item *lb = li->find_prebroken_piece (RIGHT);
Item *rb = ri->find_prebroken_piece (LEFT);
- Grob *spacing = unsmob_grob (li->get_object ("spacing"));
+ Grob *spacing = Grob::unsmob (li->get_object ("spacing"));
if (!spacing)
- spacing = unsmob_grob (ri->get_object ("spacing"));
+ spacing = Grob::unsmob (ri->get_object ("spacing"));
if (!spacing)
me->warning (_ ("Using naive multi measure rest spacing."));
else
SCM
Multi_measure_rest::set_spacing_rods (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Real sym_width = symbol_stencil (me, 0.0).extent (X_AXIS).length ();
calculate_spacing_rods (me, sym_width);
SCM
Multi_measure_rest::set_text_rods (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Stencil *stil = me->get_stencil ();
/* FIXME uncached */
if (ly_is_procedure (ctor))
{
iter = scm_call_0 (ctor);
- p = unsmob_iterator (iter);
+ p = Music_iterator::unsmob (iter);
}
else
{
Music_iterator::get_iterator (Music *m) const
{
SCM ip = get_static_get_iterator (m);
- Music_iterator *p = unsmob_iterator (ip);
+ Music_iterator *p = Music_iterator::unsmob (ip);
p->init_context (m, get_outlet ());
{
char s[1000];
- Music_iterator *iter = unsmob_iterator (sm);
+ Music_iterator *iter = Music_iterator::unsmob (sm);
sprintf (s, "#<%s>", iter->class_name ());
scm_puts (s, port);
return 1;
LY_ASSERT_SMOB (Pitch, p, 2);
Music *sc = unsmob_music (m);
- Pitch *sp = unsmob_pitch (p);
+ Pitch *sp = Pitch::unsmob (p);
sc->transpose (*sp);
// SCM_UNDEFINED ?
"Compress music object@tie{}@var{m} by moment @var{factor}.")
{
LY_ASSERT_TYPE (unsmob_music, m, 1);
- LY_ASSERT_TYPE (unsmob_moment, factor, 2);
+ LY_ASSERT_TYPE (Moment::unsmob, factor, 2);
Music *sc = unsmob_music (m);
- sc->compress (*unsmob_moment (factor));
+ sc->compress (*Moment::unsmob (factor));
return sc->self_scm ();
}
" return final pitch.")
{
LY_ASSERT_TYPE (unsmob_music, music, 1);
- LY_ASSERT_TYPE (unsmob_pitch, pitch, 2);
+ LY_ASSERT_TYPE (Pitch::unsmob, pitch, 2);
- Pitch start = *unsmob_pitch (pitch);
+ Pitch start = *Pitch::unsmob (pitch);
Music *m = unsmob_music (music);
Pitch last = m->to_relative_octave (start);
LY_ASSERT_TYPE (unsmob_music, mus, 1);
Music *m = unsmob_music (mus);
- Duration *d = unsmob_duration (m->get_property ("duration"));
+ Duration *d = Duration::unsmob (m->get_property ("duration"));
Moment len;
if (d)
LY_ASSERT_SMOB (Moment, fact, 2);
Music *m = unsmob_music (mus);
- Moment *f = unsmob_moment (fact);
+ Moment *f = Moment::unsmob (fact);
- Duration *d = unsmob_duration (m->get_property ("duration"));
+ Duration *d = Duration::unsmob (m->get_property ("duration"));
if (d)
m->set_property ("duration", d->compressed (f->main_part_).smobbed_copy ());
return SCM_UNSPECIFIED;
" pitch @var{pit}.")
{
SCM newlist = SCM_EOL;
- Pitch *p = unsmob_pitch (pit);
+ Pitch *p = Pitch::unsmob (pit);
for (SCM s = l; scm_is_pair (s); s = scm_cdr (s))
{
Music_sequence::event_chord_length_callback (SCM m)
{
Music *me = unsmob_music (m);
- Duration *d = unsmob_duration (me->get_property ("duration"));
+ Duration *d = Duration::unsmob (me->get_property ("duration"));
// Preset duration is used in chord repetitions.
if (d)
{
Music_sequence::simultaneous_relative_callback (SCM music, SCM pitch)
{
Music *me = unsmob_music (music);
- Pitch p = *unsmob_pitch (pitch);
+ Pitch p = *Pitch::unsmob (pitch);
return music_list_to_relative (me->get_property ("elements"),
p, false).smobbed_copy ();
}
Music_sequence::event_chord_relative_callback (SCM music, SCM pitch)
{
Music *me = unsmob_music (music);
- Pitch p = *unsmob_pitch (pitch);
+ Pitch p = *Pitch::unsmob (pitch);
return music_list_to_relative (me->get_property ("elements"),
p, true).smobbed_copy ();
}
Music *my_music = get_music ();
Music *child = unsmob_music (my_music->get_property ("element"));
child_iter_ = (child)
- ? unsmob_iterator (get_iterator (child))
+ ? Music_iterator::unsmob (get_iterator (child))
: 0;
}
Music::get_length () const
{
SCM lst = get_property ("length");
- if (unsmob_moment (lst))
- return *unsmob_moment (lst);
+ if (Moment::unsmob (lst))
+ return *Moment::unsmob (lst);
if (ly_is_procedure (length_callback_))
{
SCM res = scm_call_1 (length_callback_, self_scm ());
- return *unsmob_moment (res);
+ return *Moment::unsmob (res);
}
return Moment (0);
if (ly_is_procedure (lst))
{
SCM res = scm_call_1 (lst, self_scm ());
- return *unsmob_moment (res);
+ return *Moment::unsmob (res);
}
Moment m;
Music::generic_to_relative_octave (Pitch last)
{
SCM elt = get_property ("element");
- Pitch *old_pit = unsmob_pitch (get_property ("pitch"));
+ Pitch *old_pit = Pitch::unsmob (get_property ("pitch"));
if (old_pit)
{
Pitch new_pit = *old_pit;
SCM callback = get_property ("to-relative-callback");
if (ly_is_procedure (callback))
{
- Pitch *p = unsmob_pitch (scm_call_2 (callback, self_scm (),
+ Pitch *p = Pitch::unsmob (scm_call_2 (callback, self_scm (),
last.smobbed_copy ()));
return *p;
}
m->compress (factor);
compress_music_list (get_property ("elements"), factor);
- Duration *d = unsmob_duration (get_property ("duration"));
+ Duration *d = Duration::unsmob (get_property ("duration"));
if (d)
set_property ("duration",
d->compressed (factor.main_part_).smobbed_copy ());
SCM val = scm_cdr (entry);
SCM new_val = val;
- if (Pitch *p = unsmob_pitch (val))
+ if (Pitch *p = Pitch::unsmob (val))
{
Pitch transposed = p->transposed (delta);
Music::duration_length_callback (SCM m)
{
Music *me = unsmob_music (m);
- Duration *d = unsmob_duration (me->get_property ("duration"));
+ Duration *d = Duration::unsmob (me->get_property ("duration"));
Moment mom;
if (d)
Music *
unsmob_music (SCM m)
{
- return dynamic_cast<Music *> (unsmob_prob (m));
+ return dynamic_cast<Music *> (Prob::unsmob (m));
}
else if (ev->in_event_class ("harmonic-event"))
{
inf.grob ()->set_property ("style", ly_symbol2scm ("harmonic"));
- Grob *d = unsmob_grob (inf.grob ()->get_object ("dot"));
+ Grob *d = Grob::unsmob (inf.grob ()->get_object ("dot"));
if (d && !to_boolean (get_property ("harmonicDots")))
d->suicide ();
}
if (stem_)
{
Side_position_interface::add_support (scripts->at (i).script_, stem_);
- if (Grob *flag = unsmob_grob (stem_->get_object ("flag")))
+ if (Grob *flag = Grob::unsmob (stem_->get_object ("flag")))
Side_position_interface::add_support (scripts->at (i).script_, flag);
}
f->set_parent (ft.head_, Y_AXIS);
f->set_property ("avoid-slur", ly_symbol2scm ("inside"));
if (hordir == LEFT
- && unsmob_grob (ft.head_->get_object ("accidental-grob")))
+ && Grob::unsmob (ft.head_->get_object ("accidental-grob")))
Side_position_interface::add_support (f,
- unsmob_grob (ft.head_->get_object ("accidental-grob")));
- else if (unsmob_grob (ft.head_->get_object ("dot")))
+ Grob::unsmob (ft.head_->get_object ("accidental-grob")));
+ else if (Grob::unsmob (ft.head_->get_object ("dot")))
Side_position_interface::add_support (f,
- unsmob_grob (ft.head_->get_object ("dot")));
+ Grob::unsmob (ft.head_->get_object ("dot")));
Self_alignment_interface::set_aligned_on_parent (f, Y_AXIS);
Side_position_interface::set_axis (f, X_AXIS);
if (dot_wipe_head)
{
- if (Grob *d = unsmob_grob (dot_wipe_head->get_object ("dot")))
+ if (Grob *d = Grob::unsmob (dot_wipe_head->get_object ("dot")))
d->suicide ();
}
if (shift_amount < -1e-6
&& Rhythmic_head::dot_count (head_up))
{
- Grob *d = unsmob_grob (head_up->get_object ("dot"));
+ Grob *d = Grob::unsmob (head_up->get_object ("dot"));
Grob *parent = d->get_parent (X_AXIS);
if (Dot_column::has_interface (parent))
Side_position_interface::add_support (parent, head_down);
}
else if (Rhythmic_head::dot_count (head_down))
{
- Grob *d = unsmob_grob (head_down->get_object ("dot"));
+ Grob *d = Grob::unsmob (head_down->get_object ("dot"));
Grob *parent = d->get_parent (X_AXIS);
if (Dot_column::has_interface (parent))
{
- Grob *stem = unsmob_grob (head_up->get_object ("stem"));
+ Grob *stem = Grob::unsmob (head_up->get_object ("stem"));
// Loop over all heads on an up-pointing-stem to see if dots
// need to clear any heads suspended on its right side.
extract_grob_set (stem, "note-heads", heads);
if (shift_amount > 1e-6
&& Rhythmic_head::dot_count (head_down))
{
- Grob *dot_down = unsmob_grob (head_down->get_object ("dot"));
+ Grob *dot_down = Grob::unsmob (head_down->get_object ("dot"));
Grob *col_down = dot_down->get_parent (X_AXIS);
Direction dir = UP;
if (Rhythmic_head::dot_count (head_up))
{
- Grob *dot_up = unsmob_grob (head_up->get_object ("dot"));
+ Grob *dot_up = Grob::unsmob (head_up->get_object ("dot"));
Grob *col_up = dot_up->get_parent (X_AXIS);
if (col_up == col_down) // let the common DotColumn arrange dots
dir = CENTER;
}
if (dir != CENTER)
{
- Grob *stem = unsmob_grob (head_down->get_object ("stem"));
+ Grob *stem = Grob::unsmob (head_down->get_object ("stem"));
extract_grob_set (stem, "note-heads", heads);
for (vsize i = 0; i < heads.size (); i++)
- if (Grob *dot = unsmob_grob (heads[i]->get_object ("dot")))
+ if (Grob *dot = Grob::unsmob (heads[i]->get_object ("dot")))
dot->set_property ("direction", scm_from_int (dir));
}
}
SCM
Note_collision_interface::calc_positioning_done (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
me->set_property ("positioning-done", SCM_BOOL_T);
Drul_array<vector<Grob *> > clash_groups = get_clash_groups (me);
vector<Real> amounts;
for (; scm_is_pair (hand); hand = scm_cdr (hand))
{
- Grob *s = unsmob_grob (scm_caar (hand));
+ Grob *s = Grob::unsmob (scm_caar (hand));
Real amount = scm_to_double (scm_cdar (hand)) * wid;
done.push_back (s);
}
for (; scm_is_pair (autos); autos = scm_cdr (autos))
{
- Grob *s = unsmob_grob (scm_caar (autos));
+ Grob *s = Grob::unsmob (scm_caar (autos));
Real amount = scm_to_double (scm_cdar (autos)) * wid;
vsize x = find (done, s) - done.begin ();
vector<int> out;
extract_grob_set (me, "elements", elts);
for (vsize i = 0; i < elts.size (); i++)
- if (Grob *stem = unsmob_grob (elts[i]->get_object ("stem")))
+ if (Grob *stem = Grob::unsmob (elts[i]->get_object ("stem")))
{
vector<int> nhp = Stem::note_head_positions (stem);
out.insert (out.end (), nhp.begin (), nhp.end ());
"Return the @code{AccidentalPlacement} grob from @var{note-column}"
" if any, or @code{SCM_EOL} otherwise.")
{
- Grob *grob = unsmob_grob (note_column);
+ Grob *grob = Grob::unsmob (note_column);
LY_ASSERT_SMOB (Grob, note_column, 1);
Grob *acc = Note_column::accidentals (grob);
if (acc)
"Return the @code{DotColumn} grob from @var{note-column}"
" if any, or @code{SCM_EOL} otherwise.")
{
- Grob *grob = unsmob_grob (note_column);
+ Grob *grob = Grob::unsmob (note_column);
LY_ASSERT_SMOB (Grob, note_column, 1);
Grob *dot_column = Note_column::dot_column (grob);
if (dot_column)
bool
Note_column::has_rests (Grob *me)
{
- return unsmob_grob (me->get_object ("rest"));
+ return Grob::unsmob (me->get_object ("rest"));
}
bool
Direction
Note_column::dir (Grob *me)
{
- Grob *stem = unsmob_grob (me->get_object ("stem"));
+ Grob *stem = Grob::unsmob (me->get_object ("stem"));
if (stem && Stem::has_interface (stem))
return get_grob_direction (stem);
else
Grob *
Note_column::get_rest (Grob *me)
{
- return unsmob_grob (me->get_object ("rest"));
+ return Grob::unsmob (me->get_object ("rest"));
}
void
}
else if (Note_head::has_interface (h))
{
- if (unsmob_grob (me->get_object ("rest")))
+ if (Grob::unsmob (me->get_object ("rest")))
both = true;
Pointer_group_interface::add_grob (me, ly_symbol2scm ("note-heads"), h);
}
for (vsize i = 0; i < heads.size (); i++)
{
Grob *h = heads[i];
- acc = h ? unsmob_grob (h->get_object ("accidental-grob")) : 0;
+ acc = h ? Grob::unsmob (h->get_object ("accidental-grob")) : 0;
if (acc)
break;
}
extract_grob_set (me, "note-heads", heads);
for (vsize i = 0; i < heads.size (); i++)
{
- Grob *dots = unsmob_grob (heads[i]->get_object ("dot"));
+ Grob *dots = Grob::unsmob (heads[i]->get_object ("dot"));
if (dots)
return dots->get_parent (X_AXIS);
}
" notehead @var{glyph-name}.")
{
LY_ASSERT_SMOB (Font_metric, font_metric, 1);
- Font_metric *fm = unsmob_metrics (font_metric);
+ Font_metric *fm = Font_metric::unsmob (font_metric);
LY_ASSERT_TYPE (scm_is_string, glyph_name, 2);
return ly_offset2scm (Note_head::get_stem_attachment (fm, ly_scm2string (glyph_name)));
Stencil out = fm->find_by_name (idx_either + suffix);
if (out.is_empty ())
{
- Grob *stem = unsmob_grob (me->get_object ("stem"));
+ Grob *stem = Grob::unsmob (me->get_object ("stem"));
Direction stem_dir = stem ? get_grob_direction (stem) : CENTER;
if (stem_dir == CENTER)
if (style == "kievan"
&& 3 == robust_scm2int (me->get_property ("duration-log"), 2))
{
- Grob *stem = unsmob_grob (me->get_object ("stem"));
- Grob *beam = unsmob_grob (stem->get_object ("beam"));
+ Grob *stem = Grob::unsmob (me->get_object ("stem"));
+ Grob *beam = Grob::unsmob (stem->get_object ("beam"));
if (beam)
out = fm->find_by_name (idx_either + "2kievan");
}
SCM
Note_head::stem_x_shift (SCM smob)
{
- Grob *me = unsmob_grob (smob);
- Grob *stem = unsmob_grob (me->get_object ("stem"));
+ Grob *me = Grob::unsmob (smob);
+ Grob *stem = Grob::unsmob (me->get_object ("stem"));
if (stem)
(void) stem->get_property ("positioning-done");
SCM
Note_head::print (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
string idx;
return internal_print (me, &idx).smobbed_copy ();
SCM
Note_head::include_ledger_line_height (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Grob *staff = Staff_symbol_referencer::get_staff_symbol (me);
if (staff)
SCM
Note_head::calc_stem_attachment (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Font_metric *fm = Font_interface::get_default_font (me);
string key;
internal_print (me, &key);
Stream_event *ev = note_evs_[i];
Item *note = make_item ("NoteHead", ev->self_scm ());
- Pitch *pit = unsmob_pitch (ev->get_property ("pitch"));
+ Pitch *pit = Pitch::unsmob (ev->get_property ("pitch"));
#if 0 /* TODO: should have a mechanism to switch off these warnings. */
{
SCM scm_tonic = get_property ("tonic");
Pitch tonic;
- if (unsmob_pitch (scm_tonic))
- tonic = *unsmob_pitch (scm_tonic);
+ if (Pitch::unsmob (scm_tonic))
+ tonic = *Pitch::unsmob (scm_tonic);
unsigned int delta = (pit->get_notename () - tonic.get_notename () + 7) % 7;
{
if (i)
s += " ";
- Pitch p = *unsmob_pitch (events_[i]->get_property ("pitch"));
+ Pitch p = *Pitch::unsmob (events_[i]->get_property ("pitch"));
if (!to_boolean (get_property ("printOctaveNames")))
p = Pitch (-1, p.get_notename (), p.get_alteration ());
Pitch transposing;
SCM prop = get_property ("instrumentTransposition");
- if (unsmob_pitch (prop))
- transposing = *unsmob_pitch (prop);
+ if (Pitch::unsmob (prop))
+ transposing = *Pitch::unsmob (prop);
for (vsize i = 0; i < note_evs_.size (); i++)
{
Stream_event *n = note_evs_[i];
SCM pit = n->get_property ("pitch");
- if (Pitch *pitp = unsmob_pitch (pit))
+ if (Pitch *pitp = Pitch::unsmob (pit))
{
SCM articulations = n->get_property ("articulations");
Stream_event *tie_event = 0;
Grob *last_spacing = last_spacings_[parent];
if (last_spacing
- && !unsmob_grob_array (last_spacing->get_object ("right-items")))
+ && !Grob_array::unsmob (last_spacing->get_object ("right-items")))
{
- Grob *col = unsmob_grob (get_property ("currentCommandColumn"));
+ Grob *col = Grob::unsmob (get_property ("currentCommandColumn"));
Pointer_group_interface::add_grob (last_spacing,
ly_symbol2scm ("right-items"),
if (last_spacing
&& to_boolean (get_property ("hasStaffSpacing")))
{
- Grob *col = unsmob_grob (get_property ("currentCommandColumn"));
+ Grob *col = Grob::unsmob (get_property ("currentCommandColumn"));
Pointer_group_interface::add_grob (last_spacing,
ly_symbol2scm ("right-items"),
col);
for (vsize i = 0; i < note_columns.size (); i++)
{
SCM r = note_columns[i]->get_object ("rest");
- Grob *g = unsmob_grob (r);
+ Grob *g = Grob::unsmob (r);
Grob *col = note_columns[i]->get_column ();
if (!g)
{
LY_ASSERT_SMOB (Font_metric, font, 1);
- Font_metric *fm = unsmob_metrics (font);
+ Font_metric *fm = Font_metric::unsmob (font);
return fm->sub_fonts ();
}
" information about named glyph @var{glyph} (a string).")
{
Modified_font_metric *fm
- = dynamic_cast<Modified_font_metric *> (unsmob_metrics (font));
+ = dynamic_cast<Modified_font_metric *> (Font_metric::unsmob (font));
Open_type_font *otf = fm
? dynamic_cast<Open_type_font *> (fm->original_font ())
- : dynamic_cast<Open_type_font *> (unsmob_metrics (font));
+ : dynamic_cast<Open_type_font *> (Font_metric::unsmob (font));
SCM_ASSERT_TYPE (otf, font, SCM_ARG1, __FUNCTION__, "OpenType font");
LY_ASSERT_TYPE (scm_is_string, glyph, 2);
" for non-existent @var{tag}.")
{
Modified_font_metric *fm
- = dynamic_cast<Modified_font_metric *> (unsmob_metrics (font));
+ = dynamic_cast<Modified_font_metric *> (Font_metric::unsmob (font));
Open_type_font *otf = fm
? dynamic_cast<Open_type_font *> (fm->original_font ())
- : dynamic_cast<Open_type_font *> (unsmob_metrics (font));
+ : dynamic_cast<Open_type_font *> (Font_metric::unsmob (font));
SCM_ASSERT_TYPE (otf, font, SCM_ARG1, __FUNCTION__, "OpenType font");
LY_ASSERT_TYPE (scm_is_string, tag, 2);
"Is @var{font} an OpenType font?")
{
Modified_font_metric *fm
- = dynamic_cast<Modified_font_metric *> (unsmob_metrics (font));
+ = dynamic_cast<Modified_font_metric *> (Font_metric::unsmob (font));
Open_type_font *otf = fm
? dynamic_cast<Open_type_font *> (fm->original_font ())
- : dynamic_cast<Open_type_font *> (unsmob_metrics (font));
+ : dynamic_cast<Open_type_font *> (Font_metric::unsmob (font));
return scm_from_bool (otf);
}
"Return the number of glyphs in @var{font}.")
{
Modified_font_metric *fm
- = dynamic_cast<Modified_font_metric *> (unsmob_metrics (font));
+ = dynamic_cast<Modified_font_metric *> (Font_metric::unsmob (font));
Open_type_font *otf = fm
? dynamic_cast<Open_type_font *> (fm->original_font ())
- : dynamic_cast<Open_type_font *> (unsmob_metrics (font));
+ : dynamic_cast<Open_type_font *> (Font_metric::unsmob (font));
SCM_ASSERT_TYPE (otf, font, SCM_ARG1, __FUNCTION__, "OpenType font");
"Return a list of glyph names for @var{font}.")
{
Modified_font_metric *fm
- = dynamic_cast<Modified_font_metric *> (unsmob_metrics (font));
+ = dynamic_cast<Modified_font_metric *> (Font_metric::unsmob (font));
Open_type_font *otf = fm
? dynamic_cast<Open_type_font *> (fm->original_font ())
- : dynamic_cast<Open_type_font *> (unsmob_metrics (font));
+ : dynamic_cast<Open_type_font *> (Font_metric::unsmob (font));
SCM_ASSERT_TYPE (otf, font, SCM_ARG1, __FUNCTION__, "OpenType font");
SCM
Ottava_bracket::print (SCM smob)
{
- Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
+ Spanner *me = dynamic_cast<Spanner *> (Grob::unsmob (smob));
Interval span_points;
Grob *common = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT), X_AXIS);
SCM markup = me->get_property ("text");
Stencil text;
if (Text_interface::is_markup (markup))
- text = *unsmob_stencil (Text_interface::interpret_markup (layout->self_scm (),
+ text = *Stencil::unsmob (Text_interface::interpret_markup (layout->self_scm (),
properties, markup));
Drul_array<Real> shorten = robust_scm2interval (me->get_property ("shorten-pair"),
{
if (!finished_->get_bound (RIGHT))
{
- Grob *e = unsmob_grob (get_property ("currentMusicalColumn"));
+ Grob *e = Grob::unsmob (get_property ("currentMusicalColumn"));
finished_->set_bound (d, e);
}
}
{
if (span_ && !span_->get_bound (LEFT))
{
- Grob *e = unsmob_grob (get_property ("currentMusicalColumn"));
+ Grob *e = Grob::unsmob (get_property ("currentMusicalColumn"));
span_->set_bound (LEFT, e);
}
" @var{val} or @code{'()} if @var{val} is undefined.")
{
LY_ASSERT_SMOB (Output_def, def, 1);
- Output_def *op = unsmob_output_def (def);
+ Output_def *op = Output_def::unsmob (def);
LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
SCM answer = op->lookup_variable (sym);
"Return the variable scope inside @var{def}.")
{
LY_ASSERT_SMOB (Output_def, def, 1);
- Output_def *op = unsmob_output_def (def);
+ Output_def *op = Output_def::unsmob (def);
return op->scope_;
}
"Return the parent output definition of @var{def}.")
{
LY_ASSERT_SMOB (Output_def, def, 1);
- Output_def *op = unsmob_output_def (def);
+ Output_def *op = Output_def::unsmob (def);
return op->parent_ ? op->parent_->self_scm () : SCM_EOL;
}
"Set an output definition @var{def} variable @var{sym} to @var{val}.")
{
LY_ASSERT_SMOB (Output_def, def, 1);
- Output_def *output_def = unsmob_output_def (def);
+ Output_def *output_def = Output_def::unsmob (def);
LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
output_def->set_variable (sym, val);
return SCM_UNSPECIFIED;
"Clone output definition @var{def}.")
{
LY_ASSERT_SMOB (Output_def, def, 1);
- Output_def *op = unsmob_output_def (def);
+ Output_def *op = Output_def::unsmob (def);
Output_def *clone = op->clone ();
return clone->unprotect ();
{
LY_ASSERT_SMOB (Output_def, output_def, 1);
- Output_def *id = unsmob_output_def (output_def);
+ Output_def *id = Output_def::unsmob (output_def);
SCM al = ly_module_2_alist (id->scope_);
SCM ell = SCM_EOL;
for (SCM s = al; scm_is_pair (s); s = scm_cdr (s))
{
- Context_def *td = unsmob_context_def (scm_cdar (s));
+ Context_def *td = Context_def::unsmob (scm_cdar (s));
SCM key = scm_caar (s);
if (td && key == td->get_context_name ())
ell = scm_cons (scm_cons (key, td->to_alist ()), ell);
if (!SCM_UNBNDP (context_name))
LY_ASSERT_TYPE (ly_is_symbol, context_name, 2);
- Output_def *id = unsmob_output_def (output_def);
+ Output_def *id = Output_def::unsmob (output_def);
SCM al = ly_module_2_alist (id->scope_);
SCM ell = SCM_EOL;
for (SCM s = al; scm_is_pair (s); s = scm_cdr (s))
{
SCM p = scm_car (s);
- Context_def *td = unsmob_context_def (scm_cdr (p));
+ Context_def *td = Context_def::unsmob (scm_cdr (p));
if (td && scm_is_eq (scm_car (p), td->get_context_name ())
&& (SCM_UNBNDP (context_name) || td->is_alias (context_name)))
ell = scm_cons (p, ell);
1, 0, 0, (SCM def),
"Is @var{def} an output definition?")
{
- return ly_bool2scm (unsmob_output_def (def));
+ return ly_bool2scm (Output_def::unsmob (def));
}
LY_DEFINE (ly_paper_outputscale, "ly:paper-outputscale",
"Return the output-scale for output definition @var{def}.")
{
LY_ASSERT_SMOB (Output_def, def, 1);
- Output_def *b = unsmob_output_def (def);
+ Output_def *b = Output_def::unsmob (def);
return scm_from_double (output_scale (b));
}
{
LY_ASSERT_SMOB (Output_def, def, 1);
- Output_def *paper = unsmob_output_def (def);
+ Output_def *paper = Output_def::unsmob (def);
Font_metric *fm = select_font (paper, chain);
return fm->self_scm ();
}
" @var{def} as a double.")
{
LY_ASSERT_SMOB (Output_def, def, 1);
- Output_def *layout = unsmob_output_def (def);
+ Output_def *layout = Output_def::unsmob (def);
return scm_from_double (layout->get_dimension (sym));
}
" @var{def} (e.g., @code{\\paper}).")
{
LY_ASSERT_SMOB (Output_def, def, 1);
- Output_def *b = unsmob_output_def (def);
+ Output_def *b = Output_def::unsmob (def);
SCM tab1 = b->lookup_variable (ly_symbol2scm ("scaled-fonts"));
SCM tab2 = b->lookup_variable (ly_symbol2scm ("pango-fonts"));
{
SCM entry = scm_car (s);
- Font_metric *fm = unsmob_metrics (entry);
+ Font_metric *fm = Font_metric::unsmob (entry);
if (dynamic_cast<Modified_font_metric *> (fm)
|| dynamic_cast<Pango_font *> (fm))
void
assign_context_def (Output_def * m, SCM transdef)
{
- Context_def *tp = unsmob_context_def (transdef);
+ Context_def *tp = Context_def::unsmob (transdef);
assert (tp);
if (tp)
SCM
find_context_def (Output_def const *m, SCM name)
{
- Context_def *cd = unsmob_context_def (m->lookup_variable (name));
+ Context_def *cd = Context_def::unsmob (m->lookup_variable (name));
return cd ? cd->self_scm () : SCM_EOL;
}
int
Output_def::print_smob (SCM s, SCM p, scm_print_state *)
{
- Output_def * def = unsmob_output_def (s);
+ Output_def * def = Output_def::unsmob (s);
scm_puts ("#< ", p);
scm_puts (def->class_name (), p);
scm_puts (">", p);
" @var{pb} such that page turns only happen in specified places,"
" returning its pages.")
{
- Page_turn_page_breaking b (unsmob_paper_book (pb));
+ Page_turn_page_breaking b (Paper_book::unsmob (pb));
return b.solve ();
}
" @var{pb} to minimize badness in bother vertical and horizontal"
" spacing.")
{
- Optimal_page_breaking b (unsmob_paper_book (pb));
+ Optimal_page_breaking b (Paper_book::unsmob (pb));
return b.solve ();
}
" without looking for optimal spacing: stack as many lines on"
" a page before moving to the next one.")
{
- Minimal_page_breaking b (unsmob_paper_book (pb));
+ Minimal_page_breaking b (Paper_book::unsmob (pb));
return b.solve ();
}
" page. The paper-width setting will be modified so that"
" every page will be wider than the widest line.")
{
- One_line_page_breaking b (unsmob_paper_book (pb));
+ One_line_page_breaking b (Paper_book::unsmob (pb));
return b.solve ();
}
for (SCM s = systems; scm_is_pair (s); s = scm_cdr (s))
{
SCM paper_system = scm_car (s);
- if (Grob *g = unsmob_grob (scm_car (s)))
+ if (Grob *g = Grob::unsmob (scm_car (s)))
{
System *sys = dynamic_cast<System *> (g);
paper_system = sys->get_paper_system ();
// Create the page and draw it.
SCM page = make_page (page_num, last);
- Prob *p = unsmob_prob (page);
+ Prob *p = Prob::unsmob (page);
p->set_property ("lines", paper_systems);
p->set_property ("configuration", configuration);
- Stencil *foot_p = unsmob_stencil (p->get_property ("foot-stencil"));
+ Stencil *foot_p = Stencil::unsmob (p->get_property ("foot-stencil"));
Stencil foot = foot_p ? *foot_p : Stencil ();
SCM footnotes = Page_layout_problem::get_footnotes_from_lines (systems);
for (SCM l = lines; scm_is_pair (l); l = scm_cdr (l))
{
SCM labels = SCM_EOL;
- if (Grob *line = unsmob_grob (scm_car (l)))
+ if (Grob *line = Grob::unsmob (scm_car (l)))
{
System *system = dynamic_cast<System *> (line);
labels = system->get_property ("labels");
}
- else if (Prob *prob = unsmob_prob (scm_car (l)))
+ else if (Prob *prob = Prob::unsmob (scm_car (l)))
labels = prob->get_property ("labels");
for (SCM lbls = labels; scm_is_pair (lbls); lbls = scm_cdr (lbls))
SCM specs = book_->get_system_specs ();
for (SCM s = specs; scm_is_pair (s); s = scm_cdr (s))
{
- if (Paper_score *ps = dynamic_cast<Paper_score *> (unsmob_music_output (scm_car (s))))
+ if (Paper_score *ps = dynamic_cast<Paper_score *> (Music_output::unsmob (scm_car (s))))
{
system_specs_.push_back (System_spec (ps));
}
else
{
- Prob *pb = unsmob_prob (scm_car (s));
+ Prob *pb = Prob::unsmob (scm_car (s));
assert (pb);
pb->protect ();
LY_ASSERT_SMOB (Grob, from_scm, 1);
LY_ASSERT_SMOB (Grob, to_scm, 2);
- Grob *from = unsmob_grob (from_scm);
- Grob *to = unsmob_grob (to_scm);
+ Grob *from = Grob::unsmob (from_scm);
+ Grob *to = Grob::unsmob (to_scm);
return Page_layout_problem::get_spacing_spec (from, to, false, 0, 0);
}
vector<Grob *> footnotes;
for (SCM s = lines; scm_is_pair (s); s = scm_cdr (s))
{
- if (Grob *g = unsmob_grob (scm_car (s)))
+ if (Grob *g = Grob::unsmob (scm_car (s)))
{
System *sys = dynamic_cast<System *> (g);
if (!sys)
extract_grob_set (sys, "footnotes-after-line-breaking", footnote_grobs);
footnotes.insert (footnotes.end (), footnote_grobs.begin (), footnote_grobs.end ());
}
- else if (Prob *p = unsmob_prob (scm_car (s)))
+ else if (Prob *p = Prob::unsmob (scm_car (s)))
{
SCM stencils = p->get_property ("footnotes");
if (stencils == SCM_EOL)
return SCM_EOL;
bool footnotes_added;
- if (Grob *g = unsmob_grob (scm_car (lines)))
+ if (Grob *g = Grob::unsmob (scm_car (lines)))
footnotes_added = !scm_is_null (g->get_property ("footnote-stencil"));
- else if (Prob *p = unsmob_prob (scm_car (lines)))
+ else if (Prob *p = Prob::unsmob (scm_car (lines)))
footnotes_added = !scm_is_null (p->get_property ("footnote-stencil"));
else
{
SCM out = SCM_EOL;
for (SCM s = lines; scm_is_pair (s); s = scm_cdr (s))
{
- if (Grob *g = unsmob_grob (scm_car (s)))
+ if (Grob *g = Grob::unsmob (scm_car (s)))
out = scm_cons (g->get_property ("footnote-stencil"), out);
- else if (Prob *p = unsmob_prob (scm_car (s)))
+ else if (Prob *p = Prob::unsmob (scm_car (s)))
out = scm_cons (p->get_property ("footnote-stencil"), out);
else
programming_error ("Systems on a page must be a prob or grob.");
}
SCM markup = scm_call_1 (numbering_function, scm_from_int (counter));
SCM stencil = Text_interface::interpret_markup (layout, props, markup);
- Stencil *st = unsmob_stencil (stencil);
+ Stencil *st = Stencil::unsmob (stencil);
if (!st)
{
programming_error ("Your numbering function needs to return a stencil.");
markup = SCM_EOL;
stencil = Stencil (Box (Interval (0, 0), Interval (0, 0)), SCM_EOL).smobbed_copy ();
- st = unsmob_stencil (stencil);
+ st = Stencil::unsmob (stencil);
}
in_text_numbers = scm_cons (markup, in_text_numbers);
numbers = scm_cons (stencil, numbers);
for (SCM p = numbers; scm_is_pair (p); p = scm_cdr (p))
{
- Stencil *st = unsmob_stencil (scm_car (p));
+ Stencil *st = Stencil::unsmob (scm_car (p));
if (!st->extent (X_AXIS).is_empty ())
st->translate_axis ((max_length - st->extent (X_AXIS)[RIGHT]),
X_AXIS);
for (SCM s = lines; scm_is_pair (s); s = scm_cdr (s))
{
// Take care of musical systems.
- if (Grob *g = unsmob_grob (scm_car (s)))
+ if (Grob *g = Grob::unsmob (scm_car (s)))
{
System *sys = dynamic_cast<System *> (g);
if (!sys)
SCM footnote_stl = Text_interface::interpret_markup (paper->self_scm (),
props, footnote_markup);
- Stencil footnote_stencil = *unsmob_stencil (footnote_stl);
+ Stencil footnote_stencil = *Stencil::unsmob (footnote_stl);
bool do_numbering = to_boolean (footnote->get_property ("automatically-numbered"));
if (Spanner *orig = dynamic_cast<Spanner *>(footnote))
{
orig->broken_intos_[i]->set_property ("text", annotation_scm);
}
- Stencil annotation = *unsmob_stencil (scm_car (numbers));
+ Stencil annotation = *Stencil::unsmob (scm_car (numbers));
annotation.translate_axis ((footnote_stencil.extent (Y_AXIS)[UP]
+ number_raise
- annotation.extent (Y_AXIS)[UP]),
sys->set_property ("footnote-stencil", mol.smobbed_copy ());
}
// Take care of top-level markups
- else if (Prob *p = unsmob_prob (scm_car (s)))
+ else if (Prob *p = Prob::unsmob (scm_car (s)))
{
SCM stencils = p->get_property ("footnotes");
Stencil mol;
for (SCM st = stencils; scm_is_pair (st); st = scm_cdr (st))
{
- Stencil footnote_stencil = *unsmob_stencil (scm_caddar (st));
+ Stencil footnote_stencil = *Stencil::unsmob (scm_caddar (st));
bool do_numbering = to_boolean (scm_cadar (st));
SCM in_text_stencil = Stencil ().smobbed_copy ();
if (do_numbering)
{
- Stencil annotation = *unsmob_stencil (scm_car (numbers));
+ Stencil annotation = *Stencil::unsmob (scm_car (numbers));
SCM in_text_annotation = scm_car (in_text_numbers);
in_text_stencil = Text_interface::interpret_markup (layout,
props,
in_text_annotation);
- if (!unsmob_stencil (in_text_stencil))
+ if (!Stencil::unsmob (in_text_stencil))
in_text_stencil = SCM_EOL;
annotation.translate_axis ((footnote_stencil.extent (Y_AXIS)[UP]
+ number_raise
SCM footnote_stencil = Text_interface::interpret_markup (paper->self_scm (),
props, markup);
- Stencil *footnote_separator = unsmob_stencil (footnote_stencil);
+ Stencil *footnote_separator = Stencil::unsmob (footnote_stencil);
return footnote_separator ? *footnote_separator : Stencil ();
}
for (SCM s = footnotes; scm_is_pair (s); s = scm_cdr (s))
{
- Stencil *stencil = unsmob_stencil (scm_car (s));
+ Stencil *stencil = Stencil::unsmob (scm_car (s));
if (!stencil)
continue;
Page_layout_problem::Page_layout_problem (Paper_book *pb, SCM page_scm, SCM systems)
: bottom_skyline_ (DOWN)
{
- Prob *page = unsmob_prob (page_scm);
+ Prob *page = Prob::unsmob (page_scm);
bottom_loose_baseline_ = 0;
header_height_ = 0;
footer_height_ = 0;
if (page)
{
- Stencil *head = unsmob_stencil (page->get_property ("head-stencil"));
- Stencil *foot = unsmob_stencil (page->get_property ("foot-stencil"));
+ Stencil *head = Stencil::unsmob (page->get_property ("head-stencil"));
+ Stencil *foot = Stencil::unsmob (page->get_property ("foot-stencil"));
Stencil foot_stencil = foot ? *foot : Stencil ();
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) && unsmob_prob (scm_car (systems)))
+ if (scm_is_pair (systems) && Prob::unsmob (scm_car (systems)))
top_system_spacing = paper->c_variable ("top-markup-spacing");
// Note: the page height here does _not_ reserve space for headers and
{
bool first = (s == systems);
- if (Grob *g = unsmob_grob (scm_car (s)))
+ if (Grob *g = Grob::unsmob (scm_car (s)))
{
System *sys = dynamic_cast<System *> (g);
if (!sys)
append_system (sys, spring, indent, padding);
last_system_was_title = false;
}
- else if (Prob *p = unsmob_prob (scm_car (s)))
+ else if (Prob *p = Prob::unsmob (scm_car (s)))
{
SCM spec = first ? top_system_spacing
: (last_system_was_title ? markup_markup_spacing : score_markup_spacing);
void
Page_layout_problem::append_system (System *sys, Spring const &spring, Real indent, Real padding)
{
- Grob *align = unsmob_grob (sys->get_object ("vertical-alignment"));
+ Grob *align = Grob::unsmob (sys->get_object ("vertical-alignment"));
if (!align)
return;
build_system_skyline (elts, minimum_offsets_with_min_dist, &up_skyline, &down_skyline);
up_skyline.shift (indent);
down_skyline.shift (indent);
- Stencil *in_note_stencil = unsmob_stencil (sys->get_property ("in-note-stencil"));
+ Stencil *in_note_stencil = Stencil::unsmob (sys->get_property ("in-note-stencil"));
if (in_note_stencil && in_note_stencil->extent (Y_AXIS).length () > 0)
{
bottom_loose_baseline_);
bottom_skyline_ = (*sky)[DOWN];
}
- else if (Stencil *sten = unsmob_stencil (prob->get_property ("stencil")))
+ else if (Stencil *sten = Stencil::unsmob (prob->get_property ("stencil")))
{
Interval iv = sten->extent (Y_AXIS);
minimum_distance = iv[UP] - bottom_skyline_.max_height ();
{
*tail = scm_cons (scm_from_double (solution_[spring_idx]), SCM_EOL);
tail = SCM_CDRLOC (*tail);
- Interval prob_extent = unsmob_stencil (elements_[i].prob->get_property ("stencil"))->extent (Y_AXIS);
+ Interval prob_extent = Stencil::unsmob (elements_[i].prob->get_property ("stencil"))->extent (Y_AXIS);
// Lay out any non-spaceable lines between this line and
// the last one.
Interval
Page_layout_problem::prob_extent (Prob *p)
{
- Stencil *sten = unsmob_stencil (p->get_property ("stencil"));
+ Stencil *sten = Stencil::unsmob (p->get_property ("stencil"));
return sten ? sten->extent (Y_AXIS) : Interval (0, 0);
}
Stream_event *cause = gi.event_cause ();
Duration *dur_ptr = cause
- ? unsmob_duration (cause->get_property ("duration"))
+ ? Duration::unsmob (cause->get_property ("duration"))
: 0;
if (!dur_ptr)
void
Page_turn_engraver::stop_translation_timestep ()
{
- Grob *pc = unsmob_grob (get_property ("currentCommandColumn"));
+ Grob *pc = Grob::unsmob (get_property ("currentCommandColumn"));
if (pc)
{
{
Rational now = now_mom ().main_part_;
Real pen = penalty ((now_mom () - rest_begin_).main_part_ + repeat_begin_rest_length_);
- Moment *m = unsmob_moment (get_property ("minimumRepeatLengthForPageTurn"));
+ Moment *m = Moment::unsmob (get_property ("minimumRepeatLengthForPageTurn"));
if (m && *m > (now_mom () - repeat_begin_))
pen = infinity_f;
(SCM f),
"Is @var{f} a pango font?")
{
- return scm_from_bool (dynamic_cast<Pango_font *> (unsmob_metrics (f)));
+ return scm_from_bool (dynamic_cast<Pango_font *> (Font_metric::unsmob (f)));
}
LY_DEFINE (ly_pango_font_physical_fonts, "ly:pango-font-physical-fonts",
"Return alist of @code{(ps-name file-name font-index)} lists"
" for Pango font@tie{}@var{f}.")
{
- Pango_font *pf = dynamic_cast<Pango_font *> (unsmob_metrics (f));
+ Pango_font *pf = dynamic_cast<Pango_font *> (Font_metric::unsmob (f));
SCM alist = SCM_EOL;
if (pf)
"Return pages in @code{Paper_book} object @var{pb}.")
{
LY_ASSERT_SMOB (Paper_book, pb, 1);
- return unsmob_paper_book (pb)->pages ();
+ return Paper_book::unsmob (pb)->pages ();
}
LY_DEFINE (ly_paper_book_scopes, "ly:paper-book-scopes",
"Return scopes in @code{Paper_book} object @var{pb}.")
{
LY_ASSERT_SMOB (Paper_book, pb, 1);
- Paper_book *book = unsmob_paper_book (pb);
+ Paper_book *book = Paper_book::unsmob (pb);
SCM scopes = SCM_EOL;
if (book->parent_)
"Return performances in @code{Paper_book} object @var{pb}.")
{
LY_ASSERT_SMOB (Paper_book, pb, 1);
- return unsmob_paper_book (pb)->performances ();
+ return Paper_book::unsmob (pb)->performances ();
}
LY_DEFINE (ly_paper_book_systems, "ly:paper-book-systems",
"Return systems in @code{Paper_book} object @var{pb}.")
{
LY_ASSERT_SMOB (Paper_book, pb, 1);
- return unsmob_paper_book (pb)->systems ();
+ return Paper_book::unsmob (pb)->systems ();
}
LY_DEFINE (ly_paper_book_paper, "ly:paper-book-paper",
" in @code{Paper_book} object @var{pb}.")
{
LY_ASSERT_SMOB (Paper_book, pb, 1);
- Paper_book *pbook = unsmob_paper_book (pb);
+ Paper_book *pbook = Paper_book::unsmob (pb);
return pbook->paper_->self_scm ();
}
" in @code{Paper_book} object @var{pb}.")
{
LY_ASSERT_SMOB (Paper_book, pb, 1);
- Paper_book *pbook = unsmob_paper_book (pb);
+ Paper_book *pbook = Paper_book::unsmob (pb);
return pbook->header_;
}
if (scm_is_pair (bookparts_))
{
for (SCM p = bookparts_; scm_is_pair (p); p = scm_cdr (p))
- if (Paper_book *pbookpart = unsmob_paper_book (scm_car (p)))
+ if (Paper_book *pbookpart = Paper_book::unsmob (scm_car (p)))
{
bool is_last_part = (is_last && !scm_is_pair (scm_cdr (p)));
page_nb += pbookpart->output_aux (output_channel,
paper_->self_scm (),
scopes);
- if (unsmob_stencil (tit))
- title = *unsmob_stencil (tit);
+ if (Stencil::unsmob (tit))
+ title = *Stencil::unsmob (tit);
if (!title.is_empty ())
title.align_to (Y_AXIS, UP);
paper_->self_scm (),
scopes);
- if (unsmob_stencil (tit))
- title = *unsmob_stencil (tit);
+ if (Stencil::unsmob (tit))
+ title = *Stencil::unsmob (tit);
if (!title.is_empty ())
title.align_to (Y_AXIS, UP);
void
set_page_permission (SCM sys, SCM symbol, SCM permission)
{
- if (Paper_score *ps = dynamic_cast<Paper_score *> (unsmob_music_output (sys)))
+ if (Paper_score *ps = dynamic_cast<Paper_score *> (Music_output::unsmob (sys)))
{
vector<Grob *> cols = ps->get_columns ();
if (cols.size ())
col->find_prebroken_piece (LEFT)->set_property (symbol, permission);
}
}
- else if (Prob *pb = unsmob_prob (sys))
+ else if (Prob *pb = Prob::unsmob (sys))
pb->set_property (symbol, permission);
}
void
set_labels (SCM sys, SCM labels)
{
- if (Paper_score *ps = dynamic_cast<Paper_score *> (unsmob_music_output (sys)))
+ if (Paper_score *ps = dynamic_cast<Paper_score *> (Music_output::unsmob (sys)))
{
vector<Grob *> cols = ps->get_columns ();
if (cols.size ())
labels)));
}
}
- else if (Prob *pb = unsmob_prob (sys))
+ else if (Prob *pb = Prob::unsmob (sys))
pb->set_property ("labels",
scm_append_x (scm_list_2 (pb->get_property ("labels"),
labels)));
if (header_0_ == SCM_EOL)
header_0_ = header;
}
- else if (Page_marker *page_marker = unsmob_page_marker (scm_car (s)))
+ else if (Page_marker *page_marker = Page_marker::unsmob (scm_car (s)))
{
/* page markers are used to set page breaking/turning permission,
or to place bookmarking labels */
labels = scm_cons (page_marker->label (), labels);
}
}
- else if (Music_output *mop = unsmob_music_output (scm_car (s)))
+ else if (Music_output *mop = Music_output::unsmob (scm_car (s)))
{
if (Paper_score *pscore = dynamic_cast<Paper_score *> (mop))
{
if (scm_is_pair (system_specs))
set_system_penalty (scm_car (system_specs), header);
- if (unsmob_prob (title))
+ if (Prob::unsmob (title))
{
system_specs = scm_cons (title, system_specs);
- unsmob_prob (title)->unprotect ();
+ Prob::unsmob (title)->unprotect ();
}
header = SCM_EOL;
ps->set_property ("last-markup-line", SCM_BOOL_F);
ps->set_property ("first-markup-line", SCM_BOOL_F);
- paper_system_set_stencil (ps, *unsmob_stencil (t));
+ paper_system_set_stencil (ps, *Stencil::unsmob (t));
- SCM footnotes = get_footnotes (unsmob_stencil (t)->expr ());
+ SCM footnotes = get_footnotes (Stencil::unsmob (t)->expr ());
ps->set_property ("footnotes", footnotes);
ps->set_property ("is-title", SCM_BOOL_T);
if (list == texts)
{
SCM system_list = SCM_EOL;
for (SCM p = bookparts_; scm_is_pair (p); p = scm_cdr (p))
- if (Paper_book *pbookpart = unsmob_paper_book (scm_car (p)))
+ if (Paper_book *pbookpart = Paper_book::unsmob (scm_car (p)))
system_list = scm_cons (pbookpart->systems (), system_list);
systems_ = scm_append (scm_reverse_x (system_list, SCM_EOL));
}
for (SCM s = specs; scm_is_pair (s); s = scm_cdr (s))
{
if (Paper_score * pscore
- = dynamic_cast<Paper_score *> (unsmob_music_output (scm_car (s))))
+ = dynamic_cast<Paper_score *> (Music_output::unsmob (scm_car (s))))
{
SCM system_list
= scm_vector_to_list (pscore->get_paper_systems ());
Prob *last = 0;
for (SCM s = systems_; scm_is_pair (s); s = scm_cdr (s))
{
- Prob *ps = unsmob_prob (scm_car (s));
+ Prob *ps = Prob::unsmob (scm_car (s));
ps->set_property ("number", scm_from_int (++i));
if (last
if (scm_is_pair (scm_cdr (s)))
{
SCM perm = ps->get_property ("page-break-permission");
- Prob *next = unsmob_prob (scm_cadr (s));
+ Prob *next = Prob::unsmob (scm_cadr (s));
if (perm == SCM_EOL)
next->set_property ("penalty", scm_from_int (10001));
else if (perm == ly_symbol2scm ("force"))
if (scm_is_pair (bookparts_))
{
for (SCM p = bookparts_; scm_is_pair (p); p = scm_cdr (p))
- if (Paper_book *pbookpart = unsmob_paper_book (scm_car (p)))
+ if (Paper_book *pbookpart = Paper_book::unsmob (scm_car (p)))
pages_ = scm_cons (pbookpart->pages (), pages_);
pages_ = scm_append (scm_reverse_x (pages_, SCM_EOL));
}
systems_ = SCM_EOL;
for (SCM p = pages_; scm_is_pair (p); p = scm_cdr (p))
{
- Prob *page = unsmob_prob (scm_car (p));
+ Prob *page = Prob::unsmob (scm_car (p));
SCM systems = page->get_property ("lines");
systems_ = scm_cons (systems, systems_);
}
void
Paper_column_engraver::initialize ()
{
- system_ = dynamic_cast<System *> (unsmob_grob (get_property ("rootSystem")));
+ system_ = dynamic_cast<System *> (Grob::unsmob (get_property ("rootSystem")));
make_columns ();
system_->set_bound (LEFT, command_column_);
if (start_of_measure)
{
Moment mlen = Moment (measure_length (context ()));
- Grob *column = unsmob_grob (get_property ("currentCommandColumn"));
+ Grob *column = Grob::unsmob (get_property ("currentCommandColumn"));
if (column)
column->set_property ("measure-length", mlen.smobbed_copy ());
else
if (!elem->get_parent (X_AXIS))
elem->set_parent (col, X_AXIS);
- if (!unsmob_grob (elem->get_object ("axis-group-parent-X")))
+ if (!Grob::unsmob (elem->get_object ("axis-group-parent-X")))
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");
- if (unsmob_moment (mpos)
+ if (Moment::unsmob (mpos)
&& scm_is_integer (barnum))
{
SCM where = scm_cons (barnum,
Paper_column::when_mom (Grob *me)
{
SCM m = me->get_property ("when");
- if (Moment *when = unsmob_moment (m))
+ if (Moment *when = Moment::unsmob (m))
return *when;
return Moment (0);
}
{
SCM m = me->get_property ("shortest-starter-duration");
Moment s (0);
- if (unsmob_moment (m))
- s = *unsmob_moment (m);
+ if (Moment::unsmob (m))
+ s = *Moment::unsmob (m);
return s != Moment (0);
}
SCM
Paper_column::print (SCM p)
{
- Paper_column *me = dynamic_cast<Paper_column *> (unsmob_grob (p));
+ Paper_column *me = dynamic_cast<Paper_column *> (Grob::unsmob (p));
string r = ::to_string (Paper_column::get_rank (me));
- Moment *mom = unsmob_moment (me->get_property ("when"));
+ Moment *mom = Moment::unsmob (me->get_property ("when"));
string when = mom ? mom->to_string () : "?/?";
Font_metric *musfont = Font_interface::get_default_font (me);
SCM when_mol = Text_interface::interpret_markup (me->layout ()->self_scm (),
properties,
ly_string2scm (when));
- Stencil t = *unsmob_stencil (scm_mol);
+ Stencil t = *Stencil::unsmob (scm_mol);
t.scale (1.2, 1.4);
- t.add_at_edge (Y_AXIS, DOWN, *unsmob_stencil (when_mol), 0.1);
+ t.add_at_edge (Y_AXIS, DOWN, *Stencil::unsmob (when_mol), 0.1);
t.align_to (X_AXIS, LEFT);
// compensate for font serifs and half letter-distance
t.translate (Offset (-0.1, 0));
for (SCM s = me->get_object ("ideal-distances");
scm_is_pair (s); s = scm_cdr (s))
{
- Spring *sp = unsmob_spring (scm_caar (s));
- if (!unsmob_grob (scm_cdar (s))
- || !unsmob_grob (scm_cdar (s))->get_system ())
+ Spring *sp = Spring::unsmob (scm_caar (s));
+ if (!Grob::unsmob (scm_cdar (s))
+ || !Grob::unsmob (scm_cdar (s))->get_system ())
continue;
j++;
SCM stil = Text_interface::interpret_markup (me->layout ()->self_scm (),
properties,
ly_string2scm (String_convert::form_string ("%5.2lf", sp->distance ())));
- Stencil *number_stc = unsmob_stencil (stil);
+ Stencil *number_stc = Stencil::unsmob (stil);
number_stc->scale (1, 1.1);
Real num_height = number_stc->extent (Y_AXIS).length ();
Real num_len = number_stc->extent (X_AXIS).length ();
scm_is_pair (s); s = scm_cdr (s))
{
Real dist = scm_to_double (scm_cdar (s));
- Grob *other = unsmob_grob (scm_caar (s));
+ Grob *other = Grob::unsmob (scm_caar (s));
if (!other || other->get_system () != me->get_system ())
continue;
SCM stil = Text_interface::interpret_markup (me->layout ()->self_scm (),
properties,
ly_string2scm (String_convert::form_string ("%5.2lf", dist)));
- Stencil *number_stc = unsmob_stencil (stil);
+ Stencil *number_stc = Stencil::unsmob (stil);
number_stc->scale (1, 1.1);
Real num_height = number_stc->extent (Y_AXIS).length ();
Real num_len = number_stc->extent (X_AXIS).length ();
SCM
Paper_column::before_line_breaking (SCM grob)
{
- Grob *me = unsmob_grob (grob);
+ Grob *me = Grob::unsmob (grob);
SCM bbm = me->get_object ("bounded-by-me");
- Grob_array *ga = unsmob_grob_array (bbm);
+ Grob_array *ga = Grob_array::unsmob (bbm);
if (!ga)
return SCM_UNSPECIFIED;
SCM sizes = scm_hashq_ref (font_table, f->self_scm (), SCM_EOL);
SCM handle = scm_assoc (scm_from_double (lookup_mag), sizes);
if (scm_is_pair (handle))
- return unsmob_metrics (scm_cdr (handle));
+ return Font_metric::unsmob (scm_cdr (handle));
SCM val = Modified_font_metric::make_scaled_font_metric (f, lookup_mag);
sizes = scm_acons (scm_from_double (lookup_mag), val, sizes);
- unsmob_metrics (val)->unprotect ();
+ Font_metric::unsmob (val)->unprotect ();
scm_hashq_set_x (font_table, f->self_scm (), sizes);
- return unsmob_metrics (val);
+ return Font_metric::unsmob (val);
}
Font_metric *
SCM size_key = scm_from_double (factor);
SCM handle = scm_assoc (size_key, sizes);
if (scm_is_pair (handle))
- return unsmob_metrics (scm_cdr (handle));
+ return Font_metric::unsmob (scm_cdr (handle));
PangoFontDescription *description
= pango_font_description_from_string (scm_i_string_chars (descr));
SCM proc = ly_lily_module_constant ("scale-layout");
SCM new_pap = scm_call_2 (proc, o->self_scm (), scm_from_double (amount));
- o = unsmob_output_def (new_pap);
+ o = Output_def::unsmob (new_pap);
o->protect ();
return o;
}
LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
LY_ASSERT_SMOB (Stencil, stencil, 2);
- Paper_outputter *po = unsmob_outputter (outputter);
- Stencil *st = unsmob_stencil (stencil);
+ Paper_outputter *po = Paper_outputter::unsmob (outputter);
+ Stencil *st = Stencil::unsmob (stencil);
po->output_stencil (*st);
return SCM_UNSPECIFIED;
LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
LY_ASSERT_TYPE (scm_is_string, str, 2);
- Paper_outputter *po = unsmob_outputter (outputter);
+ Paper_outputter *po = Paper_outputter::unsmob (outputter);
return po->dump_string (str);
}
"Return output port for @var{outputter}.")
{
LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
- Paper_outputter *po = unsmob_outputter (outputter);
+ Paper_outputter *po = Paper_outputter::unsmob (outputter);
return po->file ();
}
"Close port of @var{outputter}.")
{
LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
- Paper_outputter *po = unsmob_outputter (outputter);
+ Paper_outputter *po = Paper_outputter::unsmob (outputter);
po->close ();
return SCM_UNSPECIFIED;
"Eval @var{expr} in module of @var{outputter}.")
{
LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
- Paper_outputter *po = unsmob_outputter (outputter);
+ Paper_outputter *po = Paper_outputter::unsmob (outputter);
po->output_scheme (expr);
{
LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
- Paper_outputter *po = unsmob_outputter (outputter);
+ Paper_outputter *po = Paper_outputter::unsmob (outputter);
return po->module ();
}
{
LY_ASSERT_TYPE (unsmob_paper_score, paper_score, 1);
- Paper_score *pscore = dynamic_cast<Paper_score *> (unsmob_music_output (paper_score));
+ Paper_score *pscore = dynamic_cast<Paper_score *> (Music_output::unsmob (paper_score));
return pscore->get_paper_systems ();
}
Paper_score *
unsmob_paper_score (SCM x)
{
- return dynamic_cast<Paper_score *> (unsmob_music_output (x));
+ return dynamic_cast<Paper_score *> (Music_output::unsmob (x));
}
" their extents otherwise.")
{
Real ret = 0;
- Prob *p1 = unsmob_prob (sys1);
- Prob *p2 = unsmob_prob (sys2);
+ Prob *p1 = Prob::unsmob (sys1);
+ Prob *p2 = Prob::unsmob (sys2);
Skyline_pair *sky1 = Skyline_pair::unsmob (p1->get_property ("vertical-skylines"));
Skyline_pair *sky2 = Skyline_pair::unsmob (p2->get_property ("vertical-skylines"));
ret = (*sky1)[DOWN].distance ((*sky2)[UP]);
else
{
- Stencil *s1 = unsmob_stencil (p1->get_property ("stencil"));
- Stencil *s2 = unsmob_stencil (p2->get_property ("stencil"));
+ Stencil *s1 = Stencil::unsmob (p1->get_property ("stencil"));
+ Stencil *s2 = Stencil::unsmob (p2->get_property ("stencil"));
Interval iv1 = s1->extent (Y_AXIS);
Interval iv2 = s2->extent (Y_AXIS);
ret = iv2[UP] - iv1[DOWN];
}
| BOOK_IDENTIFIER {
SCM proc = parser->lexer_->lookup_identifier
- (unsmob_book($1)->paper_
+ (Book::unsmob($1)->paper_
? "toplevel-book-handler"
: "toplevel-bookpart-handler");
scm_call_2 (proc, parser->self_scm (), $1);
{
SCM proc = parser->lexer_->lookup_identifier ("toplevel-text-handler");
scm_call_2 (proc, parser->self_scm (), out);
- } else if (unsmob_score ($1))
+ } else if (Score::unsmob ($1))
{
SCM proc = parser->lexer_->lookup_identifier ("toplevel-score-handler");
scm_call_2 (proc, parser->self_scm (), $1);
- } else if (Output_def * od = unsmob_output_def ($1)) {
+ } else if (Output_def * od = Output_def::unsmob ($1)) {
SCM id = SCM_EOL;
if (od->c_variable ("is-paper") == SCM_BOOL_T)
}
| output_def {
SCM id = SCM_EOL;
- Output_def * od = unsmob_output_def ($1);
+ Output_def * od = Output_def::unsmob ($1);
if (od->c_variable ("is-paper") == SCM_BOOL_T)
id = ly_symbol2scm ("$defaultpaper");
CONTEXT '{' context_def_spec_body '}'
{
$$ = $3;
- Context_def *td = unsmob_context_def ($$);
+ Context_def *td = Context_def::unsmob ($$);
if (!td) {
$$ = Context_def::make_scm ();
- td = unsmob_context_def ($$);
+ td = Context_def::unsmob ($$);
}
td->origin ()->set_spot (@$);
}
}
| context_def_spec_body context_mod {
if (!SCM_UNBNDP ($2)) {
- Context_def *td = unsmob_context_def ($$);
+ Context_def *td = Context_def::unsmob ($$);
if (!td) {
$$ = Context_def::make_scm ();
- td = unsmob_context_def ($$);
+ td = Context_def::unsmob ($$);
}
- unsmob_context_def ($$)->add_context_mod ($2);
+ Context_def::unsmob ($$)->add_context_mod ($2);
}
}
| context_def_spec_body context_modification {
- Context_def *td = unsmob_context_def ($$);
+ Context_def *td = Context_def::unsmob ($$);
if (!td) {
$$ = Context_def::make_scm ();
- td = unsmob_context_def ($$);
+ td = Context_def::unsmob ($$);
}
- SCM new_mods = unsmob_context_mod ($2)->get_mods ();
+ SCM new_mods = Context_mod::unsmob ($2)->get_mods ();
for (SCM m = new_mods; scm_is_pair (m); m = scm_cdr (m)) {
td->add_context_mod (scm_car (m));
}
}
| context_def_spec_body context_mod_arg {
- Context_def *td = unsmob_context_def ($1);
+ Context_def *td = Context_def::unsmob ($1);
if (scm_is_eq ($2, SCM_UNSPECIFIED))
;
- else if (!td && unsmob_context_def ($2))
+ else if (!td && Context_def::unsmob ($2))
$$ = $2;
else {
if (!td) {
$$ = Context_def::make_scm ();
- td = unsmob_context_def ($$);
+ td = Context_def::unsmob ($$);
}
if (unsmob_music ($2)) {
SCM proc = parser->lexer_->lookup_identifier ("context-mod-music-handler");
$2 = scm_call_2 (proc, parser->self_scm (), $2);
}
- if (Context_mod *cm = unsmob_context_mod ($2)) {
+ if (Context_mod *cm = Context_mod::unsmob ($2)) {
for (SCM m = cm->get_mods (); scm_is_pair (m); m = scm_cdr (m)) {
td->add_context_mod (scm_car (m));
}
book_block:
BOOK '{' book_body '}' {
$$ = $3;
- unsmob_book ($$)->origin ()->set_spot (@$);
+ Book::unsmob ($$)->origin ()->set_spot (@$);
pop_paper (parser);
parser->lexer_->set_identifier (ly_symbol2scm ("$current-book"), SCM_BOOL_F);
}
{
Book *book = new Book;
init_papers (parser);
- book->paper_ = dynamic_cast<Output_def*> (unsmob_output_def (parser->lexer_->lookup_identifier ("$defaultpaper"))->clone ());
+ book->paper_ = dynamic_cast<Output_def*> (Output_def::unsmob (parser->lexer_->lookup_identifier ("$defaultpaper"))->clone ());
book->paper_->unprotect ();
push_paper (parser, book->paper_);
book->header_ = get_header (parser);
parser->lexer_->set_identifier (ly_symbol2scm ("$current-book"), $1);
}
| book_body paper_block {
- unsmob_book ($1)->paper_ = unsmob_output_def ($2);
- set_paper (parser, unsmob_output_def ($2));
+ Book::unsmob ($1)->paper_ = Output_def::unsmob ($2);
+ set_paper (parser, Output_def::unsmob ($2));
}
| book_body bookpart_block {
SCM proc = parser->lexer_->lookup_identifier ("book-bookpart-handler");
{
SCM proc = parser->lexer_->lookup_identifier ("book-text-handler");
scm_call_2 (proc, $1, out);
- } else if (unsmob_score ($2))
+ } else if (Score::unsmob ($2))
{
SCM proc = parser->lexer_->lookup_identifier ("book-score-handler");
scm_call_2 (proc, $1, $2);
- } else if (Output_def *od = unsmob_output_def ($2)) {
+ } else if (Output_def *od = Output_def::unsmob ($2)) {
SCM id = SCM_EOL;
if (od->c_variable ("is-paper") == SCM_BOOL_T)
}
| book_body
{
- parser->lexer_->add_scope (unsmob_book ($1)->header_);
+ parser->lexer_->add_scope (Book::unsmob ($1)->header_);
} lilypond_header
| book_body error {
- Book *book = unsmob_book ($1);
+ Book *book = Book::unsmob ($1);
book->paper_ = 0;
book->scores_ = SCM_EOL;
book->bookparts_ = SCM_EOL;
bookpart_block:
BOOKPART '{' bookpart_body '}' {
$$ = $3;
- unsmob_book ($$)->origin ()->set_spot (@$);
+ Book::unsmob ($$)->origin ()->set_spot (@$);
parser->lexer_->set_identifier (ly_symbol2scm ("$current-bookpart"), SCM_BOOL_F);
}
;
parser->lexer_->set_identifier (ly_symbol2scm ("$current-bookpart"), $1);
}
| bookpart_body paper_block {
- unsmob_book ($$)->paper_ = unsmob_output_def ($2);
+ Book::unsmob ($$)->paper_ = Output_def::unsmob ($2);
}
| bookpart_body score_block {
SCM proc = parser->lexer_->lookup_identifier ("bookpart-score-handler");
{
SCM proc = parser->lexer_->lookup_identifier ("bookpart-text-handler");
scm_call_2 (proc, $1, out);
- } else if (unsmob_score ($2))
+ } else if (Score::unsmob ($2))
{
SCM proc = parser->lexer_->lookup_identifier ("bookpart-score-handler");
scm_call_2 (proc, $1, $2);
- } else if (Output_def *od = unsmob_output_def ($2)) {
+ } else if (Output_def *od = Output_def::unsmob ($2)) {
SCM id = SCM_EOL;
if (od->c_variable ("is-paper") == SCM_BOOL_T)
}
| bookpart_body
{
- Book *book = unsmob_book ($1);
+ Book *book = Book::unsmob ($1);
if (!ly_is_module (book->header_))
book->header_ = ly_make_module (false);
parser->lexer_->add_scope (book->header_);
} lilypond_header
| bookpart_body error {
- Book *book = unsmob_book ($1);
+ Book *book = Book::unsmob ($1);
book->paper_ = 0;
book->scores_ = SCM_EOL;
}
score_block:
SCORE '{' score_body '}' {
- unsmob_score ($3)->origin ()->set_spot (@$);
+ Score::unsmob ($3)->origin ()->set_spot (@$);
$$ = $3;
}
;
score_body:
score_items {
- if (!unsmob_score ($1)) {
+ if (!Score::unsmob ($1)) {
parser->parser_error (@1, _("Missing music in \\score"));
$$ = (new Score)->unprotect ();
if (scm_is_pair ($1) && ly_is_module (scm_car ($1)))
{
- unsmob_score ($$)->set_header (scm_car ($1));
+ Score::unsmob ($$)->set_header (scm_car ($1));
$1 = scm_cdr ($1);
}
for (SCM p = scm_reverse_x ($1, SCM_EOL);
scm_is_pair (p); p = scm_cdr (p))
{
- unsmob_score ($$)->
- add_output_def (unsmob_output_def (scm_car (p)));
+ Score::unsmob ($$)->
+ add_output_def (Output_def::unsmob (scm_car (p)));
}
}
}
| score_body error {
- unsmob_score ($$)->error_found_ = true;
+ Score::unsmob ($$)->error_found_ = true;
}
;
}
| score_items score_item
{
- Output_def *od = unsmob_output_def ($2);
+ Output_def *od = Output_def::unsmob ($2);
if (od) {
if (od->lookup_variable (ly_symbol2scm ("is-paper")) == SCM_BOOL_T)
{
od = 0;
$2 = SCM_UNSPECIFIED;
}
- } else if (!unsmob_score ($$)) {
+ } else if (!Score::unsmob ($$)) {
if (unsmob_music ($2)) {
SCM scorify = ly_lily_module_constant ("scorify-music");
$2 = scm_call_2 (scorify, $2, parser->self_scm ());
}
- if (unsmob_score ($2))
+ if (Score::unsmob ($2))
{
$$ = $2;
$2 = SCM_UNSPECIFIED;
}
}
- Score *score = unsmob_score ($$);
+ Score *score = Score::unsmob ($$);
if (score && scm_is_pair ($1)) {
if (ly_is_module (scm_car ($1)))
{
for (SCM p = scm_reverse_x ($1, SCM_EOL);
scm_is_pair (p); p = scm_cdr (p))
{
- score->add_output_def (unsmob_output_def (scm_car (p)));
+ score->add_output_def (Output_def::unsmob (scm_car (p)));
}
}
if (od) {
}
| score_items
{
- if (Score *score = unsmob_score ($1)) {
+ if (Score *score = Score::unsmob ($1)) {
if (!ly_is_module (score->get_header ()))
score->set_header (ly_make_module (false));
parser->lexer_->add_scope (score->get_header ());
paper_block:
output_def {
- Output_def *od = unsmob_output_def ($1);
+ Output_def *od = Output_def::unsmob ($1);
if (od->lookup_variable (ly_symbol2scm ("is-paper")) != SCM_BOOL_T)
{
output_def_body:
output_def_head_with_mode_switch '{' {
- unsmob_output_def ($1)->input_origin_.set_spot (@$);
+ Output_def::unsmob ($1)->input_origin_.set_spot (@$);
// This is a stupid trick to mark the beginning of the
// body for deciding whether to allow
// embedded_scm_active to have an output definition
// definitions.
if (scm_is_pair ($1))
{
- Output_def *o = unsmob_output_def ($2);
+ Output_def *o = Output_def::unsmob ($2);
if (o) {
o->input_origin_.set_spot (@$);
$1 = o->self_scm ();
} else
$1 = scm_car ($1);
}
- if (unsmob_context_def ($2))
- assign_context_def (unsmob_output_def ($1), $2);
+ if (Context_def::unsmob ($2))
+ assign_context_def (Output_def::unsmob ($1), $2);
// Seems unlikely, but let's be complete:
else if (unsmob_music ($2))
{
} music_or_context_def
{
parser->lexer_->pop_state ();
- if (unsmob_context_def ($3))
- assign_context_def (unsmob_output_def ($1), $3);
+ if (Context_def::unsmob ($3))
+ assign_context_def (Output_def::unsmob ($1), $3);
else {
SCM proc = parser->lexer_->lookup_identifier
{
Music *n = MY_MAKE_MUSIC ("NoteEvent", @$);
- parser->default_duration_ = *unsmob_duration ($1);
+ parser->default_duration_ = *Duration::unsmob ($1);
n->set_property ("duration", $1);
if (scm_is_pair ($2))
SCM proc = parser->lexer_->lookup_identifier ("context-mod-music-handler");
$2 = scm_call_2 (proc, parser->self_scm (), $2);
}
- if (unsmob_context_mod ($2))
+ if (Context_mod::unsmob ($2))
$$ = $2;
else {
parser->parser_error (@2, _ ("not a context mod"));
}
| context_mod_list context_mod {
if (!SCM_UNBNDP ($2))
- unsmob_context_mod ($1)->add_context_mod ($2);
+ Context_mod::unsmob ($1)->add_context_mod ($2);
}
| context_mod_list CONTEXT_MOD_IDENTIFIER {
- Context_mod *md = unsmob_context_mod ($2);
+ Context_mod *md = Context_mod::unsmob ($2);
if (md)
- unsmob_context_mod ($1)->add_context_mods (md->get_mods ());
+ Context_mod::unsmob ($1)->add_context_mods (md->get_mods ());
}
| context_mod_list context_mod_arg {
if (scm_is_eq ($2, SCM_UNSPECIFIED))
SCM proc = parser->lexer_->lookup_identifier ("context-mod-music-handler");
$2 = scm_call_2 (proc, parser->self_scm (), $2);
}
- if (unsmob_context_mod ($2))
- unsmob_context_mod ($$)->add_context_mods
- (unsmob_context_mod ($2)->get_mods ());
+ if (Context_mod::unsmob ($2))
+ Context_mod::unsmob ($$)->add_context_mods
+ (Context_mod::unsmob ($2)->get_mods ());
else {
parser->parser_error (@2, _ ("not a context mod"));
}
complex_music_prefix:
CONTEXT symbol optional_id optional_context_mod {
- Context_mod *ctxmod = unsmob_context_mod ($4);
+ Context_mod *ctxmod = Context_mod::unsmob ($4);
SCM mods = SCM_EOL;
if (ctxmod)
mods = ctxmod->get_mods ();
$$ = START_MAKE_SYNTAX ("context-specification", $2, $3, mods, SCM_BOOL_F);
}
| NEWCONTEXT symbol optional_id optional_context_mod {
- Context_mod *ctxmod = unsmob_context_mod ($4);
+ Context_mod *ctxmod = Context_mod::unsmob ($4);
SCM mods = SCM_EOL;
if (ctxmod)
mods = ctxmod->get_mods ();
parser->lexer_->pop_state ();
}
| mode_changing_head_with_context optional_context_mod grouped_music_list {
- Context_mod *ctxmod = unsmob_context_mod ($2);
+ Context_mod *ctxmod = Context_mod::unsmob ($2);
SCM mods = SCM_EOL;
if (ctxmod)
mods = ctxmod->get_mods ();
chord_body optional_notemode_duration post_events
{
Music *m = unsmob_music ($1);
- SCM dur = unsmob_duration ($2)->smobbed_copy ();
+ SCM dur = Duration::unsmob ($2)->smobbed_copy ();
SCM es = m->get_property ("elements");
SCM postevs = scm_reverse_x ($3, SCM_EOL);
NOTENAME_PITCH quotes {
if (!scm_is_eq (SCM_INUM0, $2))
{
- Pitch p = *unsmob_pitch ($1);
+ Pitch p = *Pitch::unsmob ($1);
p = p.transposed (Pitch (scm_to_int ($2), 0));
$$ = p.smobbed_copy ();
}
TONICNAME_PITCH quotes {
if (!scm_is_eq (SCM_INUM0, $2))
{
- Pitch p = *unsmob_pitch ($1);
+ Pitch p = *Pitch::unsmob ($1);
p = p.transposed (Pitch (scm_to_int ($2), 0));
$$ = p.smobbed_copy ();
}
| PITCH_IDENTIFIER quotes {
if (!scm_is_eq (SCM_INUM0, $2))
{
- Pitch p = *unsmob_pitch ($1);
+ Pitch p = *Pitch::unsmob ($1);
p = p.transposed (Pitch (scm_to_int ($2), 0));
$$ = p.smobbed_copy ();
}
} %prec ':'
| multiplied_duration {
$$ = $1;
- parser->default_duration_ = *unsmob_duration ($$);
+ parser->default_duration_ = *Duration::unsmob ($$);
}
;
}
}
| DURATION_IDENTIFIER dots {
- Duration *d = unsmob_duration ($1);
+ Duration *d = Duration::unsmob ($1);
Duration k (d->duration_log (),
d->dot_count () + scm_to_int ($2));
k = k.compressed (d->factor ());
$$ = $1;
}
| multiplied_duration '*' UNSIGNED {
- $$ = unsmob_duration ($$)->compressed (scm_to_int ($3)).smobbed_copy ();
+ $$ = Duration::unsmob ($$)->compressed (scm_to_int ($3)).smobbed_copy ();
}
| multiplied_duration '*' FRACTION {
Rational m (scm_to_int (scm_car ($3)), scm_to_int (scm_cdr ($3)));
- $$ = unsmob_duration ($$)->compressed (m).smobbed_copy ();
+ $$ = Duration::unsmob ($$)->compressed (m).smobbed_copy ();
}
;
if (!parser->lexer_->is_chord_state ())
parser->parser_error (@1, _ ("have to be in Chord mode for chords"));
if (scm_is_pair ($2)) {
- if (unsmob_pitch ($1))
+ if (Pitch::unsmob ($1))
$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);
- } else if (!unsmob_pitch ($1))
+ } else if (!Pitch::unsmob ($1))
$$ = MAKE_SYNTAX ("event-chord", @1, $1);
// A mere pitch drops through.
} %prec ':'
SCM nn = parser->lexer_->lookup_identifier ("pitchnames");
parser->lexer_->push_note_state (nn);
} '{' score_body '}' {
- Score *sc = unsmob_score ($4);
+ Score *sc = Score::unsmob ($4);
sc->origin ()->set_spot (@$);
if (sc->defs_.empty ()) {
Output_def *od = get_layout (parser);
SCM nn = parser->lexer_->lookup_identifier ("pitchnames");
parser->lexer_->push_note_state (nn);
} '{' score_body '}' {
- Score *sc = unsmob_score ($4);
+ Score *sc = Score::unsmob ($4);
sc->origin ()->set_spot (@$);
if (sc->defs_.empty ()) {
Output_def *od = get_layout (parser);
int
Lily_lexer::try_special_identifiers (SCM *destination, SCM sid)
{
- if (unsmob_book (sid)) {
- Book *book = unsmob_book (sid)->clone ();
+ if (Book::unsmob (sid)) {
+ 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 (unsmob_context_def (sid))
+ } else if (Context_def::unsmob (sid))
{
- *destination = unsmob_context_def (sid)->clone ()->unprotect ();
+ *destination = Context_def::unsmob (sid)->clone ()->unprotect ();
return SCM_IDENTIFIER;
- } else if (unsmob_context_mod (sid)) {
- *destination = unsmob_context_mod (sid)->smobbed_copy ();
+ } else if (Context_mod::unsmob (sid)) {
+ *destination = Context_mod::unsmob (sid)->smobbed_copy ();
return CONTEXT_MOD_IDENTIFIER;
} else if (Music *mus = unsmob_music (sid)) {
mus = mus->clone ();
bool is_event = mus->is_mus_type ("post-event");
mus->unprotect ();
return is_event ? EVENT_IDENTIFIER : MUSIC_IDENTIFIER;
- } else if (unsmob_pitch (sid)) {
- *destination = unsmob_pitch (sid)->smobbed_copy ();
+ } else if (Pitch::unsmob (sid)) {
+ *destination = Pitch::unsmob (sid)->smobbed_copy ();
return PITCH_IDENTIFIER;
- } else if (unsmob_duration (sid)) {
- *destination = unsmob_duration (sid)->smobbed_copy ();
+ } else if (Duration::unsmob (sid)) {
+ *destination = Duration::unsmob (sid)->smobbed_copy ();
return DURATION_IDENTIFIER;
- } else if (unsmob_output_def (sid)) {
- *destination = unsmob_output_def (sid)->clone ()->unprotect ();
+ } else if (Output_def::unsmob (sid)) {
+ *destination = Output_def::unsmob (sid)->clone ()->unprotect ();
return SCM_IDENTIFIER;
- } else if (unsmob_score (sid)) {
- *destination = unsmob_score (sid)->clone ()->unprotect ();
+ } else if (Score::unsmob (sid)) {
+ *destination = Score::unsmob (sid)->clone ()->unprotect ();
return SCM_IDENTIFIER;
}
n->set_property ("drum-type", simple);
return n->unprotect ();
}
- if (unsmob_pitch (simple)) {
+ if (Pitch::unsmob (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 ()) {
- if (unsmob_pitch (simple))
+ if (Pitch::unsmob (simple))
return MAKE_SYNTAX
("event-chord",
loc,
SCM lst = get_music ()->get_property ("elements");
Context *one = handles_[CONTEXT_ONE].get_context ();
set_context (one);
- first_iter_ = unsmob_iterator (get_iterator (unsmob_music (scm_car (lst))));
+ first_iter_ = Music_iterator::unsmob (get_iterator (unsmob_music (scm_car (lst))));
Context *two = handles_[CONTEXT_TWO].get_context ();
set_context (two);
- second_iter_ = unsmob_iterator (get_iterator (unsmob_music (scm_cadr (lst))));
+ second_iter_ = Music_iterator::unsmob (get_iterator (unsmob_music (scm_cadr (lst))));
Context *shared = handles_[CONTEXT_SHARED].get_context ();
set_context (shared);
for (; scm_is_pair (split_list_); split_list_ = scm_cdr (split_list_))
{
- splitm = unsmob_moment (scm_caar (split_list_));
+ splitm = Moment::unsmob (scm_caar (split_list_));
if (splitm && *splitm + start_moment_ > now)
break;
Partial_iterator::process (Moment m)
{
if (Duration * dur
- = unsmob_duration (get_music ()->get_property ("duration")))
+ = Duration::unsmob (get_music ()->get_property ("duration")))
{
// Partial_iterator is an iterator rather than an engraver, so
// the active context it is getting called in does not depend on
// Timing_translator does not set measurePosition when
// initializing.
- Context *timing = unsmob_context (scm_call_2 (ly_lily_module_constant ("ly:context-find"),
+ Context *timing = Context::unsmob (scm_call_2 (ly_lily_module_constant ("ly:context-find"),
get_outlet ()->self_scm (),
ly_symbol2scm ("Timing")));
if (now_mom ().main_part_ != command_moment_.main_part_)
{
first_command_column_
- = unsmob_grob (get_property ("currentCommandColumn"));
+ = Grob::unsmob (get_property ("currentCommandColumn"));
command_moment_ = now_mom ();
}
SCM
Percent_repeat_item_interface::double_percent (SCM grob)
{
- Grob *me = unsmob_grob (grob);
+ Grob *me = Grob::unsmob (grob);
Stencil m = x_percent (me, 2);
m.translate_axis (-m.extent (X_AXIS).center (), X_AXIS);
return m.smobbed_copy ();
SCM
Percent_repeat_item_interface::beat_slash (SCM grob)
{
- Grob *me = unsmob_grob (grob);
+ Grob *me = Grob::unsmob (grob);
Stream_event *cause = unsmob_stream_event (me->get_property ("cause"));
int count = robust_scm2int (cause->get_property ("slash-count"), 1);
Performance *
unsmob_performance (SCM x)
{
- return dynamic_cast<Performance *> (unsmob_music_output (x));
+ return dynamic_cast<Performance *> (Music_output::unsmob (x));
}
for (SCM p = get_simple_trans_list (); scm_is_pair (p); p = scm_cdr (p))
{
- Translator *t = unsmob_translator (scm_car (p));
+ Translator *t = Translator::unsmob (scm_car (p));
Performer *eng = dynamic_cast<Performer *> (t);
if (eng && eng != info.origin_trans_)
eng->acknowledge_audio_element (info);
{
for (SCM p = list; scm_is_pair (p); p = scm_cdr (p))
{
- Performer *e = dynamic_cast<Performer *> (unsmob_translator (scm_car (p)));
+ Performer *e = dynamic_cast<Performer *> (Translator::unsmob (scm_car (p)));
if (e)
(e->*method) ();
}
for (SCM s = context ()->children_contexts ();
scm_is_pair (s); s = scm_cdr (s))
{
- Context *c = unsmob_context (scm_car (s));
+ Context *c = Context::unsmob (scm_car (s));
Performer_group *group
= dynamic_cast<Performer_group *> (c->implementation ());
if (group)
Performer *
unsmob_performer (SCM perf)
{
- return dynamic_cast<Performer *> (unsmob_translator (perf));
+ return dynamic_cast<Performer *> (Translator::unsmob (perf));
}
SCM
Piano_pedal_bracket::print (SCM smob)
{
- Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
+ Spanner *me = dynamic_cast<Spanner *> (Grob::unsmob (smob));
Spanner *orig = dynamic_cast<Spanner *> (me->original ());
Drul_array<bool> broken (false, false);
Grob *common = me->get_bound (LEFT)
->common_refpoint (me->get_bound (RIGHT), X_AXIS);
- Grob *textbit = unsmob_grob (me->get_object ("pedal-text"));
+ Grob *textbit = Grob::unsmob (me->get_object ("pedal-text"));
if (textbit)
common = common->common_refpoint (textbit, X_AXIS);
{
assert (!p->finished_bracket_);
- Grob *cmc = unsmob_grob (get_property ("currentMusicalColumn"));
+ Grob *cmc = Grob::unsmob (get_property ("currentMusicalColumn"));
p->bracket_->set_bound (RIGHT, cmc);
/*
typeset_all (p);
if (p->bracket_ && !p->bracket_->get_bound (LEFT))
{
- Grob *cmc = unsmob_grob (get_property ("currentMusicalColumn"));
+ Grob *cmc = Grob::unsmob (get_property ("currentMusicalColumn"));
p->bracket_->set_bound (LEFT, cmc);
}
}
{
Grob *r = p->finished_bracket_->get_bound (RIGHT);
if (!r)
- p->finished_bracket_->set_bound (RIGHT, unsmob_grob (get_property ("currentMusicalColumn")));
+ p->finished_bracket_->set_bound (RIGHT, Grob::unsmob (get_property ("currentMusicalColumn")));
p->finished_bracket_ = 0;
}
LY_ASSERT_SMOB (Pitch, p, 1);
LY_ASSERT_SMOB (Pitch, delta, 2);
- Pitch *t = unsmob_pitch (p);
- Pitch *d = unsmob_pitch (delta);
+ Pitch *t = Pitch::unsmob (p);
+ Pitch *d = Pitch::unsmob (delta);
return t->transposed (*d).smobbed_copy ();
}
"Negate @var{p}.")
{
LY_ASSERT_SMOB (Pitch, p, 1);
- Pitch *pp = unsmob_pitch (p);
+ Pitch *pp = Pitch::unsmob (p);
return pp->negated ().smobbed_copy ();
}
" pitch@tie{}@var{p}.")
{
LY_ASSERT_SMOB (Pitch, p, 1);
- Pitch *pp = unsmob_pitch (p);
+ Pitch *pp = Pitch::unsmob (p);
return scm_from_int (pp->steps ());
}
"Extract the octave from pitch@tie{}@var{pp}.")
{
LY_ASSERT_SMOB (Pitch, pp, 1);
- Pitch *p = unsmob_pitch (pp);
+ Pitch *p = Pitch::unsmob (pp);
int q = p->get_octave ();
return scm_from_int (q);
}
"Extract the alteration from pitch@tie{}@var{pp}.")
{
LY_ASSERT_SMOB (Pitch, pp, 1);
- Pitch *p = unsmob_pitch (pp);
+ Pitch *p = Pitch::unsmob (pp);
Rational q = p->get_alteration ();
return ly_rational2scm (q);
"Extract the note name from pitch @var{pp}.")
{
LY_ASSERT_SMOB (Pitch, pp, 1);
- Pitch *p = unsmob_pitch (pp);
+ Pitch *p = Pitch::unsmob (pp);
int q = p->get_notename ();
return scm_from_int (q);
}
" middle@tie{}C as a rational number.")
{
LY_ASSERT_SMOB (Pitch, pp, 1);
- return ly_rational2scm (unsmob_pitch (pp)->tone_pitch ());
+ return ly_rational2scm (Pitch::unsmob (pp)->tone_pitch ());
}
LY_DEFINE (ly_pitch_quartertones, "ly:pitch-quartertones",
" middle@tie{}C.")
{
LY_ASSERT_SMOB (Pitch, pp, 1);
- Pitch *p = unsmob_pitch (pp);
+ Pitch *p = Pitch::unsmob (pp);
int q = p->rounded_quartertone_pitch ();
return scm_from_int (q);
}
" middle@tie{}C.")
{
LY_ASSERT_SMOB (Pitch, pp, 1);
- Pitch *p = unsmob_pitch (pp);
+ Pitch *p = Pitch::unsmob (pp);
int q = p->rounded_semitone_pitch ();
return scm_from_int (q);
}
LY_ASSERT_SMOB (Pitch, p1, 1);
LY_ASSERT_SMOB (Pitch, p2, 2);
- Pitch *a = unsmob_pitch (p1);
- Pitch *b = unsmob_pitch (p2);
+ Pitch *a = Pitch::unsmob (p1);
+ Pitch *b = Pitch::unsmob (p2);
if (Pitch::compare (*a, *b) < 0)
return SCM_BOOL_T;
LY_ASSERT_SMOB (Pitch, pitch, 1);
LY_ASSERT_SMOB (Pitch, root, 2);
- Pitch *p = unsmob_pitch (pitch);
- Pitch *r = unsmob_pitch (root);
+ Pitch *p = Pitch::unsmob (pitch);
+ Pitch *r = Pitch::unsmob (root);
return pitch_interval (*r, *p).smobbed_copy ();
}
{
LY_ASSERT_SMOB (Context, context, 1);
- Context *c = unsmob_context (context);
+ Context *c = Context::unsmob (context);
int clef_pos = robust_scm2int (c->get_property ("middleCClefPosition"), 0);
int offset = robust_scm2int (c->get_property ("middleCOffset"), 0);
/* middleCCuePosition overrides the clef! */
SCM
Pitch::less_p (SCM p1, SCM p2)
{
- Pitch *a = unsmob_pitch (p1);
- Pitch *b = unsmob_pitch (p2);
+ Pitch *a = Pitch::unsmob (p1);
+ Pitch *b = Pitch::unsmob (p2);
if (compare (*a, *b) < 0)
return SCM_BOOL_T;
if (ev
&& ev->in_event_class ("trill-span-event")
&& to_dir (ev->get_property ("span-direction")) == START
- && unsmob_pitch (ev->get_property ("pitch")))
+ && Pitch::unsmob (ev->get_property ("pitch")))
make_trill (ev);
}
Pitched_trill_engraver::make_trill (Stream_event *ev)
{
SCM scm_pitch = ev->get_property ("pitch");
- Pitch *p = unsmob_pitch (scm_pitch);
+ Pitch *p = Pitch::unsmob (scm_pitch);
SCM keysig = get_property ("localAlterations");
int c0 = scm_is_number (c0scm) ? scm_to_int (c0scm) : 0;
trill_head_->set_property ("staff-position",
- scm_from_int (unsmob_pitch (scm_pitch)->steps ()
+ scm_from_int (Pitch::unsmob (scm_pitch)->steps ()
+ c0));
trill_group_ = make_item ("TrillPitchGroup", ev->self_scm ());
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 (unsmob_grob, grob, 1);
+ LY_ASSERT_TYPE (Grob::unsmob, grob, 1);
LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
- LY_ASSERT_TYPE (unsmob_grob, grob_element, 3);
+ LY_ASSERT_TYPE (Grob::unsmob, grob_element, 3);
- Pointer_group_interface::add_grob (unsmob_grob (grob),
+ Pointer_group_interface::add_grob (Grob::unsmob (grob),
sym,
- unsmob_grob (grob_element));
+ Grob::unsmob (grob_element));
return SCM_UNSPECIFIED;
}
int
Pointer_group_interface::count (Grob *me, SCM sym)
{
- Grob_array *arr = unsmob_grob_array (me->internal_get_object (sym));
+ Grob_array *arr = Grob_array::unsmob (me->internal_get_object (sym));
return arr ? arr->size () : 0;
}
void
Pointer_group_interface::add_grob (Grob *me, SCM sym, SCM p)
{
- add_grob (me, sym, unsmob_grob (p));
+ add_grob (me, sym, Grob::unsmob (p));
}
void
Pointer_group_interface::get_grob_array (Grob *me, SCM sym)
{
SCM scm_arr = me->internal_get_object (sym);
- Grob_array *arr = unsmob_grob_array (scm_arr);
+ Grob_array *arr = Grob_array::unsmob (scm_arr);
if (!arr)
{
scm_arr = Grob_array::make_array ();
- arr = unsmob_grob_array (scm_arr);
+ arr = Grob_array::unsmob (scm_arr);
me->set_object (sym, scm_arr);
}
return arr;
vector<Grob *> const &
ly_scm2link_array (SCM x)
{
- Grob_array *arr = unsmob_grob_array (x);
+ Grob_array *arr = Grob_array::unsmob (x);
return arr ? arr->array () : empty_array;
}
vector<Item *>
internal_extract_item_array (Grob const *elt, SCM symbol)
{
- Grob_array *arr = unsmob_grob_array (elt->internal_get_object (symbol));
+ Grob_array *arr = Grob_array::unsmob (elt->internal_get_object (symbol));
vector<Item *> items;
for (vsize i = 0; arr && i < arr->size (); i++)
items.push_back (arr->item (i));
"Set property @var{sym} of @var{obj} to @var{value}.")
{
LY_ASSERT_SMOB (Prob, obj, 1);
- Prob *ps = unsmob_prob (obj);
+ Prob *ps = Prob::unsmob (obj);
LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
ps->set_property (sym, value);
" @code{'()} if @var{val} is not specified.")
{
LY_ASSERT_SMOB (Prob, prob, 1);
- Prob *ps = unsmob_prob (prob);
+ Prob *ps = Prob::unsmob (prob);
LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
if (val == SCM_UNDEFINED)
(SCM obj, SCM type),
"Is @var{obj} the specified prob-type?")
{
- Prob *prob = unsmob_prob (obj);
+ Prob *prob = Prob::unsmob (obj);
return scm_from_bool (prob && prob->type () == type);
}
"Retrieve an alist of mutable properties.")
{
LY_ASSERT_SMOB (Prob, prob, 1);
- Prob *ps = unsmob_prob (prob);
+ Prob *ps = Prob::unsmob (prob);
return ps->get_property_alist (true);
}
"Retrieve an alist of immutable properties.")
{
LY_ASSERT_SMOB (Prob, prob, 1);
- Prob *ps = unsmob_prob (prob);
+ Prob *ps = Prob::unsmob (prob);
return ps->get_property_alist (false);
}
equality; e.g., that two probs are equal iff they can be
distinguished by calls to ly:prob-property.
*/
- Prob *probs[2] = {unsmob_prob (sa), unsmob_prob (sb)};
+ Prob *probs[2] = {Prob::unsmob (sa), Prob::unsmob (sb)};
SCM props[2][2];
int i;
Property_iterator::once_finalization (SCM ctx, SCM music, SCM previous_value)
{
Music *m = unsmob_music (music);
- Context *c = unsmob_context (ctx);
+ Context *c = Context::unsmob (ctx);
// Do not use UnsetProperty, which sets the default, but rather
// cache the value before the \once \set command and restore it now
Push_property_iterator::once_finalization (SCM ctx, SCM music)
{
Music *mus = unsmob_music (music);
- Context *c = unsmob_context (ctx);
+ Context *c = Context::unsmob (ctx);
SCM sym = mus->get_property ("symbol");
if (check_grob (mus, sym))
SCM
Pure_from_neighbor_interface::calc_pure_relevant_grobs (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
extract_grob_set ((me->original () && me->original ()->is_live ()
? me->original ()
: me),
if (Grob_array::unsmob (neighbors_scm))
{
vector<Grob *> &arr
- = unsmob_grob_array (neighbors_scm)->array_reference ();
+ = Grob_array::unsmob (neighbors_scm)->array_reference ();
arr = new_elts;
}
Quote_iterator::vector_moment (int idx) const
{
SCM entry = scm_c_vector_ref (event_vector_, idx);
- return *unsmob_moment (scm_caar (entry));
+ return *Moment::unsmob (scm_caar (entry));
}
void
if (quote_ok ())
{
SCM entry = scm_c_vector_ref (event_vector_, event_idx_);
- Pitch *quote_pitch = unsmob_pitch (scm_cdar (entry));
+ Pitch *quote_pitch = Pitch::unsmob (scm_cdar (entry));
/*
The pitch that sounds when written central C is played.
*/
Pitch temp_pitch;
- Pitch *me_pitch = unsmob_pitch (get_music ()->get_property ("quoted-transposition"));
+ Pitch *me_pitch = Pitch::unsmob (get_music ()->get_property ("quoted-transposition"));
if (!me_pitch)
- me_pitch = unsmob_pitch (get_outlet ()->get_property ("instrumentTransposition"));
+ me_pitch = Pitch::unsmob (get_outlet ()->get_property ("instrumentTransposition"));
else
{
// We are not going to win a beauty contest with this one,
SCM
Relative_octave_check::relative_callback (SCM music, SCM last_pitch)
{
- Pitch p = *unsmob_pitch (last_pitch);
+ Pitch p = *Pitch::unsmob (last_pitch);
Music *m = unsmob_music (music);
- Pitch *check_p = unsmob_pitch (m->get_property ("pitch"));
+ Pitch *check_p = Pitch::unsmob (m->get_property ("pitch"));
int delta_oct = 0;
if (check_p)
for (SCM s = get_property ("busyGrobs"); scm_is_pair (s); s = scm_cdr (s))
{
- Grob *g = unsmob_grob (scm_cdar (s));
- Moment *m = unsmob_moment (scm_caar (s));
+ Grob *g = Grob::unsmob (scm_cdar (s));
+ Moment *m = Moment::unsmob (scm_caar (s));
if (!g || !m)
continue;
SCM
Rest_collision::force_shift_callback_rest (SCM rest, SCM offset)
{
- Grob *rest_grob = unsmob_grob (rest);
+ Grob *rest_grob = Grob::unsmob (rest);
Grob *parent = rest_grob->get_parent (X_AXIS);
/*
if (Note_column::has_interface (parent) && Note_column::has_rests (parent))
{
- Grob *collision = unsmob_grob (parent->get_object ("rest-collision"));
+ Grob *collision = Grob::unsmob (parent->get_object ("rest-collision"));
if (collision)
(void) collision->get_property ("positioning-done");
p->set_object ("rest-collision", me->self_scm ());
- Grob *rest = unsmob_grob (p->get_object ("rest"));
+ Grob *rest = Grob::unsmob (p->get_object ("rest"));
if (rest)
{
chain_offset_callback (rest,
SCM
Rest_collision::calc_positioning_done (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
me->set_property ("positioning-done", SCM_BOOL_T);
for (vsize i = 0; i < elts.size (); i++)
{
Grob *e = elts[i];
- if (unsmob_grob (e->get_object ("rest")))
+ if (Grob::unsmob (e->get_object ("rest")))
rests.push_back (e);
else
notes.push_back (e);
if (rest_event_ && !rest_)
{
rest_ = make_item ("Rest", rest_event_->self_scm ());
- Pitch *p = unsmob_pitch (rest_event_->get_property ("pitch"));
+ Pitch *p = Pitch::unsmob (rest_event_->get_property ("pitch"));
if (p)
{
SCM
Rest::y_offset_callback (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
int duration_log = scm_to_int (me->get_property ("duration-log"));
Real ss = Staff_symbol_referencer::staff_space (me);
SCM
Rest::calc_cross_staff (SCM smob)
{
- Grob *me = unsmob_grob (smob);
- Grob *stem = unsmob_grob (me->get_object ("stem"));
+ Grob *me = Grob::unsmob (smob);
+ Grob *stem = Grob::unsmob (me->get_object ("stem"));
if (!stem)
return SCM_BOOL_F;
SCM
Rest::print (SCM smob)
{
- return brew_internal_stencil (unsmob_grob (smob), true);
+ return brew_internal_stencil (Grob::unsmob (smob), true);
}
MAKE_SCHEME_CALLBACK (Rest, width, 1);
SCM
Rest::width (SCM smob)
{
- return generic_extent_callback (unsmob_grob (smob), X_AXIS);
+ return generic_extent_callback (Grob::unsmob (smob), X_AXIS);
}
MAKE_SCHEME_CALLBACK (Rest, height, 1);
SCM
Rest::height (SCM smob)
{
- return generic_extent_callback (unsmob_grob (smob), Y_AXIS);
+ return generic_extent_callback (Grob::unsmob (smob), Y_AXIS);
}
/*
with ledgered rests.
*/
SCM m = brew_internal_stencil (me, a != X_AXIS);
- return ly_interval2scm (unsmob_stencil (m)->extent (a));
+ return ly_interval2scm (Stencil::unsmob (m)->extent (a));
}
MAKE_SCHEME_CALLBACK (Rest, pure_height, 3);
SCM /* start */,
SCM /* end */)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
SCM m = brew_internal_stencil (me, false);
- return ly_interval2scm (unsmob_stencil (m)->extent (Y_AXIS));
+ return ly_interval2scm (Stencil::unsmob (m)->extent (Y_AXIS));
}
ADD_INTERFACE (Rest,
{
Stream_event *ev = unsmob_stream_event (sev);
SCM sm = ev->get_property ("moment");
- Moment *m = unsmob_moment (sm);
+ Moment *m = Moment::unsmob (sm);
audio_column_ = new Audio_column (*m);
announce_element (Audio_element_info (audio_column_, 0));
precomputed_recurse_over_translators (context (), START_TRANSLATION_TIMESTEP, UP);
"All output definitions in a score.")
{
LY_ASSERT_SMOB (Score, score, 1);
- Score *sc = unsmob_score (score);
+ Score *sc = Score::unsmob (score);
SCM l = SCM_EOL;
for (vsize i = 0; i < sc->defs_.size (); i++)
{
LY_ASSERT_SMOB (Score, score, 1);
LY_ASSERT_SMOB (Output_def, def, 2);
- Score *sc = unsmob_score (score);
- Output_def *output_def = unsmob_output_def (def);
+ Score *sc = Score::unsmob (score);
+ Output_def *output_def = Output_def::unsmob (def);
sc->add_output_def (output_def);
return SCM_UNSPECIFIED;
}
"Return score header.")
{
LY_ASSERT_SMOB (Score, score, 1);
- Score *sc = unsmob_score (score);
+ Score *sc = Score::unsmob (score);
return sc->get_header ();
}
SCM_ASSERT_TYPE (ly_is_module (module), module, SCM_ARG2, __FUNCTION__,
"module");
- Score *sc = unsmob_score (score);
+ Score *sc = Score::unsmob (score);
sc->set_header (module);
return SCM_UNSPECIFIED;
}
"Return score music.")
{
LY_ASSERT_SMOB (Score, score, 1);
- Score *sc = unsmob_score (score);
+ Score *sc = Score::unsmob (score);
return sc->get_music ();
}
"Was there an error in the score?")
{
LY_ASSERT_SMOB (Score, score, 1);
- Score *sc = unsmob_score (score);
+ Score *sc = Score::unsmob (score);
return scm_from_bool (sc->error_found_);
}
LY_ASSERT_SMOB (Score, score, 1);
LY_ASSERT_SMOB (Output_def, layout, 2);
- Score *sc = unsmob_score (score);
- Output_def *od = unsmob_output_def (layout);
+ Score *sc = Score::unsmob (score);
+ Output_def *od = Output_def::unsmob (layout);
if (sc->error_found_)
return SCM_EOL;
/* TODO: fix or junk --no-layout. */
SCM context = ly_run_translator (music_, scaled);
- if (dynamic_cast<Global_context *> (unsmob_context (context)))
+ if (dynamic_cast<Global_context *> (Context::unsmob (context)))
{
SCM s = ly_format_output (context);
2, 0, 0, (SCM a, SCM b),
"Compare two grobs by script priority. For internal use.")
{
- Grob *i1 = unsmob_grob (a);
- Grob *i2 = unsmob_grob (b);
+ Grob *i1 = Grob::unsmob (a);
+ Grob *i2 = Grob::unsmob (b);
SCM p1 = i1->get_property ("script-priority");
SCM p2 = i2->get_property ("script-priority");
SCM
Script_column::row_before_line_breaking (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
vector<Grob *> horizontal_grobs;
extract_grob_set (me, "scripts", scripts);
SCM
Script_column::before_line_breaking (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
vector<Grob *> staff_sided;
extract_grob_set (me, "scripts", scripts);
for (SCM s = ss; scm_is_pair (s);
s = scm_cdr (s), last = g, last_initial_outside_staff = initial_outside_staff)
{
- g = unsmob_grob (scm_car (s));
+ g = Grob::unsmob (scm_car (s));
initial_outside_staff = g->get_property ("outside-staff-priority");
if (last) //not the first grob in the list
{
*/
if (!scm_is_number (last_outside_staff))
for (SCM t = ss; !scm_is_eq (t, s); t = scm_cdr (t))
- Side_position_interface::add_support (g, unsmob_grob (scm_car (t)));
+ Side_position_interface::add_support (g, Grob::unsmob (scm_car (t)));
/*
if outside_staff_priority is missing or is equal to original
outside_staff_priority of previous grob, set new
SCM
Script_interface::calc_positioning_done (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
if (Grob *par = me->get_parent (X_AXIS))
{
Grob *stem = Note_column::get_stem (par);
relative_dir = to_dir (reldir);
SCM other_elt = me->get_object ("direction-source");
- Grob *e = unsmob_grob (other_elt);
+ Grob *e = Grob::unsmob (other_elt);
if (e)
return (Direction) (relative_dir * get_grob_direction (e));
SCM
Script_interface::calc_direction (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Direction d = Script_interface::get_direction (me);
if (!d)
SCM
Script_interface::calc_cross_staff (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Grob *stem = Note_column::get_stem (me->get_parent (X_AXIS));
if (stem && to_boolean (stem->get_property ("cross-staff")))
return SCM_BOOL_T;
- Grob *slur = unsmob_grob (me->get_object ("slur"));
+ Grob *slur = Grob::unsmob (me->get_object ("slur"));
SCM avoid_slur = me->get_property ("avoid-slur");
if (slur && to_boolean (slur->get_property ("cross-staff"))
&& (avoid_slur == ly_symbol2scm ("outside")
SCM
Script_interface::print (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Direction dir = get_grob_direction (me);
SCM
Self_alignment_interface::y_aligned_on_self (SCM element)
{
- return aligned_on_self (unsmob_grob (element), Y_AXIS, false, 0, 0);
+ return aligned_on_self (Grob::unsmob (element), Y_AXIS, false, 0, 0);
}
MAKE_SCHEME_CALLBACK (Self_alignment_interface, x_aligned_on_self, 1);
SCM
Self_alignment_interface::x_aligned_on_self (SCM element)
{
- return aligned_on_self (unsmob_grob (element), X_AXIS, false, 0, 0);
+ return aligned_on_self (Grob::unsmob (element), X_AXIS, false, 0, 0);
}
MAKE_SCHEME_CALLBACK (Self_alignment_interface, pure_y_aligned_on_self, 3);
SCM
Self_alignment_interface::pure_y_aligned_on_self (SCM smob, SCM start, SCM end)
{
- return aligned_on_self (unsmob_grob (smob), Y_AXIS, true, robust_scm2int (start, 0), robust_scm2int (end, INT_MAX));
+ return aligned_on_self (Grob::unsmob (smob), Y_AXIS, true, robust_scm2int (start, 0), robust_scm2int (end, INT_MAX));
}
SCM
SCM
Self_alignment_interface::centered_on_x_parent (SCM smob)
{
- return centered_on_object (unsmob_grob (smob)->get_parent (X_AXIS), X_AXIS);
+ return centered_on_object (Grob::unsmob (smob)->get_parent (X_AXIS), X_AXIS);
}
MAKE_SCHEME_CALLBACK (Self_alignment_interface, centered_on_y_parent, 1);
SCM
Self_alignment_interface::centered_on_y_parent (SCM smob)
{
- return centered_on_object (unsmob_grob (smob)->get_parent (Y_AXIS), Y_AXIS);
+ return centered_on_object (Grob::unsmob (smob)->get_parent (Y_AXIS), Y_AXIS);
}
MAKE_SCHEME_CALLBACK (Self_alignment_interface, aligned_on_x_parent, 1);
SCM
Self_alignment_interface::aligned_on_x_parent (SCM smob)
{
- return aligned_on_parent (unsmob_grob (smob), X_AXIS);
+ return aligned_on_parent (Grob::unsmob (smob), X_AXIS);
}
MAKE_SCHEME_CALLBACK (Self_alignment_interface, aligned_on_y_parent, 1);
SCM
Self_alignment_interface::aligned_on_y_parent (SCM smob)
{
- return aligned_on_parent (unsmob_grob (smob), Y_AXIS);
+ return aligned_on_parent (Grob::unsmob (smob), Y_AXIS);
}
SCM
SCM
Semi_tie_column::calc_positioning_done (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
me->set_property ("positioning-done", SCM_BOOL_T);
SCM
Semi_tie_column::calc_head_direction (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
extract_grob_set (me, "ties", ties);
Direction d = LEFT;
SCM
Semi_tie::calc_control_points (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
(void) me->get_property ("direction");
if (Semi_tie_column::has_interface (me->get_parent (Y_AXIS)))
int
Semi_tie::get_position (Grob *me)
{
- Grob *h = unsmob_grob (me->get_object ("note-head"));
+ Grob *h = Grob::unsmob (me->get_object ("note-head"));
return (int) rint (Staff_symbol_referencer::get_position (h));
}
&& !current_spacings_.staff_spacing_
&& to_boolean (get_property ("createSpacing")))
{
- Grob *col = unsmob_grob (get_property ("currentCommandColumn"));
+ Grob *col = Grob::unsmob (get_property ("currentCommandColumn"));
current_spacings_.staff_spacing_ = make_item ("StaffSpacing", SCM_EOL);
context ()->set_property ("hasStaffSpacing", SCM_BOOL_T);
&& last_spacings_.staff_spacing_)
{
SCM ri = last_spacings_.staff_spacing_->get_object ("right-items");
- Grob_array *ga = unsmob_grob_array (ri);
+ Grob_array *ga = Grob_array::unsmob (ri);
if (!ga)
{
SCM ga_scm = Grob_array::make_array ();
last_spacings_.staff_spacing_->set_object ("right-items", ga_scm);
- ga = unsmob_grob_array (ga_scm);
+ ga = Grob_array::unsmob (ga_scm);
}
ga->clear ();
last_spacings_ = current_spacings_;
if (Item *sp = current_spacings_.staff_spacing_)
- if (Grob *col = unsmob_grob (get_property ("currentMusicalColumn")))
+ if (Grob *col = Grob::unsmob (get_property ("currentMusicalColumn")))
Pointer_group_interface::add_grob (sp, ly_symbol2scm ("right-items"), col);
current_spacings_.clear ();
if (!debug_skylines)
return SCM_BOOL_F;
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Stencil ret;
if (Skyline_pair *s = Skyline_pair::unsmob (me->get_property ("horizontal-skylines")))
{
if (scm_is_pair (cursor_))
{
Music *m = unsmob_music (scm_car (cursor_));
- iter_ = unsmob_iterator (get_iterator (m));
+ iter_ = Music_iterator::unsmob (get_iterator (m));
}
while (iter_ && !iter_->ok ())
iter_->quit ();
if (scm_is_pair (cursor_))
- iter_ = unsmob_iterator (get_iterator (unsmob_music (scm_car (cursor_))));
+ iter_ = Music_iterator::unsmob (get_iterator (unsmob_music (scm_car (cursor_))));
else
iter_ = 0;
}
acs = scm_cdr (acs))
for (SCM s = scm_cdar (acs); scm_is_pair (s); s = scm_cdr (s))
{
- Grob *a = unsmob_grob (scm_car (s));
+ Grob *a = Grob::unsmob (scm_car (s));
support.insert (a);
}
}
current_off_ptr = &r;
}
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
// We will only ever want widths of spanners after line breaking
// so we can set pure to false
if (dynamic_cast<Spanner *> (me) && a == X_AXIS)
SCM
Side_position_interface::calc_cross_staff (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
extract_grob_set (me, "side-support-elements", elts);
Direction my_dir = get_grob_direction (me) ;
SCM
Side_position_interface::move_to_extremal_staff (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
System *sys = dynamic_cast<System *> (me->get_system ());
Direction dir = get_grob_direction (me);
if (dir != DOWN)
Axis_group_interface::add_element (top_staff, me);
// Remove any cross-staff side-support dependencies
- Grob_array *ga = unsmob_grob_array (me->get_object ("side-support-elements"));
+ Grob_array *ga = Grob_array::unsmob (me->get_object ("side-support-elements"));
if (ga)
{
vector<Grob *> const &elts = ga->array ();
for (SCM s = Spaceable_grob::get_minimum_distances (col);
scm_is_pair (s); s = scm_cdr (s))
{
- Grob *other = unsmob_grob (scm_caar (s));
+ Grob *other = Grob::unsmob (scm_caar (s));
vsize j = binary_search (cols, other, Paper_column::less_than, col_index);
if (j != VPOS)
{
Simultaneous_music_iterator::derived_substitute (Context *f, Context *t)
{
for (SCM s = children_list_; scm_is_pair (s); s = scm_cdr (s))
- unsmob_iterator (scm_car (s))->substitute_outlet (f, t);
+ Music_iterator::unsmob (scm_car (s))->substitute_outlet (f, t);
}
void
Music *mus = unsmob_music (scm_car (i));
SCM scm_iter = get_static_get_iterator (mus);
- Music_iterator *mi = unsmob_iterator (scm_iter);
+ Music_iterator *mi = Music_iterator::unsmob (scm_iter);
/* if create_separate_contexts_ is set, create a new context with the
number number as name */
SCM *proc = &children_list_;
while (scm_is_pair (*proc))
{
- Music_iterator *i = unsmob_iterator (scm_car (*proc));
+ Music_iterator *i = Music_iterator::unsmob (scm_car (*proc));
if (i->run_always ()
|| i->pending_moment () == until)
i->process (until);
for (SCM s = children_list_; scm_is_pair (s); s = scm_cdr (s))
{
- Music_iterator *it = unsmob_iterator (scm_car (s));
+ Music_iterator *it = Music_iterator::unsmob (scm_car (s));
next = min (next, it->pending_moment ());
}
bool run_always_ok = false;
for (SCM s = children_list_; scm_is_pair (s); s = scm_cdr (s))
{
- Music_iterator *it = unsmob_iterator (scm_car (s));
+ Music_iterator *it = Music_iterator::unsmob (scm_car (s));
if (!it->run_always ())
return true;
else
{
for (SCM s = children_list_; scm_is_pair (s); s = scm_cdr (s))
{
- Music_iterator *it = unsmob_iterator (scm_car (s));
+ Music_iterator *it = Music_iterator::unsmob (scm_car (s));
if (it->run_always ())
return true;
}
Simultaneous_music_iterator::do_quit ()
{
for (SCM s = children_list_; scm_is_pair (s); s = scm_cdr (s))
- unsmob_iterator (scm_car (s))->quit ();
+ Music_iterator::unsmob (scm_car (s))->quit ();
}
IMPLEMENT_CTOR_CALLBACK (Simultaneous_music_iterator);
void
Slur_proto_engraver::create_slur (const string &spanner_id, Stream_event *ev_cause, Grob *g_cause, Direction dir, bool left_broken)
{
- Grob *ccc = unsmob_grob (get_property ("currentCommandColumn"));
+ Grob *ccc = Grob::unsmob (get_property ("currentCommandColumn"));
SCM cause = ev_cause ? ev_cause->self_scm () : g_cause->self_scm ();
Spanner *slur = make_spanner (grob_name_, cause);
slur->set_property ("spanner-id", ly_string2scm (spanner_id));
void
Slur_proto_engraver::stop_translation_timestep ()
{
- if (Grob *g = unsmob_grob (get_property ("currentCommandColumn")))
+ if (Grob *g = Grob::unsmob (get_property ("currentCommandColumn")))
{
for (vsize i = 0; i < end_slurs_.size (); i++)
Slur::add_extra_encompass (end_slurs_[i], g);
{
Spanner *s = dynamic_cast<Spanner *> (end_slurs_[i]);
if (!s->get_bound (RIGHT))
- s->set_bound (RIGHT, unsmob_grob (get_property ("currentMusicalColumn")));
+ s->set_bound (RIGHT, Grob::unsmob (get_property ("currentMusicalColumn")));
announce_end_grob (s, SCM_EOL);
}
Encompass_info
Slur_score_state::get_encompass_info (Grob *col) const
{
- Grob *stem = unsmob_grob (col->get_object ("stem"));
+ Grob *stem = Grob::unsmob (col->get_object ("stem"));
Encompass_info ei;
if (!stem)
SCM
Slur::calc_direction (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
extract_grob_set (me, "note-columns", encompasses);
if (encompasses.empty ())
-- adding extra height for scripts that avoid slurs on the inside
-- adding extra height for the "bulge" in a slur above a note head
*/
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
int start = scm_to_int (start_scm);
int end = scm_to_int (end_scm);
Direction dir = get_grob_direction (me);
SCM
Slur::height (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
// FIXME uncached
Stencil *m = me->get_stencil ();
SCM
Slur::print (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
extract_grob_set (me, "note-columns", encompasses);
if (encompasses.empty ())
{
properties = scm_cons (scm_acons (ly_symbol2scm ("font-size"), scm_from_int (-6), SCM_EOL),
properties);
- Stencil tm = *unsmob_stencil (Text_interface::interpret_markup
+ Stencil tm = *Stencil::unsmob (Text_interface::interpret_markup
(me->layout ()->self_scm (), properties,
annotation));
a.add_at_edge (Y_AXIS, get_grob_direction (me), tm, 1.0);
if (Grob_array::unsmob (encompass_scm))
{
vector<Grob *> &arr
- = unsmob_grob_array (encompass_scm)->array_reference ();
+ = Grob_array::unsmob (encompass_scm)->array_reference ();
arr = new_encompasses;
}
}
{
int start = robust_scm2int (start_scm, 0);
int end = robust_scm2int (end_scm, 0);
- Grob *script = unsmob_grob (grob);
- Grob *slur = unsmob_grob (script->get_object ("slur"));
+ Grob *script = Grob::unsmob (grob);
+ Grob *slur = Grob::unsmob (script->get_object ("slur"));
if (!slur)
return offset_scm;
SCM
Slur::outside_slur_callback (SCM grob, SCM offset_scm)
{
- Grob *script = unsmob_grob (grob);
- Grob *slur = unsmob_grob (script->get_object ("slur"));
+ Grob *script = Grob::unsmob (grob);
+ Grob *slur = Grob::unsmob (script->get_object ("slur"));
if (!slur)
return offset_scm;
SCM
Slur::vertical_skylines (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
vector<Box> boxes;
if (!me)
if (previous == SCM_BOOL_T)
return previous;
- Grob *me = unsmob_grob (smob);
- Grob *slur = unsmob_grob (me->get_object ("slur"));
+ Grob *me = Grob::unsmob (smob);
+ Grob *slur = Grob::unsmob (me->get_object ("slur"));
if (!slur)
return SCM_BOOL_F;
SCM
Slur::calc_cross_staff (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
extract_grob_set (me, "note-columns", cols);
extract_grob_set (me, "encompass-objects", extras);
s = scm_cdr (s))
{
if (scm_is_pair (scm_car (s))
- && unsmob_grob (scm_cdar (s)) == next_col
- && unsmob_spring (scm_caar (s)))
- spring = unsmob_spring (scm_caar (s));
+ && Grob::unsmob (scm_cdar (s)) == next_col
+ && Spring::unsmob (scm_caar (s)))
+ spring = Spring::unsmob (scm_caar (s));
}
if (!spring)
if (Paper_column::is_breakable (l) && Paper_column::is_breakable (r))
{
- Moment *dt = unsmob_moment (l->get_property ("measure-length"));
+ Moment *dt = Moment::unsmob (l->get_property ("measure-length"));
Moment mlen (1);
if (dt)
mlen = *dt;
do
{
- if (Moment *len = unsmob_moment (cols[col_idx]->get_property ("measure-length")))
+ if (Moment *len = Moment::unsmob (cols[col_idx]->get_property ("measure-length")))
{
return len;
}
Moment shortest_playing_len = 0;
SCM s = lc->get_property ("shortest-playing-duration");
- if (unsmob_moment (s))
- shortest_playing_len = *unsmob_moment (s);
+ if (Moment::unsmob (s))
+ shortest_playing_len = *Moment::unsmob (s);
if (! shortest_playing_len.to_bool ())
{
}
else if (delta_t.grace_part_)
{
- Grob *grace_spacing = unsmob_grob (lc->get_object ("grace-spacing"));
+ Grob *grace_spacing = Grob::unsmob (lc->get_object ("grace-spacing"));
if (grace_spacing)
{
Spacing_options grace_opts;
if (loose)
{
- Grob *right_neighbor = unsmob_grob (c->get_object ("right-neighbor"));
- Grob *left_neighbor = unsmob_grob (c->get_object ("left-neighbor"));
+ Grob *right_neighbor = Grob::unsmob (c->get_object ("right-neighbor"));
+ Grob *left_neighbor = Grob::unsmob (c->get_object ("left-neighbor"));
/*
Either object can be non existent, if the score ends
min_right_rank = right_rank;
}
- Grob *old_left_neighbor = unsmob_grob (right_col->get_object ("left-neighbor"));
+ Grob *old_left_neighbor = Grob::unsmob (right_col->get_object ("left-neighbor"));
if (!old_left_neighbor || left_rank > Paper_column::get_rank (old_left_neighbor))
right_col->set_object ("left-neighbor", left_col->self_scm ());
}
if (!Paper_column::is_breakable (it) && !Paper_column::is_musical (it))
continue;
- if (i && !unsmob_grob (cols[i]->get_object ("left-neighbor")))
+ if (i && !Grob::unsmob (cols[i]->get_object ("left-neighbor")))
cols[i]->set_object ("left-neighbor", cols[i - 1]->self_scm ());
- if (i + 1 < cols.size () && !unsmob_grob (cols[i]->get_object ("right-neighbor")))
+ if (i + 1 < cols.size () && !Grob::unsmob (cols[i]->get_object ("right-neighbor")))
cols[i]->set_object ("right-neighbor", cols[i + 1]->self_scm ());
}
}
spacing_ = make_spanner ("SpacingSpanner", SCM_EOL);
spacing_->set_bound (LEFT,
- unsmob_grob (get_property ("currentCommandColumn")));
+ Grob::unsmob (get_property ("currentCommandColumn")));
}
void
{
if (spacing_)
{
- Grob *p = unsmob_grob (get_property ("currentCommandColumn"));
+ Grob *p = Grob::unsmob (get_property ("currentCommandColumn"));
spacing_->set_bound (RIGHT, p);
spacing_ = 0;
Spacing_engraver::stop_translation_timestep ()
{
Paper_column *musical_column
- = dynamic_cast<Paper_column *> (unsmob_grob (get_property ("currentMusicalColumn")));
+ = dynamic_cast<Paper_column *> (Grob::unsmob (get_property ("currentMusicalColumn")));
if (!spacing_)
start_spanner ();
musical_column->set_object ("spacing", spacing_->self_scm ());
- unsmob_grob (get_property ("currentCommandColumn"))
+ Grob::unsmob (get_property ("currentCommandColumn"))
->set_object ("spacing", spacing_->self_scm ());
SCM proportional = get_property ("proportionalNotationDuration");
- if (unsmob_moment (proportional))
+ if (Moment::unsmob (proportional))
{
musical_column->set_property ("shortest-playing-duration", proportional);
musical_column->set_property ("shortest-starter-duration", proportional);
if (!me->is_live ())
return 0;
- Grob_array *a = unsmob_grob_array (me->get_object ("right-items"));
+ Grob_array *a = Grob_array::unsmob (me->get_object ("right-items"));
Item *mincol = 0;
int min_rank = INT_MAX;
for (vsize i = 0; a && i < a->size (); i++)
if (!loose->get_system ())
break;
- Paper_column *le = dynamic_cast<Paper_column *> (unsmob_grob (scm_car (between)));
- Paper_column *re = dynamic_cast<Paper_column *> (unsmob_grob (scm_cdr (between)));
+ Paper_column *le = dynamic_cast<Paper_column *> (Grob::unsmob (scm_car (between)));
+ Paper_column *re = dynamic_cast<Paper_column *> (Grob::unsmob (scm_cdr (between)));
if (! (le && re))
break;
Paper_column *loose_col = dynamic_cast<Paper_column *> (clique[j]);
Paper_column *next_col = dynamic_cast<Paper_column *> (clique[j + 1]);
- Grob *spacing = unsmob_grob (clique_col->get_object ("spacing"));
- if (Grob *grace_spacing = unsmob_grob (clique_col->get_object ("grace-spacing")))
+ Grob *spacing = Grob::unsmob (clique_col->get_object ("spacing"));
+ if (Grob *grace_spacing = Grob::unsmob (clique_col->get_object ("grace-spacing")))
{
spacing = grace_spacing;
}
{
if (Paper_column::is_musical (cols[i]))
{
- Moment *when = unsmob_moment (cols[i]->get_property ("when"));
+ Moment *when = Moment::unsmob (cols[i]->get_property ("when"));
/*
ignore grace notes for shortest notes.
continue;
SCM st = cols[i]->get_property ("shortest-starter-duration");
- Moment this_shortest = *unsmob_moment (st);
+ Moment this_shortest = *Moment::unsmob (st);
assert (this_shortest.to_bool ());
shortest_in_measure = min (shortest_in_measure, this_shortest.main_part_);
}
SCM bsd = me->get_property ("base-shortest-duration");
Rational d = Rational (1, 8);
- if (Moment *m = unsmob_moment (bsd))
+ if (Moment *m = Moment::unsmob (bsd))
d = m->main_part_;
if (max_idx != VPOS)
if (found_matching_column && Note_spacing::has_interface (wish))
{
Real inc = options->increment_;
- Grob *gsp = unsmob_grob (left_col->get_object ("grace-spacing"));
+ Grob *gsp = Grob::unsmob (left_col->get_object ("grace-spacing"));
if (gsp && Paper_column::when_mom (left_col).grace_part_)
{
Spacing_options grace_opts;
Moment dt
= Paper_column::when_mom (next) - Paper_column::when_mom (col);
- Moment *len = unsmob_moment (left->get_property ("measure-length"));
+ Moment *len = Moment::unsmob (left->get_property ("measure-length"));
if (!len)
return false;
programming_error ("At least one vertical axis group needs to be created in the first time step.");
return;
}
- Grob *vertical_alignment = Grob::get_root_vertical_alignment (unsmob_grob (scm_caar (axis_groups_)));
+ Grob *vertical_alignment = Grob::get_root_vertical_alignment (Grob::unsmob (scm_caar (axis_groups_)));
if (!vertical_alignment) // we are at the beginning of a score, so no need for stubs
return;
vector<bool> keep_extent;
for (SCM s = axis_groups_; scm_is_pair (s); s = scm_cdr (s))
{
- Context *c = unsmob_context (scm_cdar (s));
- Grob *g = unsmob_grob (scm_caar (s));
+ Context *c = Context::unsmob (scm_cdar (s));
+ Grob *g = Grob::unsmob (scm_caar (s));
if (!c || !g)
continue;
if (c->is_removable ())
SCM axis_groups = SCM_EOL;
for (SCM s = axis_groups_; scm_is_pair (s); s = scm_cdr (s))
{
- Context *c = unsmob_context (scm_cdar (s));
- Grob *g = unsmob_grob (scm_caar (s));
+ Context *c = Context::unsmob (scm_cdar (s));
+ Grob *g = Grob::unsmob (scm_caar (s));
if (!c || !g)
continue;
if (c->is_removable ())
"Return broken-into list for @var{spanner}.")
{
LY_ASSERT_TYPE (unsmob_spanner, spanner, 1);
- Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (spanner));
+ Spanner *me = dynamic_cast<Spanner *> (Grob::unsmob (spanner));
SCM s = SCM_EOL;
for (vsize i = me->broken_intos_.size (); i--;)
1, 0, 0, (SCM g),
"Is @var{g} a spanner object?")
{
- Grob *me = unsmob_grob (g);
+ Grob *me = Grob::unsmob (g);
bool b = dynamic_cast<Spanner *> (me);
return ly_bool2scm (b);
SCM
Spanner::set_spacing_rods (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
SCM num_length = me->get_property ("minimum-length");
if (scm_is_number (num_length))
{
Spanner *
unsmob_spanner (SCM s)
{
- return dynamic_cast<Spanner *> (unsmob_grob (s));
+ return dynamic_cast<Spanner *> (Grob::unsmob (s));
}
MAKE_SCHEME_CALLBACK (Spanner, bounds_width, 1);
LY_ASSERT_SMOB (Spring, spring, 1);
LY_ASSERT_TYPE (scm_is_number, strength, 2);
- Spring *s = unsmob_spring (spring);
+ Spring *s = Spring::unsmob (spring);
s->set_inverse_compress_strength (scm_to_double (strength));
return s->smobbed_copy ();
}
LY_ASSERT_SMOB (Spring, spring, 1);
LY_ASSERT_TYPE (scm_is_number, strength, 2);
- Spring *s = unsmob_spring (spring);
+ Spring *s = Spring::unsmob (spring);
s->set_inverse_stretch_strength (scm_to_double (strength));
return s->smobbed_copy ();
}
if (Page_layout_problem::is_spaceable (*i)
&& ((pure && !Hara_kiri_group_spanner::request_suicide (*i, start, end))
|| (!pure && (*i)->is_live ())))
- return me == unsmob_grob ((*i)->get_object ("staff-grouper"));
+ return me == Grob::unsmob ((*i)->get_object ("staff-grouper"));
// If there was no spaceable, living child after me, I don't
// count as within the group.
{
span_ = make_spanner ("StaffSymbol", SCM_EOL);
span_->set_bound (LEFT,
- unsmob_grob (get_property ("currentCommandColumn")));
+ Grob::unsmob (get_property ("currentCommandColumn")));
}
}
return;
if (!finished_span_->get_bound (RIGHT))
- finished_span_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
+ finished_span_->set_bound (RIGHT, Grob::unsmob (get_property ("currentCommandColumn")));
announce_end_grob (finished_span_,
span_events_[STOP]
"Return the Y-position of @var{sg} relative to the staff.")
{
LY_ASSERT_SMOB (Grob, sg, 1);
- Grob *g = unsmob_grob (sg);
+ Grob *g = Grob::unsmob (sg);
Real pos = Staff_symbol_referencer::get_position (g);
if (fabs (rint (pos) - pos) < 1e-6) // ugh.
{
LY_ASSERT_SMOB (Grob, sg, 1);
LY_ASSERT_TYPE (scm_is_number, spos, 2);
- Grob *g = unsmob_grob (sg);
+ Grob *g = Grob::unsmob (sg);
Grob *st = Staff_symbol_referencer::get_staff_symbol (g);
int pos = scm_to_int (spos);
bool on_line = st ? Staff_symbol::on_line (g, pos) : false;
" current staff-space height.")
{
LY_ASSERT_SMOB (Grob, grob, 1);
- Grob *g = unsmob_grob (grob);
+ Grob *g = Grob::unsmob (grob);
Real thickness = Staff_symbol_referencer::line_thickness (g);
return scm_from_double (thickness);
}
" five-line staff.")
{
LY_ASSERT_SMOB (Grob, grob, 1);
- Grob *g = unsmob_grob (grob);
+ Grob *g = Grob::unsmob (grob);
Real staff_space = Staff_symbol_referencer::staff_space (g);
return scm_from_double (staff_space);
}
" @var{grob}.")
{
LY_ASSERT_SMOB (Grob, grob, 1);
- Grob *g = unsmob_grob (grob);
+ Grob *g = Grob::unsmob (grob);
Real staff_radius = Staff_symbol_referencer::staff_radius (g);
return scm_from_double (staff_radius);
}
return me;
SCM st = me->get_object ("staff-symbol");
- return unsmob_grob (st);
+ return Grob::unsmob (st);
}
Real
SCM
Staff_symbol_referencer::callback (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
SCM pos = me->get_property ("staff-position");
Real off = 0.0;
SCM
Staff_symbol::print (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Spanner *sp = dynamic_cast<Spanner *> (me);
Grob *common
= sp->get_bound (LEFT)->common_refpoint (sp->get_bound (RIGHT), X_AXIS);
SCM
Staff_symbol::height (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Real t = me->layout ()->get_dimension (ly_symbol2scm ("line-thickness"));
t *= robust_scm2double (me->get_property ("thickness"), 1.0);
for a note head is always <= 2.
*/
Stream_event *ev = gi.event_cause ();
- Duration *dur = unsmob_duration (ev->get_property ("duration"));
+ Duration *dur = Duration::unsmob (ev->get_property ("duration"));
int tremolo_flags = intlog2 (requested_type) - 2
- (dur->duration_log () > 2 ? dur->duration_log () - 2 : 0);
Stream_event *cause = gi.event_cause ();
if (!cause)
return;
- Duration *d = unsmob_duration (cause->get_property ("duration"));
+ Duration *d = Duration::unsmob (cause->get_property ("duration"));
if (!d)
return;
Stem_engraver::kill_unused_flags ()
{
for (vsize i = 0; i < maybe_flags_.size (); i++)
- if (unsmob_grob (maybe_flags_[i]->get_parent (X_AXIS)->get_object ("beam")))
+ if (Grob::unsmob (maybe_flags_[i]->get_parent (X_AXIS)->get_object ("beam")))
maybe_flags_[i]->suicide ();
}
SCM
Stem_tremolo::calc_slope (SCM smob)
{
- Grob *me = unsmob_grob (smob);
- Grob *stem = unsmob_grob (me->get_object ("stem"));
+ Grob *me = Grob::unsmob (smob);
+ Grob *stem = Grob::unsmob (me->get_object ("stem"));
Spanner *beam = Stem::get_beam (stem);
if (beam)
SCM
Stem_tremolo::calc_width (SCM smob)
{
- Grob *me = unsmob_grob (smob);
- Grob *stem = unsmob_grob (me->get_object ("stem"));
+ Grob *me = Grob::unsmob (smob);
+ Grob *stem = Grob::unsmob (me->get_object ("stem"));
Direction dir = get_grob_direction (me);
bool beam = Stem::get_beam (stem);
bool flag = Stem::duration_log (stem) >= 3 && !beam;
SCM
Stem_tremolo::calc_style (SCM smob)
{
- Grob *me = unsmob_grob (smob);
- Grob *stem = unsmob_grob (me->get_object ("stem"));
+ Grob *me = Grob::unsmob (smob);
+ Grob *stem = Grob::unsmob (me->get_object ("stem"));
Direction dir = get_grob_direction (me);
bool beam = Stem::get_beam (stem);
bool flag = Stem::duration_log (stem) >= 3 && !beam;
Real
Stem_tremolo::get_beam_translation (Grob *me)
{
- Grob *stem = unsmob_grob (me->get_object ("stem"));
+ Grob *stem = Grob::unsmob (me->get_object ("stem"));
Spanner *beam = Stem::get_beam (stem);
return (beam && beam->is_live ())
SCM
Stem_tremolo::width (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
/*
Cannot use the real slope, since it looks at the Beam.
Stencil
Stem_tremolo::untranslated_stencil (Grob *me, Real slope)
{
- Grob *stem = unsmob_grob (me->get_object ("stem"));
+ Grob *stem = Grob::unsmob (me->get_object ("stem"));
if (!stem)
{
programming_error ("no stem for stem-tremolo");
SCM
Stem_tremolo::calc_y_offset (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
return scm_from_double (y_offset (me, false));
}
SCM, /* start */
SCM /* end */)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
return scm_from_double (y_offset (me, true));
}
SCM
Stem_tremolo::print (SCM grob)
{
- Grob *me = unsmob_grob (grob);
+ Grob *me = Grob::unsmob (grob);
Stencil s = untranslated_stencil (me, robust_scm2double (me->get_property ("slope"), 0.25));
return s.smobbed_copy ();
// todo: margins
Direction d = get_grob_direction (me);
- Grob *beam = unsmob_grob (me->get_object ("beam"));
+ Grob *beam = Grob::unsmob (me->get_object ("beam"));
if (d && d * head_positions (me)[get_grob_direction (me)] >= se * d)
me->warning (_ ("weird stem size, check for narrow beams"));
SCM /* start */,
SCM /* end */)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
return ly_interval2scm (internal_pure_height (me, true));
}
if (!is_normal_stem (me))
return Interval (0.0, 0.0);
- Grob *beam = unsmob_grob (me->get_object ("beam"));
+ Grob *beam = Grob::unsmob (me->get_object ("beam"));
Interval iv = internal_height (me, false);
SCM
Stem::calc_stem_end_position (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
return scm_from_double (internal_calc_stem_end_position (me, true));
}
SCM, /* start */
SCM /* end */)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
return scm_from_double (internal_calc_stem_end_position (me, false));
}
length *= robust_scm2double (me->get_property ("length-fraction"), 1.0);
/* Tremolo stuff. */
- Grob *t_flag = unsmob_grob (me->get_object ("tremolo-flag"));
- if (t_flag && (!unsmob_grob (me->get_object ("beam")) || !calc_beam))
+ Grob *t_flag = Grob::unsmob (me->get_object ("tremolo-flag"));
+ if (t_flag && (!Grob::unsmob (me->get_object ("beam")) || !calc_beam))
{
/* Crude hack: add extra space if tremolo flag is there.
SCM
Stem::calc_positioning_done (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
if (!head_count (me))
return SCM_BOOL_T;
SCM
Stem::calc_direction (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Direction dir = CENTER;
- if (Grob *beam = unsmob_grob (me->get_object ("beam")))
+ if (Grob *beam = Grob::unsmob (me->get_object ("beam")))
{
SCM ignore_me = beam->get_property ("direction");
(void) ignore_me;
SCM
Stem::calc_default_direction (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Direction dir = CENTER;
int staff_center = 0;
SCM
Stem::height (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
return ly_interval2scm (internal_height (me, true));
}
Real
Stem::beam_end_corrective (Grob *me)
{
- Grob *beam = unsmob_grob (me->get_object ("beam"));
+ Grob *beam = Grob::unsmob (me->get_object ("beam"));
Direction dir = get_grob_direction (me);
if (beam)
{
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 && !unsmob_stencil (me->get_property ("stencil")))
+ if (calc_beam && !beam && !Stencil::unsmob (me->get_property ("stencil")))
return Interval ();
Real y1 = robust_scm2double ((calc_beam
SCM
Stem::width (SCM e)
{
- Grob *me = unsmob_grob (e);
+ Grob *me = Grob::unsmob (e);
Interval r;
SCM
Stem::calc_stem_begin_position (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
return scm_from_double (internal_calc_stem_begin_position (me, true));
}
SCM, /* start */
SCM /* end */)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
return scm_from_double (internal_calc_stem_begin_position (me, false));
}
SCM
Stem::pure_calc_length (SCM smob, SCM /*start*/, SCM /*end*/)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Real beg = robust_scm2double (me->get_pure_property ("stem-begin-position", 0, INT_MAX), 0.0);
Real res = fabs (internal_calc_stem_end_position (me, false) - beg);
return scm_from_double (res);
SCM
Stem::calc_length (SCM smob)
{
- Grob *me = unsmob_grob (smob);
- if (unsmob_grob (me->get_object ("beam")))
+ Grob *me = Grob::unsmob (smob);
+ if (Grob::unsmob (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);
/* TODO: make the stem start a direction ?
This is required to avoid stems passing in tablature chords. */
Grob *lh = get_reference_head (me);
- Grob *beam = unsmob_grob (me->get_object ("beam"));
+ Grob *beam = Grob::unsmob (me->get_object ("beam"));
if (!lh && !beam)
return false;
SCM
Stem::print (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
if (!is_valid_stem (me))
return SCM_EOL;
SCM
Stem::offset_callback (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
extract_grob_set (me, "rests", rests);
if (rests.size ())
Stem::get_beam (Grob *me)
{
SCM b = me->get_object ("beam");
- return dynamic_cast<Spanner *> (unsmob_grob (b));
+ return dynamic_cast<Spanner *> (Grob::unsmob (b));
}
Stem_info
SCM
Stem::calc_stem_info (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Direction my_dir = get_grob_direction (me);
if (!my_dir)
: 0.0);
Real height_of_my_trem = 0.0;
- Grob *trem = unsmob_grob (me->get_object ("tremolo-flag"));
+ Grob *trem = Grob::unsmob (me->get_object ("tremolo-flag"));
if (trem)
{
height_of_my_trem
bool
Stem::is_cross_staff (Grob *stem)
{
- Grob *beam = unsmob_grob (stem->get_object ("beam"));
+ Grob *beam = Grob::unsmob (stem->get_object ("beam"));
return beam && Beam::is_cross_staff (beam);
}
SCM
Stem::calc_cross_staff (SCM smob)
{
- return scm_from_bool (is_cross_staff (unsmob_grob (smob)));
+ return scm_from_bool (is_cross_staff (Grob::unsmob (smob)));
}
Grob *
Stem::flag (Grob *me)
{
- return unsmob_grob (me->get_object ("flag"));
+ return Grob::unsmob (me->get_object ("flag"));
}
/* FIXME: Too many properties */
make_named_glyph_boxes (vector<Box> &boxes, vector<Drul_array<Offset> > &buildings, PangoMatrix trans, SCM expr)
{
SCM fm_scm = scm_car (expr);
- Font_metric *fm = unsmob_metrics (fm_scm);
+ Font_metric *fm = Font_metric::unsmob (fm_scm);
expr = scm_cdr (expr);
SCM glyph = scm_car (expr);
string glyph_s = ly_scm2string (glyph);
make_glyph_string_boxes (vector<Box> &boxes, vector<Drul_array<Offset> > &buildings, PangoMatrix trans, SCM expr)
{
SCM fm_scm = scm_car (expr);
- Font_metric *fm = unsmob_metrics (fm_scm);
+ Font_metric *fm = Font_metric::unsmob (fm_scm);
expr = scm_cdr (expr);
expr = scm_cdr (expr); // font-name
expr = scm_cdr (expr); // size
SCM
Grob::pure_simple_vertical_skylines_from_extents (SCM smob, SCM begscm, SCM endscm)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
int beg = robust_scm2int (begscm, 0);
int end = robust_scm2int (endscm, INT_MAX);
// We cannot measure the widths before line breaking,
SCM
Grob::simple_vertical_skylines_from_extents (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
return maybe_pure_internal_simple_skylines_from_extents (me, X_AXIS, false, 0, 0, false, false);
}
SCM
Grob::pure_simple_horizontal_skylines_from_extents (SCM smob, SCM begscm, SCM endscm)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
int beg = robust_scm2int (begscm, 0);
int end = robust_scm2int (endscm, INT_MAX);
// If the grob is cross staff, we cannot measure its Y-extent before
SCM
Grob::simple_horizontal_skylines_from_extents (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
// See comment in function above.
return maybe_pure_internal_simple_skylines_from_extents (me, Y_AXIS, false, 0, 0, false, to_boolean (me->get_property ("cross-staff")));
}
SCM
Stencil::skylines_from_stencil (SCM sten, Real pad, Axis a)
{
- Stencil *s = unsmob_stencil (sten);
+ Stencil *s = Stencil::unsmob (sten);
if (!s)
return Skyline_pair ().smobbed_copy ();
SCM
Grob::vertical_skylines_from_stencil (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Real pad = robust_scm2double (me->get_property ("skyline-horizontal-padding"), 0.0);
SCM out = Stencil::skylines_from_stencil (me->get_property ("stencil"), pad, X_AXIS);
SCM
Grob::horizontal_skylines_from_stencil (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Real pad = robust_scm2double (me->get_property ("skyline-vertical-padding"), 0.0);
SCM out = Stencil::skylines_from_stencil (me->get_property ("stencil"), pad, Y_AXIS);
SCM
Grob::vertical_skylines_from_element_stencils (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
return internal_skylines_from_element_stencils (me, X_AXIS, false, 0, INT_MAX);
}
SCM
Grob::horizontal_skylines_from_element_stencils (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
return internal_skylines_from_element_stencils (me, Y_AXIS, false, 0, INT_MAX);
}
SCM
Grob::pure_vertical_skylines_from_element_stencils (SCM smob, SCM beg_scm, SCM end_scm)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
int beg = robust_scm2int (beg_scm, 0);
int end = robust_scm2int (end_scm, 0);
return internal_skylines_from_element_stencils (me, X_AXIS, true, beg, end);
SCM
Grob::pure_horizontal_skylines_from_element_stencils (SCM smob, SCM beg_scm, SCM end_scm)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
int beg = robust_scm2int (beg_scm, 0);
int end = robust_scm2int (end_scm, 0);
return internal_skylines_from_element_stencils (me, Y_AXIS, true, beg, end);
"Return a copy of @var{stil} but translated by @var{amount}"
" in @var{axis} direction.")
{
- Stencil *s = unsmob_stencil (stil);
+ Stencil *s = Stencil::unsmob (stil);
LY_ASSERT_SMOB (Stencil, stil, 1);
LY_ASSERT_TYPE (scm_is_number, amount, 2);
SCM new_s = s->smobbed_copy ();
scm_remember_upto_here_1 (stil);
- Stencil *q = unsmob_stencil (new_s);
+ Stencil *q = Stencil::unsmob (new_s);
q->translate_axis (real_amount, Axis (scm_to_int (axis)));
return new_s;
}
"Return a @var{stil}, but translated by @var{offset}"
" (a pair of numbers).")
{
- Stencil *s = unsmob_stencil (stil);
+ Stencil *s = Stencil::unsmob (stil);
LY_ASSERT_SMOB (Stencil, stil, 1);
LY_ASSERT_TYPE (is_number_pair, offset, 2);
Offset o = ly_scm2offset (offset);
SCM new_s = s->smobbed_copy ();
scm_remember_upto_here_1 (stil);
- Stencil *q = unsmob_stencil (new_s);
+ Stencil *q = Stencil::unsmob (new_s);
q->translate (o);
return new_s;
}
1, 0, 0, (SCM stil),
"Return the expression of @var{stil}.")
{
- Stencil *s = unsmob_stencil (stil);
+ Stencil *s = Stencil::unsmob (stil);
LY_ASSERT_SMOB (Stencil, stil, 1);
return s->expr ();
}
" @var{axis} direction (@code{0} or @code{1} for x and"
" y@tie{}axis, respectively).")
{
- Stencil *s = unsmob_stencil (stil);
+ Stencil *s = Stencil::unsmob (stil);
LY_ASSERT_SMOB (Stencil, stil, 1);
LY_ASSERT_TYPE (is_axis, axis, 2);
" @var{axis} is supplied, the emptiness check is"
" restricted to that axis.")
{
- Stencil *s = unsmob_stencil (stil);
+ Stencil *s = Stencil::unsmob (stil);
LY_ASSERT_SMOB (Stencil, stil, 1);
if (SCM_UNBNDP (axis))
return scm_from_bool (s->is_empty ());
" space. @var{first} and @var{second} may also be @code{'()} or"
" @code{#f}.")
{
- Stencil *s1 = unsmob_stencil (first);
- Stencil *s2 = unsmob_stencil (second);
+ Stencil *s1 = Stencil::unsmob (first);
+ Stencil *s2 = Stencil::unsmob (second);
Stencil result;
SCM_ASSERT_TYPE (s1 || first == SCM_BOOL_F || first == SCM_EOL,
" apart at least by this distance. If either of the stencils"
" is spacing, @var{padding} and @var{mindist} do not apply.")
{
- Stencil *s1 = unsmob_stencil (first);
- Stencil *s2 = unsmob_stencil (second);
+ Stencil *s1 = Stencil::unsmob (first);
+ Stencil *s2 = Stencil::unsmob (second);
Stencil result;
SCM_ASSERT_TYPE (s1 || first == SCM_BOOL_F || first == SCM_EOL,
while (!SCM_NULLP (args))
{
- Stencil *s = unsmob_stencil (scm_car (args));
+ Stencil *s = Stencil::unsmob (scm_car (args));
if (!s)
SCM_ASSERT_TYPE (s, scm_car (args), SCM_ARGn, __FUNCTION__, "Stencil");
LY_ASSERT_TYPE (is_axis, axis, 2);
LY_ASSERT_TYPE (scm_is_number, dir, 3);
- Stencil target = *unsmob_stencil (stil);
+ Stencil target = *Stencil::unsmob (stil);
target.align_to ((Axis)scm_to_int (axis),
scm_to_double (dir));
" in@tie{}@var{s}.")
{
LY_ASSERT_SMOB (Stencil, s, 1);
- Stencil *stil = unsmob_stencil (s);
+ Stencil *stil = Stencil::unsmob (s);
return find_expression_fonts (stil->expr ());
}
"Put @var{stc} in a different color.")
{
LY_ASSERT_SMOB (Stencil, stc, 1);
- Stencil *stil = unsmob_stencil (stc);
+ Stencil *stil = Stencil::unsmob (stc);
return Stencil (stil->extent_box (),
scm_list_3 (ly_symbol2scm ("color"),
scm_list_3 (r, g, b),
" the relative offset (@var{x}, @var{y}). E.g., an offset of"
" (-1, 1) will rotate the stencil around the left upper corner.")
{
- Stencil *s = unsmob_stencil (stil);
+ Stencil *s = Stencil::unsmob (stil);
LY_ASSERT_SMOB (Stencil, stil, 1);
LY_ASSERT_TYPE (scm_is_number, angle, 2);
LY_ASSERT_TYPE (scm_is_number, x, 3);
Real y_off = scm_to_double (y);
SCM new_s = s->smobbed_copy ();
- Stencil *q = unsmob_stencil (new_s);
+ Stencil *q = Stencil::unsmob (new_s);
q->rotate_degrees (a, Offset (x_off, y_off));
return new_s;
}
"Return a stencil @var{stil} rotated @var{angle} degrees around"
" point (@var{x}, @var{y}), given in absolute coordinates.")
{
- Stencil *s = unsmob_stencil (stil);
+ Stencil *s = Stencil::unsmob (stil);
LY_ASSERT_SMOB (Stencil, stil, 1);
LY_ASSERT_TYPE (scm_is_number, angle, 2);
LY_ASSERT_TYPE (scm_is_number, x, 3);
Real y_off = scm_to_double (y);
SCM new_s = s->smobbed_copy ();
- Stencil *q = unsmob_stencil (new_s);
+ Stencil *q = Stencil::unsmob (new_s);
q->rotate_degrees_absolute (a, Offset (x_off, y_off));
return new_s;
}
"Scale @var{stil} using the horizontal and vertical scaling"
" factors @var{x} and @var{y}.")
{
- Stencil *s = unsmob_stencil (stil);
+ Stencil *s = Stencil::unsmob (stil);
LY_ASSERT_SMOB (Stencil, stil, 1);
LY_ASSERT_TYPE (scm_is_number, x, 2);
LY_ASSERT_TYPE (scm_is_number, y, 3);
SCM new_s = s->smobbed_copy ();
- Stencil *q = unsmob_stencil (new_s);
+ Stencil *q = Stencil::unsmob (new_s);
q->scale (scm_to_double (x), scm_to_double (y));
return new_s;
SCM prop = scm_car (entry);
SCM val = scm_cdr (entry);
- if ((unsmob_pitch (val)
+ if ((Pitch::unsmob (val)
|| (prop == ly_symbol2scm ("element") && unsmob_music (val))
|| (prop == ly_symbol2scm ("elements") && scm_is_pair (val))
|| (prop == ly_symbol2scm ("pitch-alist") && scm_is_pair (val)))
Stream_event *
unsmob_stream_event (SCM m)
{
- return dynamic_cast<Stream_event *> (unsmob_prob (m));
+ return dynamic_cast<Stream_event *> (Prob::unsmob (m));
}
SCM
Sustain_pedal::print (SCM smob)
{
- Grob *e = unsmob_grob (smob);
+ Grob *e = Grob::unsmob (smob);
Stencil mol;
SCM glyph = e->get_property ("text");
nesting_->from_list (hierarchy);
nesting_->create_grobs (this, delimiter_name);
nesting_->set_bound (LEFT,
- unsmob_grob (get_property ("currentCommandColumn")));
+ Grob::unsmob (get_property ("currentCommandColumn")));
}
}
if (nesting_)
{
nesting_->set_bound (RIGHT,
- unsmob_grob (get_property ("currentCommandColumn")));
+ Grob::unsmob (get_property ("currentCommandColumn")));
nesting_->set_nesting_support (0);
delete nesting_;
System::init_elements ()
{
SCM scm_arr = Grob_array::make_array ();
- all_elements_ = unsmob_grob_array (scm_arr);
+ all_elements_ = Grob_array::unsmob (scm_arr);
all_elements_->set_ordered (false);
set_object ("all-elements", scm_arr);
}
SCM footnote_stl = Text_interface::interpret_markup (pscore_->layout ()->self_scm (),
props, footnote_markup);
- Stencil *footnote_stencil = unsmob_stencil (footnote_stl);
+ Stencil *footnote_stencil = Stencil::unsmob (footnote_stl);
out.push_back (footnote_stencil->extent (Y_AXIS).length ());
}
SCM
System::footnotes_before_line_breaking (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
vector<Grob *> footnotes;
SCM grobs_scm = Grob_array::make_array ();
extract_grob_set (me, "all-elements", elts);
if (elts[i]->internal_has_interface (ly_symbol2scm ("footnote-interface")))
footnotes.push_back (elts[i]);
- unsmob_grob_array (grobs_scm)->set_array (footnotes);
+ Grob_array::unsmob (grobs_scm)->set_array (footnotes);
return grobs_scm;
}
vector_sort (footnote_grobs, grob_2D_less);
SCM grobs_scm = Grob_array::make_array ();
- unsmob_grob_array (grobs_scm)->set_array (footnote_grobs);
+ Grob_array::unsmob (grobs_scm)->set_array (footnote_grobs);
return grobs_scm;
}
SCM
System::vertical_skyline_elements (SCM smob)
{
- Grob *me_grob = unsmob_grob (smob);
+ Grob *me_grob = Grob::unsmob (smob);
vector<Grob *> vertical_skyline_grobs;
extract_grob_set (me_grob, "elements", my_elts);
for (vsize i = 0; i < my_elts.size (); i++)
vertical_skyline_grobs.push_back (my_elts[i]);
System *me = dynamic_cast<System *> (me_grob);
- Grob *align = unsmob_grob (me->get_object ("vertical-alignment"));
+ Grob *align = Grob::unsmob (me->get_object ("vertical-alignment"));
if (!align)
{
SCM grobs_scm = Grob_array::make_array ();
- unsmob_grob_array (grobs_scm)->set_array (vertical_skyline_grobs);
+ Grob_array::unsmob (grobs_scm)->set_array (vertical_skyline_grobs);
return grobs_scm;
}
vertical_skyline_grobs.push_back (elts[i]);
SCM grobs_scm = Grob_array::make_array ();
- unsmob_grob_array (grobs_scm)->set_array (vertical_skyline_grobs);
+ Grob_array::unsmob (grobs_scm)->set_array (vertical_skyline_grobs);
return grobs_scm;
}
System::add_column (Paper_column *p)
{
Grob *me = this;
- Grob_array *ga = unsmob_grob_array (me->get_object ("columns"));
+ Grob_array *ga = Grob_array::unsmob (me->get_object ("columns"));
if (!ga)
{
SCM scm_ga = Grob_array::make_array ();
me->set_object ("columns", scm_ga);
- ga = unsmob_grob_array (scm_ga);
+ ga = Grob_array::unsmob (scm_ga);
}
p->set_rank (ga->size ());
pl->set_property ("last-in-score", SCM_BOOL_T);
Interval staff_refpoints;
- if (Grob *align = unsmob_grob (get_object ("vertical-alignment")))
+ if (Grob *align = Grob::unsmob (get_object ("vertical-alignment")))
{
extract_grob_set (align, "elements", staves);
for (vsize i = 0; i < staves.size (); i++)
SCM
System::get_vertical_alignment (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
extract_grob_set (me, "elements", elts);
Grob *ret = 0;
for (vsize i = 0; i < elts.size (); i++)
Grob *
System::get_extremal_staff (Direction dir, Interval const &iv)
{
- Grob *align = unsmob_grob (get_object ("vertical-alignment"));
+ Grob *align = Grob::unsmob (get_object ("vertical-alignment"));
if (!align)
return 0;
Grob *
System::get_neighboring_staff (Direction dir, Grob *vertical_axis_group, Interval_t<int> bounds)
{
- Grob *align = unsmob_grob (get_object ("vertical-alignment"));
+ Grob *align = Grob::unsmob (get_object ("vertical-alignment"));
if (!align)
return 0;
System::pure_refpoint_extent (vsize start, vsize end)
{
Interval ret;
- Grob *alignment = unsmob_grob (get_object ("vertical-alignment"));
+ Grob *alignment = Grob::unsmob (get_object ("vertical-alignment"));
if (!alignment)
return Interval ();
Interval
System::part_of_line_pure_height (vsize start, vsize end, bool begin)
{
- Grob *alignment = unsmob_grob (get_object ("vertical-alignment"));
+ Grob *alignment = Grob::unsmob (get_object ("vertical-alignment"));
if (!alignment)
return Interval ();
SCM
System::calc_pure_relevant_grobs (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
extract_grob_set (me, "elements", elts);
vector<Grob *> relevant_grobs;
SCM grobs_scm = Grob_array::make_array ();
- unsmob_grob_array (grobs_scm)->set_array (relevant_grobs);
+ Grob_array::unsmob (grobs_scm)->set_array (relevant_grobs);
return grobs_scm;
}
SCM
System::calc_pure_height (SCM smob, SCM start_scm, SCM end_scm)
{
- System *me = dynamic_cast<System *> (unsmob_grob (smob));
+ System *me = dynamic_cast<System *> (Grob::unsmob (smob));
int start = scm_to_int (start_scm);
int end = scm_to_int (end_scm);
static SCM
get_maybe_spaceable_staves (SCM smob, int filter)
{
- System *me = dynamic_cast<System *> (unsmob_grob (smob));
- Grob *align = unsmob_grob (me->get_object ("vertical_alignment"));
+ System *me = dynamic_cast<System *> (Grob::unsmob (smob));
+ Grob *align = Grob::unsmob (me->get_object ("vertical_alignment"));
SCM ret = SCM_EOL;
if (align)
Tempo_performer::process_music ()
{
SCM w = get_property ("tempoWholesPerMinute");
- if (unsmob_moment (w)
+ if (Moment::unsmob (w)
&& !ly_is_equal (w, last_tempo_))
{
- Rational r = unsmob_moment (w)->main_part_;
+ Rational r = Moment::unsmob (w)->main_part_;
r *= Rational (4, 1);
audio_ = new Audio_tempo (r.to_int ());
extract_grob_set (info.grob (), "note-heads", heads);
Grob *x_parent = (heads.size ()
? info.grob ()
- : unsmob_grob (info.grob ()->get_object ("rest")));
+ : Grob::unsmob (info.grob ()->get_object ("rest")));
for (vsize i = 0; i < scripts_.size (); i++)
{
LY_ASSERT_TYPE (scm_is_string, markup, 3);
string str = ly_scm2string (markup);
- Output_def *layout = unsmob_output_def (layout_smob);
+ Output_def *layout = Output_def::unsmob (layout_smob);
Font_metric *fm = select_encoded_font (layout, props);
replace_special_characters (str, props);
SCM
Text_interface::print (SCM grob)
{
- Grob *me = unsmob_grob (grob);
+ Grob *me = Grob::unsmob (grob);
SCM t = me->get_property ("text");
SCM chain = Font_interface::text_font_alist_chain (me);
{
if (!finished_->get_bound (RIGHT))
{
- Grob *e = unsmob_grob (get_property ("currentMusicalColumn"));
+ Grob *e = Grob::unsmob (get_property ("currentMusicalColumn"));
finished_->set_bound (RIGHT, e);
}
finished_ = 0;
{
if (span_ && !span_->get_bound (LEFT))
{
- Grob *e = unsmob_grob (get_property ("currentMusicalColumn"));
+ Grob *e = Grob::unsmob (get_property ("currentMusicalColumn"));
span_->set_bound (LEFT, e);
}
SCM
Tie_column::before_line_breaking (SCM smob)
{
- Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
+ Spanner *me = dynamic_cast<Spanner *> (Grob::unsmob (smob));
for (SCM s = me->get_property ("ties"); scm_is_pair (s); s = scm_cdr (s))
{
- Spanner *tie = dynamic_cast<Spanner *> (unsmob_grob (scm_car (s)));
+ Spanner *tie = dynamic_cast<Spanner *> (Grob::unsmob (scm_car (s)));
for (LEFT_and_RIGHT (dir))
{
if (dir * tie->get_bound (dir)->get_column ()->get_rank ()
SCM
Tie_column::calc_positioning_done (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
extract_grob_set (me, "ties", ro_ties);
vector<Grob *> ties (ro_ties);
if (!ties.size ())
continue;
if (!stem)
- stem = unsmob_grob (head->get_object ("stem"));
+ stem = Grob::unsmob (head->get_object ("stem"));
Real p = Staff_symbol_referencer::get_position (head);
Interval y ((p - 1) * 0.5 * staff_space,
boxes.push_back (Box (x, y));
}
- Grob *acc = unsmob_grob (heads[i]->get_object ("accidental-grob"));
+ Grob *acc = Grob::unsmob (heads[i]->get_object ("accidental-grob"));
if (acc)
acc->get_property ("stencil"); /* trigger tie-related suicide */
if (!spec.note_head_drul_[d])
continue;
- Grob *stem = unsmob_grob (spec.note_head_drul_[d]->get_object ("stem"));
+ Grob *stem = Grob::unsmob (spec.note_head_drul_[d]->get_object ("stem"));
if (stem
&& Stem::is_normal_stem (stem))
stems[d] = stem;
Direction hd = to_dir (me->get_property ("head-direction"));
return (hd == d)
- ? unsmob_grob (me->get_object ("note-head"))
+ ? Grob::unsmob (me->get_object ("note-head"))
: 0;
}
SCM
Tie::calc_direction (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Grob *yparent = me->get_parent (Y_AXIS);
if ((Tie_column::has_interface (yparent)
|| Semi_tie_column::has_interface (yparent))
- && unsmob_grob_array (yparent->get_object ("ties"))
- // && unsmob_grob_array (yparent->get_object ("ties"))->size () > 1
+ && Grob_array::unsmob (yparent->get_object ("ties"))
+ // && Grob_array::unsmob (yparent->get_object ("ties"))->size () > 1
)
{
/* trigger positioning. */
SCM
Tie::calc_control_points (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Grob *yparent = me->get_parent (Y_AXIS);
if ((Tie_column::has_interface (yparent)
|| Semi_tie_column::has_interface (yparent))
- && unsmob_grob_array (yparent->get_object ("ties")))
+ && Grob_array::unsmob (yparent->get_object ("ties")))
{
extract_grob_set (yparent, "ties", ties);
if (me->original () && ties.size () == 1
SCM
Tie::print (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
SCM cp = me->get_property ("control-points");
string str;
SCM properties = Font_interface::text_font_alist_chain (me);
- Stencil tm = *unsmob_stencil (Text_interface::interpret_markup
+ Stencil tm = *Stencil::unsmob (Text_interface::interpret_markup
(me->layout ()->self_scm (), properties,
annotation));
tm.translate (Offset (b.control_[3][X_AXIS] + 0.5,
SCM
Time_signature::print (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
SCM st = me->get_property ("style");
SCM frac = me->get_property ("fraction");
int n = 4;
SCM sd = Text_interface::interpret_markup (me->layout ()->self_scm (), chain,
ly_string2scm (::to_string (den)));
- Stencil n = *unsmob_stencil (sn);
- Stencil d = *unsmob_stencil (sd);
+ Stencil n = *Stencil::unsmob (sn);
+ Stencil d = *Stencil::unsmob (sd);
n.align_to (X_AXIS, CENTER);
d.align_to (X_AXIS, CENTER);
void
Timing_translator::initialize ()
{
- Context *timing = unsmob_context (scm_call_2 (ly_lily_module_constant ("ly:context-find"),
+ Context *timing = Context::unsmob (scm_call_2 (ly_lily_module_constant ("ly:context-find"),
context ()->self_scm (),
ly_symbol2scm ("Timing")));
if (timing != context ())
SCM measureLength = timing->get_property ("measureLength");
- if (!unsmob_moment (measureLength))
+ if (!Moment::unsmob (measureLength))
{
measureLength =
Moment (ly_scm2rational
context ()->set_property ("beamExceptions", beamExceptions);
SCM baseMoment = timing->get_property ("baseMoment");
- if (!unsmob_moment (baseMoment))
+ if (!Moment::unsmob (baseMoment))
{
baseMoment =
Moment (ly_scm2rational
{
beatStructure =
scm_call_3 (ly_lily_module_constant ("beat-structure"),
- ly_rational2scm (unsmob_moment (baseMoment)->main_part_),
+ ly_rational2scm (Moment::unsmob (baseMoment)->main_part_),
timeSignatureFraction,
timeSignatureSettings);
}
Timing_translator::measure_length () const
{
SCM l = get_property ("measureLength");
- if (unsmob_moment (l))
- return unsmob_moment (l)->main_part_;
+ if (Moment::unsmob (l))
+ return Moment::unsmob (l)->main_part_;
else
return Rational (1);
}
Moment measposp;
SCM s = get_property ("measurePosition");
- if (unsmob_moment (s))
- measposp = *unsmob_moment (s);
+ if (Moment::unsmob (s))
+ measposp = *Moment::unsmob (s);
else
{
measposp = now;
return 0;
}
- return unsmob_translator (v);
+ return Translator::unsmob (v);
}
for (SCM s = trans_list; scm_is_pair (s); s = scm_cdr (s))
{
Engraver *eng
- = dynamic_cast<Engraver *> (unsmob_translator (scm_car (s)));
+ = dynamic_cast<Engraver *> (Translator::unsmob (scm_car (s)));
if (!eng)
continue;
translator_each (SCM list, Translator_method method)
{
for (SCM p = list; scm_is_pair (p); p = scm_cdr (p))
- (unsmob_translator (scm_car (p))->*method) ();
+ (Translator::unsmob (scm_car (p))->*method) ();
}
void
ly_symbol2scm ("AnnounceNewContext"));
for (SCM tr_list = simple_trans_list_; scm_is_pair (tr_list); tr_list = scm_cdr (tr_list))
{
- Translator *tr = unsmob_translator (scm_car (tr_list));
+ Translator *tr = Translator::unsmob (scm_car (tr_list));
tr->connect_to_context (c);
}
}
{
for (SCM tr_list = simple_trans_list_; scm_is_pair (tr_list); tr_list = scm_cdr (tr_list))
{
- Translator *tr = unsmob_translator (scm_car (tr_list));
+ Translator *tr = Translator::unsmob (scm_car (tr_list));
tr->disconnect_from_context (context_);
}
context_->event_source ()->remove_listener (GET_LISTENER (create_child_translator),
Both filter_performers and filter_engravers used to use a direct dynamic_cast
on the unsmobbed translator to be filtered, i.e.,
- if (dynamic_cast<Performer *> (unsmob_translator (scm_car (*tail))))
+ if (dynamic_cast<Performer *> (Translator::unsmob (scm_car (*tail))))
but this caused mysterious optimisation issues in several GUB builds. See
issue #818 for the background to this change.
Stream_event *ev = unsmob_stream_event (sev);
// get from AnnounceNewContext
SCM cs = ev->get_property ("context");
- Context *new_context = unsmob_context (cs);
- Context_def *def = unsmob_context_def (new_context->get_definition ());
+ Context *new_context = Context::unsmob (cs);
+ Context_def *def = Context_def::unsmob (new_context->get_definition ());
SCM ops = new_context->get_definition_mods ();
SCM trans_names = def->get_translator_names (ops);
for (SCM s = c->children_contexts (); scm_is_pair (s);
s = scm_cdr (s))
- precomputed_recurse_over_translators (unsmob_context (scm_car (s)), idx, dir);
+ precomputed_recurse_over_translators (Context::unsmob (scm_car (s)), idx, dir);
if (tg && dir == UP)
{
for (SCM s = c->children_contexts (); scm_is_pair (s);
s = scm_cdr (s))
- recurse_over_translators (unsmob_context (scm_car (s)), ptr, tg_ptr, dir);
+ recurse_over_translators (Context::unsmob (scm_car (s)), ptr, tg_ptr, dir);
if (tg && dir == UP)
{
{
for (SCM s = simple_trans_list_; scm_is_pair (s); s = scm_cdr (s))
{
- Translator *tr = unsmob_translator (scm_car (s));
+ Translator *tr = Translator::unsmob (scm_car (s));
Translator_void_method_ptr ptrs[TRANSLATOR_METHOD_PRECOMPUTE_COUNT];
tr->fetch_precomputable_methods (ptrs);
" The name is a symbol.")
{
LY_ASSERT_SMOB (Translator, trans, 1);
- Translator *tr = unsmob_translator (trans);
+ Translator *tr = Translator::unsmob (trans);
char const *nm = tr->class_name ();
return ly_symbol2scm (nm);
}
"Return an alist of properties of translator @var{me}.")
{
LY_ASSERT_SMOB (Translator, me, 1);
- Translator *tr = unsmob_translator (me);
+ Translator *tr = Translator::unsmob (me);
return tr->translator_description ();
}
"Return the context of the translator object @var{trans}.")
{
LY_ASSERT_SMOB (Translator, trans, 1);
- Translator *tr = unsmob_translator (trans);
+ Translator *tr = Translator::unsmob (trans);
Context *c = tr->context ();
return c ? c->self_scm () : SCM_BOOL_F;
Moment
get_event_length (Stream_event *e)
{
- Moment *m = unsmob_moment (e->get_property ("length"));
+ Moment *m = Moment::unsmob (e->get_property ("length"));
if (m)
return *m;
else
{
if (!finished_->get_bound (RIGHT))
{
- Grob *e = unsmob_grob (get_property ("currentMusicalColumn"));
+ Grob *e = Grob::unsmob (get_property ("currentMusicalColumn"));
finished_->set_bound (RIGHT, e);
}
finished_ = 0;
{
if (span_ && !span_->get_bound (LEFT))
{
- Grob *e = unsmob_grob (get_property ("currentMusicalColumn"));
+ Grob *e = Grob::unsmob (get_property ("currentMusicalColumn"));
span_->set_bound (LEFT, e);
}
typeset_all ();
if (span_)
{
- Grob *e = unsmob_grob (get_property ("currentCommandColumn"));
+ Grob *e = Grob::unsmob (get_property ("currentCommandColumn"));
span_->set_bound (RIGHT, e);
}
}
Output_def *pap = me->layout ();
- Grob *number_grob = unsmob_grob (me->get_object ("tuplet-number"));
+ Grob *number_grob = Grob::unsmob (me->get_object ("tuplet-number"));
/*
Don't print the bracket when it would be smaller than the number.
= Text_interface::interpret_markup (pap->self_scm (),
properties, text);
- Stencil *edge_text = unsmob_stencil (t);
+ Stencil *edge_text = Stencil::unsmob (t);
edge_text->translate_axis (x_span[d] - x_span[LEFT],
X_AXIS);
edge_stencils[d] = *edge_text;
}
// Check for number-on-bracket collisions
- Grob *number = unsmob_grob (tuplets[i]->get_object ("tuplet-number"));
+ Grob *number = Grob::unsmob (tuplets[i]->get_object ("tuplet-number"));
if (number)
points.push_back (Offset (number->extent (commonx, X_AXIS).center () - x0,
number->extent (commony, Y_AXIS)[dir]));
// assume that if a script is avoiding slurs, it should not get placed
// under a tuplet bracket
- if (unsmob_grob (scripts[i]->get_object ("slur")))
+ if (Grob::unsmob (scripts[i]->get_object ("slur")))
continue;
Interval script_x (scripts[i]->extent (commonx, X_AXIS));
SCM
Tuplet_bracket::calc_direction (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
Direction dir = Tuplet_bracket::get_default_dir (me);
return scm_from_int (dir);
}
SCM
Tuplet_bracket::calc_cross_staff (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
extract_grob_set (me, "note-columns", cols);
extract_grob_set (me, "tuplets", tuplets);
for (vsize i = 0; i < cols.size (); i++)
{
- Grob *stem = unsmob_grob (cols[i]->get_object ("stem"));
+ Grob *stem = Grob::unsmob (cols[i]->get_object ("stem"));
if (stem && to_boolean (stem->get_property ("cross-staff")))
return SCM_BOOL_T;
}
void
Tuplet_iterator::construct_children ()
{
- if (Duration *d = unsmob_duration (get_music ()->get_property ("duration")))
+ if (Duration *d = Duration::unsmob (get_music ()->get_property ("duration")))
spanner_duration_ = d->get_length ();
else
{
spanner_duration_ = music_get_length ();
Moment *mp
- = unsmob_moment (get_outlet ()->get_property ("tupletSpannerDuration"));
+ = Moment::unsmob (get_outlet ()->get_property ("tupletSpannerDuration"));
if (mp)
spanner_duration_ = min (mp->main_part_, spanner_duration_);
}
}
SCM stc_scm = Text_interface::print (smob);
- Stencil *stc = unsmob_stencil (stc_scm);
+ Stencil *stc = Stencil::unsmob (stc_scm);
stc->align_to (X_AXIS, CENTER);
stc->align_to (Y_AXIS, CENTER);
Interval colliding_acc_ext_y;
for (vsize i = 0; i < heads.size (); i++)
- if (Grob *acc = unsmob_grob (heads[i]->get_object ("accidental-grob")))
+ if (Grob *acc = Grob::unsmob (heads[i]->get_object ("accidental-grob")))
{
commony = commony->common_refpoint (acc, Y_AXIS);
Interval acc_ext_y = acc->extent (commony, Y_AXIS);
SCM
Tuplet_number::calc_cross_staff (SCM smob)
{
- Grob *me = unsmob_grob (smob);
- return unsmob_grob (me->get_object ("bracket"))->get_property ("cross-staff");
+ Grob *me = Grob::unsmob (smob);
+ return Grob::unsmob (me->get_object ("bracket"))->get_property ("cross-staff");
}
ADD_INTERFACE (Tuplet_number,
// bitmask based O (1) test); where n=<number of primitives in the
// ligature> (which is typically small (n<10), though).
Stream_event *new_cause = primitive.event_cause ();
- int new_pitch = unsmob_pitch (new_cause->get_property ("pitch"))->steps ();
+ int new_pitch = Pitch::unsmob (new_cause->get_property ("pitch"))->steps ();
for (vsize i = 0; i < augmented_primitives_.size (); i++)
{
Stream_event *cause = augmented_primitives_[i].event_cause ();
- int pitch = unsmob_pitch (cause->get_property ("pitch"))->steps ();
+ int pitch = Pitch::unsmob (cause->get_property ("pitch"))->steps ();
if (pitch == new_pitch)
{
primitive.grob ()->
SCM
Vaticana_ligature::brew_ligature_primitive (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
SCM primitive = vaticana_brew_primitive (me).smobbed_copy ();
return primitive;
}
top_level_ = to_boolean (get_property ("topLevelAlignment"));
valign_ = make_spanner (top_level_ ? "VerticalAlignment" : "StaffGrouper", SCM_EOL);
- valign_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
+ valign_->set_bound (LEFT, Grob::unsmob (get_property ("currentCommandColumn")));
Align_interface::set_ordered (valign_);
}
}
{
if (valign_)
{
- valign_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
+ valign_->set_bound (RIGHT, Grob::unsmob (get_property ("currentCommandColumn")));
valign_ = 0;
}
}
SCM before = scm_hash_ref (id_to_group_hashtab_, before_id, SCM_BOOL_F);
SCM after = scm_hash_ref (id_to_group_hashtab_, after_id, SCM_BOOL_F);
- Grob *before_grob = unsmob_grob (before);
- Grob *after_grob = unsmob_grob (after);
+ Grob *before_grob = Grob::unsmob (before);
+ Grob *after_grob = Grob::unsmob (after);
Align_interface::add_element (valign_, i.grob ());
if (before_grob || after_grob)
{
- Grob_array *ga = unsmob_grob_array (valign_->get_object ("elements"));
+ Grob_array *ga = Grob_array::unsmob (valign_->get_object ("elements"));
vector<Grob *> &arr = ga->array_reference ();
Grob *added = arr.back ();
else if (qualifies (i))
{
Pointer_group_interface::add_grob (valign_, ly_symbol2scm ("elements"), i.grob ());
- if (!unsmob_grob (i.grob ()->get_object ("staff-grouper")))
+ if (!Grob::unsmob (i.grob ()->get_object ("staff-grouper")))
i.grob ()->set_object ("staff-grouper", valign_->self_scm ());
}
}
SCM properties = me->get_property_alist_chain (SCM_EOL);
SCM snum = Text_interface::interpret_markup (layout->self_scm (),
properties, text);
- Stencil num = *unsmob_stencil (snum);
+ Stencil num = *Stencil::unsmob (snum);
num.align_to (Y_AXIS, UP);
num.translate_axis (-0.5, Y_AXIS);
total.add_at_edge (X_AXIS, LEFT, num, - num.extent (X_AXIS).length ()
SCM l (get_property ("voltaSpannerDuration"));
Moment now = now_mom ();
- bool early_stop = unsmob_moment (l)
- && *unsmob_moment (l) <= now - started_mom_;
+ bool early_stop = Moment::unsmob (l)
+ && *Moment::unsmob (l) <= now - started_mom_;
end = end || early_stop;
}
void
Volta_engraver::stop_translation_timestep ()
{
- Grob *cc = unsmob_grob (get_property ("currentCommandColumn"));
+ Grob *cc = Grob::unsmob (get_property ("currentCommandColumn"));
Item *ci = dynamic_cast<Item *> (cc);
if (end_volta_bracket_ && !end_volta_bracket_->get_bound (RIGHT))
if (end_volta_bracket_ && !volta_bracket_)
{
for (SCM s = get_property ("stavesFound"); scm_is_pair (s); s = scm_cdr (s))
- Side_position_interface::add_support (volta_spanner_, unsmob_grob (scm_car (s)));
+ Side_position_interface::add_support (volta_spanner_, Grob::unsmob (scm_car (s)));
volta_spanner_ = 0;
}
while (foe);
squiggle. extent;
- 1 && * unsmob_moment (lf);
+ 1 && * Moment::unsmob (lf);
line_spanner_ = make_spanner ("DynamicLineSpanner", rq ? rq->*self_scm
(): SCM_EOL);
case foo: k;