Reviewers: ,

Message:
I have no clue why this works, but I think it works and solves
Federico's problem. Hopefully someone can have a look at it and suggest
a better way to tackle this.

Cheers,
MS

Description:
Kludgy way to get the glissando engraver working with tabs.

Please review this at http://codereview.appspot.com/4428081/

Affected files:
  M lily/glissando-engraver.cc


Index: lily/glissando-engraver.cc
diff --git a/lily/glissando-engraver.cc b/lily/glissando-engraver.cc
index 26b869dd51f73afc6bf5cf65bd6a060000bda046..d825aabe4ac020278beeee15781674aaf392e71d 100644
--- a/lily/glissando-engraver.cc
+++ b/lily/glissando-engraver.cc
@@ -17,8 +17,11 @@
   along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 */

+#include <algorithm>
+
 #include "engraver.hh"

+#include "context.hh"
 #include "international.hh"
 #include "pointer-group-interface.hh"
 #include "rhythmic-head.hh"
@@ -80,7 +83,14 @@ Glissando_engraver::acknowledge_note_column (Grob_info info)
   Grob *g = info.grob ();
   if (stop_glissandi)
     {
-      extract_grob_set (g, "note-heads", note_heads);
+      extract_grob_set (g, "note-heads", note_heads_initial);
+      vector<Grob *> note_heads;
+      for (vsize i = 0; i < note_heads_initial.size (); i++)
+        note_heads.push_back (note_heads_initial[i]);
+
+      if (context ()->context_name ().substr (0, 3) == "Tab")
+        reverse (note_heads.begin (), note_heads.end ());
+
       int glissando_index = 0;
       for (vsize i=0; i < note_column_1.size (); i++)
         {
@@ -105,7 +115,14 @@ Glissando_engraver::acknowledge_note_column (Grob_info info)

   if (start_glissandi)
     {
-      extract_grob_set (g, "note-heads", note_heads);
+      extract_grob_set (g, "note-heads", note_heads_initial);
+      vector<Grob *> note_heads;
+      for (vsize i = 0; i < note_heads_initial.size (); i++)
+        note_heads.push_back (note_heads_initial[i]);
+
+      if (context ()->context_name ().substr (0, 3) == "Tab")
+        reverse (note_heads.begin (), note_heads.end ());
+
       SCM map = get_property ("glissandoMap");
       if (map == SCM_EOL)
         for (vsize i = 0; i < note_heads.size (); i++)



_______________________________________________
lilypond-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to