]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/tab-note-heads-engraver.cc
* flower/include/offset.hh (class Offset): new operator /=
[lilypond.git] / lily / tab-note-heads-engraver.cc
index 7d8ad6bd5c840a4440af15e7257b6924913b16b5..49a760bec1400cd554b21c796378dab357e1213e 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <cctype>
 #include <cstdio>
+using namespace std;
 
 #include "rhythmic-head.hh"
 #include "output-def.hh"
@@ -20,7 +21,6 @@
 #include "warn.hh"
 #include "duration.hh"
 
-
 /**
    make (guitar-like) tablature note
 */
@@ -59,9 +59,7 @@ Tab_note_heads_engraver::try_music (Music *m)
       return true;
     }
   else if (m->is_mus_type ("busy-playing-event"))
-    {
-      return note_events_.size ();
-    }
+    return note_events_.size ();
 
   return false;
 }
@@ -112,7 +110,7 @@ Tab_note_heads_engraver::process_music ()
 
       Duration dur = *unsmob_duration (event->get_property ("duration"));
       note->set_property ("duration-log",
-                         scm_int2num (dur.duration_log ()));
+                         scm_from_int (dur.duration_log ()));
 
       if (dur.dot_count ())
        {
@@ -121,7 +119,7 @@ Tab_note_heads_engraver::process_music ()
 
          if (dur.dot_count ()
              != scm_to_int (d->get_property ("dot-count")))
-           d->set_property ("dot-count", scm_int2num (dur.dot_count ()));
+           d->set_property ("dot-count", scm_from_int (dur.dot_count ()));
 
          d->set_parent (note, Y_AXIS);
 
@@ -136,14 +134,14 @@ Tab_note_heads_engraver::process_music ()
       while (!string_found)
        {
          int fret = unsmob_pitch (scm_pitch)->semitone_pitch ()
-           - scm_to_int (scm_list_ref (stringTunings, scm_int2num (tab_string - 1)));
+           - scm_to_int (scm_list_ref (stringTunings, scm_from_int (tab_string - 1)));
          if (fret < min_fret)
            tab_string += high_string_one ? 1 : -1;
          else
            string_found = true;
        }
 
-      SCM text = scm_call_3 (proc, scm_int2num (tab_string), stringTunings, scm_pitch);
+      SCM text = scm_call_3 (proc, scm_from_int (tab_string), stringTunings, scm_pitch);
 
       int pos = 2 * tab_string - number_of_strings - 1; // No tab-note between the string !!!
       if (to_boolean (get_property ("stringOneTopmost")))
@@ -151,7 +149,7 @@ Tab_note_heads_engraver::process_music ()
 
       note->set_property ("text", text);
 
-      note->set_property ("staff-position", scm_int2num (pos));
+      note->set_property ("staff-position", scm_from_int (pos));
       notes_.push (note);
     }
 }
@@ -168,9 +166,9 @@ Tab_note_heads_engraver::stop_translation_timestep ()
 #include "translator.icc"
 
 ADD_TRANSLATOR (Tab_note_heads_engraver,
-               /* descr */ "Generate one or more tablature noteheads from Music of type NoteEvent.",
-               /* creats*/ "TabNoteHead Dots",
-               /* accepts */ "note-event string-number-event busy-playing-event",
-               /* reads */ "middleCPosition stringTunings minimumFret tablatureFormat highStringOne stringOneTopmost",
+               /* doc */ "Generate one or more tablature noteheads from Music of type NoteEvent.",
+               /* creat*/ "TabNoteHead Dots",
+               /* accept */ "note-event string-number-event busy-playing-event",
+               /* read */ "middleCPosition stringTunings minimumFret tablatureFormat highStringOne stringOneTopmost",
                /* write */ "");