source file of the GNU LilyPond music typesetter
- (c) 1998--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "grob-pitch-tuple.hh"
#include "warn.hh"
#include "note-head.hh"
+#include "staff-symbol-referencer.hh"
/**
Manufacture ties. Acknowledge noteheads, and put them into a
Spanner * tie_column_;
-
protected:
virtual void stop_translation_timestep ();
+ virtual void start_translation_timestep ();
virtual void acknowledge_grob (Grob_info);
virtual bool try_music (Music*);
- virtual void process_acknowledged_grobs ();
+ virtual void process_music ();
void typeset_tie (Grob*);
public:
TRANSLATOR_DECLARATIONS(Tie_engraver);
event_ = mus;
}
- if (event_)
- {
- SCM m = get_property ("automaticMelismata");
- bool am = gh_boolean_p (m) &&gh_scm2bool (m);
- if (am)
- {
- daddy_trans_->set_property ("tieMelismaBusy", m ? SCM_BOOL_T : SCM_BOOL_F);
- }
- }
return true;
}
+void
+Tie_engraver::process_music ()
+{
+ if (event_)
+ daddy_trans_->set_property ("tieMelismaBusy", SCM_BOOL_T);
+}
+
void
Tie_engraver::acknowledge_grob (Grob_info i)
{
for (int i = heads_to_tie_.size (); i--;)
{
Grob *th = heads_to_tie_[i];
- int staff_pos = gh_scm2int (h->get_grob_property ("staff-position"));
- int left_staff_pos = gh_scm2int (th->get_grob_property ("staff-position"));
- if (staff_pos == left_staff_pos)
+ Music * right_mus = unsmob_music (h->get_grob_property ("cause"));
+ Music * left_mus = unsmob_music (th->get_grob_property ("cause"));
+
+ /*
+ maybe should check positions too.
+ */
+ if (right_mus && left_mus
+ && gh_equal_p (right_mus->get_mus_property ("pitch"),
+ left_mus->get_mus_property ("pitch")))
{
- Grob * p = new Spanner (get_property ("Tie"));
+ Grob * p = make_spanner ("Tie");
Tie::set_interface (p); // cannot remove yet!
Tie::set_head (p, LEFT, th);
announce_grob(p, last_event_->self_scm());
}
}
+
+ if (ties_.size () && ! tie_column_)
+ {
+ tie_column_ = make_spanner ("TieColumn");
+ announce_grob(tie_column_, SCM_EOL);
+ }
+
+ if (tie_column_)
+ for (int i = ties_.size (); i--;)
+ Tie_column::add_tie (tie_column_,ties_ [i]);
}
}
void
-Tie_engraver::process_acknowledged_grobs ()
+Tie_engraver::start_translation_timestep ()
{
- if (ties_.size () > 1 && !tie_column_)
- {
- tie_column_ = new Spanner (get_property ("TieColumn"));
+ daddy_trans_->set_property ("tieMelismaBusy",
+ gh_bool2scm (heads_to_tie_.size ()));
- for (int i = ties_.size (); i--;)
- Tie_column::add_tie (tie_column_,ties_ [i]);
-
- announce_grob(tie_column_, SCM_EOL);
- }
}
-
void
Tie_engraver::stop_translation_timestep ()
{
new_head_drul[d] = Tie::head (her, (Direction)-d);
} while (flip (&d) != LEFT);
- index_set_cell (her->get_grob_property ("heads"), LEFT, new_head_drul[LEFT]->self_scm ());
- index_set_cell (her->get_grob_property ("heads"), RIGHT, new_head_drul[RIGHT]->self_scm ());
+ index_set_cell (her->get_grob_property ("head-pair"), LEFT, new_head_drul[LEFT]->self_scm ());
+ index_set_cell (her->get_grob_property ("head-pair"), RIGHT, new_head_drul[RIGHT]->self_scm ());
typeset_grob (her);
}