]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.1.8.jcn1: pats
authorJan Nieuwenhuizen <janneke@gnu.org>
Mon, 23 Nov 1998 21:29:27 +0000 (22:29 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 23 Nov 1998 21:29:27 +0000 (22:29 +0100)
pl 8.jcn1
- bf: lyric-engraver: handle multiple requests (don't overwrite)
- bf: guile-config
- music-list-iterator

---
Generated by janneke@gnu.org using package-diff 0.62,
>From = lilypond-1.1.8, To = lilypond-1.1.8.jcn1

usage

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.1.8.jcn1.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.8
1.1.8.jcn1
++state

23 files changed:
NEWS
VERSION
aclocal.m4
input/test/repeat.fly [deleted file]
input/test/repeat.ly [new file with mode: 0644]
input/test/star.ly
lily/chord-iterator.cc [deleted file]
lily/include/chord-iterator.hh [deleted file]
lily/include/lily-proto.hh
lily/include/lyric-engraver.hh
lily/include/music-list-iterator.hh [new file with mode: 0644]
lily/include/repeated-music-iterator.hh
lily/include/repeated-music.hh
lily/include/sequential-music-iterator.hh
lily/include/simultaneous-music-iterator.hh [new file with mode: 0644]
lily/lyric-engraver.cc
lily/music-iterator.cc
lily/music-list-iterator.cc [new file with mode: 0644]
lily/parser.yy
lily/repeated-music-iterator.cc
lily/repeated-music.cc
lily/simultaneous-music-iterator.cc [new file with mode: 0644]
stepmake/aclocal.m4

diff --git a/NEWS b/NEWS
index 7dcddaa33bc0e80e3fbfbdd6b2afc8b21ef97d51..4c5561f8266131274bf126032bc8d78ae667f7cd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,14 @@
---- ../lilypond-1.1.8/NEWS     Sun Nov 22 20:16:26 1998
+--- ../lilypond-1.1.8/NEWS     Sat Nov 21 12:21:29 1998
+++ b/NEWS      Mon Nov 23 21:47:36 1998
+@@ -1,3 +1,8 @@
+pl 8.jcn1
+       - bf: lyric-engraver: handle multiple requests (don't overwrite)
+       - bf: guile-config
+       - music-list-iterator
+
+ pl 8
+ pl7.jcn3--- ../lilypond-1.1.8/NEWS    Sun Nov 22 20:16:26 1998
 ++ b/NEWS      Sun Nov 22 20:43:39 1998
 @@ -1,3 +1,6 @@
 pl 8.hwn1
diff --git a/VERSION b/VERSION
index 2a172de0dee386e26e909328b846a8b91f555d9e..216dcd2ab154e114fe92391d34ae4b6e99f68a8c 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=1
 PATCH_LEVEL=8
-MY_PATCH_LEVEL=hwn1
+MY_PATCH_LEVEL=jcn1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 46b9e1839eecc088acb67b1fe009ca9d39cd9dc0..50748a506a352e63f39f83ebfb3dccd1922190f4 100644 (file)
@@ -170,7 +170,7 @@ AC_DEFUN(AC_STEPMAKE_GUILE, [
       AC_CHECK_LIB(guile, scm_boot_guile)\
     )
     if test "$ac_cv_lib_guile_scm_shell" != yes -a \
-      "$ac_cv_lib_scm_boot_guile" != yes ; then
+      "$ac_cv_lib_guile_scm_boot_guile" != yes ; then
            AC_STEPMAKE_WARN(You should install guile 1.3 or newer)
     fi
 ])
diff --git a/input/test/repeat.fly b/input/test/repeat.fly
deleted file mode 100644 (file)
index a41926a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-a b c d \repeat 2 { { c c c c d d d d e e e e } } \alternative { { e e e e } { e e e g } } c c c c  c c c c
diff --git a/input/test/repeat.ly b/input/test/repeat.ly
new file mode 100644 (file)
index 0000000..f4dbf0f
--- /dev/null
@@ -0,0 +1,18 @@
+\score{
+       <
+                 \type Staff \notes\relative c''{ 
+                         c c c c 
+                         \repeat 2 { { d d d d } }
+                         \alternative { { a a a a } { a a a a } }
+                 }
+                 \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
+                 }
+       >
+}
index 9ec0ea4a972c56c92d6824018e4ab660e3bdd4ed..f498e0bf4df34a8e2c4499cb46bd5c06b05b15f1 100644 (file)
@@ -56,19 +56,15 @@ $staff2_voice_2 = \notes {
   [g8.  g16] fis4.~a,8 [d8 e8] fis2 [b8 b8] a4. a8 a,4 d2 s4 
 }
 
-$text1 = \lyrics{
-  Oh4 __ say. can you see,2 by8. the16 dawn's4 ear- ly light2 What8
+$text = \lyrics{
+  Oh4 __ \repeat 2 { { } } 
+  \alternative < 
+  { say. can you see,2 by8. the16 dawn's4 ear- ly light2 What8
   so8 proud-4. ly8 we4 hailed,2 At8. the16 twi-4 light's last gleam-
-  ing. Whose8. broad16 
-}
-
-$text2 = \lyrics{
-  _4 stripes and bright stars,2 through8 the8 per-4 il- ous fight,2
-  O'er8 the8 ram-4. parts8 we4 watched,2 were8. so16 gal-4 lant- ly
-  _ _ _ 
-}
-
-$text3 = \lyrics{
+  ing. Whose8. broad16 }
+  { stripes4 and bright stars,2 through8. the16 per-4 il- ous fight,2
+  O'er8 the8 ram-4. parts8 we4 watched,2 were8. so16 gal-4 lant- ly }
+  >
   stream-4 ing. And8. the16 rock-4 ets' red glare,2 the8 bombs8
   burst-4 ing in air,2 gave4 proof4. through8 the4 night2 that8.
   our16 flag4 was still there,2 Oh4 say, does that star- span-
@@ -81,9 +77,7 @@ global = \notes {
        \key D;
        \partial 4;
        \skip 4;
-       \bar "|:";
        \skip 2.*8;
-       \bar ":|";
        \skip 2.*16;
        \skip 2.;
        \bar "|.";
@@ -99,10 +93,7 @@ global = \notes {
                        \notes \transpose c'' {\voicetwo \$staff1_voice_2 } 
                >
                \type Lyrics = one \lyrics <
-% urg, too much distance between two texts; fixme first
-%                      \$text1
-%                      { \$text2 \$text3 }
-                       { \$text1 \$text3 }
+                       \$text
                >
                \type Staff=staffB < 
                        \global
diff --git a/lily/chord-iterator.cc b/lily/chord-iterator.cc
deleted file mode 100644 (file)
index 1f61364..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-  Simultaneous_music-iter.cc -- implement Simultaneous_music_iterator
-
-  source file of the GNU LilyPond music typesetter
-
-  (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "translator-group.hh"
-#include "debug.hh"
-#include "chord-iterator.hh"
-
-#include "music-list.hh"
-
-
-void
-Simultaneous_music_iterator::construct_children()
-{
-  int j = 0;
-  for (PCursor<Music*> i (simultaneous_music_l ()->music_p_list_p_->top());  
-       i.ok(); j++, i++) 
-    {
-      Music_iterator * mi = get_iterator_p (i.ptr());
-      if (mi->ok()) 
-       {
-         if  (simultaneous_music_l ()->translator_type_str_.empty_b ())
-           set_translator (mi->report_to_l()->ancestor_l (0));
-         children_p_list_.bottom().add (mi);
-       }
-      else 
-       delete mi;
-    }
-}
-
-
-void
-Simultaneous_music_iterator::do_print() const
-{
-#ifndef NPRINT
-  for (PCursor<Music_iterator*> i (children_p_list_.top()); i.ok (); i++) 
-    {
-      i->print();
-    }
-#endif
-}
-
-void
-Simultaneous_music_iterator::do_process_and_next (Moment until)
-{
-  for (PCursor<Music_iterator*> i (children_p_list_.top()); i.ok ();) 
-    {
-      if  (i->next_moment() == until) 
-       {
-         i->process_and_next (until);
-       }
-      if (!i->ok()) 
-       delete i.remove_p();
-      else
-       i++;
-    }
-  Music_iterator::do_process_and_next (until);
-}
-
-
-
-
-Moment
-Simultaneous_music_iterator::next_moment() const
-{
-  Moment next;
-  next.set_infinite (1);
-  for (PCursor<Music_iterator*> i (children_p_list_.top()); i.ok (); i++)
-    next = next <? i->next_moment() ;
-  return next;
-}
-
-
-
-bool
-Simultaneous_music_iterator::ok() const
-{
-  return children_p_list_.size();
-}
-
-Simultaneous_music*
-Simultaneous_music_iterator::simultaneous_music_l ()const
-{
-  return (  Simultaneous_music *) music_l_;
-}
diff --git a/lily/include/chord-iterator.hh b/lily/include/chord-iterator.hh
deleted file mode 100644 (file)
index 6b689e9..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-  chord-iter.hh -- declare Chord_iterator
-
-  source file of the GNU LilyPond music typesetter
-
-  (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef Simultaneous_music_ITER_HH
-#define Simultaneous_music_ITER_HH
-
-
-#include "music-iterator.hh"
-#include "plist.hh"
-
-class Simultaneous_music_iterator : public Music_iterator
-{
-  Simultaneous_music *simultaneous_music_l() const;
-  Pointer_list<Music_iterator*> children_p_list_;
-public:
-  // construction is public 
-protected:
-  virtual void do_print() const;
-  virtual void construct_children();
-  virtual void do_process_and_next (Moment);
-  virtual Moment next_moment() const;
-  virtual bool ok() const;
-};
-
-#endif // Simultaneous_music_ITER_HH
index 6c75f333d2c8030f22482da61f791beae51495b8..20a49da261ce2ca8fa1c3915439a49e4cb4edf02 100644 (file)
@@ -78,10 +78,6 @@ struct General_script_def;
 struct Graphical_element;
 
 struct Graphical_axis_group;
-struct Mark_req;
-struct Music_output;
-struct Musical_pitch;
-struct Music_output_def;
 struct Global_translator;
 struct Hara_kiri_line_group_engraver;
 struct Hara_kiri_vertical_group_spanner;
@@ -114,7 +110,7 @@ struct Local_key_engraver;
 struct Lookup;
 struct Lyric_item;
 struct Lyric_req;
-struct My_lily_lexer;
+struct Mark_req;
 struct Measure_grouping_req;
 struct Melodic_req;
 struct Midi_def;
@@ -137,14 +133,19 @@ struct Molecule;
 struct Multi_measure_rest;
 struct Multi_measure_rest_req;
 struct Multi_measure_rest_engraver;
-struct Musical_script_req;
-struct Music_list;
+struct Music;
 struct Musical_req;
 struct Musical_span_req;
-struct Music;
+struct Musical_script_req;
+struct Music_list;
+struct Music_list_iterator;
+struct Music_output;
+struct Music_output_def;
+struct Musical_pitch;
 struct Music_sequence;
-struct Music_wrapper_iterator;
 struct Music_wrapper;
+struct Music_wrapper_iterator;
+struct My_lily_lexer;
 struct My_lily_parser;
 struct Note_column;
 struct Note_column_engraver;
index 47a2b58bb199fb6fbedd5a32815f17c541d03e21..15b5f510e04b345e904921edd027366371a51dcf 100644 (file)
 
 #include "lily-proto.hh"
 
-class Lyric_engraver : public Engraver {
-  Lyric_req* lreq_l_;
-  Text_item *lyric_item_p_;
+class Lyric_engraver : public Engraver 
+{
 protected:
   virtual void do_pre_move_processing();
   virtual bool do_try_music (Music*);
   virtual void do_process_requests();
   virtual void do_post_move_processing();
+
 public:
-  VIRTUAL_COPY_CONS(Translator);
-    
   Lyric_engraver();
+  VIRTUAL_COPY_CONS(Translator);
+
+private:
+  Link_array<Lyric_req> lyric_req_l_arr_;
+  Link_array<Text_item> text_p_arr_;
 };
+
 #endif // LYRIC_ENGRAVER_HH
diff --git a/lily/include/music-list-iterator.hh b/lily/include/music-list-iterator.hh
new file mode 100644 (file)
index 0000000..6cc15b5
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+  music-list-iterator.hh -- declare Music_list_iterator
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+
+#ifndef MUSIC_LIST_ITERATOR_HH
+#define MUSIC_LIST_ITERATOR_HH
+
+#include "music-iterator.hh"
+#include "pcursor.hh"
+#include "plist.hh"
+
+class Music_list_iterator : public Music_iterator
+{
+public:
+  Music_list_iterator ();
+  virtual ~Music_list_iterator ();
+
+  virtual void construct_children ();
+  virtual Moment next_moment () const;
+  virtual bool ok () const;
+
+protected:
+  Music_list* music_list_l () const;
+
+  virtual void do_print () const;
+  virtual void do_process_and_next (Moment);
+};
+
+#endif // MUSIC_LIST_ITERATOR_HH
index 081faa7c7126dd06f1eeb8cb5a5fdce0d2785fbc..5495440493b635c7783ff10dbfc2d3b0c2c09e73 100644 (file)
 #ifndef REPEATED_MUSIC_ITERATOR_HH
 #define REPEATED_MUSIC_ITERATOR_HH
 
-#include "music-wrapper-iterator.hh"
-#include "sequential-music-iterator.hh"
+#include "music-list-iterator.hh"
 
-class Repeated_music_iterator : public Music_iterator
+class Repeated_music_iterator : public Music_list_iterator
 {
 public:
   Repeated_music_iterator ();
-  ~Repeated_music_iterator ();
+  virtual ~Repeated_music_iterator ();
 
   virtual void construct_children ();
   virtual Moment next_moment () const;
@@ -25,12 +24,13 @@ public:
 
 protected:
   virtual Repeated_music* repeated_music_l () const;
+
   virtual void do_print () const;
   virtual void do_process_and_next (Moment);
 
 private:
   Music_iterator* repeat_iter_p_;
-  Sequential_music_iterator* alternative_iter_p_;
+  Music_list_iterator* alternative_iter_p_;
 };
 
 #endif /* REPEATED_MUSIC_ITERATOR_HH */
index b068c242caf576d1cfe93c067e08168f35afcc51..1a4641ff5a068a73f1a70f82b2c39fd170bbdf8a 100644 (file)
@@ -21,10 +21,10 @@ public:
   int repeats_i_;
   Music* repeat_p_;
 //  Music_list* alternative_p_;
-  Sequential_music* alternative_p_;
+  Music_sequence* alternative_p_;
 
 //  Repeated_music (Music*, int n, Music_list*);
-  Repeated_music (Music*, int n, Sequential_music*);
+  Repeated_music (Music*, int n, Music_sequence*);
   Repeated_music (Repeated_music const& s);
   virtual ~Repeated_music ();
   
index bcbf81769cffd5583d16d22fe5d5caa967edb76b..8cf39854c840dec1b9f929545a1b2016325d60ae 100644 (file)
@@ -1,33 +1,32 @@
 /*
-  Sequential_music-iter.hh -- declare Sequential_music_iterator
+  Sequential_music-iterator.hh -- declare Sequential_music_iterator
 
   source file of the GNU LilyPond music typesetter
 
   (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-#ifndef SEQUENTIAL_MUSIC_ITER_HH
-#define SEQUENTIAL_MUSIC_ITER_HH
+#ifndef SEQUENTIAL_MUSIC_ITERATOR_HH
+#define SEQUENTIAL_MUSIC_ITERATOR_HH
 
-#include "music-iterator.hh"
-#include "pcursor.hh"
+#include "music-list-iterator.hh"
 
 /** Sequential_music iteration: walk each element in turn, and
   construct an iterator for every element.
   
  */
-class Sequential_music_iterator :  public Music_iterator
+class Sequential_music_iterator :  public Music_list_iterator
 {
 public:
   Sequential_music_iterator ();
-  ~Sequential_music_iterator ();
+  virtual ~Sequential_music_iterator ();
 
   virtual void construct_children ();
   virtual Moment next_moment () const;
   virtual bool ok () const;
 
 protected:
-  Sequential_music * sequential_music_l() const;
+  Sequential_music* sequential_music_l () const;
 
   virtual void do_print() const;
   virtual void do_process_and_next (Moment);
@@ -45,4 +44,4 @@ private:
   void set_Sequential_music_translator();
 };
 
-#endif // SEQUENTIAL_MUSIC_ITER_HH
+#endif // SEQUENTIAL_MUSIC_ITERATOR_HH
diff --git a/lily/include/simultaneous-music-iterator.hh b/lily/include/simultaneous-music-iterator.hh
new file mode 100644 (file)
index 0000000..e2c1eb4
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+  simultaneous-music-iterator.hh -- declare Simultaneous_music_iterator
+
+  source file of the GNU LilyPond music typesetter
+
+  (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#ifndef SIMULTANEOUS_MUSIC_ITERATOR_HH
+#define SIMULTANEOUS_MUSIC_ITERATOR_HH
+
+#include "music-list-iterator.hh"
+
+class Simultaneous_music_iterator : public Music_list_iterator
+{
+public:
+  Simultaneous_music_iterator ();
+  virtual ~Simultaneous_music_iterator ();
+
+  virtual void construct_children ();
+  virtual Moment next_moment () const;
+  virtual bool ok () const;
+
+protected:
+  Simultaneous_music* simultaneous_music_l () const;
+
+  virtual void do_print () const;
+  virtual void do_process_and_next (Moment);
+
+private:
+  Pointer_list<Music_iterator*> children_p_list_;
+};
+
+#endif // SIMULTANEOUS_MUSIC_ITERATOR_HH
index d3c6fdf6577202a3c9a249cd3dacd7d469e5c7e3..e1be97be83a69c37bd81ed1464cb47ee052897c7 100644 (file)
@@ -4,6 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "lyric-engraver.hh"
 #include "lookup.hh"
 #include "paper-def.hh"
 #include "main.hh"
+#include "dimensions.hh"
+
+ADD_THIS_TRANSLATOR(Lyric_engraver);
 
 Lyric_engraver::Lyric_engraver()
 {
-  lreq_l_ =0;
-  lyric_item_p_ =0;
 }
 
 bool
 Lyric_engraver::do_try_music (Music*r)
 {
-  if (Lyric_req * lr = dynamic_cast <Lyric_req *> (r))
+  if (Lyric_req* l = dynamic_cast <Lyric_req *> (r))
     {
-      lreq_l_ = lr;
+      lyric_req_l_arr_.push (l);
       return true;
     }
   return false;
@@ -34,46 +36,47 @@ Lyric_engraver::do_try_music (Music*r)
 void
 Lyric_engraver::do_process_requests()
 {
-  if (lreq_l_) 
+  if (text_p_arr_.size ())
+    return;
+
+  Scalar style = get_property ("textstyle");
+  Scalar alignment = get_property ("textalignment");
+  for (int i=0; i < lyric_req_l_arr_.size (); i++)
     {
-      Text_def *td_p = new Text_def;
-      td_p->text_str_ = lreq_l_->text_str_;
-      td_p->align_dir_ = LEFT;
-      Scalar style = get_property ("textstyle");
+      Lyric_req* request_l = lyric_req_l_arr_[i];
+      Text_def* text_p = new Text_def;
+      text_p->text_str_ = request_l->text_str_;
+      text_p->align_dir_ = LEFT;
       if (style.length_i ())
-       {
-         td_p->style_str_ = style;
-       }
-      Scalar alignment = get_property ("textalignment");
+       text_p->style_str_ = style;
       if (alignment.isnum_b())
-       {
-         td_p->align_dir_= (Direction)(int)alignment;
-       }
+       text_p->align_dir_= (Direction)(int)alignment;
       
-      lyric_item_p_ =  new Text_item (td_p);
-
-      lyric_item_p_->dir_ = DOWN;
-      lyric_item_p_->fat_b_ = true;
-      announce_element (Score_element_info (lyric_item_p_, lreq_l_));
+      Text_item* item_p =  new Text_item (text_p);
+      item_p->dir_ = DOWN;
+      item_p->fat_b_ = true;
+      // urg
+      // item_p->translate (Offset (0, (i - 1) * item_p->height ().length_i ()));
+//      if (i && ((Text_def*)text_p_arr_[i - 1]->tdef_p_)->text_str_.length_i ())
+      item_p->translate (Offset (0, - i * 12 PT));
+      text_p_arr_.push (item_p);
+      announce_element (Score_element_info (item_p, request_l));
     }
 }
 
 void
 Lyric_engraver::do_post_move_processing()
 {
-  lreq_l_ =0;
 }
 
 void
 Lyric_engraver::do_pre_move_processing()
 {
-  if (lyric_item_p_)
+  for (int i=0; i < text_p_arr_.size (); i++)
     {
-      typeset_element (lyric_item_p_);
-      lyric_item_p_ =0;
+      typeset_element (text_p_arr_[i]);
     }
+  text_p_arr_.clear ();
+  lyric_req_l_arr_.clear ();
 }
 
-
-
-ADD_THIS_TRANSLATOR(Lyric_engraver);
index 718490df5ef299116cf3582e8a9433236783aec4..3d22831fbfa9ecec925e97be98e3b583a0144cb4 100644 (file)
@@ -8,10 +8,10 @@
 #include "debug.hh"
 #include "music-list.hh"
 #include "music-iterator.hh"
-#include "sequential-music-iterator.hh"
 #include "property-iterator.hh"
-#include "chord-iterator.hh"
 #include "request-iterator.hh"
+#include "sequential-music-iterator.hh"
+#include "simultaneous-music-iterator.hh"
 #include "translator-group.hh"
 #include "translation-property.hh"
 #include "change-iterator.hh"
diff --git a/lily/music-list-iterator.cc b/lily/music-list-iterator.cc
new file mode 100644 (file)
index 0000000..d243aed
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+  Music_list-iterator.cc -- implement Music_list_iterator
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#include "music-list-iterator.hh"
+#include "music-list.hh"
+
+Music_list_iterator::Music_list_iterator ()
+{
+}
+
+Music_list_iterator::~Music_list_iterator ()
+{
+}
+
+void
+Music_list_iterator::construct_children ()
+{
+}
+
+void
+Music_list_iterator::do_print() const
+{
+}
+
+void
+Music_list_iterator::do_process_and_next (Moment)
+{
+}
+
+Music_list*
+Music_list_iterator::music_list_l () const
+{
+  return (Music_list *) music_l_;
+}
+
+Moment
+Music_list_iterator::next_moment () const
+{
+  return 0;
+}
+
+bool
+Music_list_iterator::ok () const
+{
+  return false;
+}
+
index 9b27b9a12008eafcf08652c22efa4693072decb6..64c9dd8bae3ba872d1365d55b42b721cb5514b5a 100644 (file)
@@ -739,15 +739,19 @@ Alternative_music: {
                Music_list* m = new Music_list;
                $$ = new Sequential_music (m);
        }
-       | ALTERNATIVE '{' Music_list '}'                {
-               $$ = new Sequential_music ($3);
+       | ALTERNATIVE Simultaneous_music {
+               $$ = $2;
+       }
+       | ALTERNATIVE Sequential_music {
+               $$ = $2;
        }
        ;
 
 Repeated_music: REPEAT unsigned '{' Music '}' Alternative_music        {
                // s/r conflicts -> '{' '}' 
-               Sequential_music* s = (Sequential_music*)$6;
-               $$ = new Repeated_music ($4, $2, s);
+               Music_sequence* m = dynamic_cast <Music_sequence*> ($6);
+               assert (m);
+               $$ = new Repeated_music ($4, $2, m);
        }
        ;
 
index 768a289b8f6febbe7f691d1e6501b01290f21568..5faf0880e7fcf3166b1c2fd60579c09034bc90af 100644 (file)
@@ -94,8 +94,8 @@ Repeated_music_iterator::ok () const
          Repeated_music_iterator *urg = (Repeated_music_iterator*)this;
          delete urg->repeat_iter_p_;
          urg->repeat_iter_p_ = 0;
-         urg->alternative_iter_p_ = dynamic_cast<Sequential_music_iterator*>
-           (get_iterator_p (repeated_music_l ()->alternative_p_));  
+         urg->alternative_iter_p_ = dynamic_cast<Music_list_iterator*>
+           (get_iterator_p ((Music*)repeated_music_l ()->alternative_p_));  
        }
     }
   if (alternative_iter_p_)
index 4f22f72c27363eab75e4a7e348d45b02058f6189..e0692aca8a5d53ce30a0307e2be7b25b5269afb5 100644 (file)
@@ -11,7 +11,7 @@
 #include "musical-pitch.hh"
 
 //Repeated_music::Repeated_music (Music* r, int n, Music_list* a)
-Repeated_music::Repeated_music (Music* r, int n, Sequential_music* a)
+Repeated_music::Repeated_music (Music* r, int n, Music_sequence* a)
 {
   repeats_i_ = n;
   repeat_p_ = r;
@@ -29,7 +29,8 @@ Repeated_music::Repeated_music (Repeated_music const& s)
 {
   repeat_p_ = (s.repeat_p_) ? s.repeat_p_->clone () : 0;
   // urg?
-  alternative_p_ = (s.alternative_p_) ? dynamic_cast <Sequential_music*> (s.alternative_p_->clone ()) : 0;
+//  alternative_p_ = (s.alternative_p_) ? dynamic_cast <Music_list*> (s.alternative_p_->clone ()) : 0;
+  alternative_p_ = (s.alternative_p_) ? dynamic_cast <Music_sequence*> (s.alternative_p_->clone ()) : 0;
 }
 
 void
diff --git a/lily/simultaneous-music-iterator.cc b/lily/simultaneous-music-iterator.cc
new file mode 100644 (file)
index 0000000..764bcdf
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+  Simultaneous_music-iterator.cc -- implement Simultaneous_music_iterator
+
+  source file of the GNU LilyPond music typesetter
+
+  (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "translator-group.hh"
+#include "debug.hh"
+#include "simultaneous-music-iterator.hh"
+
+#include "music-list.hh"
+
+Simultaneous_music_iterator::Simultaneous_music_iterator ()
+{
+}
+
+Simultaneous_music_iterator::~Simultaneous_music_iterator ()
+{
+}
+
+void
+Simultaneous_music_iterator::construct_children()
+{
+  int j = 0;
+  for (PCursor<Music*> i (simultaneous_music_l ()->music_p_list_p_->top());  
+       i.ok(); j++, i++) 
+    {
+      Music_iterator * mi = get_iterator_p (i.ptr());
+      if (mi->ok()) 
+       {
+         if  (simultaneous_music_l ()->translator_type_str_.empty_b ())
+           set_translator (mi->report_to_l()->ancestor_l (0));
+         children_p_list_.bottom().add (mi);
+       }
+      else 
+       delete mi;
+    }
+}
+
+
+void
+Simultaneous_music_iterator::do_print() const
+{
+#ifndef NPRINT
+  for (PCursor<Music_iterator*> i (children_p_list_.top()); i.ok (); i++) 
+    {
+      i->print();
+    }
+#endif
+}
+
+void
+Simultaneous_music_iterator::do_process_and_next (Moment until)
+{
+  for (PCursor<Music_iterator*> i (children_p_list_.top()); i.ok ();) 
+    {
+      if  (i->next_moment() == until) 
+       {
+         i->process_and_next (until);
+       }
+      if (!i->ok()) 
+       delete i.remove_p();
+      else
+       i++;
+    }
+  Music_iterator::do_process_and_next (until);
+}
+
+
+
+
+Moment
+Simultaneous_music_iterator::next_moment() const
+{
+  Moment next;
+  next.set_infinite (1);
+  for (PCursor<Music_iterator*> i (children_p_list_.top()); i.ok (); i++)
+    next = next <? i->next_moment() ;
+  return next;
+}
+
+
+
+bool
+Simultaneous_music_iterator::ok() const
+{
+  return children_p_list_.size();
+}
+
+Simultaneous_music*
+Simultaneous_music_iterator::simultaneous_music_l ()const
+{
+  return (  Simultaneous_music *) music_l_;
+}
index ab45326524543cc2cf215b03b70e25aca66570e6..01156c40eced6a3e42b8c892b09d05079683fc89 100644 (file)
@@ -168,7 +168,7 @@ AC_DEFUN(AC_STEPMAKE_GUILE, [
       AC_CHECK_LIB(guile, scm_boot_guile)\
     )
     if test "$ac_cv_lib_guile_scm_shell" != yes -a \
-      "$ac_cv_lib_scm_boot_guile" != yes ; then
+      "$ac_cv_lib_guile_scm_boot_guile" != yes ; then
            AC_STEPMAKE_WARN(You should install guile 1.3 or newer)
     fi
 ])