]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/fretboard-engraver.cc
Fix 442.
[lilypond.git] / lily / fretboard-engraver.cc
index 98375a3db77471a2d75c331751548d84eb0c3ec4..4cbd08578c8db8cd5fd94af599ee7a118ba78198 100644 (file)
@@ -21,6 +21,7 @@
 #include <cstdio>
 using namespace std;
 
+#include "articulations.hh"
 #include "context.hh"
 #include "item.hh"
 #include "engraver.hh"
@@ -37,15 +38,15 @@ class Fretboard_engraver : public Engraver
 {
   Item *fret_board_;
 
-  vector<Stream_event*> note_events_;
-  vector<Stream_event*> tabstring_events_;
+  vector<Stream_event *> note_events_;
+  vector<Stream_event *> tabstring_events_;
 public:
   TRANSLATOR_DECLARATIONS (Fretboard_engraver);
 
 protected:
   void stop_translation_timestep ();
   void process_music ();
-  virtual void derived_mark() const;
+  virtual void derived_mark () const;
   DECLARE_TRANSLATOR_LISTENER (note);
   DECLARE_TRANSLATOR_LISTENER (string_number);
 
@@ -53,7 +54,6 @@ private:
   SCM last_fret_notes_;
 };
 
-
 void
 Fretboard_engraver::derived_mark () const
 {
@@ -84,17 +84,20 @@ void
 Fretboard_engraver::process_music ()
 {
   if (!note_events_.size ())
-    return ;
+    return;
 
+  SCM tab_strings = articulation_list (note_events_,
+                                      tabstring_events_,
+                                      "string-number-event");
   fret_board_ = make_item ("FretBoard", note_events_[0]->self_scm ());
   SCM fret_notes = ly_cxx_vector_to_list (note_events_);
   SCM proc = get_property ("noteToFretFunction");
   if (ly_is_procedure (proc))
-     scm_call_4 (proc,
-                 context ()->self_scm (),
-                 fret_notes,
-                 ly_cxx_vector_to_list (tabstring_events_),
-                 fret_board_->self_scm ());
+    scm_call_4 (proc,
+               context ()->self_scm (),
+               fret_notes,
+               tab_strings,
+               fret_board_->self_scm ());
   SCM changes = get_property ("chordChanges");
   if (to_boolean (changes) && scm_is_pair (last_fret_notes_)
       && ly_is_equal (last_fret_notes_, fret_notes))
@@ -113,21 +116,21 @@ Fretboard_engraver::stop_translation_timestep ()
 
 ADD_TRANSLATOR (Fretboard_engraver,
                /* doc */
-                "Generate fret diagram from one or more events of type"
+               "Generate fret diagram from one or more events of type"
                " @code{NoteEvent}.",
 
                /* create */
                "FretBoard ",
 
                /* read */
-                "chordChanges "
+               "chordChanges "
                "highStringOne "
-                "maximumFretStretch "
+               "maximumFretStretch "
                "minimumFret "
-                "noteToFretFunction "
-                "predefinedDiagramTable "
+               "noteToFretFunction "
+               "predefinedDiagramTable "
                "stringTunings "
-                "tablatureFormat ",
+               "tablatureFormat ",
 
                /* write */
                ""