CVSROOT:        /cvsroot/lilypond
Module name:    lilypond
Branch:         
Changes by:     Han-Wen Nienhuys <[EMAIL PROTECTED]>    05/10/06 13:12:57

Modified files:
        .              : ChangeLog 
        lily           : axis-group-interface.cc 
                         figured-bass-continuation.cc 
                         new-figured-bass-engraver.cc text-interface.cc 
        ly             : engraver-init.ly 
        scm            : bass-figure.scm define-grobs.scm 

Log message:
        (AncientRemoveEmptyStaffContext): switch on
        New_figured_bass_engraver by default.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ChangeLog.diff?tr1=1.4157&tr2=1.4158&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/axis-group-interface.cc.diff?tr1=1.67&tr2=1.68&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/figured-bass-continuation.cc.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/new-figured-bass-engraver.cc.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/text-interface.cc.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ly/engraver-init.ly.diff?tr1=1.253&tr2=1.254&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/bass-figure.scm.diff?tr1=1.24&tr2=1.25&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/define-grobs.scm.diff?tr1=1.239&tr2=1.240&r1=text&r2=text

Patches:
Index: lilypond/ChangeLog
diff -u lilypond/ChangeLog:1.4157 lilypond/ChangeLog:1.4158
--- lilypond/ChangeLog:1.4157   Thu Oct  6 10:27:25 2005
+++ lilypond/ChangeLog  Thu Oct  6 13:12:56 2005
@@ -1,5 +1,8 @@
 2005-10-06  Han-Wen Nienhuys  <[EMAIL PROTECTED]>
 
+       * ly/engraver-init.ly (AncientRemoveEmptyStaffContext): switch on
+       New_figured_bass_engraver by default.
+
        * lily/ttf.cc (print_trailer): only define glyph names when
        FT_Face has FT_FACE_FLAG_GLYPH_NAMES
 
Index: lilypond/lily/axis-group-interface.cc
diff -u lilypond/lily/axis-group-interface.cc:1.67 
lilypond/lily/axis-group-interface.cc:1.68
--- lilypond/lily/axis-group-interface.cc:1.67  Sat Aug 13 21:35:23 2005
+++ lilypond/lily/axis-group-interface.cc       Thu Oct  6 13:12:57 2005
@@ -77,6 +77,9 @@
   return ly_interval2scm (r - my_coord);
 }
 
+/*
+  FIXME: junk this. 
+ */
 void
 Axis_group_interface::set_axes (Grob *me, Axis a1, Axis a2)
 {
Index: lilypond/lily/figured-bass-continuation.cc
diff -u lilypond/lily/figured-bass-continuation.cc:1.1 
lilypond/lily/figured-bass-continuation.cc:1.2
--- lilypond/lily/figured-bass-continuation.cc:1.1      Wed Oct  5 13:05:44 2005
+++ lilypond/lily/figured-bass-continuation.cc  Thu Oct  6 13:12:57 2005
@@ -118,11 +118,13 @@
        - me->relative_coordinate (common, X_AXIS);
     }
   while (flip (&d) !=  LEFT);
+  spanned.widen (- robust_scm2double (me->get_property ("padding"), 0.2));
   
-  Stencil extender
-    = Line_interface::make_line (thick,
-                                Offset (spanned[LEFT], 0),
-                                Offset (spanned[RIGHT], 0));
+  Stencil extender;
+  if (!spanned.is_empty ())
+    extender = Line_interface::make_line (thick,
+                                         Offset (spanned[LEFT], 0),
+                                         Offset (spanned[RIGHT], 0));
   
   return extender.smobbed_copy ();
 }
@@ -133,6 +135,7 @@
              
              /* props */
              "thickness "
+             "padding "
              "figures "
              );
              
Index: lilypond/lily/new-figured-bass-engraver.cc
diff -u lilypond/lily/new-figured-bass-engraver.cc:1.2 
lilypond/lily/new-figured-bass-engraver.cc:1.3
--- lilypond/lily/new-figured-bass-engraver.cc:1.2      Wed Oct  5 13:11:44 2005
+++ lilypond/lily/new-figured-bass-engraver.cc  Thu Oct  6 13:12:57 2005
@@ -58,7 +58,7 @@
   
   virtual bool try_music (Music *);
   virtual void derived_mark () const; 
-  
+
   void start_translation_timestep ();
   void stop_translation_timestep ();
   void process_music ();
@@ -86,7 +86,7 @@
     found  = found  || groups_[i].current_music_;
 
   if (!found)
-    clear_spanners (); 
+    clear_spanners ();
 }
 
 New_figured_bass_engraver::New_figured_bass_engraver ()
@@ -226,41 +226,49 @@
          Figure_group group;
          groups_.push (group);
        }
-
       
       groups_[k].current_music_ = new_musics_[i];
       groups_[k].figure_item_ = 0;
       k++;
     }
 
-  SCM proc = get_property ("newFiguredBassFormatter");
-  
-  alignment_->set_bound (RIGHT, muscol);
-  if (to_boolean (get_property ("useBassFigureExtenders")))
-  for (int i = 0; i < groups_.size(); i++)
+  for (int i = 0; i < groups_.size (); i++)
     {
-      if (groups_[i].is_continuation_)
+      if (!groups_[i].is_continuation_)
        {
-         if (!groups_[i].continuation_line_)
-           {
-             Spanner * line = make_spanner ("BassFigureContinuation", SCM_EOL);
-             Item * item = groups_[i].figure_item_;
-             groups_[i].continuation_line_ = line;
-             line->set_bound (LEFT, item);
-
-             /*
-               Don't add as child. This will cache the wrong
-               (pre-break) stencil when callbacks are triggered.
-              */
-             line->set_parent (groups_[i].group_, Y_AXIS);
-             Pointer_group_interface::add_grob (line, ly_symbol2scm 
("figures"), item);
-             
-             groups_[i].figure_item_ = 0;
-           }
+         groups_[i].number_ = SCM_BOOL_F;
+         groups_[i].alteration_ = SCM_BOOL_F;
        }
-      else
-       groups_[i].continuation_line_ = 0;
     }
+
+  SCM proc = get_property ("newFiguredBassFormatter");
+  alignment_->set_bound (RIGHT, muscol);
+
+  if (to_boolean (get_property ("useBassFigureExtenders")))
+    for (int i = 0; i < groups_.size(); i++)
+      {
+       if (groups_[i].is_continuation_)
+         {
+           if (!groups_[i].continuation_line_)
+             {
+               Spanner * line = make_spanner ("BassFigureContinuation", 
SCM_EOL);
+               Item * item = groups_[i].figure_item_;
+               groups_[i].continuation_line_ = line;
+               line->set_bound (LEFT, item);
+
+               /*
+                 Don't add as child. This will cache the wrong
+                 (pre-break) stencil when callbacks are triggered.
+               */
+               line->set_parent (groups_[i].group_, Y_AXIS);
+               Pointer_group_interface::add_grob (line, ly_symbol2scm 
("figures"), item);
+             
+               groups_[i].figure_item_ = 0;
+             }
+         }
+       else
+         groups_[i].continuation_line_ = 0;
+      }
   
   for (int i = 0; i < groups_.size(); i++)
     {
@@ -275,6 +283,7 @@
          Item *item
            = make_item ("NewBassFigure",
                         group.current_music_->self_scm ());
+
          SCM fig = group.current_music_->get_property ("figure");
          if (!group.group_)
            {
Index: lilypond/lily/text-interface.cc
diff -u lilypond/lily/text-interface.cc:1.10 
lilypond/lily/text-interface.cc:1.11
--- lilypond/lily/text-interface.cc:1.10        Mon Sep 12 23:33:24 2005
+++ lilypond/lily/text-interface.cc     Thu Oct  6 13:12:57 2005
@@ -55,8 +55,10 @@
     }
   else
     {
-      programming_error ("not a markup: ");
+      programming_error ("Object is not a markup. ");
+      scm_puts ("This object should be a markup: ", scm_current_error_port ());
       scm_display (markup, scm_current_error_port ());
+      scm_puts ("\n", scm_current_error_port ());
 
       Box b;
       b[X_AXIS].set_empty ();
Index: lilypond/ly/engraver-init.ly
diff -u lilypond/ly/engraver-init.ly:1.253 lilypond/ly/engraver-init.ly:1.254
--- lilypond/ly/engraver-init.ly:1.253  Wed Oct  5 13:05:45 2005
+++ lilypond/ly/engraver-init.ly        Thu Oct  6 13:12:57 2005
@@ -596,7 +596,8 @@
   \type "Engraver_group"
   \name FiguredBass 
 
-  \consists "Figured_bass_engraver"
+%%  \consists "Figured_bass_engraver"
+  \consists "New_figured_bass_engraver"
   \consists "Note_swallow_translator"
   \consists "Skip_event_swallow_translator"
   \consists "Separating_line_group_engraver"
Index: lilypond/scm/bass-figure.scm
diff -u lilypond/scm/bass-figure.scm:1.24 lilypond/scm/bass-figure.scm:1.25
--- lilypond/scm/bass-figure.scm:1.24   Wed Oct  5 13:05:45 2005
+++ lilypond/scm/bass-figure.scm        Thu Oct  6 13:12:57 2005
@@ -14,27 +14,49 @@
 
 (define-public (format-new-bass-figure figure event context)
   (let* ((fig (ly:music-property event 'figure))
-        (fig-markup (markup #:number (number->string figure 10)))
+        (fig-markup (if (number? figure)
+                        (markup #:number (number->string figure 10))
+                        #f
+                        ))
 
         (alt (ly:music-property event 'alteration))
         (alt-markup
          (if (number? alt)
-             (alteration->text-accidental-markup alt)
+             (markup
+                     #:general-align Y DOWN #:smaller #:smaller
+                     (alteration->text-accidental-markup alt))
+             
              #f))
         (alt-dir (ly:context-property context 'figuredBassAlterationDirection))
-        
         )
+
+    (if (and (not fig-markup) alt-markup)
+       (begin
+         (set! fig-markup (markup #:left-align #:pad-around 0.3 alt-markup))
+         (set! alt-markup #f)))
+
+
+    ;; hmm, how to get figures centered between note, and
+    ;; lone accidentals too?
     
+    ;;    (if (markup? fig-markup)
+    ;; (set!
+    ;;  fig-markup (markup #:translate (cons 1.0 0)
+    ;;                     #:hcenter fig-markup)))
+
     (if alt-markup
        (set! fig-markup
-             (markup #:put-adjacent fig-markup X
+             (markup #:put-adjacent
+                     fig-markup X
                      (if (number? alt-dir)
                          alt-dir
                          LEFT)
-                     #:raise .33  
-                     #:pad-around 0.5 #:smaller alt-markup )))
+                     #:pad-around 0.2 alt-markup
+                     )))
 
-    fig-markup))
+    (if (markup?  fig-markup)
+       fig-markup
+       empty-markup)))
 
 (define-public (format-bass-figure figures context grob)
   ;; TODO: support slashed numerals here.
Index: lilypond/scm/define-grobs.scm
diff -u lilypond/scm/define-grobs.scm:1.239 lilypond/scm/define-grobs.scm:1.240
--- lilypond/scm/define-grobs.scm:1.239 Wed Oct  5 13:05:45 2005
+++ lilypond/scm/define-grobs.scm       Thu Oct  6 13:12:57 2005
@@ -208,12 +208,12 @@
     (NewBassFigure
      . (
        (print-function . ,Text_interface::print)
+       (font-size . -2)
        (meta . ((class . Item)
                 (interfaces . (text-interface
                                rhythmic-grob-interface
                                bass-figure-interface
                                font-interface))))))
-
     (BassFigureBracket
      . ((print-function . ,Figured_bass_bracket::print)
        (edge-height . (0.2 . 0.2))
@@ -238,7 +238,7 @@
     (BassFigureAlignment
      . (
        (axes . (,Y))
-       (threshold . (2.4 . 1000))
+       (threshold . (2 . 1000))
        (Y-extent-callback . ,Axis_group_interface::group_extent_callback)
        (stacking-dir . -1)
        (meta . ((class . Spanner)


_______________________________________________
Lilypond-cvs mailing list
Lilypond-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-cvs

Reply via email to