source file of the GNU LilyPond music typesetter
- (c) 2000--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
enum {
UNKNOWN,
- BEAT,
MEASURE,
DOUBLE_MEASURE,
} repeat_sign_type_ ;
- Item * beat_slash_;
Item * double_percent_;
Spanner * perc_;
Spanner * finished_perc_;
- Item * stem_tremolo_;
protected:
virtual void finalize ();
virtual bool try_music (Music*);
Percent_repeat_engraver::Percent_repeat_engraver ()
{
- perc_ = finished_perc_ = 0;
+ perc_ = 0;
+ finished_perc_ = 0;
repeat_ =0;
- stem_tremolo_ = 0;
- beat_slash_ = 0;
double_percent_ = 0;
}
if (unsmob_moment (m))
meas_len = *unsmob_moment (m);
- if (body_length_ < meas_len &&
- meas_len.main_part_.mod_rat (body_length_.main_part_) == Moment (Rational (0,0)))
- repeat_sign_type_ = BEAT;
- else if (meas_len == body_length_)
+ if (meas_len == body_length_)
repeat_sign_type_ = MEASURE;
else if (Moment (2)* meas_len == body_length_)
{
{
if (repeat_ && now_mom () == next_moment_)
{
- if (repeat_sign_type_ == BEAT)
- {
- beat_slash_ = new Item (get_property ("RepeatSlash"));
- announce_grob(beat_slash_, repeat_->self_scm());
- }
- else if (repeat_sign_type_ == MEASURE)
+ if (repeat_sign_type_ == MEASURE)
{
finished_perc_ = perc_;
typeset_perc ();
- perc_ = new Spanner (get_property ("PercentRepeat"));
+ perc_ = make_spanner ("PercentRepeat");
SCM col =get_property ("currentCommandColumn");
perc_->set_bound (LEFT, unsmob_grob (col));
announce_grob(perc_, repeat_->self_scm());
}
else if (repeat_sign_type_ == DOUBLE_MEASURE)
{
- double_percent_ = new Item (get_property ("DoublePercentRepeat"));
+ double_percent_ = make_item ("DoublePercentRepeat");
announce_grob(double_percent_, repeat_->self_scm());
/*
typeset_perc ();
if (perc_)
{
- repeat_->origin ()->warning (_ ("unterminated chord tremolo"));
+ repeat_->origin ()->warning (_ ("unterminated percent repeat"));
perc_->suicide ();
}
}
finished_perc_ = 0;
}
- if (beat_slash_)
- {
- typeset_grob (beat_slash_);
- beat_slash_ = 0;
- }
-
if (double_percent_)
{
typeset_grob (double_percent_);
ENTER_DESCRIPTION(Percent_repeat_engraver,
-/* descr */ "Make beat, whole bar and double bar repeats.",
-/* creats*/ "PercentRepeat RepeatSlash DoublePercentRepeat",
+/* descr */ "Make whole bar and double bar repeats.",
+/* creats*/ "PercentRepeat DoublePercentRepeat",
/* accepts */ "repeated-music",
/* acks */ "",
/* reads */ "measureLength currentCommandColumn",