]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.77.jcn5
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 13 Aug 2000 22:44:16 +0000 (00:44 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 13 Aug 2000 22:44:16 +0000 (00:44 +0200)
1.3.77.jcn5
===========

* Added a devnull engraver, that junks (notehead) requests of the second
  stem when combined parts are in unison (a2).

---
Generated by janneke@gnu.org,
From = lilypond-1.3.77.jcn4, To = lilypond-1.3.77.jcn5

usage

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

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

CHANGES
VERSION
lily/a2-devnull-engraver.cc [new file with mode: 0644]
lily/part-combine-music-iterator.cc
ly/engraver.ly

diff --git a/CHANGES b/CHANGES
index ebc757006ef10b5b5a101699c0a2f79bfb75af80..a08e18215c2137f09139463d2b04ec728fe4cff7 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,15 @@
---- ../lilypond-1.3.77.jcn3/CHANGES    Sun Aug 13 20:05:00 2000
+--- ../lilypond-1.3.77.jcn4/CHANGES    Sun Aug 13 23:23:46 2000
+++ b/CHANGES   Mon Aug 14 00:44:16 2000
+@@ -1,3 +1,9 @@
+1.3.77.jcn5
+===========
+
+* Added a devnull engraver, that junks (notehead) requests of the second
+  stem when combined parts are in unison (a2).
+
+ 1.3.77.jcn4
+ ===========
+ --- ../lilypond-1.3.77.jcn3/CHANGES   Sun Aug 13 20:05:00 2000
 ++ b/CHANGES   Sun Aug 13 23:23:46 2000
 @@ -1,3 +1,14 @@
 1.3.77.jcn4
diff --git a/VERSION b/VERSION
index 833ea3ac2acf97ad824a7e6b17b2b6bd6ce27865..5d097db96e4d7372f03c0045ed330e72244a7852 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
 PATCH_LEVEL=77
-MY_PATCH_LEVEL=jcn4
+MY_PATCH_LEVEL=jcn5
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/lily/a2-devnull-engraver.cc b/lily/a2-devnull-engraver.cc
new file mode 100644 (file)
index 0000000..680dedb
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+  a2-devnull-engraver.cc -- implement A2_devnull_engraver
+
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#include "engraver.hh"
+#include "item.hh"
+#include "musical-request.hh"
+#include "translator-group.hh"
+
+class A2_devnull_engraver : public Engraver
+{
+public:
+  VIRTUAL_COPY_CONS (Translator);
+  
+protected:
+  virtual bool do_try_music (Music*);
+};
+
+ADD_THIS_TRANSLATOR (A2_devnull_engraver);
+
+bool
+A2_devnull_engraver::do_try_music (Music *m) 
+{
+  if (Note_req * n = dynamic_cast <Note_req *> (m))
+    {
+      SCM a2 = get_property ("a2");
+      // should be able to read id_str_, no?
+      SCM second = get_property ("second");
+
+      if (a2 == SCM_BOOL_T && second == SCM_BOOL_T)
+       {
+         return true;
+       }
+    }
+  return false;
+}
+      
index 0f6b907551106023527845c8451c9532c97a136d..86f035486bb1c9a303352bae6b98d0ef01a321c7 100644 (file)
@@ -142,8 +142,7 @@ Part_combine_music_iterator::do_process_and_next (Moment m)
                                                              to_id);
 
   fd->set_property ("first", SCM_BOOL_T);
-  if (!combined_b_)
-    sd->set_property ("second", SCM_BOOL_T);
+  sd->set_property ("second", SCM_BOOL_T);
 
   if (first_next <= m)
     first_iter_p_->process_and_next (m);
@@ -155,13 +154,24 @@ Part_combine_music_iterator::do_process_and_next (Moment m)
 
   /*
     TODO:
+    
+    * "a2" string is fine, but "Soli" strings are one request late,
+      second a2 requests are junked one requst late...
+    
+      The problem seems to be: we need to do_try_music for the
+      spanish_inquisition to work; but the properties that we set
+      need to be set *before* we do_try_music?
+      
+    * setting of stem directions by a2-engraver don't work
+      
+    * move much as possible code (changed?) to engravers: just notify
+      them of status: unison/solo.  Engravers should be able to find
+      out whether something changed and if so, what to do.
 
-    * when combining two threads: check pitches, request stem directions
+    * who should reset the properties, it's a mess now?
 
-    * a2-engraver to put texts a2/Solo/SoloII as appropriate.
 
-    * maybe the a2-engraver should set the stem directions, iso us?
-    
+    Later (because currently,we only handle thread swiching, really):
 
     Maybe different modes exist?
 
@@ -188,22 +198,26 @@ Part_combine_music_iterator::do_process_and_next (Moment m)
     second_spanish_inquisition = new Pitch_interrogate_req;
   Music_iterator* sit = second_iter_p_->try_music (second_spanish_inquisition);
 
-  /*
-    Hmm.  In the case of a2, the second identical set of requests must
-    be junked: that's the whole point of detecting a2.  Howto/whereto
-    junk these requests?
-   */
-  if (changed_b
-      && (first_next == second_next)
+
+  // URG, moveme: just set properties
+  if (//changed_b
+      //&&
+      (first_next == second_next)
       && first_spanish_inquisition->pitch_arr_.size ()
       && (first_spanish_inquisition->pitch_arr_.size ()
          == second_spanish_inquisition->pitch_arr_.size ())
       && (first_spanish_inquisition->pitch_arr_[0] ==
          second_spanish_inquisition->pitch_arr_[0]))
     {
-      fd->set_property ("a2", SCM_BOOL_T);
-      sd->set_property ("a2", SCM_BOOL_T);
+      if (changed_b)
+       {
+         fd->set_property ("a2", SCM_BOOL_T);
+         sd->set_property ("a2", SCM_BOOL_T);
+       }
+      second_iter_p_->report_to_l ()->set_property ("a2", SCM_BOOL_T);
     }
+  else
+    second_iter_p_->report_to_l ()->set_property ("a2", SCM_BOOL_F);
   
   if (changed_b
       && first_spanish_inquisition->pitch_arr_.size ()
index fbbf35f2e694ebf76205faf11e94229491e5cad3..60399daa1bf62c93d5e8b1c0d0958e080751e1e7 100644 (file)
@@ -205,6 +205,7 @@ GraceContext=\translator {
 
 ThreadContext = \translator{
        \type Engraver_group_engraver;
+       \consists "A2_devnull_engraver";
        \consists "Note_heads_engraver";
        \consists "Output_property_engraver";   
        Generic_property_list = #generic-thread-properties