#include "command-request.hh"
#include "tuplet-spanner.hh"
#include "note-column.hh"
-#include "compressed-music.hh"
-
+#include "time-scaled-music.hh"
#include "beam.hh"
#include "music-list.hh"
bool
Tuplet_engraver::do_try_music (Music *r)
{
- if (Compressed_music * c = dynamic_cast<Compressed_music *> (r))
+ if (Time_scaled_music * c = dynamic_cast<Time_scaled_music *> (r))
{
Music *el = c->element_l ();
if (!dynamic_cast<Request_chord*> (el))
{
- compressed_music_arr_.push (c);
+ time_scaled_music_arr_.push (c);
stop_moments_.push (now_mom () + c->length_mom ());
}
return true;
void
Tuplet_engraver::do_process_requests ()
{
+ int dir = 0;
+ SCM prop = get_property ("tupletDirection", 0);
+ if (isdir_b (prop))
+ dir = to_dir (prop);
+ int visibility = 3;
+ prop = get_property ("tupletVisibility", 0);
+ if (SCM_NUMBERP(prop))
+ visibility = gh_scm2int (prop); // bool ?
+
for (int i= started_span_p_arr_.size ();
- i < compressed_music_arr_.size (); i++)
+ i < time_scaled_music_arr_.size (); i++)
{
Tuplet_spanner* glep = new Tuplet_spanner;
started_span_p_arr_.push (glep);
- glep->number_str_ = to_str (compressed_music_arr_[i]->den_i_);
- announce_element (Score_element_info (glep, compressed_music_arr_ [i]));
+ glep->number_str_ = to_str (time_scaled_music_arr_[i]->den_i_);
+ glep->set_elt_property(tuplet_visibility_scm_sym,
+ gh_int2scm (visibility));
+ if (dir != 0)
+ glep->set_elt_property(dir_forced_scm_sym, gh_int2scm (dir));
+ announce_element (Score_element_info (glep, time_scaled_music_arr_ [i]));
}
}
void
Tuplet_engraver::acknowledge_element (Score_element_info i)
{
+ bool grace= (i.elem_l_->get_elt_property (grace_scm_sym) != SCM_BOOL_F);
+ SCM wg = get_property ("weAreGraceContext",0);
+ bool wgb = gh_boolean_p (wg) && gh_scm2bool (wg);
+ if (grace != wgb)
+ return;
+
if (Note_column *nc = dynamic_cast<Note_column *> (i.elem_l_))
{
for (int j =0; j <started_span_p_arr_.size (); j++)
else if (Beam *b = dynamic_cast<Beam *> (i.elem_l_))
{
for (int j = 0; j < started_span_p_arr_.size (); j++)
- started_span_p_arr_[j]->set_beam (b);
+ started_span_p_arr_[j]->add_beam (b);
}
}
typeset_element (started_span_p_arr_[i]);
started_span_p_arr_.del (i);
stop_moments_.del(i);
- compressed_music_arr_.del(i);
+ time_scaled_music_arr_.del(i);
}
}
}