/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 2002--2010 Han-Wen Nienhuys, Jean-Baptiste Lamy <jiba@tuxfamily.org>,
+ Copyright (C) 2002--2011 Han-Wen Nienhuys, Jean-Baptiste Lamy <jiba@tuxfamily.org>,
LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
class Tab_note_heads_engraver : public Engraver
{
- vector<Item *> notes_;
-
vector<Stream_event *> note_events_;
vector<Stream_event *> tabstring_events_;
+ vector<Stream_event *> fingering_events_;
+
public:
TRANSLATOR_DECLARATIONS (Tab_note_heads_engraver);
protected:
DECLARE_TRANSLATOR_LISTENER (note);
DECLARE_TRANSLATOR_LISTENER (string_number);
+ DECLARE_TRANSLATOR_LISTENER (fingering);
void process_music ();
void stop_translation_timestep ();
tabstring_events_.push_back (ev);
}
+IMPLEMENT_TRANSLATOR_LISTENER (Tab_note_heads_engraver, fingering);
+void
+Tab_note_heads_engraver::listen_fingering (Stream_event *ev)
+{
+ fingering_events_.push_back (ev);
+}
+
void
Tab_note_heads_engraver::process_music ()
{
SCM tab_strings = articulation_list (note_events_,
tabstring_events_,
"string-number-event");
+ SCM defined_fingers = articulation_list (note_events_,
+ fingering_events_,
+ "fingering-event");
SCM tab_notes = ly_cxx_vector_to_list (note_events_);
SCM proc = get_property ("noteToFretFunction");
SCM string_fret_finger = SCM_EOL;
string_fret_finger = scm_call_3 (proc,
context ()->self_scm (),
tab_notes,
- tab_strings);
+ scm_list_2 (tab_strings,
+ defined_fingers));
SCM note_entry = SCM_EOL;
SCM string_number = SCM_EOL;
SCM fret = SCM_EOL;
context ()->self_scm (),
string_number);
note->set_property ("staff-position", staff_position);
- notes_.push_back (note);
}
}
void
Tab_note_heads_engraver::stop_translation_timestep ()
{
- notes_.clear ();
note_events_.clear ();
tabstring_events_.clear ();
+ fingering_events_.clear ();
}
ADD_TRANSLATOR (Tab_note_heads_engraver,
/* doc */
- "Generate one or more tablature noteheads from event of type"
+ "Generate one or more tablature note heads from event of type"
" @code{NoteEvent}.",
/* create */
"TabNoteHead ",
/* read */
+ "defaultStrings "
"fretLabels "
"highStringOne "
"middleCPosition "
"tablatureFormat "
"tabStaffLineLayoutFunction ",
- /* write */ ""
+ /* write */
+ ""
);