]> git.donarmstrong.com Git - lilypond.git/commitdiff
(AncientRemoveEmptyStaffContext): switch on
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 6 Oct 2005 13:12:57 +0000 (13:12 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 6 Oct 2005 13:12:57 +0000 (13:12 +0000)
New_figured_bass_engraver by default.

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

index faf12b528a277e2129541990d046bd720e6aaae4..e8a659cbed391bf5ddd8b9729dd39e804f23ae54 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2005-10-06  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * 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 b5b64edbbdb840753c2bf63ec2064919014317d7..2757cc52e77dcb08b13fb683baa421bd70dd0388 100644 (file)
@@ -77,6 +77,9 @@ Axis_group_interface::group_extent_callback (SCM element_smob, SCM scm_axis)
   return ly_interval2scm (r - my_coord);
 }
 
+/*
+  FIXME: junk this. 
+ */
 void
 Axis_group_interface::set_axes (Grob *me, Axis a1, Axis a2)
 {
index 951807440f7b3886e76ac3e3849d40296312771d..766dc49818f80db1bb37100343dcdd9a480971fb 100644 (file)
@@ -118,11 +118,13 @@ Figured_bass_continuation::print (SCM grob)
        - 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 @@ ADD_INTERFACE(Figured_bass_continuation,
              
              /* props */
              "thickness "
+             "padding "
              "figures "
              );
              
index 3ef1e29ea4b2256adec41de5c0c183bccd4d1ca5..f3186193ecdef39cc3c03ab0954f705e5b92afee 100644 (file)
@@ -58,7 +58,7 @@ protected:
   
   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 @@ New_figured_bass_engraver::stop_translation_timestep ()
     found  = found  || groups_[i].current_music_;
 
   if (!found)
-    clear_spanners (); 
+    clear_spanners ();
 }
 
 New_figured_bass_engraver::New_figured_bass_engraver ()
@@ -226,41 +226,49 @@ New_figured_bass_engraver::process_music ()
          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 @@ New_figured_bass_engraver::process_music ()
          Item *item
            = make_item ("NewBassFigure",
                         group.current_music_->self_scm ());
+
          SCM fig = group.current_music_->get_property ("figure");
          if (!group.group_)
            {
index 7a4dcc18998e4993e38b2ceaf962865e7ee719de..a940c4e452b5f1b48f33af4826e92d3a6786868c 100644 (file)
@@ -55,8 +55,10 @@ Text_interface::interpret_markup (SCM layout_smob, SCM props, SCM markup)
     }
   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 b96ee5eadaa75b8cd1d26060d480fa6fb77f88da..1fec13a6af90d61b9a644e07e36997d17bea2806 100644 (file)
@@ -596,7 +596,8 @@ AncientRemoveEmptyStaffContext = \context {
   \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 5900673cd8cafa80c5ad6f25e2db6ba936099f64..dd71afdb6e36e6bbe97d93c9b5ee2aa2e8e6a885 100644 (file)
 
 (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 d5f68bb60681b43022cbc8423db633ecbca9a90f..c15d080aa47fa4a4cde40ede80ab48edcb500448 100644 (file)
     (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))
     (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)