source file of the GNU LilyPond music typesetter
- (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 2000--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
#include "score-engraver.hh"
-#include "repeated-music.hh"
+#include "bar-line.hh"
#include "global-context.hh"
-#include "warn.hh"
-#include "misc.hh"
-#include "spanner.hh"
+#include "international.hh"
#include "item.hh"
+#include "misc.hh"
#include "percent-repeat-iterator.hh"
-#include "bar-line.hh"
+#include "repeated-music.hh"
#include "side-position-interface.hh"
+#include "spanner.hh"
+#include "warn.hh"
#include "translator.icc"
else if (Moment (2) * meas_len == body_length_)
repeat_sign_type_ = DOUBLE_MEASURE;
else
- {
- warning (_f ("can't handle a percent repeat of length: %s",
- body_length_.to_string ()));
- return false;
- }
+ return false;
+
repeat_ = m;
void
Percent_repeat_engraver::process_music ()
{
- if (repeat_ && now_mom () == next_moment_)
+ if (repeat_ && now_mom ().main_part_ == next_moment_.main_part_)
{
count_ ++;
if (repeat_sign_type_ == MEASURE)
Grob *col = unsmob_grob (get_property ("currentCommandColumn"));
percent_->set_bound (LEFT, col);
- if (total_count_ > 2)
+ if (total_count_ > 2
+ && to_boolean (get_property ("countPercentRepeats")))
{
percent_counter_
= make_spanner ("PercentRepeatCounter", repeat_->self_scm ());
-
SCM text = scm_number_to_string (scm_from_int (count_),
scm_from_int (10));
percent_counter_->set_property ("text", text);
{
double_percent_ = make_item ("DoublePercentRepeat", repeat_->self_scm ());
- if (total_count_ > 2)
+ if (total_count_ > 2
+ && to_boolean (get_property ("countPercentRepeats")))
{
double_percent_counter_
= make_item ("DoublePercentRepeatCounter",
get_score_engraver ()->forbid_breaks ();
}
next_moment_ = next_moment_ + body_length_;
+ next_moment_.grace_part_ = Rational (0);
}
}
void
Percent_repeat_engraver::start_translation_timestep ()
{
- if (stop_mom_ == now_mom ())
+ if (stop_mom_.main_part_ == now_mom ().main_part_)
{
if (percent_)
{
}
ADD_TRANSLATOR (Percent_repeat_engraver,
- /* doc */ "Make whole bar and double bar repeats.",
+ /* doc */
+ "Make whole bar and double bar repeats.",
+
/* create */
- "PercentRepeat DoublePercentRepeat "
- "PercentRepeatCounter DoublePercentRepeatCounter",
- /* accept */ "repeated-music",
- /* read */ "measureLength currentCommandColumn",
+ "PercentRepeat "
+ "DoublePercentRepeat "
+ "PercentRepeatCounter "
+ "DoublePercentRepeatCounter",
+
+ /* accept */
+ "repeated-music",
+
+ /* read */
+ "measureLength "
+ "currentCommandColumn "
+ "countPercentRepeats",
+
/* write */ "");