]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/ambitus-engraver.cc (create_ambitus): change name to
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 23 Jul 2004 15:08:45 +0000 (15:08 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 23 Jul 2004 15:08:45 +0000 (15:08 +0000)
AmbitusLine. Create AmbitusAccidental and AmbitusNoteHead for
other ambitus parts.

* lily/ledger-line-spanner.cc (print): new file. Set limits to
ledger line length to avoid clashes.

ChangeLog
lily/ambitus-engraver.cc
lily/ambitus.cc
lily/ledger-line-spanner.cc
scm/define-grobs.scm

index ec7e0d88b3e8f612823f77fcea6b0b76f5c5155c..46c784045997cf28d250aa249778624f820188e8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2004-07-23  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/ambitus-engraver.cc (create_ambitus): change name to
+       AmbitusLine. Create AmbitusAccidental and AmbitusNoteHead for
+       other ambitus parts.
+
        * lily/include/pitch-interval.hh (Pitch>): new file.
 
        * lily/pitch-interval.cc (add_point): new file.
index 9985bf97c9c1f37ce05c95ef721739d80144265f..71f00f7aa8d14aa4e156c8ed4f56aee476d3292d 100644 (file)
@@ -43,7 +43,17 @@ private:
 void
 Ambitus_engraver::create_ambitus ()
 {
-  ambitus_ = make_item ("Ambitus",SCM_EOL);
+  ambitus_ = make_item ("AmbitusLine",SCM_EOL);
+  Direction d = DOWN;
+  do
+    {
+      heads_[d] = make_item ("AmbitusNoteHead", SCM_EOL);
+      accidentals_[d] = make_item ("AmbitusAccidental", SCM_EOL);
+      heads_[d]->set_property ("accidental-grob", accidentals_[d]->self_scm ());
+      Side_position_interface::add_support (accidentals_[d], heads_[d]);
+    }
+  while (flip (&d) != DOWN);
+  ambitus_->set_parent (heads_[DOWN], X_AXIS);
   is_typeset_ = false;         
 }
 
@@ -83,16 +93,7 @@ Ambitus_engraver::stop_translation_timestep ()
       start_c0_ = robust_scm2int (get_property ("middleCPosition"), 0);
       start_key_sig_ = get_property ("keySignature");
 
-      Direction d = DOWN;
-      do
-       {
-         heads_[d] = make_item ("AmbitusNoteHead", SCM_EOL);
-         accidentals_[d] = make_item ("AmbitusAccidental", SCM_EOL);
-         heads_[d]->set_property ("accidental-grob", accidentals_[d]->self_scm ());
-         Side_position_interface::add_support (accidentals_[d], heads_[d]);
-       }
-      while (flip (&d) != DOWN);
-      ambitus_->set_parent (heads_[DOWN], X_AXIS);
+
       is_typeset_ = true;
     }
 }
index 44953bd4ca113197b8919719a20e8a3c4efe2d7d..bfcc7fd5c6a0f9dddfb73f631084804adbe09a6a 100644 (file)
@@ -38,11 +38,12 @@ Ambitus::print (SCM smob)
       if (minh->relative_coordinate (common, Y_AXIS) >
          maxh->relative_coordinate (common, Y_AXIS))
        {
-         maxh = heads[0];
-         minh = heads[0];
+         Grob *t = maxh;
+         maxh = minh;
+         minh = t;
        }
 
-      Real pad = 1.35;
+      Real pad = 0.35;
       Real pmax = maxh->relative_coordinate (common, Y_AXIS) - pad;
       Real pmin = minh->relative_coordinate (common, Y_AXIS) + pad;
       
index ca54f00089789ea7f73543a06f68fbeff47a255d..ad03ae36496ad8290f1aeffef2c5cdfe7d3648ff 100644 (file)
@@ -139,7 +139,7 @@ Ledger_line_spanner::print (SCM smob)
        {
          Interval head_extent = h->extent (common[X_AXIS], X_AXIS);
          Interval ledger_extent = head_extent;
-         head_extent.widen (length_fraction * head_extent.length ());
+         ledger_extent.widen (length_fraction * head_extent.length ());
 
          Direction vdir = Direction (sign (pos));
          int rank = Paper_column::get_rank (h->get_column ());
index 00b9e655df0e7eb20c85e5654081674152d906b0..bdec00c635dba3f7b54c0a751b561fce2d806768 100644 (file)
        (meta . ((interfaces . (item-interface accidental-placement-interface))))
        ))
 
-    (Ambitus
+    (AmbitusLine
      . (
        (breakable . #t)
        (break-align-symbol . ambitus)
        (print-function . ,Ambitus::print)
        (join-heads . #t)
+       (X-offset-callbacks (,Self_alignment_interface::centered_on_parent))
        (break-visibility . ,begin-of-line-visible)
        (space-alist . (
                       (clef . (extra-space . 0.0))