]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.79
authorfred <fred>
Tue, 26 Mar 2002 23:54:55 +0000 (23:54 +0000)
committerfred <fred>
Tue, 26 Mar 2002 23:54:55 +0000 (23:54 +0000)
input/bugs/almost.ly [new file with mode: 0644]
input/test/hymn.ly [new file with mode: 0644]
input/test/part-combine.ly
input/test/short-part-combine.ly [new file with mode: 0644]
input/test/solo-a2.ly [new file with mode: 0644]
lily/a2-devnull-engraver.cc
lily/a2-engraver.cc

diff --git a/input/bugs/almost.ly b/input/bugs/almost.ly
new file mode 100644 (file)
index 0000000..7276562
--- /dev/null
@@ -0,0 +1,18 @@
+\score{
+       \context Staff <
+               \context Voice=one { \skip 1; }
+               \context Voice=two { \skip 1; }
+
+               \context Voice=one \partcombine Voice
+                       \context Thread=one \notes\relative c'' {
+                               a4 c4.()g8 a4
+                       }
+                       \context Thread=two \notes\relative c'' {
+                               g4 e4.()d8 c4
+                       }
+       >
+       \paper{
+               linewidth=60.\mm;
+       }
+}
+
diff --git a/input/test/hymn.ly b/input/test/hymn.ly
new file mode 100644 (file)
index 0000000..8003c4d
--- /dev/null
@@ -0,0 +1,32 @@
+\score{
+       \context Staff <
+               \context Voice=one { \skip 1; }
+               \context Voice=two { \skip 1; }
+
+               \context Voice=one \partcombine Voice
+                       \context Thread=one \notes\relative c'' {
+                               %a4 c4.()g8 a4 |
+                               g4 e' g()f | 
+                               b, a c2
+                       }
+                       \context Thread=two \notes\relative c'' {
+                               %g4 e4.()d8 c4 |
+                               g4 c, e()f |
+                               d2 a
+                       }
+       >
+       \paper{
+               linewidth=140.\mm;
+               \translator {
+                       \VoiceContext
+                       soloADue = ##f
+                       %\remove Slur_engraver;
+                       \consists Slur_engraver;
+               }
+%              \translator {
+%                      \ThreadContext
+%                      \consists Slur_engraver;
+%              }
+       }
+}
+
index 074498488ee796903089430d760f4cdd13a004c1..40fe3fc007747934d57558c2432e4bcecb17124b 100644 (file)
@@ -1,22 +1,27 @@
 \score{
-       \context Staff = first <
-               \context Voice=first { \skip 1; }
-               \context Voice=second { \skip 1; }
+       \context Staff = one <
+               \context Voice=one { \skip 1; }
+               \context Voice=two { \skip 1; }
 
-               \context Voice=first \partcombine Voice
-                       \context Thread=first \notes\relative c''
+               \context Voice=one \partcombine Voice
+                       \context Thread=one \notes\relative c''
                                {
                                        c4 d e f
                                        b,4 d c d
                                        r2 e4 f
                                        c4 d e f
+                                       c d e f
                                }
-                       \context Thread=second \notes\relative c''
+                       \context Thread=two \notes\relative c''
                                {
-                                       a b c d
+                                       g b d f
                                        r2 c4 d
                                        a c c d
                                        a4. b8 c4 d
+                                       c d e f
                                }
                >
+       \paper{
+               linewidth = 100.\mm;
+       }
 }
diff --git a/input/test/short-part-combine.ly b/input/test/short-part-combine.ly
new file mode 100644 (file)
index 0000000..89e907c
--- /dev/null
@@ -0,0 +1,16 @@
+\score{
+       \context Staff = one <
+               \context Voice=one { \skip 1; }
+               \context Voice=two { \skip 1; }
+
+               \context Voice=one \partcombine Voice
+                       \context Thread=one \notes\relative c''
+                               {
+                                       d e f
+                               }
+                       \context Thread=two \notes\relative c''
+                               {
+                                       d d d
+                               }
+               >
+}
diff --git a/input/test/solo-a2.ly b/input/test/solo-a2.ly
new file mode 100644 (file)
index 0000000..e305421
--- /dev/null
@@ -0,0 +1,19 @@
+\score{
+       \context Staff = one <
+               \context Voice=one { \skip 1; }
+               \context Voice=two { \skip 1; }
+
+               \context Voice=one \partcombine Voice
+                       \context Thread=one \notes\relative c''
+                               {
+                                       e \property Voice.soloADue = ##f e
+                               }
+                       \context Thread=two \notes\relative c''
+                               {
+                                       e \property Voice.soloADue = ##f e
+                               }
+               >
+       \paper{
+               linewidth = 100.\mm;
+       }
+}
index 680dedb5a326658b16aa08b9e39823f9338d34f9..30638451d88107a4b9c48954d9cdbabbf744a085 100644 (file)
@@ -17,25 +17,16 @@ public:
   VIRTUAL_COPY_CONS (Translator);
   
 protected:
-  virtual bool do_try_music (Music*);
+  virtual void acknowledge_element (Score_element_info);
 };
 
 ADD_THIS_TRANSLATOR (A2_devnull_engraver);
 
-bool
-A2_devnull_engraver::do_try_music (Music *m) 
+void
+A2_devnull_engraver::acknowledge_element (Score_element_info i)
 {
-  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;
+  if (daddy_trans_l_->id_str_ == "two"
+      && to_boolean (get_property ("unison"))
+      && to_boolean (get_property ("soloADue")))
+    i.elem_l_->suicide ();
 }
-      
index 65a239e03029c3b08cbb42ccd76e0c225e500a86..796056eb4de1eb1f8df7d6b21d419c41c737a75c 100644 (file)
@@ -23,12 +23,12 @@ public:
 protected:
   virtual void do_process_music ();
   virtual void acknowledge_element (Score_element_info);
-  //virtual void process_acknowledged ();
 
   virtual void do_pre_move_processing ();
 
 private:
   Item* text_p_;
+  enum State { NORMAL, SOLO, SPLIT_INTERVAL, UNISON } state_;
 };
 
 ADD_THIS_TRANSLATOR (A2_engraver);
@@ -36,6 +36,7 @@ ADD_THIS_TRANSLATOR (A2_engraver);
 A2_engraver::A2_engraver ()
 {
   text_p_ = 0;
+  state_ = NORMAL;
 }
 
 void
@@ -43,39 +44,50 @@ A2_engraver::do_process_music ()
 {
   if (!text_p_)
     {
-      SCM a2 = get_property ("a2");
+      SCM unison = get_property ("unison");
+      SCM unirhythm = get_property ("unirhythm");
       SCM solo = get_property ("solo");
-      SCM solo2 = get_property ("solo2");
+      SCM split_interval = get_property ("split-interval");
+      SCM solo_adue = get_property ("soloADue");
 
-      if (solo == SCM_BOOL_T || a2 == SCM_BOOL_T || solo2 == SCM_BOOL_T)
+      if (solo_adue == SCM_BOOL_T
+         && ((solo == SCM_BOOL_T && state_ != SOLO)
+             || (unison == SCM_BOOL_T && state_ != UNISON
+                 && daddy_trans_l_->id_str_ == "one")))
        {
          text_p_ = new Item (get_property ("basicTextScriptProperties"));
          Side_position::set_axis (text_p_, Y_AXIS);
          announce_element (text_p_, 0);
       
-         /*
-           Urg, read prop
-         */
-         SCM text;
          Direction dir = UP;
+         SCM text;
          if (solo == SCM_BOOL_T)
            {
-             text = ly_str02scm ("Solo");
-           }
-         else if (solo2 == SCM_BOOL_T)
-           {
-             text = ly_str02scm ("Solo II");
-             dir = DOWN;
+             state_ = SOLO;
+             if (daddy_trans_l_->id_str_ == "one")
+               {
+                 text = get_property ("soloText");
+               }
+             else
+               {
+                 text = get_property ("soloIIText");
+                 dir = DOWN;
+               }
            }
-         else if (a2 == SCM_BOOL_T)
+         else if (unison == SCM_BOOL_T)
            {
-             text = ly_str02scm ("\\`a 2");
+             state_ = UNISON;
+             if (daddy_trans_l_->id_str_ == "one")
+               text = get_property ("aDueText");
            }
-
+         
          Side_position::set_direction (text_p_, dir);
          text_p_->set_elt_property ("text", text);
-
        }
+      else if (unison == SCM_BOOL_T)
+       state_ = UNISON;
+      else if (unirhythm == SCM_BOOL_T && split_interval == SCM_BOOL_T)
+       state_ = SPLIT_INTERVAL;
     }
 }
 
@@ -95,26 +107,31 @@ A2_engraver::acknowledge_element (Score_element_info i)
       if (Stem::has_interface (i.elem_l_))
        {
          Side_position::add_support (text_p_, i.elem_l_);
+       }
+    }
+         
          
-         SCM a2 = get_property ("a2");
-         SCM solo = get_property ("solo");
-         SCM solo2 = get_property ("solo2");
+  if (Stem::has_interface (i.elem_l_))
+    {
+      Item *stem_l = dynamic_cast<Item*> (i.elem_l_);
 
-         SCM first = get_property ("first");
-         SCM second = get_property ("second");
+      SCM unison = get_property ("unison");
+      SCM unirhythm = get_property ("unirhythm");
+      SCM solo = get_property ("solo");
+      SCM split_interval = get_property ("split-interval");
+      SCM solo_adue = get_property ("soloADue");
 
-         if (solo != SCM_BOOL_T
-             && solo2 != SCM_BOOL_T
-             && a2 != SCM_BOOL_T)
+      if ((unirhythm != SCM_BOOL_T && solo != SCM_BOOL_T)
+         || (unirhythm == SCM_BOOL_T && split_interval == SCM_BOOL_T
+             && (unison != SCM_BOOL_T || solo_adue != SCM_BOOL_T)))
+       {
+         if (daddy_trans_l_->id_str_ == "one")
            {
-             if (first == SCM_BOOL_T)
-               {
-                 Directional_element_interface (i.elem_l_).set (UP);
-               }
-             else if (second == SCM_BOOL_T)
-               {
-                 Directional_element_interface (i.elem_l_).set (DOWN);
-               }
+             stem_l->set_elt_property ("direction", gh_int2scm (1));
+           }
+         else if (daddy_trans_l_->id_str_ == "two")
+           {
+             stem_l->set_elt_property ("direction", gh_int2scm (-1));
            }
        }
     }
@@ -129,9 +146,5 @@ A2_engraver::do_pre_move_processing ()
       typeset_element (text_p_);
       text_p_ = 0;
     }
-  // burp: reset properties
-  daddy_trans_l_->set_property ("a2", SCM_BOOL_F);
-  daddy_trans_l_->set_property ("solo", SCM_BOOL_F);
-  daddy_trans_l_->set_property ("solo2", SCM_BOOL_F);
 }