#include "self-alignment-interface.hh"
#include "side-position-interface.hh"
#include "stem.hh"
-#include "stream-event.hh"
+#include "stem.hh"
#include "warn.hh"
#include "translator.icc"
{
Grob *head_;
Grob *script_;
- Stream_event *note_event_;
- Stream_event *finger_event_;
+ Music *note_event_;
+ Music *finger_event_;
bool follow_into_staff_;
int position_;
note_event_ = finger_event_ = 0;
follow_into_staff_ = false;
}
+ static int compare (Finger_tuple const &c1, Finger_tuple const &c2)
+ {
+ return c1.position_- c2.position_;
+ }
};
-bool
-operator< (Finger_tuple const &a, Finger_tuple const &b)
-{
- return a.position_ < b.position_;
-}
-
class New_fingering_engraver : public Engraver
{
vector<Finger_tuple> fingerings_;
void stop_translation_timestep ();
DECLARE_ACKNOWLEDGER (rhythmic_head);
DECLARE_ACKNOWLEDGER (stem);
- void add_fingering (Grob *, Stream_event *, Stream_event *);
- void add_script (Grob *, Stream_event *, Stream_event *);
- void add_string (Grob *, Stream_event *, Stream_event *);
+ void add_fingering (Grob *, Music *, Music *);
+ void add_script (Grob *, Music *, Music *);
+ void add_string (Grob *, Music *, Music *);
void position_scripts (SCM orientations, vector<Finger_tuple> *);
};
void
New_fingering_engraver::acknowledge_rhythmic_head (Grob_info inf)
{
- Stream_event *note_ev = inf.event_cause ();
+ Music *note_ev = inf.music_cause ();
if (!note_ev)
return;
for (SCM s = arts; scm_is_pair (s); s = scm_cdr (s))
{
- Stream_event *ev = unsmob_stream_event (scm_car (s));
+ Music *m = unsmob_music (scm_car (s));
- if (!ev)
+ if (!m)
continue;
- if (ev->in_event_class ("fingering-event"))
- add_fingering (inf.grob (), ev, note_ev);
- else if (ev->in_event_class ("text-script-event"))
- ev->origin ()->warning (_ ("can't add text scripts to individual note heads"));
- else if (ev->in_event_class ("script-event"))
- add_script (inf.grob (), ev, note_ev);
- else if (ev->in_event_class ("string-number-event"))
- add_string (inf.grob (), ev, note_ev);
- else if (ev->in_event_class ("harmonic-event"))
+ if (m->is_mus_type ("fingering-event"))
+ add_fingering (inf.grob (), m, note_ev);
+ else if (m->is_mus_type ("text-script-event"))
+ m->origin ()->warning (_ ("can't add text scripts to individual note heads"));
+ else if (m->is_mus_type ("script-event"))
+ add_script (inf.grob (), m, note_ev);
+ else if (m->is_mus_type ("string-number-event"))
+ add_string (inf.grob (), m, note_ev);
+ else if (m->is_mus_type ("harmonic-event"))
{
inf.grob ()->set_property ("style", ly_symbol2scm ("harmonic"));
Grob *d = unsmob_grob (inf.grob ()->get_object ("dot"));
void
New_fingering_engraver::add_script (Grob *head,
- Stream_event *event,
- Stream_event *note)
+ Music *event,
+ Music *note)
{
(void) note;
void
New_fingering_engraver::add_fingering (Grob *head,
- Stream_event *event,
- Stream_event *hevent)
+ Music *event,
+ Music *hevent)
{
Finger_tuple ft;
void
New_fingering_engraver::add_string (Grob *head,
- Stream_event *event,
- Stream_event *hevent)
+ Music *event,
+ Music *hevent)
{
Finger_tuple ft;
}
}
- vector_sort (*scripts, less<Finger_tuple> ());
+ vector_sort (*scripts, Finger_tuple::compare);
bool up_p = scm_c_memq (ly_symbol2scm ("up"), orientations) != SCM_BOOL_F;
bool down_p = scm_c_memq (ly_symbol2scm ("down"), orientations) != SCM_BOOL_F;