source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "repeat-engraver.hh"
#include "musical-request.hh"
#include "multi-measure-rest.hh"
#include "command-request.hh"
-#include "time-description.hh"
+#include "timing-translator.hh"
#include "engraver-group-engraver.hh"
-#include "new-repeated-music.hh"
-#include "time-description.hh"
+#include "repeated-music.hh"
+#include "timing-translator.hh"
#include "volta-spanner.hh"
#include "note-column.hh"
#include "paper-def.hh"
if (repeated_music_l_)
return false;
- if (r->semi_fold_b_)
+ if (r->volta_fold_b_)
{
repeated_music_l_ = r;
}
We acknowledge other types of unfolded music as well, to
get auto context selection right.
*/
- return true;
+ if (r->type_ == "volta" || r->type_ == "unfolded")
+ return true;
}
return false;
/**
Walk through repeat music, and generate events for appropriate times.
+
+ UGH. Should use Music_iteration for this.
+
+ Should also queue some event to get timing information reset during
+ 2nd and following voltas.
*/
void
Repeat_engraver::queue_events ()
Music_sequence* alt = repeated_music_l_->alternatives_p_;
Moment walk_mom = now_mom () + repeated_music_l_->repeat_body_p_->length_mom ();
- bool create_volta = ! get_property ("noVoltaBraces",0).to_bool ();
+ SCM novolta = get_property ("noVoltaBraces");
+ bool create_volta = !to_boolean (novolta);
Cons_list<Bar_create_event> becel;
becel.append (new Bar_create_event (now_mom (), "|:"));
becel.append (c);
last_number = volta_number;
volta_number ++;
+ SCM l (get_property ("voltaSpannerDuration"));
+ if (SMOB_IS_TYPE_B (Moment, l))
+ {
+ Moment vSD_mom = *SMOB_TO_TYPE (Moment,l);
+ if ( vSD_mom < i->car_->length_mom() ) // terminate volta early ?
+ {
+ vSD_mom += walk_mom;
+ c->last_b_ = true;
+ becel.append (new Bar_create_event (vSD_mom, "stop"));
+ }
+ }
}
- // should think about voltaSpannerDuration
walk_mom += i->car_->length_mom();
if (i->next_)
}
void
-Repeat_engraver::do_process_requests ()
+Repeat_engraver::do_process_music ()
{
if (repeated_music_l_ && !done_this_one_b_)
{
else
{
assert (!volta_span_p_);
- volta_span_p_ = new Volta_spanner;
+ volta_span_p_ = new Volta_spanner (get_property ("basicVoltaSpannerProperties"));
announce_element (Score_element_info (volta_span_p_,0));
- volta_span_p_->number_str_ = t;
- volta_span_p_->last_b_ = head->car_->last_b_;
+ volta_span_p_->set_elt_property ("text",
+ ly_str02scm (t.ch_C()));
+ volta_span_p_->set_elt_property ("last-volta",
+ gh_bool2scm (head->car_->last_b_));
// voltaSpannerDuration stuff here.
// other property stuff here.
}
}
else
{
- warning ("No bar engraver found. Ignoring repeats.");
+ warning (_ ("No bar engraver found. Ignoring repeats."));
}
delete head->car_;