2004-03-08 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/[a-g].cc: () style cleanup.
+
* Documentation/user/tutorial.itely (Automatic and manual beams):
editing of tutorial.
Context *origin_;
Grob* head_;
bool tied_;
- Accidental_entry();
+ Accidental_entry ();
};
-Accidental_entry::Accidental_entry()
+Accidental_entry::Accidental_entry ()
{
tied_ = false;
done_ = false;
set_property_on_children (Context * trans, const char * sym, SCM val)
{
trans->set_property (sym, val);
- for (SCM p = trans->context_list_; gh_pair_p (p); p = ly_cdr(p))
+ for (SCM p = trans->context_list_; gh_pair_p (p); p = ly_cdr (p))
{
Context *trg = unsmob_context (ly_car (p));
- set_property_on_children(trg, sym, ly_deep_copy(val));
+ set_property_on_children (trg, sym, ly_deep_copy (val));
}
}
bool ignore_octave)
{
int n = pitch->get_notename ();
- int o = pitch->get_octave();
+ int o = pitch->get_octave ();
int a = pitch->get_alteration ();
int curbarnum_i = gh_scm2int (curbarnum);
int accbarnum_i = 0;
Accidental_engraver::get_bar_num ()
{
SCM barnum = get_property ("currentBarNumber");
- SCM smp = get_property("measurePosition");
+ SCM smp = get_property ("measurePosition");
Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
if (mp.main_part_ < Rational (0)
void
Accidental_engraver::process_acknowledged_grobs ()
{
- if (accidentals_.size () && !accidentals_.top().done_)
+ if (accidentals_.size () && !accidentals_.top ().done_)
{
SCM accidentals = get_property ("autoAccidentals");
SCM cautionaries = get_property ("autoCautionaries");
if (!accidental_placement_)
{
accidental_placement_ = make_item ("AccidentalPlacement");
- announce_grob (accidental_placement_, a->self_scm());
+ announce_grob (accidental_placement_, a->self_scm ());
}
Accidental_placement::add_accidental (accidental_placement_, a);
}
}
- for (int i = 0; i < accidentals_.size(); i++)
+ for (int i = 0; i < accidentals_.size (); i++)
{
if (Grob *a = accidentals_[i].accidental_)
typeset_grob (a);
}
if (accidental_placement_)
- typeset_grob(accidental_placement_);
+ typeset_grob (accidental_placement_);
accidental_placement_ = 0;
- accidentals_.clear();
+ accidentals_.clear ();
left_objects_.clear ();
right_objects_.clear ();
}
{
left_objects_.push (info.grob_);
}
- else if (info.grob_->internal_has_interface (ly_symbol2scm("finger-interface")))
+ else if (info.grob_->internal_has_interface (ly_symbol2scm ("finger-interface")))
{
left_objects_.push (info.grob_);
}
trans_ -> set_property ("localKeySignature", ly_deep_copy (sig));
trans_ = trans_->daddy_context_;
}
- set_property_on_children(daddy_context_,"localKeySignature", sig);
+ set_property_on_children (daddy_context_,"localKeySignature", sig);
last_keysig_ = sig;
}
#include "note-collision.hh"
#include "accidental-interface.hh"
-MAKE_SCHEME_CALLBACK(Accidental_placement,alignment_callback, 2);
+MAKE_SCHEME_CALLBACK (Accidental_placement,alignment_callback, 2);
SCM
-Accidental_placement::alignment_callback(SCM s, SCM )
+Accidental_placement::alignment_callback (SCM s, SCM )
{
Grob * me =unsmob_grob (s);
{
a->set_parent (me, X_AXIS);
a->add_offset_callback (alignment_callback_proc, X_AXIS);
- SCM cause = a->get_parent (Y_AXIS)->get_property("cause");
+ SCM cause = a->get_parent (Y_AXIS)->get_property ("cause");
Music *mcause =unsmob_music (cause);
if (!mcause)
which = & ra;
Interval extent;
- for (int i = 0; i < which->size(); i++)
+ for (int i = 0; i < which->size (); i++)
{
- extent.unite (which->elem(i)->extent (item_col, X_AXIS));
+ extent.unite (which->elem (i)->extent (item_col, X_AXIS));
}
if (!extent.is_empty ())
Link_array<Grob> grobs_;
Real offset_;
int notename_;
- Accidental_placement_entry()
+ Accidental_placement_entry ()
{
offset_ =0.0;
notename_ = -1;
int ape_compare (Accidental_placement_entry *const &a,
Accidental_placement_entry *const &b)
{
- return sign (ape_priority (a) - ape_priority(b));
+ return sign (ape_priority (a) - ape_priority (b));
}
int ape_rcompare (Accidental_placement_entry *const &a,
Accidental_placement_entry *const &b)
{
- return -sign (ape_priority (a) - ape_priority(b));
+ return -sign (ape_priority (a) - ape_priority (b));
}
asc.sort (&ape_compare);
- apes->clear();
+ apes->clear ();
int i =0;
int parity = 1;
- while (i < asc.size())
+ while (i < asc.size ())
{
Accidental_placement_entry * a = 0;
if (parity)
- a = asc.pop();
+ a = asc.pop ();
else
a = asc[i++];
parity = !parity;
}
- apes->reverse();
+ apes->reverse ();
}
/*
This routine computes placements of accidentals. During
- add_accidental(), accidentals are already grouped by note, so that
+ add_accidental (), accidentals are already grouped by note, so that
octaves are placed above each other; they form columns. Then the
columns are sorted: the biggest columns go closest to the note.
Then the columns are spaced as closely as possible (using skyline
for (int i= apes.size (); i--;)
{
Accidental_placement_entry * ape = apes[i];
- for (int j = ape->grobs_.size(); j--;)
+ for (int j = ape->grobs_.size (); j--;)
{
Grob * a = ape->grobs_[j];
This is a little kludgy: to get all notes, we look if there are
collisions as well.
*/
- for (int i = note_cols.size() ; i--;)
+ for (int i = note_cols.size () ; i--;)
{
Grob *c = note_cols[i]->get_parent (X_AXIS);
if (Note_collision_interface::has_interface (c))
}
}
- for (int i = note_cols.size() ; i--;)
+ for (int i = note_cols.size () ; i--;)
{
heads.concat (Pointer_group_interface__extract_grobs (note_cols[i],
(Grob*)0,
"note-heads"));
}
- heads.default_sort();
- heads.uniq();
+ heads.default_sort ();
+ heads.uniq ();
common[Y_AXIS] = common_refpoint_of_array (heads, common[Y_AXIS], Y_AXIS);
ape->left_skyline_ = empty_skyline (LEFT);
ape->right_skyline_ = empty_skyline (RIGHT);
- for (int j = apes[i]->grobs_.size(); j--;)
+ for (int j = apes[i]->grobs_.size (); j--;)
{
Grob * a = apes[i]->grobs_[j];
Array<Box> boxes = Accidental_interface::accurate_boxes (a, common);
ape->extents_.concat (boxes);
- for (int j = boxes.size(); j--;)
+ for (int j = boxes.size (); j--;)
{
insert_extent_into_skyline (&ape->left_skyline_, boxes[j], Y_AXIS, LEFT);
insert_extent_into_skyline (&ape->right_skyline_ , boxes[j], Y_AXIS, RIGHT);
Interval total;
- for (int i = apes.size(); i--;)
+ for (int i = apes.size (); i--;)
{
Interval y ;
- for (int j = apes[i]->extents_.size(); j--;)
+ for (int j = apes[i]->extents_.size (); j--;)
{
y.unite (apes[i]->extents_[j][Y_AXIS]);
}
common[X_AXIS] = common_refpoint_of_array (heads, common[X_AXIS], X_AXIS);
Array<Skyline_entry> head_skyline (empty_skyline (LEFT));
Array<Box> head_extents;
- for (int i = heads.size(); i--;)
+ for (int i = heads.size (); i--;)
{
- Box b(heads[i]->extent (common[X_AXIS] , X_AXIS),
+ Box b (heads[i]->extent (common[X_AXIS] , X_AXIS),
heads[i]->extent (common[Y_AXIS], Y_AXIS));
insert_extent_into_skyline (&head_skyline, b , Y_AXIS, LEFT);
left_skyline = new_left_skyline;
}
- for (int i = apes.size(); i--;)
+ for (int i = apes.size (); i--;)
{
Accidental_placement_entry* ape = apes[i];
- for (int j = ape->grobs_.size(); j--;)
+ for (int j = ape->grobs_.size (); j--;)
{
ape->grobs_[j]->translate_axis (ape->offset_, X_AXIS);
}
Interval left_extent, right_extent;
Accidental_placement_entry *ape = apes[0];
- for (int i = ape->extents_.size(); i--;)
+ for (int i = ape->extents_.size (); i--;)
left_extent.unite (ape->offset_ + ape->extents_[i][X_AXIS]);
- ape = apes.top();
- for (int i = ape->extents_.size(); i--;)
+ ape = apes.top ();
+ for (int i = ape->extents_.size (); i--;)
right_extent.unite (ape->offset_ + ape->extents_[i][X_AXIS]);
left_extent[LEFT] -= robust_scm2double (me->get_property ("left-padding"), 0);
- Interval width(left_extent[LEFT], right_extent[RIGHT]);
+ Interval width (left_extent[LEFT], right_extent[RIGHT]);
SCM scm_width = ly_interval2scm (width);
me->set_extent (scm_width, X_AXIS);
- for (int i = apes.size(); i--;)
+ for (int i = apes.size (); i--;)
delete apes[i];
return SCM_UNSPECIFIED;
}
-ADD_INTERFACE(Accidental_placement,
+ADD_INTERFACE (Accidental_placement,
"accidental-placement-interface",
"Resolve accidental collisions.",
"left-padding padding right-padding accidental-grobs positioning-done")
*/
}
- if (!boxes.size())
+ if (!boxes.size ())
boxes.push (b);
Offset o (a->relative_coordinate (common[X_AXIS], X_AXIS),
a->relative_coordinate (common[Y_AXIS], Y_AXIS));
- for(int i = boxes.size(); i--;)
+ for (int i = boxes.size (); i--;)
{
- boxes[i].translate(o);
+ boxes[i].translate (o);
}
return boxes;
if (parens)
mol = parenthesize (me, mol);
- return mol.smobbed_copy();
+ return mol.smobbed_copy ();
}
#include <string.h>
-#include "warn.hh" // error()
+#include "warn.hh" // error ()
#include "libc-extension.hh"
#include "afm.hh"
#include "stencil.hh"
This is not very elegant, in that we need special support for
hara-kiri. Unfortunately, the generic wiring of
force_hara_kiri_callback () (extent and offset callback) is
- such that we might get into a loop if we call extent() or
- offset() the elements.
+ such that we might get into a loop if we call extent () or
+ offset () the elements.
*/
&& Hara_kiri_group_spanner::has_interface (elems[j]))
Hara_kiri_group_spanner::consider_suicide (elems[j]);
- if (!elems[j]-> live())
- elems.del(j);
+ if (!elems[j]->live ())
+ elems.del (j);
}
for (int j =0; j < elems.size (); j++)
TODO: maybe we should rethink and throw out thresholding altogether.
The original function has been taken over by
- align_to_fixed_distance().
+ align_to_fixed_distance ().
*/
void
Align_interface::align_elements_to_extents (Grob * me, Axis a)
class Ambitus_engraver : public Engraver
{
public:
-TRANSLATOR_DECLARATIONS(Ambitus_engraver);
+TRANSLATOR_DECLARATIONS (Ambitus_engraver);
virtual void process_music ();
virtual void acknowledge_grob (Grob_info);
virtual void stop_translation_timestep ();
* most probably arises from an empty voice, such as shared
* global timesig/clef definitions.
*/
- ambitus_->suicide();
+ ambitus_->suicide ();
}
}
}
-ENTER_DESCRIPTION(Ambitus_engraver,
+ENTER_DESCRIPTION (Ambitus_engraver,
/* descr */ "",
/* creats*/ "Ambitus",
/* accepts */ "",
bool ignore_octave_b, bool force_accidental)
{
int notename = pitch->get_notename ();
- int octave = pitch->get_octave();
- int alteration = pitch->get_alteration();
+ int octave = pitch->get_octave ();
+ int alteration = pitch->get_alteration ();
if (force_accidental) // ignore key signature
return 1;
{
if (!num_acc)
return;
- if (pitch->get_alteration())
+ if (pitch->get_alteration ())
{
Stencil accidental (Font_interface::get_default_font (me)->
find_by_name (String ("accidentals-") +
Pitch *pitch_min = unsmob_pitch (me->get_property ("pitch-min"));
if (!pitch_min)
{
- me->programming_error("Ambitus: pitch_min undefined; assuming 0");
+ me->programming_error ("Ambitus: pitch_min undefined; assuming 0");
p_min = 0;
}
else
Pitch *pitch_max = unsmob_pitch (me->get_property ("pitch-max"));
if (!pitch_max)
{
- me->programming_error("Ambitus: pitch_max undefined; assuming 0");
+ me->programming_error ("Ambitus: pitch_max undefined; assuming 0");
p_max = 0;
}
else
class Apply_context_iterator : public Simple_music_iterator
{
public:
- DECLARE_SCHEME_CALLBACK(constructor, ());
+ DECLARE_SCHEME_CALLBACK (constructor, ());
protected:
virtual void process (Moment);
};
{
SCM proc = get_music ()->get_property ("procedure");
- scm_call_1 (proc, get_outlet ()->self_scm());
+ scm_call_1 (proc, get_outlet ()->self_scm ());
Simple_music_iterator::process (m);
}
class Arpeggio_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Arpeggio_engraver);
+ TRANSLATOR_DECLARATIONS (Arpeggio_engraver);
protected:
virtual void acknowledge_grob (Grob_info);
virtual void process_music ();
if (arpeggio_req_)
{
arpeggio_ = make_item ("Arpeggio");
- announce_grob(arpeggio_, arpeggio_req_->self_scm());
+ announce_grob (arpeggio_, arpeggio_req_->self_scm ());
}
}
-ENTER_DESCRIPTION(Arpeggio_engraver,
+ENTER_DESCRIPTION (Arpeggio_engraver,
/* descr */ "Generate an Arpeggio from a Arpeggio_req",
/* creats*/ "Arpeggio",
/* accepts */ "arpeggio-event",
if (dir)
{
arrow = fm->find_by_name ("scripts-arpeggio-arrow-" + to_string (dir));
- heads[dir] -= dir * arrow.extent (Y_AXIS).length();
+ heads[dir] -= dir * arrow.extent (Y_AXIS).length ();
}
for (Real y= heads[LEFT] ; y < heads[RIGHT];
Real lt = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
Real sp = 1.5 * Staff_symbol_referencer::staff_space (me);
- Real dy = heads.length() + sp;
+ Real dy = heads.length () + sp;
Real x = 0.7;
Stencil mol (Lookup::bracket (Y_AXIS, Interval (0, dy), lt, x, lt));
mol.translate_axis (heads[LEFT] - sp/2.0, Y_AXIS);
- return mol.smobbed_copy();
+ return mol.smobbed_copy ();
}
*/
class Auto_beam_engraver : public Engraver
{
- TRANSLATOR_DECLARATIONS(Auto_beam_engraver);
+ TRANSLATOR_DECLARATIONS (Auto_beam_engraver);
protected:
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
bool
Auto_beam_engraver::test_moment (Direction dir, Moment test_mom)
{
- Moment now = now_mom();
+ Moment now = now_mom ();
if (dir == START
&& now.grace_part_)
{
Beam::add_stem (beam, (*stems_)[i]);
}
- announce_grob(beam, SCM_EOL);
+ announce_grob (beam, SCM_EOL);
return beam;
}
beam_start_moment_ = now_mom ();
beam_start_location_ = *unsmob_moment (get_property ("measurePosition"));
- subdivide_beams_ = gh_scm2bool(get_property("subdivideBeams"));
+ subdivide_beams_ = gh_scm2bool (get_property ("subdivideBeams"));
beat_length_ = *unsmob_moment (get_property ("beatLength"));
}
{
if (finished_beam_)
{
- finished_grouping_->beamify(beat_length_, subdivide_beams_);
+ finished_grouping_->beamify (beat_length_, subdivide_beams_);
Beam::set_beaming (finished_beam_, finished_grouping_);
typeset_grob (finished_beam_);
finished_beam_ = 0;
class Auto_change_iterator : public Music_wrapper_iterator
{
public:
- DECLARE_SCHEME_CALLBACK(constructor, ());
+ DECLARE_SCHEME_CALLBACK (constructor, ());
Auto_change_iterator ();
virtual Spanner* get_spanner () ;
virtual void add_element (Grob*) ;
public:
- TRANSLATOR_DECLARATIONS(Axis_group_engraver);
+ TRANSLATOR_DECLARATIONS (Axis_group_engraver);
};
Axis_group_engraver::Axis_group_engraver ()
staffline_->set_bound (LEFT,it);
- announce_grob(staffline_, SCM_EOL);
+ announce_grob (staffline_, SCM_EOL);
}
}
virtual void acknowledge_grob (Grob_info);
virtual void add_element (Grob *e);
public:
- TRANSLATOR_DECLARATIONS(Hara_kiri_engraver);
+ TRANSLATOR_DECLARATIONS (Hara_kiri_engraver);
};
void
}
-Hara_kiri_engraver::Hara_kiri_engraver()
+Hara_kiri_engraver::Hara_kiri_engraver ()
{
}
-ENTER_DESCRIPTION(Hara_kiri_engraver,
+ENTER_DESCRIPTION (Hara_kiri_engraver,
/* descr */ "Like Axis_group_engraver, but make a hara-kiri spanner, and add "
"interesting items (ie. note heads, lyric syllables and normal rests) ",
/* creats*/ "RemoveEmptyVerticalGroup",
/* reads */ "",
/* write */ "");
-ENTER_DESCRIPTION(Axis_group_engraver,
+ENTER_DESCRIPTION (Axis_group_engraver,
/* descr */ "Group all objects created in this context in a VerticalAxisGroup spanner.",
/* creats*/ "VerticalAxisGroup",
/* accepts */ "",
for (int i = X_AXIS; i < NO_AXES; i++)
{
- Axis a((Axis)i);
+ Axis a ((Axis)i);
z1[a] = box_extent [a].linear_combination (sign (off[a]));
text_mol->align_to (a, -sign (off[a]));
}
{
public:
virtual void process (Moment);
- Bar_check_iterator( );
- DECLARE_SCHEME_CALLBACK(constructor, ());
+ Bar_check_iterator ( );
+ DECLARE_SCHEME_CALLBACK (constructor, ());
};
-IMPLEMENT_CTOR_CALLBACK(Bar_check_iterator);
+IMPLEMENT_CTOR_CALLBACK (Bar_check_iterator);
-Bar_check_iterator::Bar_check_iterator()
+Bar_check_iterator::Bar_check_iterator ()
{
}
void
Bar_check_iterator::process (Moment m)
{
- Simple_music_iterator::process(m);
+ Simple_music_iterator::process (m);
if (!m.to_bool ())
{
Context *tr = get_outlet ();
bool warn =true;
if (to_boolean (sync))
{
- tr = tr->where_defined (ly_symbol2scm("measurePosition"));
+ tr = tr->where_defined (ly_symbol2scm ("measurePosition"));
Moment zero;
tr->set_property ("measurePosition", zero.smobbed_copy ());
}
class Bar_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS( Bar_engraver );
+ TRANSLATOR_DECLARATIONS (Bar_engraver);
void request_bar (String type_string);
protected:
if (scm_equal_p (gl, bar_->get_property ("glyph")) != SCM_BOOL_T)
bar_->set_property ("glyph", gl);
- announce_grob(bar_, SCM_EOL);
+ announce_grob (bar_, SCM_EOL);
}
}
This is a little hairy : whichBar may be set by
Repeat_acknowledge_engraver::process_music, which is at score
context. This means that grobs could should be created after
- process_music. We do stuff process_acknowledged_grobs(), just to be
+ process_music. We do stuff process_acknowledged_grobs (), just to be
on the safe side.
*/
}
-ENTER_DESCRIPTION(Bar_engraver,
+ENTER_DESCRIPTION (Bar_engraver,
/* descr */ "Create barlines. This engraver is controlled through the "
"@code{whichBar} property. If it has no bar line to create, it will forbid a linebreak at this point",
/* creats*/ "BarLine",
Real dist = ( Staff_symbol_referencer::line_count (me) & 1 ? 1 :
(staff_space<2 ? 2 : .5) ) * staff_space;
Stencil colon (dot);
- colon.translate_axis(dist,Y_AXIS);
- colon.add_stencil(dot);
- colon.translate_axis(-dist/2,Y_AXIS);
+ colon.translate_axis (dist,Y_AXIS);
+ colon.add_stencil (dot);
+ colon.translate_axis (-dist/2,Y_AXIS);
Stencil m;
virtual void acknowledge_grob (Grob_info);
virtual void process_music ();
void create_items ();
- TRANSLATOR_DECLARATIONS(Bar_number_engraver );
+ TRANSLATOR_DECLARATIONS (Bar_number_engraver );
};
SCM bn = get_property ("currentBarNumber");
SCM proc = get_property ("barNumberVisibility");
if (gh_number_p (bn) && gh_procedure_p (proc)
- && to_boolean(gh_call1(proc, bn)))
+ && to_boolean (gh_call1(proc, bn)))
{
create_items ();
// guh.
text_ = make_item ("BarNumber");
Side_position_interface::set_axis (text_,Y_AXIS);
- announce_grob(text_, SCM_EOL);
+ announce_grob (text_, SCM_EOL);
}
-ENTER_DESCRIPTION(Bar_number_engraver,
+ENTER_DESCRIPTION (Bar_number_engraver,
/* descr */ "A bar number is created whenever measurePosition is zero. It is\n"
"put on top of all staves, and appears only at left side of the staff.",
/* creats*/ "BarNumber",
virtual bool try_music (Music*);
virtual void process_music ();
- virtual bool valid_start_point();
+ virtual bool valid_start_point ();
virtual bool valid_end_point ();
public:
- TRANSLATOR_DECLARATIONS(Beam_engraver);
+ TRANSLATOR_DECLARATIONS (Beam_engraver);
};
always nested.
*/
bool
-Beam_engraver::valid_start_point()
+Beam_engraver::valid_start_point ()
{
Moment n = now_mom ();
}
bool
-Beam_engraver::valid_end_point()
+Beam_engraver::valid_end_point ()
{
return valid_start_point ();
}
beam_info_ = new Beaming_info_list;
/* urg, must copy to Auto_beam_engraver too */
- announce_grob (beam_, start_ev_->self_scm());
+ announce_grob (beam_, start_ev_->self_scm ());
}
}
{
if (finished_beam_)
{
- finished_beam_info_->beamify(beat_length_, subdivide_beams_);
+ finished_beam_info_->beamify (beat_length_, subdivide_beams_);
Beam::set_beaming (finished_beam_, finished_beam_info_);
typeset_grob (finished_beam_);
delete finished_beam_info_;
{
set_melisma (true);
- subdivide_beams_ = to_boolean(get_property("subdivideBeams"));
+ subdivide_beams_ = to_boolean (get_property ("subdivideBeams"));
beat_length_ = *unsmob_moment (get_property ("beatLength"));
}
}
now_stop_ev_ = 0;
beam_ = 0;
beam_info_ = 0;
- typeset_beam();
+ typeset_beam ();
set_melisma (false);
}
}
}
else if (Stem::has_interface (info.grob_))
{
- Moment now = now_mom();
+ Moment now = now_mom ();
if (!valid_start_point ())
return ;
if (Stem::get_beam (stem))
return;
- Music* m = info.music_cause();
+ Music* m = info.music_cause ();
if (!m->is_mus_type ("rhythmic-event"))
{
String s = _ ("stem must have Rhythmic structure");
-ENTER_DESCRIPTION(Beam_engraver,
+ENTER_DESCRIPTION (Beam_engraver,
/* descr */ "Handles Beam events by engraving Beams. If omitted, then notes will be "
"printed with flags instead of beams.",
/* creats*/ "Beam",
class Grace_beam_engraver : public Beam_engraver
{
public:
- TRANSLATOR_DECLARATIONS(Grace_beam_engraver);
+ TRANSLATOR_DECLARATIONS (Grace_beam_engraver);
protected:
- virtual bool valid_start_point();
+ virtual bool valid_start_point ();
virtual bool valid_end_point ();
};
-Grace_beam_engraver::Grace_beam_engraver()
+Grace_beam_engraver::Grace_beam_engraver ()
{
}
bool
-Grace_beam_engraver::valid_start_point()
+Grace_beam_engraver::valid_start_point ()
{
Moment n = now_mom ();
-ENTER_DESCRIPTION(Grace_beam_engraver,
+ENTER_DESCRIPTION (Grace_beam_engraver,
/* descr */ "Handles Beam events by engraving Beams. If omitted, then notes will "
"be printed with flags instead of beams. Only engraves beams when we "
" are at grace points in time. "
class Beam_performer : public Performer {
public:
- TRANSLATOR_DECLARATIONS(Beam_performer);
+ TRANSLATOR_DECLARATIONS (Beam_performer);
protected:
virtual bool try_music (Music *ev) ;
return false;
}
-ENTER_DESCRIPTION(Beam_performer,"","",
+ENTER_DESCRIPTION (Beam_performer,"","",
"beam-event","","","");
-Beam_performer::Beam_performer()
+Beam_performer::Beam_performer ()
{
beam_ = false;
}
Array<Real> base_lengths;
Array<Real> stem_xposns;
- Drul_array<bool> dirs_found(0,0);
+ Drul_array<bool> dirs_found (0,0);
Grob *common[2];
for (int a = 2; a--;)
- common[a] = common_refpoint_of_array (stems, me, Axis(a));
+ common[a] = common_refpoint_of_array (stems, me, Axis (a));
Grob * fvs = first_visible_stem (me);
Grob *lvs = last_visible_stem (me);
stem_y != 0.0, when we're cross staff.
*/
- for (int i= 0; i < stems.size(); i++)
+ for (int i= 0; i < stems.size (); i++)
{
Grob*s = stems[i];
int i = 0;
Real mindist = 1e6;
- for (; i < qscores.size(); i ++)
+ for (; i < qscores.size (); i ++)
{
Real d =fabs (qscores[i].yl- ins[LEFT]) + fabs (qscores[i].yr - ins[RIGHT]);
if (d < mindist)
Direction ldir, Direction rdir)
{
Real dy = yr - yl;
- Drul_array<Real> y(yl,yr);
- Drul_array<Direction> dirs(ldir,rdir);
+ Drul_array<Real> y (yl,yr);
+ Drul_array<Direction> dirs (ldir,rdir);
Real extra_demerit = SECONDARY_BEAM_DEMERIT / (beam_counts[LEFT] >? beam_counts[RIGHT]);
Offset
Box::center () const
{
- return Offset (interval_a_[X_AXIS].center(),
- interval_a_[Y_AXIS].center());
+ return Offset (interval_a_[X_AXIS].center (),
+ interval_a_[Y_AXIS].center ());
}
void
Box::widen (Real x, Real y)
void add_column (SCM);
public:
- TRANSLATOR_DECLARATIONS(Break_align_engraver);
+ TRANSLATOR_DECLARATIONS (Break_align_engraver);
};
void
left_edge_ = make_item ("LeftEdge");
add_to_group (left_edge_->get_property ("break-align-symbol"), left_edge_);
- announce_grob(left_edge_, SCM_EOL);
+ announce_grob (left_edge_, SCM_EOL);
}
add_to_group (align_name, item);
}
void
-Break_align_engraver::add_to_group(SCM align_name, Item*item)
+Break_align_engraver::add_to_group (SCM align_name, Item*item)
{
SCM s = scm_assoc (align_name, column_alist_);
Item * group = 0;
group->set_property ("break-align-symbol", align_name);
group->set_parent (align_, Y_AXIS);
- announce_grob(group, item->self_scm());
+ announce_grob (group, item->self_scm ());
column_alist_ = scm_assoc_set_x (column_alist_, align_name, group->self_scm ());
Axis_group_interface::add_element (group, item);
}
-ENTER_DESCRIPTION(Break_align_engraver,
+ENTER_DESCRIPTION (Break_align_engraver,
/* descr */ "Align grobs with corresponding break-align-symbols into groups, and order the groups according to breakAlignOrder",
/* creats*/ "BreakAlignment BreakAlignGroup LeftEdge",
/* accepts */ "",
idx++;
Array<Real> offsets;
- offsets.set_size (elems.size());
- for (int i= 0; i < offsets.size();i ++)
+ offsets.set_size (elems.size ());
+ for (int i= 0; i < offsets.size ();i ++)
offsets[i] = 0.0;
Real extra_right_space = 0.0;
int edge_idx = -1;
- while (idx < elems.size())
+ while (idx < elems.size ())
{
int next_idx = idx+1;
- while (next_idx < elems.size() &&
+ while (next_idx < elems.size () &&
extents[next_idx].is_empty () )
next_idx++;
Grob *l = elems[idx];
Grob *r = 0;
- if (next_idx < elems.size())
+ if (next_idx < elems.size ())
r = elems[next_idx];
SCM alist = SCM_EOL;
if (edge_idx < 0
&& elt->get_property ("break-align-symbol")
- == ly_symbol2scm( "left-edge"))
+ == ly_symbol2scm ( "left-edge"))
edge_idx = idx;
SCM l =elt->get_property ("space-alist");
- if (gh_pair_p(l))
+ if (gh_pair_p (l))
{
alist= l;
break;
for (SCM s = r ? r->get_property ("elements") : SCM_EOL;
!gh_symbol_p (rsym) && gh_pair_p (s); s = gh_cdr (s))
{
- Grob * elt =unsmob_grob(gh_car (s));
+ Grob * elt =unsmob_grob (gh_car (s));
rsym = elt->get_property ("break-align-symbol");
}
- if (rsym == ly_symbol2scm("left-edge"))
+ if (rsym == ly_symbol2scm ("left-edge"))
edge_idx = next_idx;
SCM entry = SCM_EOL;
if (!entry_found)
{
String sym_string;
- if(gh_symbol_p (rsym))
+ if (gh_symbol_p (rsym))
sym_string = ly_symbol2string (rsym);
String orig_string ;
if (unsmob_grob (l->get_property ("cause")))
orig_string = unsmob_grob (l->get_property ("cause"))->name ();
- programming_error (_f("No spacing entry from %s to `%s'",
+ programming_error (_f ("No spacing entry from %s to `%s'",
orig_string.to_str0 (),
sym_string.to_str0 ()));
}
offsets[next_idx] = extents[idx][RIGHT] + distance
- extents[next_idx][LEFT];
/* should probably junk minimum-space */
- else if (type == ly_symbol2scm("minimum-space"))
+ else if (type == ly_symbol2scm ("minimum-space"))
offsets[next_idx] = extents[idx][RIGHT] >? distance;
}
else
Interval total_extent;
Real alignment_off =0.0;
- for (int i =0 ; i < offsets.size(); i++)
+ for (int i =0 ; i < offsets.size (); i++)
{
here += offsets[i];
if (i == edge_idx)
alignment_off = -total_extent[LEFT];
here = alignment_off;
- for (int i =0 ; i < offsets.size(); i++)
+ for (int i =0 ; i < offsets.size (); i++)
{
here += offsets[i];
elems[i]->translate_axis (here, X_AXIS);
/* now: sc && sc->get_system () == line */
if (!line)
- return sc->self_scm();
+ return sc->self_scm ();
/*
We don't return SCM_UNDEFINED for
return SCM_UNDEFINED;
}
- return sc->self_scm();
+ return sc->self_scm ();
}
if (n != SCM_UNDEFINED)
{
*tail = gh_cons (n, SCM_EOL);
- tail = SCM_CDRLOC(*tail);
+ tail = SCM_CDRLOC (*tail);
}
}
forall g in p (if grob-list):
g := substitute (g)
- for spanners since this is O(SYSTEMCOUNT * GROBCOUNT), and SYSTEMCOUNT =
- O(GROBCOUNT), we have a quadratic algorithm. --for a single spanner
+ for spanners since this is O (SYSTEMCOUNT * GROBCOUNT), and SYSTEMCOUNT =
+ O (GROBCOUNT), we have a quadratic algorithm. --for a single spanner
This is problematic: with large (long) scores, the costs can be
significant; especially all-elements in System, can become huge. For
put grob list in array,
- reorder array so spanners are separate -- O(grobcount)
+ reorder array so spanners are separate -- O (grobcount)
find first and last indexes of grobs on a specific system
- for items this is O(itemcount)
+ for items this is O (itemcount)
- for spanners this is O(sum-of spanner-system-ranges)
+ for spanners this is O (sum-of spanner-system-ranges)
- perform the substitution O(sum-of spanner-system-ranges)
+ perform the substitution O (sum-of spanner-system-ranges)
The complexity is harder to determine, but should be subquadratic;
{
Slice rv;
- if (System*st = sp->get_system())
+ if (System*st = sp->get_system ())
{
rv = Slice (st->rank_, st->rank_);
}
else
{
- if (sp->broken_intos_.size())
- rv = Slice (sp->broken_intos_[0]->get_system()->rank_,
- sp->broken_intos_.top()->get_system()->rank_);
+ if (sp->broken_intos_.size ())
+ rv = Slice (sp->broken_intos_[0]->get_system ()->rank_,
+ sp->broken_intos_.top ()->get_system ()->rank_);
}
return rv;
}
Slice
item_system_range (Item* it)
{
- if (System*st= it->get_system())
+ if (System*st= it->get_system ())
return Slice (st->rank_, st->rank_);
Slice sr;
do
{
Item *bi = it->find_prebroken_piece (d);
- if (bi && bi->get_system())
- sr.add_point (bi->get_system()->rank_);
+ if (bi && bi->get_system ())
+ sr.add_point (bi->get_system ()->rank_);
}
- while (flip(&d)!=LEFT);
+ while (flip (&d)!=LEFT);
return sr;
}
else if (Item* it = dynamic_cast<Item*> (g))
return item_system_range (it);
else
- return Slice();
+ return Slice ();
}
right_ = sr[RIGHT];
}
}
- Substitution_entry()
+ Substitution_entry ()
{
grob_ =0;
left_ = right_ = -2;
static int
spanner_compare (void const * a , void const * b)
{
- return ((Substitution_entry*)a)->length() -
+ return ((Substitution_entry*)a)->length () -
((Substitution_entry*)b)->length ();
}
};
int it_index = 0;
for (SCM s = grob_list; gh_pair_p (s); s = gh_cdr (s))
{
- Grob * g = unsmob_grob (gh_car(s));
+ Grob * g = unsmob_grob (gh_car (s));
Slice sr = grob_system_range (g);
sr.intersect (system_range);
is a waste of time -- the staff-spanners screw up the
ordering, since they go across the entire score.
*/
- for (int i = sp_indices.size(); i--;)
+ for (int i = sp_indices.size (); i--;)
sp_indices[i]= Slice (sp_index, len-1);
assert (it_index <= sp_index);
assert (broken_intos_.size () == system_range.length () + 1);
- for (int i = 0; i < broken_intos_.size(); i++)
+ for (int i = 0; i < broken_intos_.size (); i++)
{
Grob * sc = broken_intos_[i];
System * l = sc->get_system ();
- set_break_subsititution (l ? l->self_scm(): SCM_UNDEFINED);
+ set_break_subsititution (l ? l->self_scm (): SCM_UNDEFINED);
SCM newval = SCM_EOL;
SCM * tail = &newval;
{
*tail = scm_cons (subs, SCM_EOL);
- tail = SCM_CDRLOC(*tail);
+ tail = SCM_CDRLOC (*tail);
}
}
printf ("%d (%d), sp %d (%d)\n",
it_indices [i].length (), it_index,
- sp_indices[i].length() , len -sp_index);
+ sp_indices[i].length () , len -sp_index);
{
SCM l1 =substitute_grob_list (grob_list);
we have a special function here: we want to invoke a special
function for lists of grobs. These can be very long for large
- orchestral scores (eg. 1M elements). do_break_substitution() can
+ orchestral scores (eg. 1M elements). do_break_substitution () can
recurse many levels, taking lots of stack space.
This becomes a problem if lily is linked against guile with
SCM *tail = &l;
for (SCM s = alist; gh_pair_p (s); s = gh_cdr (s))
{
- SCM sym = gh_caar(s);
- SCM val = gh_cdar(s);
+ SCM sym = gh_caar (s);
+ SCM val = gh_cdar (s);
SCM type = scm_object_property (sym, ly_symbol2scm ("backend-type?"));
if (type == grob_list_p)
For the substitution of a single property, we tack the result onto
mutable_property_alist_ ; mutable_property_alist_ is empty after
Grob::Grob (Grob const&), except that System has all-elements set,
- as a side product of typeset_grob() on newly copied spanners.
+ as a side product of typeset_grob () on newly copied spanners.
Here we clear that list explicitly to free some memory and
counter some of the confusion I encountered while debugging
class Breathing_sign_engraver : public Engraver {
public:
- TRANSLATOR_DECLARATIONS(Breathing_sign_engraver);
+ TRANSLATOR_DECLARATIONS (Breathing_sign_engraver);
protected:
virtual bool try_music (Music *req);
{
breathing_sign_ = make_item ("BreathingSign");
- announce_grob(breathing_sign_, breathing_sign_req_->self_scm());
+ announce_grob (breathing_sign_, breathing_sign_req_->self_scm ());
breathing_sign_req_ = 0;
}
}
}
-ENTER_DESCRIPTION(Breathing_sign_engraver,
+ENTER_DESCRIPTION (Breathing_sign_engraver,
/* descr */ "",
/* creats*/ "BreathingSign",
/* accepts */ "breathing-event",
return gh_double2scm (inter_f * sz * d);
}
-ADD_INTERFACE(Breathing_sign, "breathing-sign-interface",
+ADD_INTERFACE (Breathing_sign, "breathing-sign-interface",
"A breathing sign.",
"direction");
class Chord_name_engraver : public Engraver
{
- TRANSLATOR_DECLARATIONS( Chord_name_engraver);
+ TRANSLATOR_DECLARATIONS ( Chord_name_engraver);
protected:
virtual void stop_translation_timestep ();
virtual void process_music ();
void
Chord_name_engraver::process_music ()
{
- if (!notes_.size() )
+ if (!notes_.size () )
return;
SCM bass = SCM_EOL;
SCM chord_as_scm = gh_cons (pitches, gh_cons (bass, inversion));
chord_name_ = make_item ("ChordName");
- chord_name_->set_property("text", markup);
- announce_grob(chord_name_, notes_[0]->self_scm ());
+ chord_name_->set_property ("text", markup);
+ announce_grob (chord_name_, notes_[0]->self_scm ());
SCM s = get_property ("chordChanges");
if (to_boolean (s) && gh_pair_p (last_chord_)
&& gh_equal_p (chord_as_scm, last_chord_))
The READs description is not strictly accurate:
which properties are read depend on the chord naming function active.
*/
-ENTER_DESCRIPTION(Chord_name_engraver,
+ENTER_DESCRIPTION (Chord_name_engraver,
/* descr */ "Catch note-events "
"and generate the appropriate chordname.",
/* creats*/ "ChordName",
class Chord_tremolo_engraver : public Engraver
{
void typeset_beam ();
- TRANSLATOR_DECLARATIONS(Chord_tremolo_engraver);
+ TRANSLATOR_DECLARATIONS (Chord_tremolo_engraver);
protected:
Repeated_music * repeat_;
Moment mp
= (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
beam_start_location_ = mp;
- announce_grob(beam_, repeat_->self_scm());
+ announce_grob (beam_, repeat_->self_scm ());
}
else if (!sequential_body_b_ && !stem_tremolo_)
{
if (flags_)
{
stem_tremolo_ = make_item ("StemTremolo");
- announce_grob(stem_tremolo_, repeat_->self_scm());
+ announce_grob (stem_tremolo_, repeat_->self_scm ());
stem_tremolo_->set_property ("flag-count",
scm_int2num (flags_));
}
{
Grob * s = info.grob_;
- if (start_mom_ == now_mom())
+ if (start_mom_ == now_mom ())
Stem::set_beaming (s, flags_, RIGHT);
else
Stem::set_beaming (s, flags_, LEFT);
-ENTER_DESCRIPTION(Chord_tremolo_engraver,
+ENTER_DESCRIPTION (Chord_tremolo_engraver,
/* descr */ "Generates beams for tremolo repeats.",
/* creats*/ "Beam",
/* accepts */ "repeated-music",
Chord_tremolo_iterator::construct_children ()
{
Repeated_music * rep = dynamic_cast<Repeated_music*> (get_music ());
- factor_ = Moment (Rational(1, 1));
+ factor_ = Moment (Rational (1, 1));
child_iter_ = unsmob_iterator (get_iterator (rep->body ()));
}
}
void
-Chord_tremolo_iterator::do_quit()
+Chord_tremolo_iterator::do_quit ()
{
if (child_iter_)
- child_iter_->quit();
+ child_iter_->quit ();
}
void
Chord_tremolo_iterator::derived_mark () const
{
if (child_iter_)
- scm_gc_mark (child_iter_->self_scm());
+ scm_gc_mark (child_iter_->self_scm ());
}
void
class Clef_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Clef_engraver);
+ TRANSLATOR_DECLARATIONS (Clef_engraver);
Direction octave_dir_;
if (!clef_)
{
Item *c= make_item ("Clef");
- announce_grob(c, SCM_EOL);
+ announce_grob (c, SCM_EOL);
clef_ = c;
SCM cpos = get_property ("clefPosition");
g->set_parent (clef_, X_AXIS);
g->set_property ("direction", scm_int2num (dir));
octavate_ = g;
- announce_grob(octavate_, SCM_EOL);
+ announce_grob (octavate_, SCM_EOL);
}
}
}
-ENTER_DESCRIPTION(Clef_engraver,
+ENTER_DESCRIPTION (Clef_engraver,
/* descr */ "Determine and set reference point for pitches",
/* creats*/ "Clef OctavateEight",
/* accepts */ "",
{
protected:
- TRANSLATOR_DECLARATIONS(Cluster_spanner_engraver);
+ TRANSLATOR_DECLARATIONS (Cluster_spanner_engraver);
virtual bool try_music (Music *);
virtual void process_music ();
virtual void acknowledge_grob (Grob_info);
void
Cluster_spanner_engraver::process_music ()
{
- if (cluster_notes_.size())
+ if (cluster_notes_.size ())
{
SCM c0scm = get_property ("centralCPosition");
{
typeset_grobs ();
- cluster_notes_.clear();
+ cluster_notes_.clear ();
}
}
}
-ENTER_DESCRIPTION(Cluster_spanner_engraver,
+ENTER_DESCRIPTION (Cluster_spanner_engraver,
/* descr */ "Engraves a cluster using Spanner notation ",
/* creats*/ "ClusterSpanner ClusterSpannerBeacon",
/* accepts */ "cluster-note-event",
else
{
programming_error ("#'style should be symbol.");
- me->suicide();
- return Stencil();
+ me->suicide ();
+ return Stencil ();
}
{
Box box;
box.add_point (bottom_points[i] - hvpadding);
- box.add_point (Offset(top_points[i + 1][X_AXIS],
+ box.add_point (Offset (top_points[i + 1][X_AXIS],
top_points[i][Y_AXIS]) + hvpadding);
out.add_stencil (Lookup::round_filled_box (box, blotdiameter));
}
for (int i = 0; i < size - 1; i++)
{
Box box;
- box.add_point (Offset(bottom_points[i][X_AXIS],
+ box.add_point (Offset (bottom_points[i][X_AXIS],
bottom_points[i + 1][Y_AXIS]) - hvpadding);
box.add_point (top_points[i + 1] + hvpadding);
out.add_stencil (Lookup::round_filled_box (box, blotdiameter));
Spanner *spanner = dynamic_cast<Spanner*> (me);
if (!spanner)
{
- me->programming_error ("Cluster::print(): not a spanner");
+ me->programming_error ("Cluster::print (): not a spanner");
return SCM_EOL;
}
{
Spanner *orig = dynamic_cast<Spanner*> (spanner->original_);
- if (spanner->get_break_index () < orig->broken_intos_.size()-1)
+ if (spanner->get_break_index () < orig->broken_intos_.size ()-1)
{
Spanner * next = orig->broken_intos_[spanner->get_break_index () + 1];
SCM cols = next->get_property ("columns");
*
* - collect all accidentals that occur within the ligature and put
* them at the left side of the ligature (TODO; see function
- * collect_accidentals()),
+ * collect_accidentals ()),
*
* - collapse superflous space after each ligature (TODO).
*
* of the ligature (to preemptively avoid collision with adjacent
* notes); or maybe just additionally create a
* mensural/vaticana/whatever-ligature grob (e.g. via
- * Mensural_ligature::print(SCM)) that just consists of a
+ * Mensural_ligature::print (SCM)) that just consists of a
* bounding box around all primitives of the ligature.
*
- * TODO: Maybe move functions fold_up_primitives() and
- * join_primitives() from subclasses to here? N.B. it is not
+ * TODO: Maybe move functions fold_up_primitives () and
+ * join_primitives () from subclasses to here? N.B. it is not
* appropriate to put these into Ligature_engraver, since, for
* example, Ligature_bracket_engraver does not share any of this code.
*/
* TODO: Let superflous space after each ligature collapse. The
* following code should help in doing so (though it does not yet
* fully work). Just put the following code into
- * Spacing_spanner::do_measure(). I put it temporarily here as memo
+ * Spacing_spanner::do_measure (). I put it temporarily here as memo
* until it really works and I also get Han-Wen's/Jan's permission to
* add it to the spacing spanner code.
*/
sibling_parent->warning (_f ("Coherent_ligature_engraver: "
"setting `spacing-increment = "
"0.01': ptr=%ul", parent));
- sibling_parent->set_property("forced-spacing",
+ sibling_parent->set_property ("forced-spacing",
gh_double2scm (0.01));
#endif
sibling->set_parent (column, X_AXIS);
int prev_pitch = 0;
int delta_pitch = 0;
Item *prev_primitive = 0, *primitive = 0;
- for (int i = 0; i < primitives.size(); i++) {
+ for (int i = 0; i < primitives.size (); i++) {
primitive = dynamic_cast<Item*> (primitives[i].grob_);
Music *music_cause = primitives[i].music_cause ();
int pitch =
virtual void process_acknowledged_grobs ();
virtual void stop_translation_timestep ();
public:
- TRANSLATOR_DECLARATIONS(Collision_engraver);
+ TRANSLATOR_DECLARATIONS (Collision_engraver);
};
-ENTER_DESCRIPTION(Collision_engraver,
+ENTER_DESCRIPTION (Collision_engraver,
/* descr */ "",
/* creats*/ "NoteCollision",
/* accepts */ "",
When we catch the note, we predict the end of the note. We keep the
events living until we reach the predicted end-time.
- Every time process_music() is called and there are note events, we
+ Every time process_music () is called and there are note events, we
figure out how long the note to typeset should be. It should be no
longer than what's specified, than what is left to do and it should
not cross barlines.
Duration find_nearest_duration (Rational length);
public:
- TRANSLATOR_DECLARATIONS(Completion_heads_engraver);
+ TRANSLATOR_DECLARATIONS (Completion_heads_engraver);
protected:
virtual void initialize ();
first_b_ = true;
Moment musiclen = m->get_length ();
- Moment now = now_mom();
+ Moment now = now_mom ();
if (now_mom ().grace_part_)
{
{
int log_limit= 6;
- Duration d(0,0);
+ Duration d (0,0);
/*
this could surely be done more efficient. Left to the reader as an
Item *note = make_item ("NoteHead");
Music * req = note_reqs_[i];
- if (scratch_note_reqs_.size())
+ if (scratch_note_reqs_.size ())
{
req = scratch_note_reqs_[i];
SCM pits = note_reqs_[i]->get_property ("pitch");
notes_.push (note);
}
- if (prev_notes_.size() == notes_.size ())
+ if (prev_notes_.size () == notes_.size ())
{
- for (int i= 0; i < notes_.size(); i++)
+ for (int i= 0; i < notes_.size (); i++)
{
Grob * p = make_spanner ("Tie");
Tie::set_interface (p); // cannot remove yet!
Tie::set_head (p, RIGHT, notes_[i]);
ties_.push (p);
- announce_grob(p, SCM_EOL);
+ announce_grob (p, SCM_EOL);
}
}
don't do complicated arithmetic with grace notes.
*/
if (orig
- && now_mom().grace_part_ )
+ && now_mom ().grace_part_ )
{
left_to_do_ = Rational (0,0);
}
{
for (int i = ties_.size (); i--;)
typeset_grob (ties_[i]);
- ties_.clear();
+ ties_.clear ();
for (int i=0; i < notes_.size (); i++)
{
typeset_grob (notes_[i]);
}
- if (notes_.size())
+ if (notes_.size ())
prev_notes_ = notes_;
notes_.clear ();
}
dots_.clear ();
- for (int i = scratch_note_reqs_.size(); i--;)
+ for (int i = scratch_note_reqs_.size (); i--;)
{
scm_gc_unprotect_object (scratch_note_reqs_[i]->self_scm () );
}
- scratch_note_reqs_.clear();
+ scratch_note_reqs_.clear ();
}
void
}
}
-Completion_heads_engraver::Completion_heads_engraver()
+Completion_heads_engraver::Completion_heads_engraver ()
{
}
-ENTER_DESCRIPTION(Completion_heads_engraver,
+ENTER_DESCRIPTION (Completion_heads_engraver,
/* descr */ "This engraver replaces "
"@code{Note_heads_engraver}. It plays some trickery to "
"break long notes and automatically tie them into the next measure.",
*/
+/*
+ TODO: should junk this class an replace by
+ a single list of context modifications?
+ */
+
#include "lily-proto.hh"
#include "context-def.hh"
#include "translator-group.hh"
context_name_ = SCM_EOL;
description_ = SCM_EOL;
- smobify_self();
+ smobify_self ();
}
Context_def::~Context_def ()
context_name_ = SCM_EOL;
description_ = SCM_EOL;
- smobify_self();
+ smobify_self ();
description_ = s.description_;
accept_mods_ = s.accept_mods_;
this following line was added in 1.9.3, but hsould've been
there all along... Let's hope it doesn't cause nightmares.
*/
- best_depth = result.size();
+ best_depth = result.size ();
}
}
{
Context_def * t = new Context_def (*this);
- SCM x = t->self_scm();
+ SCM x = t->self_scm ();
scm_gc_unprotect_object (x);
return x;
}
{
Context_def* t = new Context_def;
- SCM x =t->self_scm();
+ SCM x =t->self_scm ();
scm_gc_unprotect_object (x);
return x;
}
class Context_specced_music_iterator : public Music_wrapper_iterator
{
public:
- DECLARE_SCHEME_CALLBACK(constructor,());
+ DECLARE_SCHEME_CALLBACK (constructor,());
virtual void construct_children ();
};
if (a)
set_translator (a);
- Music_wrapper_iterator::construct_children();
+ Music_wrapper_iterator::construct_children ();
}
-IMPLEMENT_CTOR_CALLBACK(Context_specced_music_iterator);
+IMPLEMENT_CTOR_CALLBACK (Context_specced_music_iterator);
Context_def * td = unsmob_context_def (t->definition_);
/*
- this can not move before add_context(), because \override
+ this can not move before add_context (), because \override
operations require that we are in the hierarchy.
*/
td->apply_default_property_operations (t);
SCM
Context::properties_as_alist () const
{
- return properties_dict()->to_alist();
+ return properties_dict ()->to_alist ();
}
String
? daddy_context_->get_output_def () : 0;
}
-Context::~Context()
+Context::~Context ()
{
}
Moment
Context::now_mom () const
{
- return daddy_context_->now_mom();
+ return daddy_context_->now_mom ();
}
int
IMPLEMENT_SMOBS (Context);
IMPLEMENT_DEFAULT_EQUAL_P (Context);
-IMPLEMENT_TYPE_P(Context,"ly:context?");
+IMPLEMENT_TYPE_P (Context,"ly:context?");
bool
Context::try_music (Music* m)
class Custos_engraver : public Engraver
{
public:
-TRANSLATOR_DECLARATIONS( Custos_engraver);
+ TRANSLATOR_DECLARATIONS (Custos_engraver);
virtual void start_translation_timestep ();
virtual void acknowledge_grob (Grob_info);
virtual void process_acknowledged_grobs ();
Item *item = dynamic_cast <Item *> (info.grob_);
if (item)
{
- Music * m = info.music_cause();
+ Music * m = info.music_cause ();
if (Bar_line::has_interface (info.grob_))
custos_permitted = true;
else if (Note_head::has_interface (info.grob_)
{
Item* custos = make_item ("Custos");
- announce_grob(custos, SCM_EOL);
+ announce_grob (custos, SCM_EOL);
custodes_.push (custos);
return custos;
-ENTER_DESCRIPTION(Custos_engraver,
+ENTER_DESCRIPTION (Custos_engraver,
/* descr */ "",
/* creats*/ "Custos",
/* accepts */ "",
Grob * stem_;
Link_array<Item> heads_;
public:
- TRANSLATOR_DECLARATIONS(
- Dot_column_engraver );
+ TRANSLATOR_DECLARATIONS (Dot_column_engraver );
protected:
virtual void acknowledge_grob (Grob_info);
if (!dotcol_)
{
dotcol_ = make_item ("DotColumn");
- announce_grob(dotcol_, SCM_EOL);
+ announce_grob (dotcol_, SCM_EOL);
}
Dot_column::add_head (dotcol_, info.grob_);
-ENTER_DESCRIPTION(Dot_column_engraver,
+ENTER_DESCRIPTION (Dot_column_engraver,
/* descr */ " Engraves dots on dotted notes shifted to the right of the note.\n"
"If omitted, then dots appear on top of the notes.",
/* creats*/ "DotColumn",
return gh_double2scm (0.0);
}
-MAKE_SCHEME_CALLBACK(Dot_column,side_position, 2);
+MAKE_SCHEME_CALLBACK (Dot_column,side_position, 2);
SCM
Dot_column::side_position (SCM element_smob, SCM axis)
{
Link_array<Music> events_;
public:
- TRANSLATOR_DECLARATIONS(Drum_notes_engraver);
+ TRANSLATOR_DECLARATIONS (Drum_notes_engraver);
protected:
virtual bool try_music (Music *ev) ;
virtual void stop_translation_timestep ();
};
-Drum_notes_engraver::Drum_notes_engraver()
+Drum_notes_engraver::Drum_notes_engraver ()
{
}
- announce_grob (note,ev->self_scm());
+ announce_grob (note,ev->self_scm ());
notes_.push (note);
}
}
-ENTER_DESCRIPTION(Drum_notes_engraver,
+ENTER_DESCRIPTION (Drum_notes_engraver,
/* descr */ "Generate noteheads.",
/* creats*/ "NoteHead Dots Script",
/* accepts */ "note-event busy-playing-event",
class Drum_note_performer : public Performer {
public:
- TRANSLATOR_DECLARATIONS(Drum_note_performer);
+ TRANSLATOR_DECLARATIONS (Drum_note_performer);
protected:
virtual bool try_music (Music *ev) ;
return false;
}
-ENTER_DESCRIPTION(Drum_note_performer,
+ENTER_DESCRIPTION (Drum_note_performer,
"Play drum notes.","",
"note-event busy-playing-event","","","");
-Drum_note_performer::Drum_note_performer()
+Drum_note_performer::Drum_note_performer ()
{
}
void typeset_all ();
-TRANSLATOR_DECLARATIONS(Dynamic_engraver );
+TRANSLATOR_DECLARATIONS (Dynamic_engraver );
protected:
virtual void finalize ();
Music * rq = accepted_spanreqs_drul_[START];
if (script_ev_)
rq = script_ev_ ;
- announce_grob(line_spanner_, rq ? rq->self_scm(): SCM_EOL);
+ announce_grob (line_spanner_, rq ? rq->self_scm (): SCM_EOL);
}
}
Axis_group_interface::add_element (line_spanner_, script_);
- announce_grob(script_, script_ev_->self_scm());
+ announce_grob (script_, script_ev_->self_scm ());
}
Music *stop_ev = accepted_spanreqs_drul_ [STOP] ?
}
else if (accepted_spanreqs_drul_[STOP] )
{
- accepted_spanreqs_drul_[STOP]->origin ()->warning(_ ("can't find start of (de)crescendo"));
+ accepted_spanreqs_drul_[STOP]->origin ()->warning (_ ("can't find start of (de)crescendo"));
stop_ev = 0;
}
add_bound_item (line_spanner_, cresc_->get_bound (LEFT));
- announce_grob(cresc_, accepted_spanreqs_drul_[START]->self_scm());
+ announce_grob (cresc_, accepted_spanreqs_drul_[START]->self_scm ());
}
}
}
typeset_all ();
if (line_spanner_
- && !line_spanner_->live())
+ && !line_spanner_->live ())
line_spanner_ = 0;
if (line_spanner_)
{
}
if (cresc_
- && !cresc_->live())
+ && !cresc_->live ())
cresc_ = 0;
if (cresc_)
{
Maybe just check at typeset_grob ()?
*/
if (finished_cresc_
- && !finished_cresc_->live())
+ && !finished_cresc_->live ())
finished_cresc_ = 0;
if (finished_line_spanner_
- && !finished_line_spanner_->live())
+ && !finished_line_spanner_->live ())
finished_line_spanner_ = 0;
if (finished_cresc_)
{
if (line_spanner_
/* Don't refill killed spanner */
- && line_spanner_->live())
+ && line_spanner_->live ())
{
Side_position_interface::add_support (line_spanner_,i.grob_);
add_bound_item (line_spanner_,dynamic_cast<Item*> (i.grob_));
}
}
}
-ENTER_DESCRIPTION(Dynamic_engraver,
+ENTER_DESCRIPTION (Dynamic_engraver,
/* descr */
"This engraver creates hairpins, dynamic texts, and their vertical\n"
"alignments. The symbols are collected onto a DynamicLineSpanner grob\n"
class Dynamic_performer : public Performer
{
public:
- TRANSLATOR_DECLARATIONS(Dynamic_performer);
+ TRANSLATOR_DECLARATIONS (Dynamic_performer);
protected:
virtual bool try_music (Music* req);
virtual void stop_translation_timestep ();
return false;
}
-ENTER_DESCRIPTION(Dynamic_performer,
+ENTER_DESCRIPTION (Dynamic_performer,
/*descr*/ "",
/* creats*/ "",
/* accepts */ "absolute-dynamic-event",
engraver_each (get_simple_trans_list (),
&Engraver::process_acknowledged_grobs);
- if (!announce_infos_.size())
+ if (!announce_infos_.size ())
break;
acknowledge_grobs ();
Translator_group::initialize ();
}
-Engraver_group_engraver::Engraver_group_engraver() {}
+Engraver_group_engraver::Engraver_group_engraver () {}
-ENTER_DESCRIPTION(Engraver_group_engraver,
+ENTER_DESCRIPTION (Engraver_group_engraver,
/* descr */ "A group of engravers taken together",
/* creats*/ "",
/* accepts */ "",
bool
engraver_valid (Translator*tr, SCM ifaces)
{
- SCM ack_ifs = scm_assoc (ly_symbol2scm ("interfaces-acked"), tr->translator_description());
+ SCM ack_ifs = scm_assoc (ly_symbol2scm ("interfaces-acked"), tr->translator_description ());
ack_ifs = gh_cdr (ack_ifs);
for (SCM s = ifaces; ly_pair_p (s); s = ly_cdr (s))
if (scm_memq (ly_car (s), ack_ifs) != SCM_BOOL_F)
-Engraver::Engraver()
+Engraver::Engraver ()
{
}
}
-ENTER_DESCRIPTION(Engraver,
+ENTER_DESCRIPTION (Engraver,
"", "",
"",
"", "", "");
bool gotcha = try_music (mus);
if (!gotcha)
- mus->origin ()->warning (_f ("Junking event: `%s'", mus->name()));
+ mus->origin ()->warning (_f ("Junking event: `%s'", mus->name ()));
}
}
Simple_music_iterator::process (m);
{
}
-ADD_MUSIC(Event);
-LY_DEFINE(ly_music_duration_length, "ly:music-duration-length", 1, 0,0,
+ADD_MUSIC (Event);
+LY_DEFINE (ly_music_duration_length, "ly:music-duration-length", 1, 0,0,
(SCM mus),
"Extract the duration field from @var{mus}, and return the length.")
{
- Music* m = unsmob_music(mus);
- SCM_ASSERT_TYPE(m, mus, SCM_ARG1, __FUNCTION__, "Music");
+ Music* m = unsmob_music (mus);
+ SCM_ASSERT_TYPE (m, mus, SCM_ARG1, __FUNCTION__, "Music");
Duration *d = unsmob_duration (m->get_property ("duration"));
l = d->get_length ();
}
else
- programming_error("Music has no duration");
- return l.smobbed_copy();
+ programming_error ("Music has no duration");
+ return l.smobbed_copy ();
}
-LY_DEFINE(ly_music_duration_compress, "ly:music-duration-compress", 2, 0,0,
+LY_DEFINE (ly_music_duration_compress, "ly:music-duration-compress", 2, 0,0,
(SCM mus, SCM factor),
"Extract the duration field from @var{mus}, and compress it.")
{
- Music* m = unsmob_music(mus);
+ Music* m = unsmob_music (mus);
Moment * f = unsmob_moment (factor);
- SCM_ASSERT_TYPE(m, mus, SCM_ARG1, __FUNCTION__, "Music");
- SCM_ASSERT_TYPE(f, factor, SCM_ARG2, __FUNCTION__, "Moment");
+ SCM_ASSERT_TYPE (m, mus, SCM_ARG1, __FUNCTION__, "Music");
+ SCM_ASSERT_TYPE (f, factor, SCM_ARG2, __FUNCTION__, "Moment");
Duration *d = unsmob_duration (m->get_property ("duration"));
if (d)
- m->set_property ("duration", d->compressed (f->main_part_).smobbed_copy());
+ m->set_property ("duration", d->compressed (f->main_part_).smobbed_copy ());
return SCM_UNSPECIFIED;
}
TODO: this should use ly:pitch.
*/
-LY_DEFINE(ly_transpose_key_alist, "ly:transpose-key-alist",
+LY_DEFINE (ly_transpose_key_alist, "ly:transpose-key-alist",
2, 0,0, (SCM l, SCM pitch),
"Make a new key alist of @var{l} transposed by pitch @var{pitch}")
{
orig = orig.transposed (*p);
key =scm_int2num (orig.get_notename ());
- alter = scm_int2num (orig.get_alteration());
+ alter = scm_int2num (orig.get_alteration ());
newlist = gh_cons (gh_cons (key, alter), newlist);
}
}
{
SCM pa = get_property ("pitch-alist");
- set_property ("pitch-alist", ly_transpose_key_alist (pa, p.smobbed_copy()));
+ set_property ("pitch-alist", ly_transpose_key_alist (pa, p.smobbed_copy ()));
Pitch tonic = *unsmob_pitch (get_property ("tonic"));
set_property ("tonic",
tonic.smobbed_copy ());
Spanner* extender_;
Spanner * pending_extender_;
public:
- TRANSLATOR_DECLARATIONS(Extender_engraver);
+ TRANSLATOR_DECLARATIONS (Extender_engraver);
protected:
virtual void acknowledge_grob (Grob_info);
if (ev_)
{
extender_ = make_spanner ("LyricExtender");
- announce_grob (extender_, ev_->self_scm());
+ announce_grob (extender_, ev_->self_scm ());
}
}
-ENTER_DESCRIPTION(Extender_engraver,
+ENTER_DESCRIPTION (Extender_engraver,
/* descr */ "Create lyric extenders",
/* creats*/ "LyricExtender",
/* accepts */ "extender-event",
class Figured_bass_engraver : public Engraver
{
- TRANSLATOR_DECLARATIONS(Figured_bass_engraver);
+ TRANSLATOR_DECLARATIONS (Figured_bass_engraver);
protected:
Link_array<Music> figures_;
Music * rest_req_;
};
-Figured_bass_engraver::Figured_bass_engraver()
+Figured_bass_engraver::Figured_bass_engraver ()
{
figure_ = 0;
rest_req_ = 0;
if (rest_req_)
{
figure_ = make_item ("BassFigure");
- announce_grob(figure_, rest_req_->self_scm()); // todo
+ announce_grob (figure_, rest_req_->self_scm ()); // todo
figure_->set_property ("text" , scm_makfrom0str ("-"));
}
else if (figures_.size ())
SCM l = SCM_EOL;
for (int i = 0; i <figures_.size (); i++)
- l = gh_cons (figures_[i]->self_scm(), l);
+ l = gh_cons (figures_[i]->self_scm (), l);
SCM markup = scm_call_2 (proc, l, daddy_context_->self_scm ());
figure_ = make_item ("BassFigure");
figure_->set_property ("text", markup);
- announce_grob(figure_, figures_[0]->self_scm()); // todo
+ announce_grob (figure_, figures_[0]->self_scm ()); // todo
}
}
}
-ENTER_DESCRIPTION(Figured_bass_engraver,
+ENTER_DESCRIPTION (Figured_bass_engraver,
/* descr */ "Make figured bass numbers.",
/* creats*/ "BassFigure",
/* accepts */ "rest-event bass-figure-event",
Link_array<Item> fingerings_;
public:
- TRANSLATOR_DECLARATIONS(Fingering_engraver);
+ TRANSLATOR_DECLARATIONS (Fingering_engraver);
protected:
virtual bool try_music (Music* m);
virtual void stop_translation_timestep ();
void
Fingering_engraver::process_music ()
{
- for (int i= reqs_.size(); i--;)
+ for (int i= reqs_.size (); i--;)
{
SCM dir = reqs_[i]->get_property ("direction");
make_script (to_dir (dir), reqs_[i], Y_AXIS, i);
SCM dig = r->get_property ("digit");
fingering->set_property ("text", scm_number_to_string (dig, gh_int2scm (10)));
- announce_grob (fingering, r->self_scm());
+ announce_grob (fingering, r->self_scm ());
fingerings_.push (fingering);
}
reqs_.clear ();
}
-Fingering_engraver::Fingering_engraver()
+Fingering_engraver::Fingering_engraver ()
{
}
-ENTER_DESCRIPTION(Fingering_engraver,
+ENTER_DESCRIPTION (Fingering_engraver,
/* descr */ "Create fingering-scripts",
/* creats*/ "Fingering",
/* accepts */ "fingering-event",
return main_iter_ || alternative_iter_;
}
void
-Folded_repeat_iterator::do_quit()
+Folded_repeat_iterator::do_quit ()
{
- if (main_iter_)main_iter_->quit();
- if (alternative_iter_)alternative_iter_->quit();
+ if (main_iter_)main_iter_->quit ();
+ if (alternative_iter_)alternative_iter_->quit ();
}
Moment
alternative_iter_->process (m - main_length_mom_);
if (!alternative_iter_->ok ())
{
- alternative_iter_->quit();
+ alternative_iter_->quit ();
alternative_iter_ =0;
}
}
ugh.
*/
Simultaneous_music_iterator * s = new Simultaneous_music_iterator;
- s->separate_contexts_b_ = true;
+ s->create_separate_contexts_ = true;
s->init_translator (mus, get_outlet ());
alternative_iter_ = s;
alternative_iter_->construct_children ();
- scm_gc_unprotect_object (s->self_scm());
+ scm_gc_unprotect_object (s->self_scm ());
}
}
return 0;
}
void
-Folded_repeat_iterator::derived_mark()const
+Folded_repeat_iterator::derived_mark ()const
{
if (main_iter_)
- scm_gc_mark (main_iter_->self_scm());
+ scm_gc_mark (main_iter_->self_scm ());
if (alternative_iter_)
- scm_gc_mark (alternative_iter_->self_scm());
+ scm_gc_mark (alternative_iter_->self_scm ());
}
void
Box
Font_metric::get_indexed_char (int k) const
{
- return get_ascii_char(k);
+ return get_ascii_char (k);
}
{
Font_metric * m = (Font_metric*) SCM_CELL_WORD_1 (s);
- m->derived_mark();
+ m->derived_mark ();
return m->description_;
}
return m;
}
-LY_DEFINE(ly_find_glyph_by_name, "ly:find-glyph-by-name", 2 , 0, 0,
+LY_DEFINE (ly_find_glyph_by_name, "ly:find-glyph-by-name", 2 , 0, 0,
(SCM font, SCM name),
"This function retrieves a Stencil for the glyph named @var{name} in "
"@var{font}. The font must be available as an AFM file. If the glyph "
"is not found, #f is returned. ")
{
Font_metric *fm = unsmob_metrics (font);
- SCM_ASSERT_TYPE(fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
- SCM_ASSERT_TYPE(gh_string_p (name), name, SCM_ARG2, __FUNCTION__, "string");
+ SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
+ SCM_ASSERT_TYPE (gh_string_p (name), name, SCM_ARG2, __FUNCTION__, "string");
Stencil m = fm->find_by_name (ly_scm2string (name));
return m.smobbed_copy ();
}
-LY_DEFINE(ly_get_glyph, "ly:get-glyph", 2 , 0, 0,
+LY_DEFINE (ly_get_glyph, "ly:get-glyph", 2 , 0, 0,
(SCM font, SCM index),
"This function retrieves a Stencil for the glyph numbered @var{index} in "
"@var{font}. ")
{
Font_metric *fm = unsmob_metrics (font);
- SCM_ASSERT_TYPE(fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
- SCM_ASSERT_TYPE(gh_number_p (index), index, SCM_ARG2, __FUNCTION__, "number");
+ SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
+ SCM_ASSERT_TYPE (gh_number_p (index), index, SCM_ARG2, __FUNCTION__, "number");
return fm->get_ascii_char_stencil (gh_scm2int (index)).smobbed_copy ();
}
-LY_DEFINE(ly_text_dimension,"ly:text-dimension", 2 , 0, 0,
+LY_DEFINE (ly_text_dimension,"ly:text-dimension", 2 , 0, 0,
(SCM font, SCM text),
"Given the font metric in @var{font} and the string @var{text}, compute "
"the extents of that text in that font. The return value is a pair of "
{
Box b;
Font_metric *fm = unsmob_metrics (font);
- SCM_ASSERT_TYPE(fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
- SCM_ASSERT_TYPE(gh_string_p (text), text, SCM_ARG2, __FUNCTION__, "string");
+ SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
+ SCM_ASSERT_TYPE (gh_string_p (text), text, SCM_ARG2, __FUNCTION__, "string");
b = fm->text_dimension (ly_scm2string (text));
- return gh_cons (ly_interval2scm (b[X_AXIS]), ly_interval2scm(b[Y_AXIS]));
+ return gh_cons (ly_interval2scm (b[X_AXIS]), ly_interval2scm (b[Y_AXIS]));
}
Stencil
class Font_size_engraver : public Engraver
{
- TRANSLATOR_DECLARATIONS(Font_size_engraver);
+ TRANSLATOR_DECLARATIONS (Font_size_engraver);
protected:
virtual void acknowledge_grob (Grob_info gi);
private:
}
-ENTER_DESCRIPTION(Font_size_engraver,
+ENTER_DESCRIPTION (Font_size_engraver,
/* descr */ "Puts fontSize into font-relative-size grob property.",
/* creats*/ "",
/* accepts */ "",
class Forbid_line_break_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Forbid_line_break_engraver);
+ TRANSLATOR_DECLARATIONS (Forbid_line_break_engraver);
virtual void start_translation_timestep ();
};
-Forbid_line_break_engraver::Forbid_line_break_engraver(){}
+Forbid_line_break_engraver::Forbid_line_break_engraver (){}
void
-Forbid_line_break_engraver::start_translation_timestep()
+Forbid_line_break_engraver::start_translation_timestep ()
{
/*
Check for running note heads. This should probably be done elsewhere.
*/
SCM busy = get_property ("busyGrobs");
- Moment now = now_mom();
+ Moment now = now_mom ();
while (gh_pair_p (busy) && unsmob_moment (gh_caar (busy))->main_part_ == now.main_part_)
busy = gh_cdr (busy);
Grob *g = unsmob_grob (gh_cdar (busy));
if (Rhythmic_head::has_interface (g))
{
- get_score_engraver()->forbid_breaks();
+ get_score_engraver ()->forbid_breaks ();
}
- busy = gh_cdr(busy);
+ busy = gh_cdr (busy);
}
}
-ENTER_DESCRIPTION(Forbid_line_break_engraver,
+ENTER_DESCRIPTION (Forbid_line_break_engraver,
/* descr */ "Forbid line breaks when note heads are still playing at some point.",
/* creats*/ "",
/* accepts */ "",
}
-LY_DEFINE(ly_get_all_function_documentation, "ly:get-all-function-documentation",
+LY_DEFINE (ly_get_all_function_documentation, "ly:get-all-function-documentation",
0,0,0, (),
"Get a hash table with all lilypond Scheme extension functions.")
{
class Glissando_engraver : public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Glissando_engraver);
+ TRANSLATOR_DECLARATIONS (Glissando_engraver);
protected:
virtual void acknowledge_grob (Grob_info);
-ENTER_DESCRIPTION(Glissando_engraver,
+ENTER_DESCRIPTION (Glissando_engraver,
/* descr */ "Engrave a glissandi",
/* creats*/ "Glissando",
/* accepts */ "glissando-event",
/* do the last one */
if (breaks.size () % HAPPY_DOTS_I)
- progress_indication (String ("[") + to_string (breaks.size()) + "]");
+ progress_indication (String ("[") + to_string (breaks.size ()) + "]");
progress_indication ("\n");
Column_x_positions cp (optimal_paths[final_breaks[i]].line_config_);
lines.push (cp);
- if(!cp.satisfies_constraints_)
+ if (!cp.satisfies_constraints_)
warning ("Could not find line breaking that satisfies constraints.");
}
return lines;
Moment
Grace_iterator::pending_moment () const
{
- Moment cp =Music_wrapper_iterator::pending_moment();
+ Moment cp =Music_wrapper_iterator::pending_moment ();
Moment pending;
pending.grace_part_ = start_mom_.grace_part_ + cp.main_part_;
void check_and_fix_all_prefixes (Array<Grob_info> primitives)
{
/* Check for illegal head modifier combinations */
- for (int i = 0; i < primitives.size(); i++)
+ for (int i = 0; i < primitives.size (); i++)
{
Grob *primitive = primitives[i].grob_;
int prev_prefix_set = 0;
int prev_context_info = 0;
int prev_pitch = 0;
- for (int i = 0; i < primitives.size(); i++) {
+ for (int i = 0; i < primitives.size (); i++) {
Grob *primitive = primitives[i].grob_;
Music *music_cause = primitives[i].music_cause ();
int context_info = 0;
SCM l = parse_symbol_list (vars);
- ly_add_interface(s,d,l);
+ ly_add_interface (s,d,l);
}
-LY_DEFINE(ly_add_interface, "ly:add-interface", 3,0,0, (SCM a, SCM b, SCM c),
+LY_DEFINE (ly_add_interface, "ly:add-interface", 3,0,0, (SCM a, SCM b, SCM c),
"Add an interface description.")
{
SCM_ASSERT_TYPE (gh_symbol_p (a), a, SCM_ARG1, __FUNCTION__, "symbol");
SCM_ASSERT_TYPE (gh_string_p (b), b, SCM_ARG2, __FUNCTION__, "string");
- SCM_ASSERT_TYPE (gh_list_p(c), c, SCM_ARG3, __FUNCTION__, "list of syms");
+ SCM_ASSERT_TYPE (gh_list_p (c), c, SCM_ARG3, __FUNCTION__, "list of syms");
if (!gh_vector_p (all_ifaces))
{
all_ifaces = scm_make_vector (gh_int2scm (40), SCM_EOL);
}
-LY_DEFINE(ly_all_grob_interfaces, "ly:all-grob-interfaces",
+LY_DEFINE (ly_all_grob_interfaces, "ly:all-grob-interfaces",
0,0,0, (),
"Get a hash table with all interface descriptions.")
{
if (iface == SCM_BOOL_F)
{
String msg = to_string ("Unknown interface `%s'",
- ly_symbol2string (gh_car(ifs)).to_str0 ());
+ ly_symbol2string (gh_car (ifs)).to_str0 ());
programming_error (msg);
continue;
}
{
String str = to_string ("Grob %s has no interface for property %s",
me->name ().to_str0 (),
- ly_symbol2string(sym).to_str0 ());
+ ly_symbol2string (sym).to_str0 ());
programming_error (str);
}
}
Grob_pitch_tuple::time_compare (Grob_pitch_tuple const&h1,
Grob_pitch_tuple const &h2)
{
- return Moment::compare(h1.end_, h2.end_);
+ return Moment::compare (h1.end_, h2.end_);
}
class Grob_pq_engraver: public Engraver
{
public:
- TRANSLATOR_DECLARATIONS(Grob_pq_engraver);
+ TRANSLATOR_DECLARATIONS (Grob_pq_engraver);
protected:
virtual void initialize ();
virtual void acknowledge_grob (Grob_info);
};
-Grob_pq_engraver::Grob_pq_engraver()
+Grob_pq_engraver::Grob_pq_engraver ()
{
}
daddy_context_->set_property ("busyGrobs", SCM_EOL);
}
-LY_DEFINE(ly_grob_pq_less_p, "ly:grob-pq-less?",
+LY_DEFINE (ly_grob_pq_less_p, "ly:grob-pq-less?",
2, 0 ,0, (SCM a, SCM b),
"Compare 2 Grob PQ entries. Internal")
{
Moment end = n + l;
SCM lst = scm_acons (end.smobbed_copy (),
- gi.grob_->self_scm(),
+ gi.grob_->self_scm (),
SCM_EOL);
SCM busy= get_property ("busyGrobs");
void
Grob_pq_engraver::start_translation_timestep ()
{
- Moment now = now_mom();
+ Moment now = now_mom ();
SCM start_busy = get_property ("busyGrobs");
SCM busy = start_busy;
Todo: do something sensible. The grob-pq-engraver is not water
tight, and stuff like tupletSpannerDuration confuses it.
*/
- programming_error (_f("Skipped something?\nGrob %s ended before "
+ programming_error (_f ("Skipped something?\nGrob %s ended before "
"I expected it to end.",
- unsmob_grob (gh_cdar (busy))->name().to_str0()));
+ unsmob_grob (gh_cdar (busy))->name ().to_str0()));
busy = gh_cdr (busy);
}
}
-ENTER_DESCRIPTION(Grob_pq_engraver,
+ENTER_DESCRIPTION (Grob_pq_engraver,
/* descr */ "Administrate when certain grobs (eg. note heads) stop playing; this \
engraver is a sort-of a failure, since it doesn't handle all sorts of \
set_prop (name,cons (thing, get_prop (name)))
- since it can reuse the handle returned by scm_assq().
+ since it can reuse the handle returned by scm_assq ().
*/
void
Grob::add_to_list_property (SCM sym, SCM thing)
mutable prop list.
*/
handle = scm_sloppy_assq (sym, immutable_property_alist_);
- SCM tail = (handle != SCM_BOOL_F) ? gh_cdr(handle) : SCM_EOL;
+ SCM tail = (handle != SCM_BOOL_F) ? gh_cdr (handle) : SCM_EOL;
SCM val = gh_cons (thing, tail);
mutable_property_alist_ = gh_cons (gh_cons (sym, val),
mutable_property_alist_ = SCM_EOL;
/*
- We do smobify_self() as the first step. Since the object lives on
+ We do smobify_self () as the first step. Since the object lives on
the heap, none of its SCM variables are protected from GC. After
- smobify_self(), they are.
+ smobify_self (), they are.
*/
smobify_self ();
*/
bool itc = internal_type_checking_global_b;
internal_type_checking_global_b = false;
- internal_set_property (ly_symbol2scm ("interfaces"), gh_cdr(ifs));
+ internal_set_property (ly_symbol2scm ("interfaces"), gh_cdr (ifs));
internal_type_checking_global_b = itc;
}
Stencil *
Grob::get_stencil () const
{
- if (!live())
+ if (!live ())
{
return 0;
}
because some Spanners have enormously long lists in their
properties.
*/
- for (SCM s = mutable_property_alist_; gh_pair_p(s);
- s = gh_cdr(s))
+ for (SCM s = mutable_property_alist_; gh_pair_p (s);
+ s = gh_cdr (s))
{
sp->substitute_one_mutable_property (gh_caar (s),
gh_cdar (s));
return;
#if 0 // see below.
- String nm = name();
+ String nm = name ();
#endif
mutable_property_alist_ = SCM_EOL;
Grob *
common_refpoint_of_array (Link_array<Grob> const &arr, Grob *common, Axis a)
{
- for (int i = arr.size() ; i--; )
+ for (int i = arr.size () ; i--; )
{
Grob * s = arr[i];
if (!s)
void
Grob::warning (String s)const
{
- SCM cause = self_scm();
+ SCM cause = self_scm ();
while (Grob * g = unsmob_grob (cause))
{
cause = g->get_property ("cause");
if (Music *m = unsmob_music (cause))
{
- m->origin()->warning (s);
+ m->origin ()->warning (s);
}
else
::warning (s);
*/
-MAKE_SCHEME_CALLBACK(Horizontal_bracket, print, 1);
+MAKE_SCHEME_CALLBACK (Horizontal_bracket, print, 1);
SCM
Horizontal_bracket::print (SCM smob)
Spanner *sp = dynamic_cast<Spanner*> (me);
Link_array<Grob> gs = Pointer_group_interface__extract_grobs (me,(Grob*)0, "columns");
- if (!gs.size())
+ if (!gs.size ())
{
- me->suicide();
+ me->suicide ();
return SCM_EOL;
}
Grob * cx = common_refpoint_of_array (gs, me, X_AXIS);
cx = cx->common_refpoint (sp->get_bound (LEFT), X_AXIS);
cx = cx->common_refpoint (sp->get_bound (RIGHT),X_AXIS);
- Interval ext = gs.top()->extent (cx, X_AXIS);
+ Interval ext = gs.top ()->extent (cx, X_AXIS);
ext.unite (gs[0]->extent (cx, X_AXIS));
Direction d = get_grob_direction (me);
b.translate_axis ( - sp->get_bound (LEFT)->relative_coordinate (cx, X_AXIS), X_AXIS);
- return b.smobbed_copy();
+ return b.smobbed_copy ();
}
ADD_INTERFACE (Horizontal_bracket,"horizontal-bracket-interface",
DECLARE_SCHEME_CALLBACK(constructor, ());
/// make a new context for every child.
- bool separate_contexts_b_;
+ bool create_separate_contexts_;
virtual void construct_children ();
virtual Moment pending_moment () const;
Simultaneous_music_iterator::Simultaneous_music_iterator ()
{
- separate_contexts_b_ = false;
+ create_separate_contexts_ = false;
children_list_ = SCM_EOL;
}
void
-Simultaneous_music_iterator::derived_mark()const
+Simultaneous_music_iterator::derived_mark () const
{
scm_gc_mark (children_list_);
}
void
-Simultaneous_music_iterator::derived_substitute(Context *f,Context *t)
+Simultaneous_music_iterator::derived_substitute (Context *f,Context *t)
{
for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr(s))
unsmob_iterator (gh_car (s))-> substitute_outlet (f,t);
SCM scm_iter = get_static_get_iterator (mus);
Music_iterator * mi = unsmob_iterator (scm_iter);
- /* if separate_contexts_b_ is set, create a new context with the
+ /* if create_separate_contexts_ is set, create a new context with the
number number as name */
SCM name = unsmob_context_def (get_outlet ()->definition_)->get_context_name ();
- Context * t = (j && separate_contexts_b_)
+ Context * t = (j && create_separate_contexts_)
? get_outlet ()->find_create_context (name, to_string (j), SCM_EOL)
: get_outlet ();
Simultaneous_music_iterator::process (Moment until)
{
SCM *proc = &children_list_;
- while(gh_pair_p (*proc))
+ while (gh_pair_p (*proc))
{
Music_iterator * i = unsmob_iterator (gh_car (*proc));
if (i->run_always ()
unsmob_iterator (gh_car (s))->quit();
}
-
IMPLEMENT_CTOR_CALLBACK (Simultaneous_music_iterator);