From 4919c3354b3b7c001a47c2a37ada95a60512c037 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 14 Aug 2000 00:44:16 +0200 Subject: [PATCH] patch::: 1.3.77.jcn5 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 | 13 ++++++++- VERSION | 2 +- lily/a2-devnull-engraver.cc | 41 +++++++++++++++++++++++++++ lily/part-combine-music-iterator.cc | 44 +++++++++++++++++++---------- ly/engraver.ly | 1 + 5 files changed, 84 insertions(+), 17 deletions(-) create mode 100644 lily/a2-devnull-engraver.cc diff --git a/CHANGES b/CHANGES index ebc757006e..a08e18215c 100644 --- 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 833ea3ac2a..5d097db96e 100644 --- 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 index 0000000000..680dedb5a3 --- /dev/null +++ b/lily/a2-devnull-engraver.cc @@ -0,0 +1,41 @@ +/* + a2-devnull-engraver.cc -- implement A2_devnull_engraver + + source file of the GNU LilyPond music typesetter + + (c) 2000 Jan Nieuwenhuizen +*/ + +#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 (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; +} + diff --git a/lily/part-combine-music-iterator.cc b/lily/part-combine-music-iterator.cc index 0f6b907551..86f035486b 100644 --- a/lily/part-combine-music-iterator.cc +++ b/lily/part-combine-music-iterator.cc @@ -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 () diff --git a/ly/engraver.ly b/ly/engraver.ly index fbbf35f2e6..60399daa1b 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -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 -- 2.39.5