]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/ambitus.cc
* ly/engraver-init.ly: use Hara kiri by default for
[lilypond.git] / lily / ambitus.cc
index a7ee2c9a46fdc7e2e6cd37f509d342ce8471f336..2a3a29f23b0f4e8cbd011fa17a07ede79d1c76e8 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (C) 2002 Juergen Reuter <reuter@ipd.uka.de>
+  (c) 2002--2003 Juergen Reuter <reuter@ipd.uka.de>
 */
 
 #include "staff-symbol-referencer.hh"
  */
 
 /**
- * Given a pitch and a key_signature, decide what accidentals to show.
- *
- * Possible return values:
- *
- * 0: do not show any accidental
- * 1: show pitch->alteration_ only
- * 2: show pitch->alteration_, preceded by a natural sign
+  Given a pitch and a key_signature, decide what accidentals to show.
+  Possible return values:
+  0: do not show any accidental
+  1: show pitch->alteration_ only
+  2: show pitch->get_alteration, preceded by a natural sign
+
+  UGH: code duplication! See accidental-engraver.
  */
 static int
 number_accidentals (SCM key_signature, Pitch *pitch,
                    bool ignore_octave_b, bool force_accidental)
 {
-  int notename = pitch->notename_;
-  int octave = pitch->octave_;
-  int alteration = pitch->alteration_;
+  int notename = pitch->get_notename ();
+  int octave = pitch->get_octave();
+  int alteration = pitch->get_alteration();
 
   if (force_accidental) // ignore key signature
     return 1;
 
+  
 #if DEBUG_AMBITUS
   scm_display (key_signature, scm_current_output_port ());
 #endif
@@ -101,14 +105,14 @@ add_accidentals (Item *me, Molecule *head, int num_acc,
 {
   if (!num_acc)
     return;
-  if (pitch->alteration_)
+  if (pitch->get_alteration())
     {
       Molecule accidental (Font_interface::get_default_font (me)->
                           find_by_name (String ("accidentals-") +
                                         accidentals_style +
-                                        to_string (pitch->alteration_)));
+                                        to_string (pitch->get_alteration())));
       accidental.translate_axis (yoffs, Y_AXIS);
-      head->add_at_edge (X_AXIS,  LEFT, accidental, 0.1);
+      head->add_at_edge (X_AXIS,  LEFT, accidental, 0.1, 0);
     }
   if (num_acc == 2)
     {
@@ -117,7 +121,7 @@ add_accidentals (Item *me, Molecule *head, int num_acc,
                                      accidentals_style +
                                      to_string ("0")));
       natural.translate_axis (yoffs, Y_AXIS);
-      head->add_at_edge (X_AXIS,  LEFT, natural, 0.1);
+      head->add_at_edge (X_AXIS,  LEFT, natural, 0.1, 0);
     }
 }
 
@@ -133,7 +137,7 @@ Ambitus::brew_molecule (SCM smob)
   if (gh_symbol_p (scm_note_head_style))
     {
       String note_head_style =
-       ly_scm2string (scm_symbol_to_string (scm_note_head_style));
+       ly_symbol2string (scm_note_head_style);
     }
   else
     {
@@ -146,6 +150,9 @@ Ambitus::brew_molecule (SCM smob)
       return SCM_EOL;
     }
 
+  /*
+    FIXME: Use positions. 
+   */
   int p_min, p_max;
   Pitch *pitch_min = unsmob_pitch (me->get_grob_property ("pitch-min"));
   if (!pitch_min)
@@ -225,7 +232,7 @@ Ambitus::brew_molecule (SCM smob)
   if (gh_symbol_p (scm_accidentals_style))
     {
       accidentals_style =
-       ly_scm2string (scm_symbol_to_string (scm_accidentals_style));
+       ly_symbol2string (scm_accidentals_style);
     }
   else
     {