]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.1.23.jcn5: URG?
authorJan Nieuwenhuizen <janneke@gnu.org>
Sat, 23 Jan 1999 15:20:13 +0000 (16:20 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sat, 23 Jan 1999 15:20:13 +0000 (16:20 +0100)
pl 23.jcn5
- verder hakken aan repeat-engraver URG

---
Generated by janneke@gnu.org using package-diff 0.62,
>From = lilypond-1.1.23.jcn4, To = lilypond-1.1.23.jcn5

usage

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.1.23.jcn5.diff

Patches do not contain automatically generated files
or (urg) empty directories,
i.e., you should rerun autoconf, configure
and possibly make outdirs.

--state
1.1.23.jcn4
1.1.23.jcn5
++state

NEWS
VERSION
input/test/repeat.ly
lily/bar-engraver.cc
lily/include/bar-engraver.hh
lily/include/volta-spanner.hh
lily/repeat-engraver.cc
lily/volta-spanner.cc

diff --git a/NEWS b/NEWS
index ed8d4e1d1dfb550427581055f38c07d6af0153e4..fc1703b3406d80073fa1c60361430168642d1908 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,12 @@
---- ../lilypond-1.1.23.jcn3/NEWS       Thu Jan 21 18:57:17 1999
+--- ../lilypond-1.1.23.jcn4/NEWS       Fri Jan 22 17:54:13 1999
+++ b/NEWS      Sat Jan 23 16:13:25 1999
+@@ -1,3 +1,6 @@
+pl 23.jcn5
+       - verder hakken aan repeat-engraver URG
+
+ pl 23.jcn4
+       - hakken aan repeat-engaver
+ --- ../lilypond-1.1.23.jcn3/NEWS      Thu Jan 21 18:57:17 1999
 ++ b/NEWS      Fri Jan 22 17:54:13 1999
 @@ -1,3 +1,6 @@
 pl 23.jcn4
diff --git a/VERSION b/VERSION
index 12248a04abbf4d904cbde6c82a460de31a34353c..34dd45d4d95a7d2eab40659cdccb1009f45b8d8e 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=1
 PATCH_LEVEL=23
-MY_PATCH_LEVEL=jcn4
+MY_PATCH_LEVEL=jcn5
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 914b665f96b10e62094228e048525e15e57ec660..7abd8c0b8c84474c1b10702fd9dc3ab13b9fe62c 100644 (file)
@@ -1,18 +1,13 @@
 \score{
        <
                  \type Staff \notes\relative c'{ 
-                         c d e f
+                         c4 d e f
                          \repeat 2 { g a b c }
-                         \alternative { { c b a g } { f e d c } }
-                 }
-                 \type Lyrics \lyrics {
-                         De eer- ste < { maat } { moet } >
-                         \repeat 2 { }
-                         \alternative < 
-                                 { en dan twee keer } 
-                                 { een koe- plet _ } 
-                         > 
-                         en dan nog dit er ach- ter aan
+%                        \alternative { { c b a g } { f e d c } } c c c c
+                         \alternative { { c b a g } { f e d c } { c d e f } }
+                         g g g g
+                         \repeat 2 { c c c c }
+                         \repeat 2 { c c c c }
                  }
        >
 }
index 62b5f70ffd4e24a5f7b5d1cbbbea069fe866ce9e..59ab434cf64087bbe26b61c1b4a870161a851914 100644 (file)
@@ -19,7 +19,6 @@
 Bar_engraver::Bar_engraver()
 {
   bar_p_ =0;
-  bar_l_ =0;
   do_post_move_processing();
 }
 
@@ -45,8 +44,8 @@ Bar_engraver::acknowledge_element (Score_element_info i)
 {
   if (Bar *b = dynamic_cast<Bar *> (i.elem_l_))
     {
-      bar_l_ = b;
-      //      auto_create_bar_b_ = false;
+      // only bar-engraver should create bars
+      assert (0);
     }
 }
 
@@ -67,6 +66,30 @@ Bar_engraver::create_bar ()
     }
 }
 
+void
+Bar_engraver::request_bar (String type_str)
+{
+#if 0 // will dump core at announce_element (invalid daddy_grav_l_...)
+  create_bar ();
+#else
+  if (!bar_p_)
+    {
+      bar_p_ = new Bar;
+      bar_p_->break_priority_i_  = 0;
+      // urg: "" != empty...
+      String default_type = get_property ("defaultBarType", 0);
+      if (default_type.length_i ())
+       {
+         bar_p_->type_str_ = default_type;
+       }
+    }
+#endif
+  if (((type_str == "|:") && (bar_p_->type_str_ == ":|"))
+    || ((type_str == ":|") && (bar_p_->type_str_ == "|:")))
+    bar_p_->type_str_ = ":|:";
+  else
+    bar_p_->type_str_ = type_str;
+}
 
 void 
 Bar_engraver::do_creation_processing ()
@@ -93,9 +116,7 @@ Bar_engraver::do_process_requests()
   Time_description const *time = get_staff_info().time_C_;
   if (bar_req_l_) 
     {
-      if (!bar_p_)
-       create_bar ();    
-
+      create_bar ();    
       bar_p_->type_str_ = bar_req_l_->type_str_;
     }
   else 
@@ -110,16 +131,7 @@ Bar_engraver::do_process_requests()
        }
     }
   
-  /*
-    hmm, perhaps it's Better to create empty bars if you want none
-    displayed, and keep bars for breakpoints ?
-   */
-#if 0
-  if ((time && time->whole_in_measure_)
-      && !always.to_bool ()
-      && !bar_p_ && !bar_l_)
-#endif
-  if (!bar_p_ && !bar_l_)
+  if (!bar_p_)
     {
       Break_req r;
       r.penalty_i_ = Break_req::DISALLOW;
@@ -131,15 +143,6 @@ Bar_engraver::do_process_requests()
 void 
 Bar_engraver::do_pre_move_processing()
 {
-  if (bar_l_)
-    {
-      bar_l_ = 0;
-      if (bar_p_)
-       {
-         bar_p_->unlink ();
-         bar_p_ = 0;
-       }
-    }
   if (bar_p_) 
     {
       typeset_element (bar_p_);
index 7d52fafe67cbcad18d66b1be9544b61d7c19cc81..a626178f84f76db61afb44b4f87fa3caafc2e6b4 100644 (file)
@@ -7,26 +7,22 @@
 */
 
 
-#ifndef BARGRAV_HH
-#define BARGRAV_HH
+#ifndef BAR_ENGRAVER_HH
+#define BAR_ENGRAVER_HH
+
 #include "engraver.hh"
 
 /**
   generate bars. Either user ("|:"), or default (new measure)
   */
-class Bar_engraver : public Engraver {
-  Bar_req * bar_req_l_;
-  Bar * bar_p_;
-  Bar * bar_l_;
-  bool auto_create_bar_b_;
-
-  void create_bar ();
+class Bar_engraver : public Engraver
+{
 public:
-  VIRTUAL_COPY_CONS(Translator);
   Bar_engraver();
+  VIRTUAL_COPY_CONS(Translator);
   
-
-     
+  void request_bar (String type_str);
+    
 protected:
   virtual void acknowledge_element (Score_element_info i);
   virtual void do_creation_processing ();
@@ -35,6 +31,13 @@ protected:
   virtual void do_process_requests();
   virtual void do_pre_move_processing();
   virtual void do_post_move_processing();
+
+private:
+  void create_bar ();
+
+  Bar_req * bar_req_l_;
+  Bar * bar_p_;
+  bool auto_create_bar_b_;
 };
 
-#endif // BARGRAV_HH
+#endif // BAR_ENGRAVER_HH
index cf8c1b32d55f88c1c51738c9d4ea711398398baf..a64f7ef08ab56a6b6ac917bde094017c7b23f0c1 100644 (file)
@@ -32,6 +32,7 @@ protected:
   VIRTUAL_COPY_CONS (Score_element);
 
   virtual void do_add_processing ();
+  virtual Interval do_height () const;
   virtual void do_post_processing ();
   virtual void do_substitute_dependency (Score_element*,Score_element*);
 };
index 472b849b0dc65a79c3a81e2c662e644b779ebbd9..f8d438d258989604021330072cc3f69fedc16d3d 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "repeat-engraver.hh"
 #include "bar.hh"
+#include "bar-engraver.hh"
 #include "musical-request.hh"
 #include "multi-measure-rest.hh"
 #include "command-request.hh"
@@ -17,6 +18,7 @@
 #include "time-description.hh"
 #include "volta-spanner.hh"
 #include "note-column.hh"
+#include "paper-def.hh"
 
 ADD_THIS_TRANSLATOR (Repeat_engraver);
 
@@ -99,26 +101,58 @@ Repeat_engraver::do_removal_processing ()
       typeset_element (volta_p_arr_[i]);
 }
 
+#define URG
+
 void
 Repeat_engraver::do_process_requests ()
 {  
   Moment now = now_moment ();
+  Time_description const *time = get_staff_info().time_C_;
+  Bar_engraver* bar_engraver_l = dynamic_cast <Bar_engraver*>
+    (paper ()->find_translator_l ("Bar_engraver"));
   for (int i = bar_p_arr_.size (); i < repeated_music_arr_.size (); i++)
     {
-      Bar* bar_p = new Bar;
-      bar_p-> type_str_ = "|:";
-      bar_p_arr_.push (bar_p);
-      if (now > Moment (0))
-       announce_element (Score_element_info (bar_p, repeated_music_arr_[i])); 
+#ifndef URG
+      //suck me plenty
+      // nou hw, ik heb 't geprobeerd, maar ik snap er geen ruk van:
+      // zodra ik het via gevonden bar-engraver doe, dumpt ze koor
+      // in create_bar::announce_element, of ze zet helemaal geen ":|".
+      // het lijkt erop alsof ik een heel andere bar-engraver vind
+      // dan die ik zoek, ofzo??
+      if (bar_engraver_l && (now > Moment (0)))
+       bar_engraver_l->request_bar (":|");
+      else
+#endif
+       if (now > Moment (0))
+       {
+         Bar* bar_p = new Bar;
+         bar_p-> type_str_ = "|:";
+         bar_p_arr_.push (bar_p);
+#ifndef URG
+         announce_element (Score_element_info (bar_p,
+                                               repeated_music_arr_[i])); 
+#endif
+       }
     }
   for (int i = 0; i < bar_p_arr_.size (); i++)
     {
       if (!bar_p_arr_[i] && (now >= stop_mom_arr_[i]))
         {
-         Bar* bar_p = new Bar;
-         bar_p-> type_str_ = ":|";
-         bar_p_arr_[i] = bar_p;
-         announce_element (Score_element_info (bar_p, repeated_music_arr_[i]));
+#ifndef URG
+         //suck me plenty
+         if (bar_engraver_l)
+           bar_engraver_l->request_bar ("|:");
+         else
+#endif
+           {
+             Bar* bar_p = new Bar;
+             bar_p-> type_str_ = ":|";
+             bar_p_arr_[i] = bar_p;
+#ifndef URG
+             announce_element (Score_element_info (bar_p,
+                                                   repeated_music_arr_[i]));
+#endif
+           }
        }
     }
   int bees = volta_p_arr_.size ();
index 2a25bb47b344e683d9e3805d579b23779d3783e5..b0c5ea4b7de8e8663f0430cc7c12526e59cae74f 100644 (file)
@@ -86,6 +86,16 @@ Volta_spanner::do_add_processing ()
   dot_p_->style_str_ = "bold";
 }
   
+Interval
+Volta_spanner::do_height () const
+{
+  /*
+    in most cases, it's a lot better not no have height...
+  */
+  Interval i;
+  return i;
+}
+
 void
 Volta_spanner::do_post_processing ()
 {