/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 2008--2014 Han-Wen Nienhuys <hanwen@lilypond.org>
+ Copyright (C) 2008--2015 Han-Wen Nienhuys <hanwen@lilypond.org>
LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
char const *ctxprop)
{
SCM spanner_type = evt->get_property (evprop);
- if (spanner_type == SCM_EOL)
+ if (scm_is_null (spanner_type))
spanner_type = get_property (ctxprop);
return spanner_type;
}
SCM cresc_type = get_property_setting (current_span_event_, "span-type",
(start_type + "Spanner").c_str ());
- if (cresc_type == ly_symbol2scm ("text"))
+ if (scm_is_eq (cresc_type, ly_symbol2scm ("text")))
{
current_spanner_
= make_spanner ("DynamicTextSpanner",
early: this allows dynamics to be spaced individually instead of
being linked together.
*/
- if (current_spanner_->get_property ("style") == ly_symbol2scm ("none"))
+ if (scm_is_eq (current_spanner_->get_property ("style"),
+ ly_symbol2scm ("none")))
current_spanner_->set_property ("spanner-broken", SCM_BOOL_T);
}
else
{
- if (cresc_type != ly_symbol2scm ("hairpin"))
+ if (!scm_is_eq (cresc_type, ly_symbol2scm ("hairpin")))
{
string as_string = ly_scm_write_string (cresc_type);
current_span_event_
}
if (finished_spanner_)
{
- if (Hairpin::has_interface (finished_spanner_))
+ if (has_interface<Hairpin> (finished_spanner_))
Pointer_group_interface::add_grob (finished_spanner_,
ly_symbol2scm ("adjacent-spanners"),
current_spanner_);
- if (Hairpin::has_interface (current_spanner_))
+ if (has_interface<Hairpin> (current_spanner_))
Pointer_group_interface::add_grob (current_spanner_,
ly_symbol2scm ("adjacent-spanners"),
finished_spanner_);
if (finished_spanner_ && !finished_spanner_->get_bound (RIGHT))
finished_spanner_
->set_bound (RIGHT,
- unsmob_grob (get_property ("currentMusicalColumn")));
+ unsmob<Grob> (get_property ("currentMusicalColumn")));
if (current_spanner_ && !current_spanner_->get_bound (LEFT))
current_spanner_
->set_bound (LEFT,
- unsmob_grob (get_property ("currentMusicalColumn")));
+ unsmob<Grob> (get_property ("currentMusicalColumn")));
script_ = 0;
script_event_ = 0;
accepted_spanevents_drul_.set (0, 0);
string type;
SCM start_sym = scm_car (ev->get_property ("class"));
- if (start_sym == ly_symbol2scm ("decrescendo-event"))
+ if (scm_is_eq (start_sym, ly_symbol2scm ("decrescendo-event")))
type = "decrescendo";
- else if (start_sym == ly_symbol2scm ("crescendo-event"))
+ else if (scm_is_eq (start_sym, ly_symbol2scm ("crescendo-event")))
type = "crescendo";
else
programming_error ("unknown dynamic spanner type");
{
extract_grob_set (info.grob (), "note-heads", heads);
/*
- Spacing constraints may require dynamics to be aligned on rests,
+ Spacing constraints may require dynamics to be attached to rests,
so check for a rest if this note column has no note heads.
*/
Grob *x_parent = (heads.size ()
- ? heads[0]
- : unsmob_grob (info.grob ()->get_object ("rest")));
+ ? info.grob ()
+ : unsmob<Grob> (info.grob ()->get_object ("rest")));
if (x_parent)
- {
- script_->set_parent (x_parent, X_AXIS);
- Self_alignment_interface::set_center_parent (script_, X_AXIS);
- }
+ script_->set_parent (x_parent, X_AXIS);
}
if (current_spanner_ && !current_spanner_->get_bound (LEFT))