]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.18.jcn3
authorJan Nieuwenhuizen <janneke@gnu.org>
Tue, 28 Dec 1999 23:55:50 +0000 (00:55 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Tue, 28 Dec 1999 23:55:50 +0000 (00:55 +0100)
1.3.18.jcn3
===========

* Moved decision for stacking staff spanners {[ from item-creation phase
to post_processing (only then we know dimensions/visibility of items)

* Separted bar-break-glyph-alist, see input/test/no-span.ly

12 files changed:
CHANGES
VERSION
input/test/no-span.ly
lily/bar-engraver.cc
lily/base-span-bar-engraver.cc
lily/include/base-span-bar-engraver.hh
lily/include/span-score-bar-engraver.hh
lily/span-bar.cc
lily/span-score-bar-engraver.cc
mutopia/J.S.Bach/pa.ly
scm/generic-property.scm
scm/lily.scm

diff --git a/CHANGES b/CHANGES
index 12163a631bcdda9d5822c3288ff7887e6d6e1979..87eedc5cd2e36f73af950ba5c6307e253ca37dcf 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,11 @@
+1.3.18.jcn3
+===========
+
+* Moved decision for stacking staff spanners {[ from item-creation phase
+to post_processing (only then we know dimensions/visibility of items)
+
+* Separted bar-break-glyph-alist, see input/test/no-span.ly
+
 1.3.18.jcn2
 ===========
 
diff --git a/VERSION b/VERSION
index 2a45430e42948ccc3816f82b1d7a3ad441763ba5..6ffd4693169e6539d828fcc532f4e799199c17bc 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
 PATCH_LEVEL=18
-MY_PATCH_LEVEL=jcn2
+MY_PATCH_LEVEL=jcn3
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index e027434bb6df6bc0a6387aaa81f633021857b65b..74c05787ea22a21c9185e245df717cc31435a460 100644 (file)
@@ -1,19 +1,10 @@
-\header {
-  filename =  "pa.ly";
-  title =    "Wachet auf, ruft uns die Stimme";
-  opus =    "BWV";
-  composer =  "Johann Sebastian Bach 1685-1750 ";
-  enteredby =  "JCN";
-  copyright =  "public domain";
-}
-
-%% ?
+%% why non of this any effect?
 #(define Span_bar_engraver-visibility #f)
 #(define Staff_group_bar_engraver-visibility #f)
 #(define Span_score_bar_engraver-visability #f)
 
+#(assoc-set! bar-break-glyph-alist "bracket" '(nil . nil))
 
-% these should be two separate scores...
 \score{
   \context Score <
    \context StaffGroup<
   >
 \paper {
   textheight = 280.0 \mm;
-%{
-  \translator { 
-    \OrchestralScoreContext 
-    minVerticalAlign = 4.0*\staffheight;
-    maxVerticalAlign = 4.0*\staffheight;
-   }
-%}
   \translator { 
     \StaffGroupContext
     minVerticalAlign = 4.0*\staffheight;
     maxVerticalAlign = 4.0*\staffheight;
-    glyph = "brace";
+% this doesn't work
+    barType = #"|"
    }
    \translator { 
     \PianoStaffContext
index 1dc6c18fafef76859e9896a9eb1fbe75235ad6b8..90178f46663172a126dd8ab55ebf3412e4bdf29a 100644 (file)
@@ -40,7 +40,7 @@ Bar_engraver::create_bar ()
       SCM default_type = get_property ("defaultBarType", 0);
       if (gh_string_p (default_type))
        {
-         bar_p_->set_elt_property ("glyph", default_type); // gu.h
+         bar_p_->set_elt_property ("default-glyph", default_type); // gu.h
        }
 
 #if 0
@@ -78,14 +78,14 @@ Bar_engraver::request_bar (String requested_type)
       return;
     }
 
-  String current = ly_scm2string (bar_p_->get_elt_property ("glyph"));
+  String current = ly_scm2string (bar_p_->get_elt_property ("default-glyph"));
   
   if ((requested_type == "|:" && current== ":|")
     || (requested_type == ":|" && current == "|:"))
     requested_type = ":|:";
 
   
-  bar_p_->set_elt_property ("glyph",
+  bar_p_->set_elt_property ("default-glyph",
                            ly_str02scm (requested_type.ch_C ()));
 }
 
@@ -115,7 +115,7 @@ Bar_engraver::do_process_requests()
   if (which.length_i ())
     {
       create_bar();
-      bar_p_->set_elt_property ("glyph",  ly_str02scm (which.ch_C ()));
+      bar_p_->set_elt_property ("default-glyph",  ly_str02scm (which.ch_C ()));
     }
   
   if (!bar_p_)
index 9ef6b8fc1a18ea47aae654a3bae9b8b7b37fabe5..cc873a5a81f5d2ed86d4587b76f6c1d58e68b440 100644 (file)
@@ -69,24 +69,10 @@ Base_span_bar_engraver::acknowledge_element (Score_element_info i)
          
          announce_element (Score_element_info (spanbar_p_,0));
 
-#if 0
-         
-         // urg, elt-properties are not set until pre_processing (property-engraver)
          if (!gh_string_p (spanbar_p_->get_elt_property ("glyph"))
              && !gh_string_p (spanbar_p_->get_elt_property ("default-glyph")))
            spanbar_p_-> set_elt_property ("default-glyph",
-                                          bar_l_arr_[0]->get_elt_property ("glyph"));
-#else
-
-         if (!gh_string_p (spanbar_p_->get_elt_property ("glyph"))
-             && gh_string_p (spanbar_p_->get_elt_property ("default-glyph")))
-           spanbar_p_-> set_elt_property ("glyph", spanbar_p_->get_elt_property ("default-glyph"));
-           
-         if (!gh_string_p (spanbar_p_->get_elt_property ("glyph")))
-           spanbar_p_-> set_elt_property ("glyph",
-                                          bar_l_arr_[0]->get_elt_property ("glyph"));
-
-#endif
+                                          bar_l_arr_[0]->get_elt_property ("default-glyph"));
        }
     }
 }
index b4caf237d0cc572bf0da408b03758cc6a6d30822..9cf40242f6fec5b22b89bc87a41796eba8608530 100644 (file)
@@ -23,7 +23,6 @@ class Axis_align_spanner;
   */
 class Base_span_bar_engraver : public Engraver
 {
-  Span_bar * spanbar_p_;
   Array<Bar*> bar_l_arr_;
 
 public:
@@ -37,6 +36,7 @@ protected:
     horizontal alignment priority, otherwise, hang the spanbar on the
     acknowledged bar.  */
   bool use_priority_b_;
+  Span_bar * spanbar_p_;
   
   virtual void acknowledge_element (Score_element_info);
   virtual void do_pre_move_processing();
index 14cd512a60662f9bb5e867f82721f550475dc440..9dff3b412c241c544168b0bf698d06d26e011597 100644 (file)
@@ -37,6 +37,7 @@ public:
   VIRTUAL_COPY_CONS (Translator);
   
   virtual Span_bar * get_span_bar_p () const;
+  virtual void acknowledge_element (Score_element_info);
 };
 
 /**
index 951235525f1e89bfb73d1e2731d00206680e0cb9..d116caf288581316b54ec319badc9c0e04980873 100644 (file)
@@ -54,6 +54,31 @@ Span_bar::do_post_processing ()
   Interval i(get_spanned_interval ());
 
   translate_axis (i.center (), Y_AXIS);
+
+  /*
+    {[ stacking shift
+    ugh
+  */
+  SCM me = get_elt_property ("glyph");
+  if (gh_string_p (me) && ly_scm2string (me) == "bracket")
+    {
+      SCM e = get_elt_property ("other");
+      if (e != SCM_UNDEFINED)
+       {
+         assert (SMOB_IS_TYPE_B (Score_element, e));
+         Score_element* se = SMOB_TO_TYPE (Score_element, e);
+         SCM her = se->get_elt_property ("glyph");
+#if 0
+         // urg x-extent broken?
+         if (gh_string_p (her) && ly_scm2string (her) == "brace")
+           se->translate_axis (-extent (X_AXIS).length (), X_AXIS);
+#else
+         if (gh_string_p (her) && ly_scm2string (her) == "brace"
+             && !to_boolean (get_elt_property ("transparent")))
+           se->translate_axis (-paper_l ()->get_var ("interline"), X_AXIS);
+#endif 
+       }
+    }
 }
 
 void
index cda87205a004418b0a83767274cafc759a5991d9..ecccf6e4a9eff92e93652f3c632d0ca44663b677 100644 (file)
@@ -40,6 +40,19 @@ Piano_bar_engraver::get_span_bar_p () const
   return s;
 }
 
+void
+Piano_bar_engraver::acknowledge_element (Score_element_info i)
+{
+  Base_span_bar_engraver::acknowledge_element (i);
+
+  if (Span_bar * b = dynamic_cast<Span_bar *> (i.elem_l_))
+    {
+      SCM g = b->get_elt_property ("default-glyph");
+      if (gh_string_p (g) && (ly_scm2string (g) == "bracket"))
+       spanbar_p_->set_elt_property ("other", b->self_scm_);
+    }
+}
+
 Span_bar*
 Staff_group_bar_engraver::get_span_bar_p () const
 {
@@ -53,12 +66,15 @@ void
 Staff_group_bar_engraver::acknowledge_element (Score_element_info i)
 {
   Base_span_bar_engraver::acknowledge_element (i);
+
+  if (!spanbar_p_)
+    return;
+
   if (Span_bar * b = dynamic_cast<Span_bar *> (i.elem_l_))
     {
-      SCM gl = b->get_elt_property ("glyph");
-      if (gh_string_p (gl) && ly_scm2string (gl)  == "brace")
-       b->translate_axis ( -paper_l ()->get_var ("interline"),
-                           X_AXIS); // ugh
+      SCM g = b->get_elt_property ("default-glyph");
+      if (gh_string_p (g) && (ly_scm2string (g) == "brace"))
+       spanbar_p_->set_elt_property ("other", b->self_scm_);
     }
 }
 
index 94132512ba40e1d17f2b0006ed2072ca16feae4b..8967924d083379768a935bc4b3bf5185c6fa8ab4 100644 (file)
@@ -226,7 +226,6 @@ pedal = \notes \relative c, {
 
 
 
-% these should be two separate scores...
 \score{
   \context Score <
    \context StaffGroup<
@@ -246,26 +245,19 @@ pedal = \notes \relative c, {
   >
 
 \paper {
-  %textheight = 280.0 \mm;
-  % landscape:
-  textheight = 160.0 \mm;
-  linewidth = 290.0 \mm;
-%{
+  textheight = 280.0 \mm;
+  % landscape: -- does not work? ly2dvi -L
+  %textheight = 160.0 \mm;
+  %linewidth = 290.0 \mm;
   \translator { 
     \OrchestralScoreContext 
     minVerticalAlign = 4.0*\staffheight;
     maxVerticalAlign = 4.0*\staffheight;
    }
-%}
   \translator { 
-    \StaffGroupContext
-    minVerticalAlign = 4.0*\staffheight;
-    maxVerticalAlign = 4.0*\staffheight;
-   }
-   \translator { 
     \PianoStaffContext
-       minVerticalAlign = 2.5*\staffheight;
-       maxVerticalAlign = 2.5*\staffheight;
+    minVerticalAlign = 2.5*\staffheight;
+    maxVerticalAlign = 2.5*\staffheight;
    }
   }
   \midi {
index 498f05bc4aee589fbd45117ce297d8ad49e9352e..296f70b8c261362b8b9f74a4e596b07e6bb32048 100644 (file)
 (define generic-bar-properties
   (cons "Staff_bar" (list
                     (list 'barSize number? 'bar-size)
-                    ;(list 'glyph symbol? 'glyph)
+                    (list 'barType symbol? 'glyph)
+                    )
+       )
+  )    
+
+(define generic-span-bar-properties
+  (cons "Span_bar" (list
+                    (list 'barSize number? 'bar-size)
+                    (list 'barType symbol? 'glyph)
                     )
        )
   )    
index 3ab025c5fd32a83b7998f12b4b3796bdcdccdeb5..96941d93f8b33877e5096f9da0398ad3d57190f2 100644 (file)
 ;
 ; How should a  bar line behave at a break? 
 ;
-(define (break-barline glyph dir)
-   (let ((result (assoc glyph 
-                       '((":|:" . (":|" . "|:"))
-                         ("|" . ("|" . ""))
-                         ("|s" . (nil . "|"))
-                         ("|:" . ("|" . "|:"))
-                         ("|." . ("|." . nil))
-                         (":|" . (":|" . nil))
-                         ("||" . ("||" . nil))
-                         (".|." . (".|." . nil))
-                         ("scorebar" . (nil . "scorepostbreak"))
-                         ("brace" . (nil . "brace"))
-                         ("bracket" . (nil . "bracket"))  
-                         )
-                       )))
 
+; move this to paper.scm?
+; to override, see input/test/no-span.ly
+(define bar-break-glyph-alist
+  '((":|:" . (":|" . "|:"))
+    ("|" . ("|" . ""))
+    ("|s" . (nil . "|"))
+    ("|:" . ("|" . "|:"))
+    ("|." . ("|." . nil))
+    (":|" . (":|" . nil))
+    ("||" . ("||" . nil))
+    (".|." . (".|." . nil))
+    ("scorebar" . (nil . "scorepostbreak"))
+    ("brace" . (nil . "brace"))
+    ("bracket" . (nil . "bracket"))  
+    ))
+
+(define (break-barline glyph dir)
+   (let ((result (assoc glyph bar-break-glyph-alist)))
      (if (equal? result #f)
         (ly-warn (string-append "Unknown bar glyph: `" glyph "'"))
         (index-cell (cdr result) dir))