*/
-MAKE_SCHEME_CALLBACK(Accidental_placement, calc_positioning_done, 1);
+MAKE_SCHEME_CALLBACK (Accidental_placement, calc_positioning_done, 1);
SCM
Accidental_placement::calc_positioning_done (SCM smob)
{
/*
merge with align-to-extents?
*/
-MAKE_SCHEME_CALLBACK(Align_interface, stretch_after_break, 1)
+MAKE_SCHEME_CALLBACK (Align_interface, stretch_after_break, 1)
SCM
Align_interface::stretch_after_break (SCM grob)
{
Direction stacking_dir = robust_scm2dir (me->get_property ("stacking-dir"),
DOWN);
- Real delta = extra_space / elems.size() * stacking_dir;
+ Real delta = extra_space / elems.size () * stacking_dir;
for (vsize i = 0; i < elems.size (); i++)
elems[i]->translate_axis (i * delta, Y_AXIS);
}
(SCM name),
"Load the font @var{name}. ")
{
- LY_ASSERT_TYPE(scm_is_string, name, 1);
+ LY_ASSERT_TYPE (scm_is_string, name, 1);
Font_metric *fm = all_fonts_global->find_font (ly_scm2string (name));
Real total_t = moment_to_real (dynamics_.back ()->get_column ()->when () - start);
- for (vsize i = 1; i < dynamics_.size(); i ++)
+ for (vsize i = 1; i < dynamics_.size (); i ++)
{
Moment dt_moment = dynamics_[i]->get_column ()->when ()
- start;
return 0;
/*
- Can't use make_spanner_from_properties() because we have to use
+ Can't use make_spanner_from_properties () because we have to use
beam_settings_.
*/
Spanner *beam = new Spanner (beam_settings_);
Grob_array *ga = unsmob_grob_array (elements);
SCM_ASSERT_TYPE (ga || scm_is_pair (elements), elements, SCM_ARG1, __FUNCTION__, "list or Grob_array");
- LY_ASSERT_SMOB(Grob, common, 2);
- LY_ASSERT_TYPE(is_axis, axis, 3);
+ LY_ASSERT_SMOB (Grob, common, 2);
+ LY_ASSERT_TYPE (is_axis, axis, 3);
vector<Grob*> elts;
if (!ga)
return common;
}
-MAKE_SCHEME_CALLBACK(Axis_group_interface,calc_x_common, 1);
+MAKE_SCHEME_CALLBACK (Axis_group_interface, calc_x_common, 1);
SCM
Axis_group_interface::calc_x_common (SCM grob)
{
return common->self_scm ();
}
-MAKE_SCHEME_CALLBACK(Axis_group_interface,calc_y_common, 1);
+MAKE_SCHEME_CALLBACK (Axis_group_interface, calc_y_common, 1);
SCM
Axis_group_interface::calc_y_common (SCM grob)
{
class Balloon_engraver : public Engraver
{
- TRANSLATOR_DECLARATIONS(Balloon_engraver);
+ TRANSLATOR_DECLARATIONS (Balloon_engraver);
- DECLARE_TRANSLATOR_LISTENER(annotate_output);
- DECLARE_ACKNOWLEDGER(grob);
+ DECLARE_TRANSLATOR_LISTENER (annotate_output);
+ DECLARE_ACKNOWLEDGER (grob);
vector<Stream_event *> events_;
void stop_translation_timestep ();
-ADD_ACKNOWLEDGER(Balloon_engraver,grob);
+ADD_ACKNOWLEDGER (Balloon_engraver, grob);
-ADD_TRANSLATOR(Balloon_engraver,
+ADD_TRANSLATOR (Balloon_engraver,
"Create balloon texts",
"BalloonTextItem ",
/*read*/ "",
Grob *p = me->get_parent (X_AXIS);
- Offset off(me->relative_coordinate (p, X_AXIS),
+ Offset off (me->relative_coordinate (p, X_AXIS),
me->relative_coordinate (p, Y_AXIS));
Box b (p->extent (p, X_AXIS),
Real bot_y = max ((i - dash_size) * half_space,
-(count-1) * half_space - line_thick/2);
- bar.add_stencil (Lookup::round_filled_box (Box (Interval (0,thick),
+ bar.add_stencil (Lookup::round_filled_box (Box (Interval (0, thick),
Interval (bot_y, top_y)),
blot));
}
s.translate (Offset (thick/2, -h/2));
return s;
}
- return Stencil();
+ return Stencil ();
}
}
-ADD_ACKNOWLEDGER(Bar_number_engraver,break_aligned);
-ADD_ACKNOWLEDGER(Bar_number_engraver,break_alignment);
+ADD_ACKNOWLEDGER (Bar_number_engraver, break_aligned);
+ADD_ACKNOWLEDGER (Bar_number_engraver, break_alignment);
ADD_TRANSLATOR (Bar_number_engraver,
/* doc */ "A bar number is created whenever measurePosition "
if (beam_
&& !scm_is_number (info.grob ()->get_property_data ("staff-position")))
{
- chain_offset_callback (info.grob(),
+ chain_offset_callback (info.grob (),
Beam::rest_collision_callback_proc, Y_AXIS);
}
}
return best_start;
}
-MAKE_SCHEME_CALLBACK(Beam, calc_beaming, 1)
+MAKE_SCHEME_CALLBACK (Beam, calc_beaming, 1)
SCM
Beam::calc_beaming (SCM smob)
{
do
{
bool on_bound = (event_dir == LEFT) ? j == 0 :
- j == segs.size() - 1;
+ j == segs.size () - 1;
bool inside_stem = (event_dir == LEFT)
? segs[j].stem_index_ > 0
if (event_dir == RIGHT)
{
segments.push_back (current);
- current = Beam_segment();
+ current = Beam_segment ();
}
}
while (flip (&event_dir) != LEFT);
return segments;
}
-MAKE_SCHEME_CALLBACK(Beam, print, 1);
+MAKE_SCHEME_CALLBACK (Beam, print, 1);
SCM
Beam::print (SCM grob)
{
-MAKE_SCHEME_CALLBACK(Beam, calc_stem_shorten, 1)
+MAKE_SCHEME_CALLBACK (Beam, calc_stem_shorten, 1)
SCM
Beam::calc_stem_shorten (SCM smob)
{
Hmm. At this time, beam position and slope are determined. Maybe,
stem directions and length should set to relative to the chord's
position of the beam. */
-MAKE_SCHEME_CALLBACK(Beam, set_stem_lengths, 1);
+MAKE_SCHEME_CALLBACK (Beam, set_stem_lengths, 1);
SCM
Beam::set_stem_lengths (SCM smob)
{
de_grace ();
if (infos_[0].start_moment_ < Moment (0))
- for (vsize i = 0; i < infos_.size(); i++)
+ for (vsize i = 0; i < infos_.size (); i++)
infos_[i].start_moment_ += options.measure_length_;
Moment measure_pos (0);
vector<Moment> beat_starts;
SCM grouping = options.grouping_;
- while (measure_pos <= infos_.back().start_moment_)
+ while (measure_pos <= infos_.back ().start_moment_)
{
int count = 2;
if (scm_is_pair (grouping))
vsize j = 0;
vsize k = 0;
- for (vsize i = 0; i < infos_.size(); i++)
+ for (vsize i = 0; i < infos_.size (); i++)
{
- while (j + 1 < group_starts.size()
+ while (j + 1 < group_starts.size ()
&& group_starts[j+1] <= infos_[i].start_moment_)
j++;
infos_[i].group_start_ = group_starts[j];
infos_[i].beat_length_ = options.beat_length_;
- while (k + 1 < beat_starts.size()
+ while (k + 1 < beat_starts.size ()
&& beat_starts[k+1] <= infos_[i].start_moment_)
k++;
- if (k < beat_starts.size())
+ if (k < beat_starts.size ())
infos_[i].beat_start_ = beat_starts[k];
}
slurs. For large slurs, this gives a certain hookiness at the end,
so we increase the indent.
- indent = G(w)
+ indent = G (w)
- w -> 0, G(w) -> .33 w
+ w -> 0, G (w) -> .33 w
(due to derivative constraints, we cannot have indent > len/3)
- w -> inf, G(w) -> 2*h_inf
+ w -> inf, G (w) -> 2*h_inf
i.e.
- G(0) = 0 , G'(0) 1/3, G(infty) = 2h_inf
+ G (0) = 0 , G'(0) 1/3, G (infty) = 2h_inf
solve from
- G(w) = r + p/(w+q)
+ G (w) = r + p/(w+q)
yields
- G(w) = 2 h_inf - max_fraction * q^2/ (w + q)
+ G (w) = 2 h_inf - max_fraction * q^2/ (w + q)
with q = 2 h_inf
*/
}
/*
- Cache binom(3,j) t^j (1-t)^{3-j}
+ Cache binom (3, j) t^j (1-t)^{3-j}
*/
struct Polynomial_cache {
Polynomial terms_[4];
{
Book *book = unsmob_book (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);
+ 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));
"output).")
{
LY_ASSERT_SMOB (Book, book_smob, 1);
- LY_ASSERT_SMOB(Output_def, default_paper, 2);
- LY_ASSERT_SMOB(Output_def, default_layout, 3);
+ LY_ASSERT_SMOB (Output_def, default_paper, 2);
+ LY_ASSERT_SMOB (Output_def, default_layout, 3);
Book *book = unsmob_book (book_smob);
Score *newscore = unsmob_score (scm_car (p))->clone ();
*t = scm_cons (newscore->self_scm (), SCM_EOL);
- t = SCM_CDRLOC(*t);
+ t = SCM_CDRLOC (*t);
newscore->unprotect ();
}
}
Align_interface::add_element (me, toadd);
}
-MAKE_SCHEME_CALLBACK(Break_alignment_interface, calc_positioning_done, 1)
+MAKE_SCHEME_CALLBACK (Break_alignment_interface, calc_positioning_done, 1)
SCM
Break_alignment_interface::calc_positioning_done (SCM smob)
{
-MAKE_SCHEME_CALLBACK(Break_alignable_interface, self_align_callback, 1)
+MAKE_SCHEME_CALLBACK (Break_alignable_interface, self_align_callback, 1)
SCM
Break_alignable_interface::self_align_callback (SCM grob)
{
}
Direction which_edge = LEFT;
- if (vsize (last_idx_found + 1) < elements.size())
+ if (vsize (last_idx_found + 1) < elements.size ())
last_idx_found ++;
else
which_edge = RIGHT;
{
public:
DECLARE_SCHEME_CALLBACK (height, (SCM));
- DECLARE_GROB_INTERFACE();
+ DECLARE_GROB_INTERFACE ();
};
MAKE_SCHEME_CALLBACK (Cluster_beacon, height, 1);
#include "warn.hh"
/*
- We use the following optimal substructure. Let W(A) be our weight function.
+ We use the following optimal substructure. Let W (A) be our weight function.
- Let A_{k,n} = (a_{k,n,1}, ... a_{k,n,k}) be the optimal set of line breaks
- for k systems and n potential breakpoints. a_{k,n,k} = n (it is the end of
+ Let A_{k, n} = (a_{k, n,1}, ... a_{k, n, k}) be the optimal set of line breaks
+ for k systems and n potential breakpoints. a_{k, n, k} = n (it is the end of
the piece)
Then A_{k+1, m} is contructed from
- min_ {k < j < m} ( W(A_{k,j} :: m) )
+ min_ {k < j < m} ( W (A_{k, j} :: m) )
where by A::m we denote appending m to the list A
Indices in the code:
The above algorithm makes it easy to end at a point before the end of the
- score (just find A_{k,m} for some m < breaks_.size () - 1). However, we must
+ score (just find A_{k, m} for some m < breaks_.size () - 1). However, we must
add information for starting at a point after the beginning. One constructor
allows the specification of a list of starting columns, start_. We then have
start_.size () different solution arrays. state_[i] is the array for the
. . . .
. . . .
where the X's mark invalid solutions (can't have more systems than
- breakpoints). Note that each value is of the form a_{x,n,x}. This is because
- a breakpoint of the form a_{x,n,x-1} will also be called a_{x-1,m,x-1} for
+ breakpoints). Note that each value is of the form a_{x, n, x}. This is because
+ a breakpoint of the form a_{x, n, x-1} will also be called a_{x-1, m, x-1} for
some m < n. Each cell in the array stores the value of its m (ie. the
ending breakpoint of the previous line) as "prev_".
- For finding A_{sys, brk}, let "me" be the (sys_count,brk) cell in our
+ For finding A_{sys, brk}, let "me" be the (sys_count, brk) cell in our
solution array (state_[start][sys * rank + brk]).
Then A_{sys, brk} = A_{sys - 1, me.prev_} :: me
return get_best_solution (0, VPOS);
resize (systems_);
- return get_solution(0, VPOS, systems_);
+ return get_solution (0, VPOS, systems_);
}
Column_x_positions
Column_x_positions col;
vector<Grob*> line (all_.begin () + breaks_[i],
- all_.begin() + breaks_[j] + 1);
+ all_.begin () + breaks_[j] + 1);
Interval line_dims = line_dimensions_int (pscore_->layout (), i);
bool last = j == breaks_.size () - 1;
bool ragged = ragged_right || (last && ragged_last);
SCM
Context_def::mark_smob (SCM smob)
{
- ASSERT_LIVE_IS_ALLOWED();
+ ASSERT_LIVE_IS_ALLOWED ();
Context_def *me = (Context_def *) SCM_CELL_WORD_1 (smob);
/*
tack onto alist. We can use set_car, since
- updated_grob_properties() in child contexts will check
+ updated_grob_properties () in child contexts will check
for changes in the car.
*/
if (ok)
Context *tr = unsmob_context (context);
LY_ASSERT_SMOB (Context, context, 1);
- LY_ASSERT_TYPE(ly_is_symbol, name, 2);
+ LY_ASSERT_TYPE (ly_is_symbol, name, 2);
return updated_grob_properties (tr, name);
}
Context *tg = unsmob_context (context);
LY_ASSERT_SMOB (Context, context, 1);
- LY_ASSERT_TYPE(ly_is_symbol, grob, 2);
- LY_ASSERT_TYPE(ly_is_symbol, eltprop, 3);
+ LY_ASSERT_TYPE (ly_is_symbol, grob, 2);
+ LY_ASSERT_TYPE (ly_is_symbol, eltprop, 3);
execute_pushpop_property (tg, grob, eltprop, val);
"Return the value of @var{name} from context @var{c}")
{
LY_ASSERT_SMOB (Context, c, 1);
- LY_ASSERT_TYPE(ly_is_symbol, name, 2);
+ LY_ASSERT_TYPE (ly_is_symbol, name, 2);
Context *t = unsmob_context (c);
return t->internal_get_property (name);
"to @var{val}.")
{
LY_ASSERT_SMOB (Context, context, 1);
- LY_ASSERT_TYPE(ly_is_symbol, name, 2);
+ LY_ASSERT_TYPE (ly_is_symbol, name, 2);
Context *tr = unsmob_context (context);
"where @var{name} is defined.")
{
LY_ASSERT_SMOB (Context, context, 1);
- LY_ASSERT_TYPE(ly_is_symbol,name, 2);
+ LY_ASSERT_TYPE (ly_is_symbol, name, 2);
Context *tr = unsmob_context (context);
"Unset value of property @var{name} in context @var{context}.")
{
LY_ASSERT_SMOB (Context, context, 1);
- LY_ASSERT_TYPE(ly_is_symbol,name, 2);
+ LY_ASSERT_TYPE (ly_is_symbol, name, 2);
Context *tr = unsmob_context (context);
tr->unset_property (name);
"Return @code{#f} if not found.")
{
LY_ASSERT_SMOB (Context, context, 1);
- LY_ASSERT_TYPE(ly_is_symbol,name, 2);
+ LY_ASSERT_TYPE (ly_is_symbol, name, 2);
Context *tr = unsmob_context (context);
while (tr)
Context *a = 0;
- if (to_boolean (get_music()->get_property ("create-new")))
+ if (to_boolean (get_music ()->get_property ("create-new")))
a = get_outlet ()->create_unique_context (ct, c_id, ops);
else
a = get_outlet ()->find_create_context (ct, c_id, ops);
vector<Audio_item*> texts_;
void add_text (Audio_text::Type, string);
- TRANSLATOR_DECLARATIONS(Control_track_performer);
+ TRANSLATOR_DECLARATIONS (Control_track_performer);
protected:
virtual void initialize ();
Dispatcher *f = unsmob_dispatcher (from);
LY_ASSERT_SMOB (Dispatcher, to, 1);
- LY_ASSERT_SMOB(Dispatcher, from, 2);
+ LY_ASSERT_SMOB (Dispatcher, from, 2);
t->register_as_listener (f);
Dispatcher *d = unsmob_dispatcher (disp);
LY_ASSERT_SMOB (Listener, list, 1);
- LY_ASSERT_SMOB(Dispatcher, disp, 2);
+ LY_ASSERT_SMOB (Dispatcher, disp, 2);
for (int arg = SCM_ARG3; scm_is_pair (cl); cl = scm_cdr (cl), arg++)
{
LY_ASSERT_SMOB (Dispatcher, disp, 1);
- LY_ASSERT_SMOB(Stream_event, ev, 2);
+ LY_ASSERT_SMOB (Stream_event, ev, 2);
d->broadcast (e);
return SCM_UNDEFINED;
}
*/
struct { int prio; SCM list; } lists[num_classes+1];
int i = 0;
- for (SCM cl = class_list; scm_is_pair(cl); cl = scm_cdr (cl))
+ for (SCM cl = class_list; scm_is_pair (cl); cl = scm_cdr (cl))
{
SCM list = scm_hashq_ref (listeners_, scm_car (cl), SCM_EOL);
- if (!scm_is_pair(list))
+ if (!scm_is_pair (list))
num_classes--;
else
{
}
// go to the next listener; bubble-sort the class list.
SCM next = scm_cdr (lists[0].list);
- if (!scm_is_pair(next))
+ if (!scm_is_pair (next))
num_classes--;
- int prio = (scm_is_pair(next)) ? scm_to_int (scm_caar (next)) : INT_MAX;
+ int prio = (scm_is_pair (next)) ? scm_to_int (scm_caar (next)) : INT_MAX;
for (i = 0; prio > lists[i+1].prio; i++)
lists[i] = lists[i+1];
lists[i].prio = prio;
{
/* Tell all dispatchers that we listen to, that we want to hear ev_class
events */
- for (SCM disp = dispatchers_; scm_is_pair(disp); disp = scm_cdr (disp))
+ 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));
SCM dummy = scm_cons (SCM_EOL, list);
SCM e = dummy;
- while (scm_is_pair(scm_cdr (e)))
+ while (scm_is_pair (scm_cdr (e)))
if (*unsmob_listener (scm_cdadr (e)) == l && first)
{
- scm_set_cdr_x (e, scm_cddr(e));
+ scm_set_cdr_x (e, scm_cddr (e));
first = false;
break;
}
}
}
-MAKE_SCHEME_CALLBACK(Dot_column, calc_positioning_done, 1);
+MAKE_SCHEME_CALLBACK (Dot_column, calc_positioning_done, 1);
SCM
Dot_column::calc_positioning_done (SCM smob)
{
class Dots_engraver : public Engraver
{
- DECLARE_ACKNOWLEDGER(rhythmic_head);
- TRANSLATOR_DECLARATIONS(Dots_engraver);
+ DECLARE_ACKNOWLEDGER (rhythmic_head);
+ TRANSLATOR_DECLARATIONS (Dots_engraver);
};
Dots_engraver::Dots_engraver ()
}
-ADD_ACKNOWLEDGER(Dots_engraver, rhythmic_head);
+ADD_ACKNOWLEDGER (Dots_engraver, rhythmic_head);
-ADD_TRANSLATOR(Dots_engraver,
+ADD_TRANSLATOR (Dots_engraver,
"Create @ref{Dots} objects for @ref{rhythmic-head-interface}s.",
/* create */
}
Moment len = get_event_length (n);
- if (now_mom().grace_part_)
+ if (now_mom ().grace_part_)
{
len.grace_part_ = len.main_part_;
len.main_part_ = Rational (0);
2, 0, 0, (SCM p1, SCM p2),
"Is @var{p1} shorter than @var{p2}?")
{
- LY_ASSERT_SMOB(Duration, p1, 1);
- LY_ASSERT_SMOB(Duration, p2, 2);
+ LY_ASSERT_SMOB (Duration, p1, 1);
+ LY_ASSERT_SMOB (Duration, p2, 2);
Duration *a = unsmob_duration (p1);
Duration *b = unsmob_duration (p2);
bool compress = false;
if (num != SCM_UNDEFINED)
{
- LY_ASSERT_TYPE (scm_is_number,num, 3);
+ LY_ASSERT_TYPE (scm_is_number, num, 3);
compress = true;
}
else
if (den != SCM_UNDEFINED)
{
- LY_ASSERT_TYPE (scm_is_number,den, 4);
+ LY_ASSERT_TYPE (scm_is_number, den, 4);
compress = true;
}
else
if (span_events_[START])
{
- span_dynamic_ = new Audio_span_dynamic();
+ span_dynamic_ = new Audio_span_dynamic ();
announce_element (Audio_element_info (span_dynamic_, span_events_[START]));
span_dynamic_->grow_dir_ = grow_dir_[START];
struct Enclosing_bracket
{
- DECLARE_GROB_INTERFACE();
+ DECLARE_GROB_INTERFACE ();
public:
- DECLARE_SCHEME_CALLBACK(print, (SCM));
- DECLARE_SCHEME_CALLBACK(width, (SCM));
+ DECLARE_SCHEME_CALLBACK (print, (SCM));
+ DECLARE_SCHEME_CALLBACK (width, (SCM));
};
-ADD_INTERFACE(Enclosing_bracket,
+ADD_INTERFACE (Enclosing_bracket,
"Brackets alongside bass figures.",
else
continue;
- SCM acklist = scm_hashq_ref (acknowledge_hash_table_drul_[info.start_end()],
+ SCM acklist = scm_hashq_ref (acknowledge_hash_table_drul_[info.start_end ()],
nm, SCM_BOOL_F);
Engraver_dispatch_list *dispatch
struct Figured_bass_continuation
{
- DECLARE_GROB_INTERFACE();
+ DECLARE_GROB_INTERFACE ();
public:
- DECLARE_SCHEME_CALLBACK(print, (SCM));
- DECLARE_SCHEME_CALLBACK(center_on_figures, (SCM));
+ DECLARE_SCHEME_CALLBACK (print, (SCM));
+ DECLARE_SCHEME_CALLBACK (center_on_figures, (SCM));
};
MAKE_SCHEME_CALLBACK (Figured_bass_continuation, center_on_figures, 1);
return extender.smobbed_copy ();
}
-ADD_INTERFACE(Figured_bass_continuation,
+ADD_INTERFACE (Figured_bass_continuation,
"Simple extender line between bounds.",
/* props */
struct Figured_bass_engraver : public Engraver
{
- TRANSLATOR_DECLARATIONS(Figured_bass_engraver);
- void clear_spanners();
+ TRANSLATOR_DECLARATIONS (Figured_bass_engraver);
+ void clear_spanners ();
void add_brackets ();
void create_grobs ();
new_event_found_ = true;
/*
- No ASSIGN_EVENT_ONCE() ; otherwise we get warnings about
+ No ASSIGN_EVENT_ONCE () ; otherwise we get warnings about
polyphonic rests.
*/
rest_event_ = ev;
if (consecutive_lines.size () == 2)
{
vector<Grob*> left_figs;
- for (vsize j = consecutive_lines.size(); j--;)
+ for (vsize j = consecutive_lines.size (); j--;)
left_figs.push_back (consecutive_lines[j]->get_bound (LEFT));
SCM ga = Grob_array::make_array ();
unsmob_grob_array (ga)->set_array (left_figs);
- for (vsize j = consecutive_lines.size(); j--;)
+ for (vsize j = consecutive_lines.size (); j--;)
consecutive_lines[j]->set_object ("figures",
unsmob_grob_array (ga)->smobbed_copy ());
}
Figured_bass_engraver::center_repeated_continuations ()
{
vector<Spanner*> consecutive_lines;
- for (vsize i = 0; i <= groups_.size(); i++)
+ for (vsize i = 0; i <= groups_.size (); i++)
{
if (i < groups_.size ()
&& groups_[i].continuation_line_
&& (consecutive_lines.empty ()
- || (consecutive_lines[0]->get_bound(LEFT)->get_column ()
+ || (consecutive_lines[0]->get_bound (LEFT)->get_column ()
== groups_[i].continuation_line_->get_bound (LEFT)->get_column ()
- && consecutive_lines[0]->get_bound(RIGHT)->get_column ()
+ && consecutive_lines[0]->get_bound (RIGHT)->get_column ()
== groups_[i].continuation_line_->get_bound (RIGHT)->get_column ())))
consecutive_lines.push_back (groups_[i].continuation_line_);
else
}
if (to_boolean (get_property ("figuredBassCenterContinuations")))
- center_repeated_continuations();
+ center_repeated_continuations ();
for (vsize i = 0; i < groups_.size (); i++)
{
if (use_extenders)
{
vector<int> junk_continuations;
- for (vsize i = 0; i < groups_.size(); i++)
+ for (vsize i = 0; i < groups_.size (); i++)
{
Figure_group &group = groups_[i];
{
for (vsize i = 0; i <= junk_continuations.size (); i++)
{
- if (i < junk_continuations.size()
+ if (i < junk_continuations.size ()
&& (i == 0 || junk_continuations[i-1] == junk_continuations[i] - 1))
consecutive.push_back (groups_[junk_continuations[i]].continuation_line_);
else
alignment_->set_bound (RIGHT, muscol);
SCM proc = get_property ("figuredBassFormatter");
- for (vsize i = 0; i < groups_.size(); i++)
+ for (vsize i = 0; i < groups_.size (); i++)
{
Figure_group &group = groups_[i];
class Figured_bass_position_engraver : public Engraver
{
- TRANSLATOR_DECLARATIONS(Figured_bass_position_engraver);
+ TRANSLATOR_DECLARATIONS (Figured_bass_position_engraver);
Spanner *bass_figure_alignment_;
Spanner *positioner_;
{
assert (!positioner_);
- positioner_ = make_spanner("BassFigureAlignmentPositioning", bass_figure_alignment_->self_scm ());
+ positioner_ = make_spanner ("BassFigureAlignmentPositioning", bass_figure_alignment_->self_scm ());
positioner_->set_bound (LEFT, bass_figure_alignment_->get_bound (LEFT));
Axis_group_interface::add_element (positioner_, bass_figure_alignment_);
}
}
-ADD_ACKNOWLEDGER(Figured_bass_position_engraver,note_column);
-ADD_ACKNOWLEDGER(Figured_bass_position_engraver,slur);
-ADD_END_ACKNOWLEDGER(Figured_bass_position_engraver,slur);
+ADD_ACKNOWLEDGER (Figured_bass_position_engraver, note_column);
+ADD_ACKNOWLEDGER (Figured_bass_position_engraver, slur);
+ADD_END_ACKNOWLEDGER (Figured_bass_position_engraver, slur);
-ADD_ACKNOWLEDGER(Figured_bass_position_engraver,tie);
-ADD_ACKNOWLEDGER(Figured_bass_position_engraver,bass_figure_alignment);
-ADD_END_ACKNOWLEDGER(Figured_bass_position_engraver,bass_figure_alignment);
+ADD_ACKNOWLEDGER (Figured_bass_position_engraver, tie);
+ADD_ACKNOWLEDGER (Figured_bass_position_engraver, bass_figure_alignment);
+ADD_END_ACKNOWLEDGER (Figured_bass_position_engraver, bass_figure_alignment);
ADD_TRANSLATOR (Figured_bass_position_engraver,
/* doc */
/*
- file-name-map.cc -- implement map_file_name()
+ file-name-map.cc -- implement map_file_name ()
source file of the GNU LilyPond music typesetter
display_config (FcConfig *fcc)
{
string retval;
- retval += display_strlist ("Config files", FcConfigGetConfigFiles(fcc));
- retval += display_strlist ("Config dir", FcConfigGetConfigDirs(fcc));
- retval += display_strlist ("Font dir", FcConfigGetFontDirs(fcc));
+ retval += display_strlist ("Config files", FcConfigGetConfigFiles (fcc));
+ retval += display_strlist ("Config dir", FcConfigGetConfigDirs (fcc));
+ retval += display_strlist ("Font dir", FcConfigGetFontDirs (fcc));
return retval;
}
val.type = FcTypeString;
val.u.s = (const FcChar8*)ly_scm2string (name).c_str (); // FC_SLANT_ITALIC;
- FcPatternAdd(pat, FC_FAMILY, val, FcFalse);
+ FcPatternAdd (pat, FC_FAMILY, val, FcFalse);
FcResult result;
SCM scm_result = SCM_BOOL_F;
FcConfigSubstitute (NULL, pat, FcMatchFont);
FcDefaultSubstitute (pat);
- pat = FcFontMatch(NULL, pat, &result);
+ pat = FcFontMatch (NULL, pat, &result);
FcChar8 *str = 0;
if (FcPatternGetString (pat, FC_FILE, 0, &str) == FcResultMatch)
scm_result = scm_from_locale_string ((char const*) str);
{
Font_metric *fm = unsmob_metrics (font);
LY_ASSERT_SMOB (Font_metric, font, 1);
- LY_ASSERT_TYPE(scm_is_string,name, 2);
+ LY_ASSERT_TYPE (scm_is_string, name, 2);
Stencil m = fm->find_by_name (ly_scm2string (name));
{
Font_metric *fm = unsmob_metrics (font);
LY_ASSERT_SMOB (Font_metric, font, 1);
- LY_ASSERT_TYPE(scm_is_number, index,2);
+ LY_ASSERT_TYPE (scm_is_number, index,2);
return fm->get_ascii_char_stencil (scm_to_int (index)).smobbed_copy ();
}
{
Font_metric *fm = unsmob_metrics (font);
LY_ASSERT_SMOB (Font_metric, font, 1);
- LY_ASSERT_TYPE(scm_is_string,name, 2);
+ LY_ASSERT_TYPE (scm_is_string, name, 2);
return scm_from_int (fm->name_to_index (ly_scm2string (name)));
}
{
Font_metric *fm = unsmob_metrics (font);
LY_ASSERT_SMOB (Font_metric, font, 1);
- LY_ASSERT_TYPE(scm_is_integer,index, 2);
+ LY_ASSERT_TYPE (scm_is_integer, index, 2);
return scm_from_unsigned_integer (fm->index_to_charcode (scm_to_int (index)));
}
{
Font_metric *fm = unsmob_metrics (font);
LY_ASSERT_SMOB (Font_metric, font, 1);
- LY_ASSERT_TYPE(scm_is_string,name, 2);
+ LY_ASSERT_TYPE (scm_is_string, name, 2);
return scm_from_unsigned_integer (fm->index_to_charcode (fm->name_to_index (ly_scm2string (name))));
}
(unsmob_metrics (font));
LY_ASSERT_SMOB (Font_metric, font, 1);
- LY_ASSERT_TYPE(scm_is_string,text, 2);
+ LY_ASSERT_TYPE (scm_is_string, text, 2);
Stencil stc (fm->text_stencil (ly_scm2string (text)));
return scm_cons (ly_interval2scm (stc.extent (X_AXIS)),
ly_interval2scm (stc.extent (Y_AXIS)));
#include "freetype.hh"
#undef __FTERRORS_H__
-#define FT_ERRORDEF( e, v, s ) { e, s },
+#define FT_ERRORDEF(e, v, s) { e, s },
#define FT_ERROR_START_LIST {
#define FT_ERROR_END_LIST { 0, 0 } };
scm_set_procedure_property_x (func, ly_symbol2scm ("documentation"),
ly_string2scm (s));
SCM entry = scm_cons (ly_string2scm (varlist), ly_string2scm (doc));
- scm_hashq_set_x (doc_hash_table, ly_symbol2scm (fname.c_str()), entry);
+ scm_hashq_set_x (doc_hash_table, ly_symbol2scm (fname.c_str ()), entry);
}
LY_DEFINE (ly_get_all_function_documentation, "ly:get-all-function-documentation",
ly_add_type_predicate ((void*) &unsmob_item, "item");
}
-ADD_SCM_INIT_FUNC(func_doc, init_func_doc);
+ADD_SCM_INIT_FUNC (func_doc, init_func_doc);
int sz = INT_MAX;
if (size != SCM_UNDEFINED)
{
- LY_ASSERT_TYPE(scm_is_number,size, 2);
+ LY_ASSERT_TYPE (scm_is_number, size, 2);
sz = scm_to_int (size);
}
"Replace @var{a} by @var{b} in @var{s}.")
{
LY_ASSERT_TYPE (scm_is_string, s, 1);
- LY_ASSERT_TYPE(scm_is_string,b, 2);
- LY_ASSERT_TYPE(scm_is_string,s, 3);
+ LY_ASSERT_TYPE (scm_is_string, b, 2);
+ LY_ASSERT_TYPE (scm_is_string, s, 3);
string ss = ly_scm2string (s);
replace_all (ss, string (scm_i_string_chars (a)),
return scm_cons (key, result);
}
-LY_DEFINE(ly_hash_table_keys, "ly:hash-table-keys",
+LY_DEFINE (ly_hash_table_keys, "ly:hash-table-keys",
1,0,0, (SCM tab),
"return a list of keys in @var{tab}")
{
warning (_ ("Found infinity or nan in output. Substituting 0.0"));
return ("0.0");
if (strict_infinity_checking)
- abort();
+ abort ();
}
else
return (String_convert::form_string ("%.*lf", precision, val));
vector<string> results;
vsize i = 0;
- while (i < format.size())
+ while (i < format.size ())
{
vsize tilde = format.find ('~', i);
+ ": too many arguments");
vsize len = 0;
- for (vsize i = 0; i < results.size(); i++)
- len += results[i].size();
+ for (vsize i = 0; i < results.size (); i++)
+ len += results[i].size ();
char *result = (char*) scm_malloc (len + 1);
char *ptr = result;
- for (vsize i = 0; i < results.size(); i++)
+ for (vsize i = 0; i < results.size (); i++)
{
- strncpy (ptr, results[i].c_str (), results[i].size());
- ptr += results[i].size();
+ strncpy (ptr, results[i].c_str (), results[i].size ());
+ ptr += results[i].size ();
}
*ptr = '\0';
"final state.\n")
{
LY_ASSERT_SMOB (Music, mus, 1);
- LY_ASSERT_TYPE (unsmob_global_context,ctx, 2);
+ LY_ASSERT_TYPE (unsmob_global_context, ctx, 2);
Music *music = unsmob_music (mus);
if (!music
{
Grob_array *me = unsmob_grob_array (grob_arr);
LY_ASSERT_SMOB (Grob_array, grob_arr, 1);
- LY_ASSERT_TYPE(scm_is_integer,index, 2);
+ LY_ASSERT_TYPE (scm_is_integer, index, 2);
vsize i = scm_to_unsigned (index);
if (i == VPOS || i >= me->size ())
"Add an interface description.")
{
LY_ASSERT_TYPE (ly_is_symbol, a, 1);
- LY_ASSERT_TYPE(scm_is_string,b, 2);
- LY_ASSERT_TYPE(ly_is_list,c, 3);
+ LY_ASSERT_TYPE (scm_is_string, b, 2);
+ LY_ASSERT_TYPE (ly_is_list, c, 3);
if (!all_ifaces)
{
SCM tab = scm_c_make_hash_table (59);
/*
We can't change signatures depending on NDEBUG, since NDEBUG comes
over the command line and may be different per .cc file. This
- should be done through the macro expansion of get_property().
+ should be done through the macro expansion of get_property ().
*/
void
Grob::internal_set_property (SCM sym, SCM v, char const *file, int line, char const *fun)
if (val == ly_symbol2scm ("calculation-in-progress"))
programming_error (_f ("cyclic dependency: calculation-in-progress encountered for #'%s (%s)",
ly_symbol2string (sym).c_str (),
- name().c_str ()));
+ name ().c_str ()));
#endif
if (ly_is_procedure (val)
/*
If the function returns SCM_UNSPECIFIED, we assume the
- property has been set with an explicit set_property()
+ property has been set with an explicit set_property ()
call.
*/
if (value == SCM_UNSPECIFIED)
Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
-#include "warn.hh" // error()
+#include "warn.hh" // error ()
#include "item.hh"
#include "output-def.hh"
#include "system.hh"
Grob *sc = unsmob_grob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
- LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
+ LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
return sc->get_property_data (sym);
}
Grob *sc = unsmob_grob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
- LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
+ LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
if (!ly_is_procedure (val)
&& !type_check_assignment (sym, val, ly_symbol2scm ("backend-type?")))
Grob *sc = unsmob_grob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
- LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
+ LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
if (deflt == SCM_UNDEFINED)
deflt = SCM_EOL;
Grob *sc = unsmob_grob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
- LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
+ LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
return sc->internal_get_object (sym);
}
LY_ASSERT_SMOB (Grob, grob, 1);
- LY_ASSERT_SMOB(Grob, refp, 2);
- LY_ASSERT_TYPE(is_axis,axis, 3);
+ LY_ASSERT_SMOB (Grob, refp, 2);
+ LY_ASSERT_TYPE (is_axis, axis, 3);
Axis a = Axis (scm_to_int (axis));
LY_ASSERT_SMOB (Grob, grob, 1);
- LY_ASSERT_SMOB(Grob, refp, 2);
- LY_ASSERT_TYPE(is_axis,axis, 3);
+ LY_ASSERT_SMOB (Grob, refp, 2);
+ LY_ASSERT_TYPE (is_axis, axis, 3);
Axis a = Axis (scm_to_int (axis));
LY_ASSERT_SMOB (Grob, grob, 1);
- LY_ASSERT_SMOB(Grob,refp, 2);
- LY_ASSERT_TYPE(is_axis,axis, 3);
+ LY_ASSERT_SMOB (Grob, refp, 2);
+ LY_ASSERT_TYPE (is_axis, axis, 3);
Axis a = Axis (scm_to_int (axis));
SCM_ASSERT_TYPE (false, refp, SCM_ARG2, __FUNCTION__, "common refpoint");
}
- return scm_from_double (sc->relative_coordinate (ref,a));
+ return scm_from_double (sc->relative_coordinate (ref, a));
}
Grob *sc = unsmob_grob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
- LY_ASSERT_TYPE(is_axis,axis, 2);
+ LY_ASSERT_TYPE (is_axis, axis, 2);
Grob *par = sc->get_parent (Axis (scm_to_int (axis)));
return par ? par->self_scm () : SCM_EOL;
Grob *me = unsmob_grob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
- LY_ASSERT_TYPE(scm_is_number,d, 2);
- LY_ASSERT_TYPE(is_axis,a, 3);
+ LY_ASSERT_TYPE (scm_is_number, d, 2);
+ LY_ASSERT_TYPE (is_axis, a, 3);
me->translate_axis (scm_to_double (d), Axis (scm_to_int (a)));
return SCM_UNSPECIFIED;
Grob *gr = unsmob_grob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
- LY_ASSERT_SMOB(Grob,other, 2);
+ LY_ASSERT_SMOB (Grob, other, 2);
Grob *o = unsmob_grob (other);
- LY_ASSERT_TYPE(is_axis,axis, 3);
+ LY_ASSERT_TYPE (is_axis, axis, 3);
Grob *refp = gr->common_refpoint (o, Axis (scm_to_int (axis)));
return refp ? refp->self_scm () : SCM_BOOL_F;
Grob *gr = unsmob_grob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
- LY_ASSERT_SMOB(Grob_array,others, 2);
+ LY_ASSERT_SMOB (Grob_array, others, 2);
Grob_array *ga = unsmob_grob_array (others);
- LY_ASSERT_TYPE(is_axis,axis, 3);
+ LY_ASSERT_TYPE (is_axis, axis, 3);
Grob *refp = common_refpoint_of_array (ga->array (), gr, Axis (scm_to_int (axis)));
return refp ? refp->self_scm () : SCM_BOOL_F;
SCM
Grob::mark_smob (SCM ses)
{
- ASSERT_LIVE_IS_ALLOWED();
+ ASSERT_LIVE_IS_ALLOWED ();
Grob *s = (Grob *) SCM_CELL_WORD_1 (ses);
scm_gc_mark (s->immutable_property_alist_);
return grob_stencil_extent (me, Y_AXIS);
}
-MAKE_SCHEME_CALLBACK(Grob, y_parent_positioning, 1);
+MAKE_SCHEME_CALLBACK (Grob, y_parent_positioning, 1);
SCM
Grob::y_parent_positioning (SCM smob)
{
}
-MAKE_SCHEME_CALLBACK(Grob, x_parent_positioning, 1);
+MAKE_SCHEME_CALLBACK (Grob, x_parent_positioning, 1);
SCM
Grob::x_parent_positioning (SCM smob)
{
Box extent (Interval (-rad, rad), Interval (-rad, rad));
/* Hmmm, perhaps we should have a Lookup::circle () method? */
- Stencil circle(extent,
+ Stencil circle (extent,
scm_list_4 (ly_symbol2scm ("circle"),
scm_from_double (rad),
scm_from_double (thick),
}
else
{
- Stencil b = make_bracket (me, ext.length(), a, dir);
+ Stencil b = make_bracket (me, ext.length (), a, dir);
b.translate_axis (ext[LEFT] - refpoint->relative_coordinate (common, a), a);
return b;
Input *ip = unsmob_input (sip);
LY_ASSERT_TYPE (unsmob_input, sip, 1);
- LY_ASSERT_TYPE(scm_is_string, msg,2);
+ LY_ASSERT_TYPE (scm_is_string, msg,2);
msg = scm_simple_format (SCM_BOOL_F, msg, rest);
class Instrument_switch_engraver : public Engraver
{
- TRANSLATOR_DECLARATIONS(Instrument_switch_engraver);
+ TRANSLATOR_DECLARATIONS (Instrument_switch_engraver);
protected:
Grob *text_;
SCM cue_name_;
text_ = 0;
}
-ADD_TRANSLATOR(Instrument_switch_engraver,
+ADD_TRANSLATOR (Instrument_switch_engraver,
"Create a cue text for taking instrument.",
"InstrumentSwitch ",
SCM last = get_property ("lastKeySignature");
SCM key = get_property ("keySignature");
- bool extranatural = to_boolean(get_property("extraNatural"));
+ bool extranatural = to_boolean (get_property ("extraNatural"));
if ((to_boolean (get_property ("printKeyCancellation"))
|| key == SCM_EOL)
struct Key_signature_interface
{
DECLARE_SCHEME_CALLBACK (print, (SCM));
- DECLARE_GROB_INTERFACE();
+ DECLARE_GROB_INTERFACE ();
};
Interval x_extent,
Real left_shorten);
- DECLARE_GROB_INTERFACE();
+ DECLARE_GROB_INTERFACE ();
};
Stencil
{
int line_count = (staff_extent.contains (pos)
? 0
- : sign (pos) * int (rint(pos - staff_extent[Direction (sign (pos))])) / 2);
+ : sign (pos) * int (rint (pos - staff_extent[Direction (sign (pos))])) / 2);
Stencil stencil;
if (line_count)
{
struct Ledgered_interface
{
- DECLARE_GROB_INTERFACE();
+ DECLARE_GROB_INTERFACE ();
};
ADD_INTERFACE (Ledgered_interface,
SCM
ly_string2scm (string const &str)
{
- return scm_from_locale_stringn (str.c_str(),
+ return scm_from_locale_stringn (str.c_str (),
str.length ());
}
for (vsize i = 0; i < os.size (); i++)
{
*tail = scm_cons (ly_offset2scm (os[i]), SCM_EOL);
- tail = SCM_CDRLOC(*tail);
+ tail = SCM_CDRLOC (*tail);
}
return l;
}
#include "lily-lexer.hh"
-LY_DEFINE(ly_lexer_keywords, "ly:lexer-keywords",
+LY_DEFINE (ly_lexer_keywords, "ly:lexer-keywords",
1, 0, 0, (SCM lexer),
"Return a list of (KEY . CODE) pairs, signifying the lilypond reserved words list.")
{
scm_from_int (keytable_->table_[i].tokcode_),
SCM_EOL);
- tail = SCM_CDRLOC(*tail);
+ tail = SCM_CDRLOC (*tail);
}
return l;
SCM
Lily_lexer::mark_smob (SCM s)
{
- ASSERT_LIVE_IS_ALLOWED();
+ ASSERT_LIVE_IS_ALLOWED ();
Lily_lexer *lexer = (Lily_lexer *) SCM_CELL_WORD_1 (s);
LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
Lily_parser *parser = unsmob_lily_parser (parser_smob);
- LY_ASSERT_TYPE (ly_is_symbol,symbol, 2);
+ LY_ASSERT_TYPE (ly_is_symbol, symbol, 2);
parser->lexer_->set_identifier (scm_symbol_to_string (symbol), val);
return SCM_UNSPECIFIED;
Lily_parser *parser = unsmob_lily_parser (parser_smob);
- LY_ASSERT_TYPE (ly_is_symbol,symbol, 2);
+ LY_ASSERT_TYPE (ly_is_symbol, symbol, 2);
SCM val = parser->lexer_->lookup_identifier (ly_scm2string (scm_symbol_to_string (symbol)));
if (val != SCM_UNDEFINED)
{
LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
Lily_parser *parser = unsmob_lily_parser (parser_smob);
- LY_ASSERT_TYPE(scm_is_string,ly_code, 2);
+ LY_ASSERT_TYPE (scm_is_string, ly_code, 2);
parser->parse_string (ly_scm2string (ly_code));
LY_ASSERT_SMOB (Lily_parser, parser, 1);
Lily_parser *p = unsmob_lily_parser (parser);
- LY_ASSERT_TYPE(scm_is_string,msg, 2);
+ LY_ASSERT_TYPE (scm_is_string, msg, 2);
string s = ly_scm2string (msg);
Input *i = unsmob_input (input);
if (period <= 0)
return Stencil ();
- Real len = (to-from).length();
+ Real len = (to-from).length ();
int n = (int) rint ((len - period * fraction) / period);
if (n > 0)
TODO: figure out something intelligent for really short
sections.
*/
- period = ((to-from).length() - period * fraction) / n;
+ period = ((to-from).length () - period * fraction) / n;
}
stil = make_dashed_line (thick, from, to, period, fraction);
}
DECLARE_SCHEME_CALLBACK (calc_left_bound_info_and_text, (SCM));
DECLARE_SCHEME_CALLBACK (calc_right_bound_info, (SCM));
DECLARE_SCHEME_CALLBACK (calc_bound_info, (SCM, Direction));
- DECLARE_GROB_INTERFACE();
+ DECLARE_GROB_INTERFACE ();
};
else
{
Grob *commony = me->common_refpoint (me->get_bound (dir), Y_AXIS);
- y = me->get_bound (dir)->extent (commony, Y_AXIS).center();
+ y = me->get_bound (dir)->extent (commony, Y_AXIS).center ();
details = scm_acons (ly_symbol2scm ("common-Y"), commony->self_scm (), details);
}
{
if (music_context_)
{
- music_context_->event_source()->remove_listener (GET_LISTENER (set_busy), ly_symbol2scm ("music-event"));
+ music_context_->event_source ()->remove_listener (GET_LISTENER (set_busy), ly_symbol2scm ("music-event"));
}
music_context_ = to;
if (to)
{
- to->event_source()->add_listener (GET_LISTENER (set_busy), ly_symbol2scm ("music-event"));
+ to->event_source ()->add_listener (GET_LISTENER (set_busy), ly_symbol2scm ("music-event"));
}
}
*/
string prefix_directory;
-/* The jail specification: USER,GROUP,JAIL,DIR. */
+/* The jail specification: USER, GROUP, JAIL, DIR. */
string jail_spec;
/* The option parser */
{_i ("DIR"), "include", 'I', _i ("add DIR to search path")},
{_i ("FILE"), "init", 'i', _i ("use FILE as init file")},
#if HAVE_CHROOT
- {_i ("USER,GROUP,JAIL,DIR"), "jail", 'j', _i ("chroot to JAIL, become USER:GROUP\n"
+ {_i ("USER, GROUP, JAIL, DIR"), "jail", 'j', _i ("chroot to JAIL, become USER:GROUP\n"
"and cd into DIR")},
#endif
{0, "no-print", 0, _i ("do not generate printed output")},
/*
Interpolate stem directions for neutral stems.
*/
-MAKE_SCHEME_CALLBACK(Melody_spanner,calc_neutral_stem_direction, 1);
+MAKE_SCHEME_CALLBACK (Melody_spanner, calc_neutral_stem_direction, 1);
SCM
Melody_spanner::calc_neutral_stem_direction (SCM smob)
{
{
string str = Midi_chunk::data_string ();
- for (vector<Midi_event*>::const_iterator i (events_.begin());
- i != events_.end(); i ++)
+ for (vector<Midi_event*>::const_iterator i (events_.begin ());
+ i != events_.end (); i ++)
{
str += (*i)->to_string ();
}
"In absence of grace notes, @var{g} is zero.\n")
{
LY_ASSERT_TYPE (scm_is_integer, n, 1);
- LY_ASSERT_TYPE(scm_is_integer,d, 2);
+ LY_ASSERT_TYPE (scm_is_integer, d, 2);
int grace_num = 0;
if (gn != SCM_UNDEFINED)
{
- LY_ASSERT_TYPE(scm_is_integer,gn, 3);
+ LY_ASSERT_TYPE (scm_is_integer, gn, 3);
grace_num = scm_to_int (gn);
}
int grace_den = 1;
if (gd != SCM_UNDEFINED)
{
- LY_ASSERT_TYPE(scm_is_integer,gd, 4);
+ LY_ASSERT_TYPE (scm_is_integer, gd, 4);
grace_den = scm_to_int (gd);
}
"Subtract two moments.")
{
LY_ASSERT_SMOB (Moment, a, 1);
- LY_ASSERT_SMOB (Moment,b, 2);
+ LY_ASSERT_SMOB (Moment, b, 2);
Moment *ma = unsmob_moment (a);
Moment *mb = unsmob_moment (b);
"Add two moments.")
{
LY_ASSERT_SMOB (Moment, a, 1);
- LY_ASSERT_SMOB(Moment,b, 2);
+ LY_ASSERT_SMOB (Moment, b, 2);
Moment *ma = unsmob_moment (a);
Moment *mb = unsmob_moment (b);
"Multiply two moments.")
{
LY_ASSERT_SMOB (Moment, a, 1);
- LY_ASSERT_SMOB(Moment, b, 2);
+ LY_ASSERT_SMOB (Moment, b, 2);
Moment *ma = unsmob_moment (a);
Moment *mb = unsmob_moment (b);
"Divide two moments.")
{
LY_ASSERT_SMOB (Moment, a, 1);
- LY_ASSERT_SMOB(Moment, b, 2);
+ LY_ASSERT_SMOB (Moment, b, 2);
Moment *ma = unsmob_moment (a);
Moment *mb = unsmob_moment (b);
"Modulo of two moments.")
{
LY_ASSERT_SMOB (Moment, a, 1);
- LY_ASSERT_SMOB(Moment, b, 2);
+ LY_ASSERT_SMOB (Moment, b, 2);
Moment *ma = unsmob_moment (a);
Moment *mb = unsmob_moment (b);
"If @var{sym} is undefined, return @code{'()}.\n")
{
LY_ASSERT_TYPE (unsmob_music, mus, 1);
- return ly_prob_property (mus,sym,dfault);
+ return ly_prob_property (mus, sym, dfault);
}
LY_DEFINE (ly_music_set_property_x, "ly:music-set-property!",
"Compress music object @var{m} by moment @var{factor}.")
{
LY_ASSERT_TYPE (unsmob_music, m, 1);
- LY_ASSERT_TYPE(unsmob_moment,factor, 2);
+ LY_ASSERT_TYPE (unsmob_moment, factor, 2);
Music *sc = unsmob_music (m);
sc->compress (*unsmob_moment (factor));
void
New_fingering_engraver::stop_translation_timestep ()
{
- position_all();
+ position_all ();
stem_ = 0;
heads_.clear ();
}
}
-MAKE_SCHEME_CALLBACK(Note_collision_interface, calc_positioning_done, 1)
+MAKE_SCHEME_CALLBACK (Note_collision_interface, calc_positioning_done, 1)
SCM
Note_collision_interface::calc_positioning_done (SCM smob)
{
Direction d = UP;
do
{
- for (vsize i = cg[d].size(); i--; )
+ for (vsize i = cg[d].size (); i--; )
{
/*
Trigger positioning
#include "font-metric.hh"
-LY_DEFINE(ly_note_head__stem_attachment, "ly:note-head::stem-attachment",
+LY_DEFINE (ly_note_head__stem_attachment, "ly:note-head::stem-attachment",
2, 0, 0, (SCM font_metric, SCM glyph_name),
"Get attachment in @var{font-metric} for attaching a stem to notehead "
"@var{glyph-name}.")
{
LY_ASSERT_SMOB (Font_metric, font_metric, 1);
Font_metric *fm = unsmob_metrics (font_metric);
- LY_ASSERT_TYPE(scm_is_string,glyph_name, 2);
+ LY_ASSERT_TYPE (scm_is_string, glyph_name, 2);
return ly_offset2scm (Note_head::get_stem_attachment (fm, ly_scm2string (glyph_name)));
}
return att;
}
-MAKE_SCHEME_CALLBACK(Note_head, calc_stem_attachment, 1);
+MAKE_SCHEME_CALLBACK (Note_head, calc_stem_attachment, 1);
SCM
Note_head::calc_stem_attachment (SCM smob)
{
}
Moment len = get_event_length (n);
- if (now_mom().grace_part_)
+ if (now_mom ().grace_part_)
{
len.grace_part_ = len.main_part_;
len.main_part_ = Rational (0);
if (g)
{
if (g->common_refpoint (it_col, X_AXIS) != it_col)
- programming_error ("Note_spacing::get_spacing(): Common refpoint incorrect");
+ programming_error ("Note_spacing::get_spacing (): Common refpoint incorrect");
else
left_head_wid = g->extent (it_col, X_AXIS);
}
Open_type_font *otf = dynamic_cast<Open_type_font *> (fm->original_font ());
SCM_ASSERT_TYPE (otf, font, SCM_ARG1, __FUNCTION__, "OTF font-metric");
- LY_ASSERT_TYPE(scm_is_string, glyph, 2);
+ LY_ASSERT_TYPE (scm_is_string, glyph, 2);
SCM sym = scm_string_to_symbol (glyph);
return scm_hashq_ref (otf->get_char_table (), sym, SCM_EOL);
char name[len];
size_t code = FT_Get_Glyph_Name (face_, signed_idx, name, len);
if (code)
- warning (_f ("FT_Get_Glyph_Name() Freetype error: %s",
+ warning (_f ("FT_Get_Glyph_Name () Freetype error: %s",
freetype_error_string (code)));
SCM sym = ly_symbol2scm (name);
char name[len];
size_t code = FT_Get_Glyph_Name (face_, i, name, len);
if (code)
- warning (_f ("FT_Get_Glyph_Name() error: %s",
+ warning (_f ("FT_Get_Glyph_Name () error: %s",
freetype_error_string (code).c_str ()));
*tail = scm_cons (scm_from_locale_string (name), SCM_EOL);
struct Ottava_bracket
{
DECLARE_SCHEME_CALLBACK (print, (SCM));
- DECLARE_GROB_INTERFACE();
+ DECLARE_GROB_INTERFACE ();
};
/*
Output_def::lookup_variable (SCM sym) const
{
SCM var = ly_module_lookup (scope_, sym);
- if (SCM_VARIABLEP (var) && SCM_VARIABLE_REF(var) != SCM_UNDEFINED)
+ if (SCM_VARIABLEP (var) && SCM_VARIABLE_REF (var) != SCM_UNDEFINED)
return SCM_VARIABLE_REF (var);
if (parent_)
{
}
-ADD_ACKNOWLEDGER (Output_property_engraver,grob);
+ADD_ACKNOWLEDGER (Output_property_engraver, grob);
ADD_TRANSLATOR (Output_property_engraver,
/* doc */
return ret;
}
-/* the cases for page_count = 1 or 2 can be done in O(n) time. Since they
+/* the cases for page_count = 1 or 2 can be done in O (n) time. Since they
are by far the most common cases, we have special functions for them */
static Spacing_result
space_systems_on_1_page (vector<Line_details> const &lines, Real page_height, bool ragged)
{
int errorcode = FT_Get_Glyph_Name (ftface, pg, glyph_name, GLYPH_NAME_LEN);
if (errorcode)
- programming_error (_f ("FT_Get_Glyph_Name() error: %s",
- freetype_error_string (errorcode).c_str()
+ programming_error (_f ("FT_Get_Glyph_Name () error: %s",
+ freetype_error_string (errorcode).c_str ()
));
}
/* read the breakbefore property of a score block and set up the preceding
system-spec to honour it. That is, SYM should be the system spec that
immediately precedes the score (from which HEADER is taken)
- in the get_system_specs() list */
+ in the get_system_specs () list */
void
set_system_penalty (SCM sys, SCM header)
{
Prob *ps = make_paper_system (props);
paper_system_set_stencil (ps, title);
- return ps->self_scm();
+ return ps->self_scm ();
}
return SCM_BOOL_F;
&& !measure_position (context ()).main_part_);
/*
- We can't do this in start_translation_timestep(), since time sig
+ We can't do this in start_translation_timestep (), since time sig
changes won't have happened by then.
*/
if (start_of_measure)
{
LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
- LY_ASSERT_SMOB(Stencil, stencil, 2);
+ LY_ASSERT_SMOB (Stencil, stencil, 2);
Paper_outputter *po = unsmob_outputter (outputter);
Stencil *st = unsmob_stencil (stencil);
"Dump @var{str} onto @var{outputter}.")
{
LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
- LY_ASSERT_TYPE(scm_is_string, str, 2);
+ LY_ASSERT_TYPE (scm_is_string, str, 2);
Paper_outputter *po = unsmob_outputter (outputter);
if (is_number_pair (yext))
{
- Box b = s.extent_box();
+ Box b = s.extent_box ();
b[Y_AXIS] = ly_scm2interval (yext);
s = Stencil (b, s.expr ());
DECLARE_ACKNOWLEDGER (grob);
};
-Parenthesis_engraver::Parenthesis_engraver()
+Parenthesis_engraver::Parenthesis_engraver ()
{
}
&& to_boolean (get_property ("countPercentRepeats")))
{
Item *double_percent_counter = make_item ("DoublePercentRepeatCounter",
- percent_event_->self_scm());
+ percent_event_->self_scm ());
SCM text = scm_number_to_string (count,
scm_from_int (10));
{
percent_event_->origin ()->warning (_ ("unterminated percent repeat"));
percent_->suicide ();
- percent_counter_->suicide();
+ percent_counter_->suicide ();
}
}
class Percent_repeat_iterator : public Sequential_iterator
{
public:
- DECLARE_CLASSNAME(Percent_repeat_iterator);
+ DECLARE_CLASSNAME (Percent_repeat_iterator);
DECLARE_SCHEME_CALLBACK (constructor, ());
Percent_repeat_iterator ();
protected:
"Write @var{performance} to @var{filename}")
{
LY_ASSERT_TYPE (unsmob_performance, performance, 1);
- LY_ASSERT_TYPE(scm_is_string, filename, 2);
+ LY_ASSERT_TYPE (scm_is_string, filename, 2);
unsmob_performance (performance)->write_output (ly_scm2string (filename));
return SCM_UNSPECIFIED;
struct Piano_pedal_bracket
{
DECLARE_SCHEME_CALLBACK (print, (SCM));
- DECLARE_GROB_INTERFACE();
+ DECLARE_GROB_INTERFACE ();
};
MAKE_SCHEME_CALLBACK (Piano_pedal_bracket, print, 1);
a->type_string_ = pedal_type;
a->dir_ = STOP;
audios_.push_back (a);
- Audio_element_info info(a, p->event_drul_[STOP]);
+ Audio_element_info info (a, p->event_drul_[STOP]);
announce_element (info);
}
p->start_event_ = 0;
a->type_string_ = pedal_type;
a->dir_ = START;
audios_.push_back (a);
- Audio_element_info info(a, p->event_drul_[START]);
+ Audio_element_info info (a, p->event_drul_[START]);
announce_element (info);
}
p->event_drul_[START] = 0;
"The @var{alter} is a rational number of whole tones for alteration.")
{
LY_ASSERT_TYPE (scm_is_integer, octave, 1);
- LY_ASSERT_TYPE(scm_is_integer, note, 2);
- LY_ASSERT_TYPE(scm_is_rational, alter, 3);
+ LY_ASSERT_TYPE (scm_is_integer, note, 2);
+ LY_ASSERT_TYPE (scm_is_rational, alter, 3);
Pitch p (scm_to_int (octave), scm_to_int (note),
ly_scm2rational (alter));
alteration_ = Rational (0);
alteration_ -= tone_pitch () - pitch;
}
- while (alteration_ < Rational(-1))
+ while (alteration_ < Rational (-1))
{
if (notename_ == 0)
{
{
LY_ASSERT_SMOB (Prob, obj, 1);
Prob *ps = unsmob_prob (obj);
- LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
+ LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
if (dfault == SCM_UNDEFINED)
dfault = SCM_EOL;
"If obj the specified prob-type?")
{
Prob*prob = unsmob_prob (obj);
- return scm_from_bool (prob && prob->type() == type);
+ return scm_from_bool (prob && prob->type () == type);
}
LY_DEFINE (ly_make_prob, "ly:make-prob",
}
-LY_DEFINE(ly_paper_system_p, "ly:paper-system?",
+LY_DEFINE (ly_paper_system_p, "ly:paper-system?",
1, 0, 0, (SCM obj),
"Type predicate.")
{
SCM bprop = props[1][i];
for (;
- scm_is_pair (aprop) && scm_is_pair(bprop);
+ scm_is_pair (aprop) && scm_is_pair (bprop);
aprop = scm_cdr (aprop), bprop = scm_cdr (bprop))
{
SCM aval = scm_cdar (aprop);
SCM
Prob::mark_smob (SCM smob)
{
- ASSERT_LIVE_IS_ALLOWED();
+ ASSERT_LIVE_IS_ALLOWED ();
Prob *system = (Prob *) SCM_CELL_WORD_1 (smob);
scm_gc_mark (system->mutable_property_alist_);
/*
When running from build dir, a full LILYPOND_PREFIX is set-up at
- $(OUTBASE)/{share,lib}/lilypond/current
+ $(OUTBASE)/{share, lib}/lilypond/current
*/
string
expand_environment_variables (string orig)
{
- const char *start_ptr = orig.c_str();
- const char *ptr = orig.c_str();
- size_t len = orig.length();
+ const char *start_ptr = orig.c_str ();
+ const char *ptr = orig.c_str ();
+ size_t len = orig.length ();
string out;
while (ptr < start_ptr + len)
if (start_var < end_var)
{
string var_name (start_var, end_var - start_var);
- const char *value = getenv (var_name.c_str());
+ const char *value = getenv (var_name.c_str ());
if (value != NULL)
out += string (value);
value = expand_environment_variables (value);
if (command == "set")
- sane_putenv (variable.c_str(), value, true);
+ sane_putenv (variable.c_str (), value, true);
else if (command == "setdir")
- set_env_dir (variable.c_str(), value);
+ set_env_dir (variable.c_str (), value);
else if (command == "setfile")
- set_env_file (variable.c_str(), value);
+ set_env_file (variable.c_str (), value);
else if (command == "prependdir")
prepend_env_path (variable.c_str (), value);
else
TODO: look at horizontal-shift to determine ordering between rests
for more than two voices.
*/
-MAKE_SCHEME_CALLBACK(Rest_collision, calc_positioning_done, 1);
+MAKE_SCHEME_CALLBACK (Rest_collision, calc_positioning_done, 1);
SCM
Rest_collision::calc_positioning_done (SCM smob)
{
{
}
-IMPLEMENT_SMOBS(Scale);
-IMPLEMENT_DEFAULT_EQUAL_P(Scale);
+IMPLEMENT_SMOBS (Scale);
+IMPLEMENT_DEFAULT_EQUAL_P (Scale);
typeset_all ();
}
-IMPLEMENT_LISTENER(Score_engraver, one_time_step);
+IMPLEMENT_LISTENER (Score_engraver, one_time_step);
void
Score_engraver::one_time_step (SCM)
{
SCM l = SCM_EOL;
for (vsize i = 0; i < sc->defs_.size (); i++)
- l = scm_cons (sc->defs_[i]->self_scm(), l);
+ l = scm_cons (sc->defs_[i]->self_scm (), l);
return scm_reverse_x (l, SCM_EOL);
}
struct Text_script
{
- DECLARE_GROB_INTERFACE();
+ DECLARE_GROB_INTERFACE ();
};
ADD_INTERFACE (Text_script,
#include "tie-column-format.hh"
-ADD_INTERFACE(Semi_tie_column,
+ADD_INTERFACE (Semi_tie_column,
"The interface for a column of l.v. ties.",
/* properties */
/*
Cut & paste from tie-column.cc
*/
-MAKE_SCHEME_CALLBACK(Semi_tie_column, calc_positioning_done, 1);
+MAKE_SCHEME_CALLBACK (Semi_tie_column, calc_positioning_done, 1);
SCM
Semi_tie_column::calc_positioning_done (SCM smob)
{
problem.set_manual_tie_configuration (manual_configs);
Ties_configuration base = problem.generate_optimal_configuration ();
- for (vsize i = 0; i < lv_ties.size(); i++)
+ for (vsize i = 0; i < lv_ties.size (); i++)
{
SCM cp = Tie::get_control_points (lv_ties[i], problem.common_x_refpoint (), base[i],
problem.details_);
#include "warn.hh"
#include "staff-symbol-referencer.hh"
-ADD_INTERFACE(Semi_tie,
+ADD_INTERFACE (Semi_tie,
"A tie which is only on one side connected to note heads. ",
"thickness "
);
-MAKE_SCHEME_CALLBACK(Semi_tie, calc_control_points, 1)
+MAKE_SCHEME_CALLBACK (Semi_tie, calc_control_points, 1)
SCM
Semi_tie::calc_control_points (SCM smob)
{
}
-MAKE_SCHEME_CALLBACK(Separation_item,calc_skylines,1);
+MAKE_SCHEME_CALLBACK (Separation_item, calc_skylines,1);
SCM
Separation_item::calc_skylines (SCM smob)
{
return SCM_EOL;
}
-LY_DEFINE(ly_simple_closure_p, "ly:simple-closure?",
+LY_DEFINE (ly_simple_closure_p, "ly:simple-closure?",
1,0,0, (SCM clos),
"Type predicate.")
{
return scm_from_bool (is_simple_closure (clos));
}
-LY_DEFINE(ly_make_simple_closure, "ly:make-simple-closure",
+LY_DEFINE (ly_make_simple_closure, "ly:make-simple-closure",
1, 0, 0, (SCM expr),
"Make a simple closure. @var{expr} should be form of "
"@code{(@var{func} @var{a1} @var{A2} ...)}, and will be invoked "
{
SCM z;
- SCM_NEWSMOB(z, simple_closure_tag, expr);
+ SCM_NEWSMOB (z, simple_closure_tag, expr);
return z;
}
-LY_DEFINE(ly_eval_simple_closure, "ly:eval-simple-closure",
+LY_DEFINE (ly_eval_simple_closure, "ly:eval-simple-closure",
2, 2, 0, (SCM delayed, SCM closure, SCM scm_start, SCM scm_end),
"Evaluate a simple closure with the given delayed argument. "
"If start and end are defined, evaluate it purely with those "
SCM_ASSERT_TYPE (len >= 0, springs, SCM_ARG1, __FUNCTION__, "list of springs");
SCM_ASSERT_TYPE (scm_ilength (rods) > 0, rods, SCM_ARG1, __FUNCTION__, "list of rods");
- LY_ASSERT_TYPE(scm_is_number, length, 3);
+ LY_ASSERT_TYPE (scm_is_number, length, 3);
bool is_ragged = ragged == SCM_BOOL_T;
Simple_spacer spacer;
void
Building::precompute ()
{
- slope_ = (height_[RIGHT] - height_[LEFT]) / (iv_.length());
+ slope_ = (height_[RIGHT] - height_[LEFT]) / (iv_.length ());
if (height_[LEFT] == height_[RIGHT]) /* in case they're both infinity */
slope_ = 0;
while (!buildings->empty ())
partials.push_back (non_overlapping_skyline (buildings));
- /* we'd like to say while (partials->size () > 1) but that's O(n).
+ /* we'd like to say while (partials->size () > 1) but that's O (n).
Instead, we exit in the middle of the loop */
while (!partials.empty ())
{
SCM
Skyline::mark_smob (SCM)
{
- ASSERT_LIVE_IS_ALLOWED();
+ ASSERT_LIVE_IS_ALLOWED ();
return SCM_EOL;
}
}
-MAKE_SCHEME_CALLBACK(Slur, calc_control_points, 1)
+MAKE_SCHEME_CALLBACK (Slur, calc_control_points, 1)
SCM
Slur::calc_control_points (SCM smob)
{
if (!xe.is_empty ()
&& !ye.is_empty ())
- avoid.push_back (Offset (xe.center(), ye[dir_]));
+ avoid.push_back (Offset (xe.center (), ye[dir_]));
}
}
return avoid;
-MAKE_SCHEME_CALLBACK(Slur, calc_direction, 1)
+MAKE_SCHEME_CALLBACK (Slur, calc_direction, 1)
SCM
Slur::calc_direction (SCM smob)
{
}
ADD_SCM_INIT_FUNC (init_smob_protection, init_smob_protection);
-LY_DEFINE(ly_smob_protects, "ly:smob-protects",
+LY_DEFINE (ly_smob_protects, "ly:smob-protects",
0, 0, 0, (),
"Return lily's internal smob protection list")
{
string context = line.substr (0, ch)
+ to_string ('\n')
+ to_string (' ', col)
- + line.substr (ch, line.length()-ch);
+ + line.substr (ch, line.length ()-ch);
return context;
}
#include "ly-smobs.icc"
-IMPLEMENT_SMOBS(Source_file);
-IMPLEMENT_DEFAULT_EQUAL_P(Source_file);
-IMPLEMENT_TYPE_P(Source_file, "ly:source-file?");
+IMPLEMENT_SMOBS (Source_file);
+IMPLEMENT_DEFAULT_EQUAL_P (Source_file);
+IMPLEMENT_TYPE_P (Source_file, "ly:source-file?");
SCM
Source_file::mark_smob (SCM smob)
Spanner *me = unsmob_spanner (smob);
/*
- can't use get_system() ? --hwn.
+ can't use get_system () ? --hwn.
*/
Spacing_options options;
options.init_from_grob (me);
Spacing_spanner::fills_measure (Grob *me, Item *left, Item *col)
{
System *sys = get_root_system (me);
- Item *next = sys->column (col->get_column()->get_rank () + 1);
+ Item *next = sys->column (col->get_column ()->get_rank () + 1);
if (!next)
return false;
"for left, and @code{1} for right.")
{
LY_ASSERT_TYPE (unsmob_spanner, slur, 1);
- LY_ASSERT_TYPE(is_direction, dir,2);
+ LY_ASSERT_TYPE (is_direction, dir,2);
return unsmob_spanner (slur)->get_bound (to_dir (dir))->self_scm ();
}
return dynamic_cast<Spanner *> (unsmob_grob (s));
}
-MAKE_SCHEME_CALLBACK(Spanner, bounds_width, 1);
+MAKE_SCHEME_CALLBACK (Spanner, bounds_width, 1);
SCM
Spanner::bounds_width (SCM grob)
{
return z[X_AXIS] * get_line_thickness (me) + z[Y_AXIS] * staff_space (me);
}
-MAKE_SCHEME_CALLBACK(Staff_symbol,height,1);
+MAKE_SCHEME_CALLBACK (Staff_symbol, height,1);
SCM
Staff_symbol::height (SCM smob)
{
if (!stem)
{
programming_error ("no stem for stem-tremolo");
- return Stencil();
+ return Stencil ();
}
Direction stemdir = get_grob_direction (stem);
return (scm_is_number (s)) ? scm_to_int (s) : 2;
}
-MAKE_SCHEME_CALLBACK(Stem, calc_positioning_done, 1);
+MAKE_SCHEME_CALLBACK (Stem, calc_positioning_done, 1);
SCM
Stem::calc_positioning_done (SCM smob)
{
return SCM_BOOL_T;
}
-MAKE_SCHEME_CALLBACK(Stem, calc_direction, 1);
+MAKE_SCHEME_CALLBACK (Stem, calc_direction, 1);
SCM
Stem::calc_direction (SCM smob)
{
return scm_from_int (dir);
}
-MAKE_SCHEME_CALLBACK(Stem, calc_default_direction, 1);
+MAKE_SCHEME_CALLBACK (Stem, calc_default_direction, 1);
SCM
Stem::calc_default_direction (SCM smob)
{
}
/*
- Can't get_stencil(), since that would cache stencils too early.
+ Can't get_stencil (), since that would cache stencils too early.
This causes problems with beams.
*/
Stencil *stencil = unsmob_stencil (print (smob));
- Interval iv = stencil ? stencil->extent (Y_AXIS) : Interval();
+ Interval iv = stencil ? stencil->extent (Y_AXIS) : Interval ();
if (beam)
{
if (dir == CENTER)
return si;
}
-MAKE_SCHEME_CALLBACK(Stem, calc_stem_info, 1);
+MAKE_SCHEME_CALLBACK (Stem, calc_stem_info, 1);
SCM
Stem::calc_stem_info (SCM smob)
{
{
Stencil *s = unsmob_stencil (stil);
LY_ASSERT_SMOB (Stencil, stil, 1);
- LY_ASSERT_TYPE(scm_is_number,amount, 2);
- LY_ASSERT_TYPE(is_axis,axis, 3);
+ LY_ASSERT_TYPE (scm_is_number, amount, 2);
+ LY_ASSERT_TYPE (is_axis, axis, 3);
Real real_amount = scm_to_double (amount);
{
Stencil *s = unsmob_stencil (stil);
LY_ASSERT_SMOB (Stencil, stil, 1);
- LY_ASSERT_TYPE(is_number_pair, offset, 2);
+ LY_ASSERT_TYPE (is_number_pair, offset, 2);
Offset o = ly_scm2offset (offset);
SCM new_s = s->smobbed_copy ();
{
Stencil *s = unsmob_stencil (stil);
LY_ASSERT_SMOB (Stencil, stil, 1);
- LY_ASSERT_TYPE(is_axis, axis, 2);
+ LY_ASSERT_TYPE (is_axis, axis, 2);
return ly_interval2scm (s->extent (Axis (scm_to_int (axis))));
}
first, SCM_ARG1, __FUNCTION__, "Stencil, #f or ()");
SCM_ASSERT_TYPE (s2 || second == SCM_BOOL_F || second == SCM_EOL,
second, SCM_ARG4, __FUNCTION__, "Stencil, #f or ()");
- LY_ASSERT_TYPE(is_axis, axis, 2);
- LY_ASSERT_TYPE(is_direction, direction, 3);
+ LY_ASSERT_TYPE (is_axis, axis, 2);
+ LY_ASSERT_TYPE (is_direction, direction, 3);
Real p = 0.0;
if (padding != SCM_UNDEFINED)
{
- LY_ASSERT_TYPE(scm_is_number, padding, 5);
+ LY_ASSERT_TYPE (scm_is_number, padding, 5);
p = scm_to_double (padding);
}
Real m = 0.0;
if (minimum != SCM_UNDEFINED)
{
- LY_ASSERT_TYPE(scm_is_number, minimum, 6);
+ LY_ASSERT_TYPE (scm_is_number, minimum, 6);
m = scm_to_double (minimum);
}
Interval x;
if (xext != SCM_UNDEFINED)
{
- LY_ASSERT_TYPE(is_number_pair, xext, 2);
+ LY_ASSERT_TYPE (is_number_pair, xext, 2);
x = ly_scm2interval (xext);
}
Interval y;
if (yext != SCM_UNDEFINED)
{
- LY_ASSERT_TYPE(is_number_pair,yext, 3);
+ LY_ASSERT_TYPE (is_number_pair, yext, 3);
y = ly_scm2interval (yext);
}
"Other values are interpolated (so 0 means the center).")
{
LY_ASSERT_SMOB (Stencil, stil, 1);
- LY_ASSERT_TYPE(is_axis,axis, 2);
- LY_ASSERT_TYPE(scm_is_number, dir, 3);
+ LY_ASSERT_TYPE (is_axis, axis, 2);
+ LY_ASSERT_TYPE (scm_is_number, dir, 3);
Stencil target = *unsmob_stencil (stil);
"may be negative. The thickness is given by @var{t}.")
{
LY_ASSERT_TYPE (is_axis, a, 1);
- LY_ASSERT_TYPE(is_number_pair,iv, 2);
- LY_ASSERT_TYPE(scm_is_number, t,3);
- LY_ASSERT_TYPE(scm_is_number, p,4);
+ LY_ASSERT_TYPE (is_number_pair, iv, 2);
+ LY_ASSERT_TYPE (scm_is_number, t,3);
+ LY_ASSERT_TYPE (scm_is_number, p,4);
return Lookup::bracket ((Axis)scm_to_int (a), ly_scm2interval (iv),
scm_to_double (t),
{
Stencil *s = unsmob_stencil (stil);
LY_ASSERT_SMOB (Stencil, stil, 1);
- LY_ASSERT_TYPE(scm_is_number,angle, 2);
- LY_ASSERT_TYPE(scm_is_number, x,3);
- LY_ASSERT_TYPE(scm_is_number, y, 4);
+ LY_ASSERT_TYPE (scm_is_number, angle, 2);
+ LY_ASSERT_TYPE (scm_is_number, x,3);
+ LY_ASSERT_TYPE (scm_is_number, y, 4);
Real a = scm_to_double (angle);
Real x_off = scm_to_double (x);
Real y_off = scm_to_double (y);
"@var{yext} and roundness @var{blot}.")
{
LY_ASSERT_TYPE (is_number_pair, xext, 1);
- LY_ASSERT_TYPE(is_number_pair, yext, 2);
- LY_ASSERT_TYPE(scm_is_number, blot, 3);
+ LY_ASSERT_TYPE (is_number_pair, yext, 2);
+ LY_ASSERT_TYPE (scm_is_number, blot, 3);
return Lookup::round_filled_box (Box (ly_scm2interval (xext), ly_scm2interval (yext)),
scm_to_double (blot)).smobbed_copy ();
LY_ASSERT_TYPE (ly_is_symbol, cl, 1);
/* should be scm_list_p, but scm_list_p is expensive. */
- LY_ASSERT_TYPE(scm_is_pair, proplist, 2);
+ LY_ASSERT_TYPE (scm_is_pair, proplist, 2);
if (proplist == SCM_UNDEFINED)
proplist = SCM_EOL;
struct Bracket_nesting_node
{
public:
- virtual ~Bracket_nesting_node(){}
+ virtual ~Bracket_nesting_node (){}
virtual bool add_staff (Grob *) { return false; }
virtual void add_support (Grob *) { }
virtual void set_bound (Direction, Grob *){}
void
System_start_delimiter_engraver::acknowledge_staff_symbol (Grob_info inf)
{
- Grob *staff = inf.grob();
+ Grob *staff = inf.grob ();
bool succ = nesting_->add_staff (staff);
if (!succ)
while (hi - lo > 1);
Stencil stil (fm->find_by_name ("brace" + to_string (lo)));
- stil.translate_axis (-b[X_AXIS].length()/2, X_AXIS);
+ stil.translate_axis (-b[X_AXIS].length ()/2, X_AXIS);
stil.translate_axis (-0.2, X_AXIS);
{
public:
static Stencil get_stencil (Grob *);
- DECLARE_GROB_INTERFACE();
+ DECLARE_GROB_INTERFACE ();
DECLARE_SCHEME_CALLBACK (print, (SCM));
};
p->align_to (Y_AXIS, robust_scm2double (align_y, 0.0));
return *p;
}
- return Stencil();
+ return Stencil ();
}
Grob *g = entries[j].grob_;
Stencil st = g->get_print_stencil ();
- if (st.expr() == SCM_EOL)
+ if (st.expr () == SCM_EOL)
continue;
Offset o;
DECLARE_ACKNOWLEDGER (note_head);
};
-Tab_harmonic_engraver::Tab_harmonic_engraver()
+Tab_harmonic_engraver::Tab_harmonic_engraver ()
{
}
public:
TRANSLATOR_DECLARATIONS (Tab_staff_symbol_engraver);
protected:
- DECLARE_ACKNOWLEDGER(staff_symbol);
+ DECLARE_ACKNOWLEDGER (staff_symbol);
};
void
return SCM_UNSPECIFIED;
}
-MAKE_SCHEME_CALLBACK(Tie_column, calc_positioning_done, 1)
+MAKE_SCHEME_CALLBACK (Tie_column, calc_positioning_done, 1)
SCM
Tie_column::calc_positioning_done (SCM smob)
{
Ties_configuration base = problem.generate_optimal_configuration ();
- for (vsize i = 0; i < base.size(); i++)
+ for (vsize i = 0; i < base.size (); i++)
{
SCM cp = Tie::get_control_points (ties[i], problem.common_x_refpoint (),
base[i],
Bezier
Tie_configuration::get_untransformed_bezier (Tie_details const &details) const
{
- Real l = attachment_x_.length();
+ Real l = attachment_x_.length ();
if (isinf (l) || isnan (l))
{
programming_error ("Inf or NaN encountered");
Real
Tie_configuration::height (Tie_details const &details) const
{
- Real l = attachment_x_.length();
+ Real l = attachment_x_.length ();
return slur_shape (l,
details.height_limit_,
details.ratio_).curve_point (0.5)[Y_AXIS];
}
-Ties_configuration::Ties_configuration()
+Ties_configuration::Ties_configuration ()
{
score_ = 0.0;
scored_ = false;
Ties_configuration::complete_score_card () const
{
string s;
- for (vsize i = 0; i < size(); i++)
+ for (vsize i = 0; i < size (); i++)
{
s += complete_tie_card (i);
}
SCM details = me->get_property ("details");
- height_limit_ = get_real_detail("height-limit", 0.75);
- ratio_ = get_real_detail("ratio", .333);
+ height_limit_ = get_real_detail ("height-limit", 0.75);
+ ratio_ = get_real_detail ("ratio", .333);
between_length_limit_ = get_real_detail ("between-length-limit", 1.0);
- wrong_direction_offset_penalty_ = get_real_detail("wrong-direction-offset-penalty", 10);
+ wrong_direction_offset_penalty_ = get_real_detail ("wrong-direction-offset-penalty", 10);
- min_length_ = get_real_detail("min-length", 1.0);
- min_length_penalty_factor_ = get_real_detail("min-length-penalty-factor", 1.0);
+ min_length_ = get_real_detail ("min-length", 1.0);
+ min_length_penalty_factor_ = get_real_detail ("min-length-penalty-factor", 1.0);
// in half-space
center_staff_line_clearance_ = get_real_detail ("center-staff-line-clearance", 0.4);
tip_staff_line_clearance_ = get_real_detail ("tip-staff-line-clearance", 0.4);
- staff_line_collision_penalty_ = get_real_detail("staff-line-collision-penalty", 5);
+ staff_line_collision_penalty_ = get_real_detail ("staff-line-collision-penalty", 5);
dot_collision_clearance_ = get_real_detail ( "dot-collision-clearance", 0.25);
dot_collision_penalty_ = get_real_detail ( "dot-collision-penalty", 0.25);
x_gap_ = get_real_detail ("note-head-gap", 0.2);
if (!wait && new_heads_to_tie.size ())
heads_to_tie_.clear ();
- // hmmm, how to do with copy() ?
+ // hmmm, how to do with copy () ?
for (vsize i = 0; i < new_heads_to_tie.size (); i++)
heads_to_tie_.push_back (new_heads_to_tie[i]);
return attachments;
}
-Tie_formatting_problem::Tie_formatting_problem()
+Tie_formatting_problem::Tie_formatting_problem ()
{
x_refpoint_ = 0;
}
*/
boxes.push_back (Box (x, y));
- stem_extents_[key].unite (Box (x,y));
+ stem_extents_[key].unite (Box (x, y));
if (dir == LEFT)
{
Box flag_box = Stem::get_translated_flag (stem).extent_box ();
- flag_box.translate( Offset (x[RIGHT], X_AXIS));
+ flag_box.translate ( Offset (x[RIGHT], X_AXIS));
boxes.push_back (flag_box);
}
}
}
extract_grob_set (stem, "note-heads", heads);
- for (vsize i = 0; i < heads.size(); i ++)
+ for (vsize i = 0; i < heads.size (); i ++)
{
- if (find (bounds.begin(), bounds.end (), dynamic_cast<Item*> (heads[i])) == bounds.end ())
+ if (find (bounds.begin (), bounds.end (), dynamic_cast<Item*> (heads[i])) == bounds.end ())
{
/*
other untied notes in the same chord.
{
Interval x;
Interval y;
- if (head_boxes.size())
+ if (head_boxes.size ())
{
Box b = boundary (head_boxes, updowndir, 0);
x = b[X_AXIS];
while (flip (&d) != LEFT);
if (ties_conf
- && ties_conf->size() == 1)
+ && ties_conf->size () == 1)
{
Direction d = LEFT;
Drul_array<Grob*> stems (0, 0);
);
vars.push_back (var);
}
- if (i == ties.size() && !specifications_[i].has_manual_position_
+ if (i == ties.size () && !specifications_[i].has_manual_position_
&& ties[i].dir_ == UP)
{
Tie_configuration_variation var;
if (to_boolean (x_refpoint_->layout ()
->lookup_variable (ly_symbol2scm ("debug-tie-scoring"))))
{
- for (vsize i = 0; i < base.size(); i++)
+ for (vsize i = 0; i < base.size (); i++)
{
string card = base.complete_tie_card (i);
specifications_[i].tie_grob_->set_property ("quant-score",
heads_to_tie_ = now_heads_;
}
- for (vsize i = now_tied_heads_.size(); i--;)
+ for (vsize i = now_tied_heads_.size (); i--;)
heads_to_tie_.push_back (now_tied_heads_[i]);
event_ = 0;
}
-MAKE_SCHEME_CALLBACK(Tie, calc_direction, 1);
+MAKE_SCHEME_CALLBACK (Tie, calc_direction, 1);
SCM
Tie::calc_direction (SCM smob)
{
}
-MAKE_SCHEME_CALLBACK(Tie, calc_control_points, 1);
+MAKE_SCHEME_CALLBACK (Tie, calc_control_points, 1);
SCM
Tie::calc_control_points (SCM smob)
{
public:
DECLARE_SCHEME_CALLBACK (constructor, ());
/* construction */
- DECLARE_CLASSNAME(Time_scaled_music_iterator);
+ DECLARE_CLASSNAME (Time_scaled_music_iterator);
Time_scaled_music_iterator ();
protected:
virtual void process (Moment m);
m.main_part_ == next_split_mom_)
{
descend_to_bottom_context ();
- if (tuplet_handler_.get_outlet())
+ if (tuplet_handler_.get_outlet ())
create_event (STOP)->send_to_context (tuplet_handler_.get_outlet ());
if (m.main_part_ < music_get_length ().main_part_)
tuplet_handler_.set_context (0);
}
}
- Music_wrapper_iterator::process(m);
+ Music_wrapper_iterator::process (m);
if (child_iter_ && child_iter_->ok ())
descend_to_child (child_iter_->get_outlet ());
interface_name += "-interface";
/*
- this is only called during program init, so safe to use scm_gc_protect_object()
+ this is only called during program init, so safe to use scm_gc_protect_object ()
*/
inf.symbol_ = scm_gc_protect_object (ly_symbol2scm (interface_name.c_str ()));
ack_array->push_back (inf);
assert (0 == ev_class.find (prefix));
/* "listen_foo_bar" -> "foo-bar" */
- ev_class.erase (0, strlen(prefix));
+ ev_class.erase (0, strlen (prefix));
replace_all (ev_class, '_', '-');
new_ev->origin ()->warning (_f ("Two simultaneous %s events, junking this one", ev_class.c_str ()));
FT_UInt gindex;
FT_CharMap current_cmap = face->charmap;
- FT_Select_Charmap(face, FT_ENCODING_UNICODE);
+ FT_Select_Charmap (face, FT_ENCODING_UNICODE);
int j = 0;
for (charcode = FT_Get_First_Char (face, &gindex); gindex != 0;
GLYPH_NAME_LEN);
if (error)
{
- programming_error ("FT_Get_Glyph_Name(): error.");
+ programming_error ("FT_Get_Glyph_Name (): error.");
glyph_name[0] = 0;
}
}
Note_column::get_stem (cols.back ()));
if (dynamic_cast<Item*> (stems[RIGHT])->get_column ()
- != me->get_bound (RIGHT)->get_column())
+ != me->get_bound (RIGHT)->get_column ())
return 0;
Drul_array<Grob*> beams;
}
-MAKE_SCHEME_CALLBACK(Tuplet_bracket,calc_connect_to_neighbors,1);
+MAKE_SCHEME_CALLBACK (Tuplet_bracket, calc_connect_to_neighbors,1);
SCM
Tuplet_bracket::calc_connect_to_neighbors (SCM smob)
{
return commonx;
}
-MAKE_SCHEME_CALLBACK(Tuplet_bracket,calc_control_points,1)
+MAKE_SCHEME_CALLBACK (Tuplet_bracket, calc_control_points,1)
SCM
Tuplet_bracket::calc_control_points (SCM smob)
{
/*
This may happen if the end of a tuplet is part of a quoted voice.
*/
- Moment now = now_mom();
+ Moment now = now_mom ();
for (vsize i = tuplets_.size (); i --; )
{
if (tuplets_[i].stop_moment_ == now)
struct Tuplet_number
{
- DECLARE_SCHEME_CALLBACK(print, (SCM));
- DECLARE_GROB_INTERFACE();
+ DECLARE_SCHEME_CALLBACK (print, (SCM));
+ DECLARE_GROB_INTERFACE ();
};
-MAKE_SCHEME_CALLBACK(Tuplet_number, print, 1);
+MAKE_SCHEME_CALLBACK (Tuplet_number, print, 1);
SCM
Tuplet_number::print (SCM smob)
{
DECLARE_ACKNOWLEDGER (grob);
};
-Tweak_engraver::Tweak_engraver()
+Tweak_engraver::Tweak_engraver ()
{
}
void
Vaticana_ligature_engraver::check_for_ambiguous_dot_pitch (Grob_info primitive)
{
- // TODO: Fix performance, which is currently O(n^2) (since this
- // method is called O(n) times and takes O(n) steps in the for
- // loop), but could be O(n) (by replacing the for loop by e.g. a
- // bitmask based O(1) test); where n=<number of primitives in the
+ // TODO: Fix performance, which is currently O (n^2) (since this
+ // method is called O (n) times and takes O (n) steps in the for
+ // loop), but could be O (n) (by replacing the for loop by e.g. a
+ // 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 ();