]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/ambitus.cc
* input/regression/bar-check-redefine.ly (pipeSymbol): new file.
[lilypond.git] / lily / ambitus.cc
index 75e3dff62d2d82769922b0a9a6b559c554effa41..9e5b145557a9a0f2472f0a56b7bcac37ce356013 100644 (file)
 #include "paper-def.hh"
 #include "lookup.hh"
 
+/*
+  UGH UGH UGH
+
+  This does 3 things at one:
+
+  - acc positioning
+  - drawing accidentals
+  - drawing note heads
+
+  It confuses interpretation & formatting.
+
+  UGH.
+  --hwn.
+ */
+
 /*
  * TODO: note-head collision handling
  *
@@ -56,8 +71,8 @@ number_accidentals (SCM key_signature, Pitch *pitch,
                    bool ignore_octave_b, bool force_accidental)
 {
   int notename = pitch->get_notename ();
-  int octave = pitch->get_octave();
-  int alteration = pitch->get_alteration();
+  int octave = pitch->get_octave ();
+  int alteration = pitch->get_alteration ();
 
   if (force_accidental) // ignore key signature
     return 1;
@@ -105,7 +120,7 @@ add_accidentals (Item *me, Stencil *head, int num_acc,
 {
   if (!num_acc)
     return;
-  if (pitch->get_alteration())
+  if (pitch->get_alteration ())
     {
       Stencil accidental (Font_interface::get_default_font (me)->
                           find_by_name (String ("accidentals-") +
@@ -132,7 +147,7 @@ Ambitus::print (SCM smob)
   Item *me = (Item *)unsmob_grob (smob);
   Stencil stencil = Stencil ();
 
-  SCM scm_note_head_style = me->get_grob_property ("note-head-style");
+  SCM scm_note_head_style = me->get_property ("note-head-style");
   String note_head_style;
   if (gh_symbol_p (scm_note_head_style))
     {
@@ -154,20 +169,20 @@ Ambitus::print (SCM smob)
     FIXME: Use positions. 
    */
   int p_min, p_max;
-  Pitch *pitch_min = unsmob_pitch (me->get_grob_property ("pitch-min"));
+  Pitch *pitch_min = unsmob_pitch (me->get_property ("pitch-min"));
   if (!pitch_min)
     {
-      me->programming_error("Ambitus: pitch_min undefined; assuming 0");
+      me->programming_error ("Ambitus: pitch_min undefined; assuming 0");
       p_min = 0;
     }
   else
     {
       p_min = pitch_min->steps ();
     }
-  Pitch *pitch_max = unsmob_pitch (me->get_grob_property ("pitch-max"));
+  Pitch *pitch_max = unsmob_pitch (me->get_property ("pitch-max"));
   if (!pitch_max)
     {
-      me->programming_error("Ambitus: pitch_max undefined; assuming 0");
+      me->programming_error ("Ambitus: pitch_max undefined; assuming 0");
       p_max = 0;
     }
   else
@@ -179,7 +194,7 @@ Ambitus::print (SCM smob)
       me->programming_error ("Ambitus: reverse range");
     }
 
-  SCM c0 = me->get_grob_property ("c0-position");
+  SCM c0 = me->get_property ("c0-position");
   if (gh_number_p (c0))
     {
       p_min += gh_scm2int (c0);
@@ -195,7 +210,7 @@ Ambitus::print (SCM smob)
   head_max.translate_axis (0.5*p_max, Y_AXIS);
 
   // join heads
-  if (to_boolean (me->get_grob_property ("join-heads")) &&
+  if (to_boolean (me->get_property ("join-heads")) &&
       ((p_max - p_min) >= 3))
     {
       Real linethickness = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
@@ -226,8 +241,8 @@ Ambitus::print (SCM smob)
   stencil.add_stencil (ledger_lines);
 
   // add accidentals
-  SCM key_signature = me->get_grob_property ("key-signature");
-  SCM scm_accidentals_style = me->get_grob_property ("accidentals-style");
+  SCM key_signature = me->get_property ("key-signature");
+  SCM scm_accidentals_style = me->get_property ("accidentals-style");
   String accidentals_style;
   if (gh_symbol_p (scm_accidentals_style))
     {
@@ -238,6 +253,7 @@ Ambitus::print (SCM smob)
     {
       accidentals_style = String ("");
     }
+  
   int num_acc;
   num_acc = number_accidentals (key_signature, pitch_min, true, false);
   add_accidentals (me, &head_min, num_acc, pitch_min,
@@ -254,5 +270,5 @@ Ambitus::print (SCM smob)
 }
 
 ADD_INTERFACE (Ambitus, "ambitus-interface",
-  "An ambitus represents the pitch range of a voice.",
-  "c0-position pitch-min pitch-max accidentals note-head-style join-heads");
+  "An object that represents the pitch range of a voice.",
+  "c0-position pitch-min pitch-max accidentals note-head-style accidentals-style join-heads");