/*
completion-note-heads-engraver.cc -- Completion_heads_engraver
- (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
#include <cctype>
+using namespace std;
#include "rhythmic-head.hh"
#include "output-def.hh"
#include "duration.hh"
#include "pitch.hh"
-
-
/*
TODO: make matching rest engraver.
*/
return true;
}
else if (m->is_mus_type ("busy-playing-event"))
- {
- return note_events_.size () && is_first_;
- }
+ return note_events_.size () && is_first_;
return false;
}
continue;
}
else
- {
- d = Duration (d.duration_log () + 1, 2);
- }
+ d = Duration (d.duration_log () + 1, 2);
}
if (d.duration_log () >= log_limit)
Duration note_dur;
Duration *orig = 0;
if (left_to_do_)
- {
- note_dur = find_nearest_duration (left_to_do_);
- }
+ note_dur = find_nearest_duration (left_to_do_);
else
{
orig = unsmob_duration (note_events_[0]->get_property ("duration"));
}
if (orig)
- {
- left_to_do_ = orig->get_length ();
- }
+ left_to_do_ = orig->get_length ();
if (orig && note_dur.get_length () != orig->get_length ())
{
Item *note = make_item ("NoteHead", event->self_scm ());
note->set_property ("duration-log",
- scm_int2num (note_dur.duration_log ()));
+ scm_from_int (note_dur.duration_log ()));
int dots = note_dur.dot_count ();
if (dots)
measly attempt to save an eeny-weenie bit of memory.
*/
if (dots != scm_to_int (d->get_property ("dot-count")))
- d->set_property ("dot-count", scm_int2num (dots));
+ d->set_property ("dot-count", scm_from_int (dots));
d->set_parent (note, Y_AXIS);
dots_.push (d);
if (scm_is_number (c0))
pos += scm_to_int (c0);
- note->set_property ("staff-position", scm_int2num (pos));
+ note->set_property ("staff-position", scm_from_int (pos));
notes_.push (note);
}
for (int i = 0; i < notes_.size (); i++)
{
Grob *p = make_spanner ("Tie", SCM_EOL);
- Tie::set_interface (p); // cannot remove yet!
-
Tie::set_head (p, LEFT, prev_notes_[i]);
Tie::set_head (p, RIGHT, notes_[i]);
*/
if (orig
&& now_mom ().grace_part_)
- {
- left_to_do_ = Rational (0, 0);
- }
+ left_to_do_ = Rational (0, 0);
}
void
dots_.clear ();
for (int i = scratch_note_events_.size (); i--;)
- {
- scratch_note_events_[i]->unprotect ();
- }
+ scratch_note_events_[i]->unprotect ();
scratch_note_events_.clear ();
}
#include "translator.icc"
ADD_TRANSLATOR (Completion_heads_engraver,
- /* descr */ "This engraver replaces "
+ /* doc */ "This engraver replaces "
"@code{Note_heads_engraver}. It plays some trickery to "
"break long notes and automatically tie them into the next measure.",
- /* creats*/ "NoteHead Dots Tie",
- /* accepts */ "busy-playing-event note-event",
- /* reads */ "middleCPosition measurePosition measureLength",
+ /* create */ "NoteHead Dots Tie",
+ /* accept */ "busy-playing-event note-event",
+ /* read */ "middleCPosition measurePosition measureLength",
/* write */ "");