]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.1.39.hwn1
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 14 Apr 1999 11:58:33 +0000 (13:58 +0200)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 14 Apr 1999 11:58:33 +0000 (13:58 +0200)
pl 39.hwn1
- consified mi2mu

---
Generated by hanwen@cs.uu.nl using package-diff 0.62,
>From = lilypond-1.1.39, To = lilypond-1.1.39.hwn1

usage

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.1.39.hwn1.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.39
1.1.39.hwn1
++state

20 files changed:
NEWS
VERSION
flower/include/cons.hh
lily/include/p-col.hh
lily/include/rod.hh
lily/include/spacing-spanner.hh [new file with mode: 0644]
lily/music-list.cc
lily/rod.cc
mi2mu/include/midi-track-parser.hh
mi2mu/include/mudela-column.hh
mi2mu/include/mudela-item.hh
mi2mu/include/mudela-score.hh
mi2mu/include/mudela-staff.hh
mi2mu/include/mudela-voice.hh
mi2mu/midi-track-parser.cc
mi2mu/mudela-column.cc
mi2mu/mudela-score.cc
mi2mu/mudela-staff.cc
mi2mu/mudela-voice.cc
mi2mu/template9.cc [deleted file]

diff --git a/NEWS b/NEWS
index 9759d8c3680a72dcc9b0e013d693e482cae7a47a..d561e5e3aee1b152f3c7af96611abf63e731e085 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,13 @@
-pl 39.jcn1
+--- ../lilypond-1.1.39/NEWS    Tue Apr 13 21:32:36 1999
+++ b/NEWS      Tue Apr 13 22:43:46 1999
+@@ -1,3 +1,7 @@
+pl 39.hwn1
+       - consified mi2mu
+
+
+ pl 39
+       - \property textstyle -> textStyle
+ pl 39.jcn1
        - Musical_pitch::str (): use names from notename table
 
 pl 39
diff --git a/VERSION b/VERSION
index 76ebe35e329e1dc043111c6bc3ddc22fe177f808..c6610d636ac704351affea3003a4be450076c976 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=1
 PATCH_LEVEL=39
-MY_PATCH_LEVEL=jcn1
+MY_PATCH_LEVEL=hwn1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 6e62c4c865b97cec07ba92663c2e156928cc15cf..8fd58acb7f799b763323b6d94c6808dd91890a4f 100644 (file)
@@ -11,6 +11,8 @@
 #define CONS_HH
 
 
+#include <assert.h>
+
 template<class T>
 class Cons
 {
@@ -55,6 +57,31 @@ Cons<T> *remove_cons (Cons<T> **pp)
   return knip;
 }
 
+template<class T> int cons_list_size_i (Cons<T> *l)
+{
+  int i=0;
+  while  (l)
+    {
+      l = l->next_;
+       i++;
+    }
+  return i;
+}
+
+
+
+
+
+template<class T>
+Cons<T> * last_cons (Cons<T> * head)
+{
+  while (head->next_)
+    {
+      head = head->next_;
+    }
+  return head;
+}
+
 /**
 
    Invariants:
@@ -69,15 +96,22 @@ class Cons_list
 {
 public:
   Cons<T> * head_;
-  Cons<T> ** tail_;
-  Cons_list () { init_list (); }
-  void init_list () {head_ =0; tail_ = &head_; }
+  Cons<T> ** nil_pointer_address_;
+  Cons_list ()
+    {
+      init ();
+    }
+  void init ()
+    {
+      head_ =0;
+      nil_pointer_address_ = &head_;
+    }
   void append (Cons<T> *c)
     {
       assert (!c->next_);
-      *tail_ = c;
-      while (*tail_)
-       tail_ = &(*tail_)->next_;
+      *nil_pointer_address_ = c;
+      while (*nil_pointer_address_)
+       nil_pointer_address_ = &(*nil_pointer_address_)->next_;
     }
   /**
      PRE: *pp should either be the head_ pointer, or the next_ pointer
@@ -85,8 +119,8 @@ public:
   */
   Cons<T> *remove_cons (Cons<T> **pp)
     {
-      if (&(*pp)->next_ == tail_)
-       tail_ = pp;
+      if (&(*pp)->next_ == nil_pointer_address_)
+       nil_pointer_address_ = pp;
 
       return ::remove_cons (pp);
     }
@@ -95,7 +129,14 @@ public:
       delete head_;
       head_ =0;
     }
-  ~Cons_list () { junk (); }
+  ~Cons_list ()
+    {
+      junk ();
+    }
+  int size_i ()
+    {
+      return cons_list_size_i (head_);
+    }
 };
 
 
@@ -105,19 +146,5 @@ template<class T>
 void
 clone_killing_cons_list (Cons_list<T>&, Cons<T> *src);
 
-template<class T> int cons_list_size_i (Cons<T> *l)
-{
-  int i=0;
-  while  (l)
-    {
-      l = l->next_;
-       i++;
-    }
-  return i;
-}
-
-
-
-
 #endif /* CONS_HH */
 
index 82be4547bcae15eaea843bc751f941bd16f7dc55..1211309e1cc9c754cacf302830ab887dc01e8023 100644 (file)
@@ -31,7 +31,7 @@ class Paper_column : public Axis_group_item {
 public:
   VIRTUAL_COPY_CONS(Score_element);
   Drul_array<Array<Column_rod> > minimal_dists_arr_drul_;
-
+  Drul_array<Array<Column_spring> > spring_arr_drul_;
   void preprocess ();
   /// set a minimum distance
   void add_rod (Paper_column * to, Real distance);
index 2d8b9b4e5388558636be084b604164fc4ba39998..fbde969355aa575a11070a4def704ba9d7bf0fe3 100644 (file)
@@ -22,6 +22,7 @@ struct Column_rod {
   void print () const;
 };
 
+
 struct Rod
 {
   Drul_array <Item*> item_l_drul_;
@@ -31,6 +32,18 @@ struct Rod
   Rod ();
 };
 
+struct Column_spring {
+  Paper_column *other_l_;
+  Real distance_f_;
+  Real strength_f_;
+  
+  Column_spring ();
+  static int compare (const Column_spring &r1, const Column_spring &r2);
+  void print () const;
+};
 
+struct Spring{
+  
+};
 #endif /* ROD_HH */
 
diff --git a/lily/include/spacing-spanner.hh b/lily/include/spacing-spanner.hh
new file mode 100644 (file)
index 0000000..fbf332b
--- /dev/null
@@ -0,0 +1,23 @@
+/*   
+  spacing-spanner.hh -- declare Spacing_spanner
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#ifndef SPACING_SPANNER_HH
+#define SPACING_SPANNER_HH
+
+class Spacing_spanner : public Spanner
+{
+  Link_array<Paper_column> cols_;
+
+  Spacing_spanner ();
+protected:
+  virtual void do_space_processing ();
+};
+
+#endif /* SPACING_SPANNER_HH */
+
index 01ccd5be0fa9ffb0e27c8b5822df9b54cee4d563..656798d3cad2d591022ced217e2cc75a5ac2f7ed 100644 (file)
@@ -92,7 +92,7 @@ Music_list::do_relative_octave (Musical_pitch last, bool ret_first)
 Music_list::Music_list (Music_list const &s)
   : Cons_list<Music> (s)
 {
-  init_list ();
+  Cons_list<Music>::init ();
   clone_killing_cons_list (*this, s.head_);
 }
 
index 8f3cdc92608aca449f37d4ddb50fee9a6076b890..008707bbc1da16aac1a7950aa0c36923734b6e22 100644 (file)
@@ -47,3 +47,24 @@ Rod::add_to_cols ()
   item_l_drul_[LEFT]->column_l ()->add_rod
     (item_l_drul_[RIGHT]->column_l (), distance_f_);
 }
+
+void
+Column_spring::print () const
+{
+#ifndef NDEBUG
+  DOUT << "Column_spring { rank = "
+       << other_l_->rank_i () << ", dist = " << distance_f_ << "}\n";   
+#endif
+}
+
+Column_spring::Column_spring ()
+{
+  distance_f_ = 0;
+  other_l_ = 0;
+}
+  
+int
+Column_spring::compare (const Column_spring &r1, const Column_spring &r2)
+{
+  return r1.other_l_->rank_i() - r2.other_l_->rank_i();
+}
index 3679ef600796be31a80d6df42e6549314ca573d9..d873e198df29fcbc8f5e15c5dcd63e511cb9fcd9 100644 (file)
@@ -11,7 +11,7 @@
 #define MIDI_TRACK_PARSER_HH
 
 #include "proto.hh"
-#include "plist.hh"
+#include "cons.hh"
 #include "moment.hh"
 #include "mi2mu-proto.hh"
 #include "midi-parser.hh"
@@ -36,7 +36,7 @@ private:
 
   Moment at_mom_;
   Byte running_byte_;
-  Link_list<Mudela_note*> open_note_l_list_;
+  Cons_list<Mudela_note> open_note_l_list_;
   Mudela_staff* mudela_staff_p_;
   Midi_parser_info* track_info_p_;
 };
index b1ab97c24bb37c4f35b8833943b29f85829d93c5..a09cebb4694291d9fc5c074a5bbcd4887859eaaa 100644 (file)
@@ -9,7 +9,7 @@
 #include "proto.hh"
 #include "mi2mu-proto.hh"
 #include "moment.hh"
-#include "plist.hh"
+#include "cons.hh"
 
 /// (mudela_column)
 class Mudela_column 
@@ -18,9 +18,9 @@ public:
     Mudela_column (Mudela_score* mudela_score_l, Moment mom);
 
     void add_item (Mudela_item* mudela_item_l);
-    Moment at_mom();
+    Moment at_mom ();
 
-    Link_list<Mudela_item*> mudela_item_l_list_;
+    Cons_list<Mudela_item> mudela_item_l_list_;
     Moment at_mom_;
     Mudela_score* mudela_score_l_;
 };
index 6dce94333df8aca2c37ffba363e9b2df2efb13bd..e1b52b7368a8252d6d36ef7fe9bddb690a906269 100644 (file)
 class Mudela_item 
 {
 public:
-    Mudela_item (Mudela_column* mudela_column_l);
-    virtual ~Mudela_item ();
+  Mudela_item (Mudela_column* mudela_column_l);
+  virtual ~Mudela_item ();
     
-    virtual Moment at_mom();
-    virtual Moment duration_mom();
-    void output (Mudela_stream& mudela_stream_r);
-    virtual String str() = 0;
+  virtual Moment at_mom ();
+  virtual Moment duration_mom ();
+  void output (Mudela_stream& mudela_stream_r);
+  virtual String str () = 0;
 
-    Mudela_column* mudela_column_l_;
+  Mudela_column* mudela_column_l_;
 };
 
 class Mudela_key : public Mudela_item 
 {
 public:
-    Mudela_key (int accidentals_i, int minor_i);
+  Mudela_key (int accidentals_i, int minor_i);
 
-    String notename_str (int pitch_i);
-    virtual String str();
+  String notename_str (int pitch_i);
+  virtual String str ();
 
-//private:
-    int accidentals_i_;
-    int minor_i_;
+  //private:
+  int accidentals_i_;
+  int minor_i_;
 };
 
 class Mudela_time_signature : public Mudela_item 
 {
 public:
-    Mudela_time_signature (int num_i, int den_i, int division_4_i, int count_32_i);
+  Mudela_time_signature (int num_i, int den_i, int division_4_i, int count_32_i);
 
-    Duration i2_dur (int time_i, int division_1_i);
-    int clocks_1_i();
-    int den_i();
-    int num_i();
-    virtual String str();
-    Moment bar_mom();
+  Duration i2_dur (int time_i, int division_1_i);
+  int clocks_1_i ();
+  int den_i ();
+  int num_i ();
+  virtual String str ();
+  Moment bar_mom ();
 
 private:
-    Real sync_f_;
-    Duration sync_dur_;
-    int clocks_1_i_;
-    int num_i_;
-    int den_i_;
+  Real sync_f_;
+  Duration sync_dur_;
+  int clocks_1_i_;
+  int num_i_;
+  int den_i_;
 };
 
 class Mudela_note : public Mudela_item 
 {
 public:
-    Mudela_note (Mudela_column* mudela_column_l, int channel_i, int pitch_i, int dyn_i);
+  Mudela_note (Mudela_column* mudela_column_l, int channel_i, int pitch_i, int dyn_i);
 
-    Duration duration();
-    virtual Moment duration_mom();
-    virtual String str();
+  Duration duration ();
+  virtual Moment duration_mom ();
+  virtual String str ();
     
-//    int const c0_pitch_i_c_ = 60; // huh?
-    static int const c0_pitch_i_c_ = 48;
+  //    int const c0_pitch_i_c_ = 60; // huh?
+  static int const c0_pitch_i_c_ = 48;
 
-    static bool const simple_plet_b_s = false;
-    int channel_i_;
-    int pitch_i_;
-    Mudela_column* end_column_l_;
+  static bool const simple_plet_b_s = false;
+  int channel_i_;
+  int pitch_i_;
+  Mudela_column* end_column_l_;
 };
 
 class Mudela_skip : public Mudela_item 
 {
 public:
-    Mudela_skip (Mudela_column* mudela_column_l, Moment skip_mom);
+  Mudela_skip (Mudela_column* mudela_column_l, Moment skip_mom);
 
-    Duration duration();
-    virtual Moment duration_mom();
-    virtual String str();
+  Duration duration ();
+  virtual Moment duration_mom ();
+  virtual String str ();
 
 private:
-    Moment mom_;
+  Moment mom_;
 };
 
 
 class Mudela_tempo : public Mudela_item 
 {
 public:
-    Mudela_tempo (int useconds_per_4_i);
+  Mudela_tempo (int useconds_per_4_i);
 
-    int get_tempo_i (Moment moment);
-    virtual String str();
-    int useconds_per_4_i();
+  int get_tempo_i (Moment moment);
+  virtual String str ();
+  int useconds_per_4_i ();
 
 private:
-    int useconds_per_4_i_;
-    Moment seconds_per_1_mom_;
+  int useconds_per_4_i_;
+  Moment seconds_per_1_mom_;
 };
 
 class Mudela_text : public Mudela_item 
 {
 public:
-    enum Type { 
-       TEXT = 1, COPYRIGHT, TRACK_NAME, INSTRUMENT_NAME, LYRIC, 
-       MARKER, CUE_POINT
-    };
-    Mudela_text (Mudela_text::Type type,  String str);
-    virtual String str();
-
-//private:
-    Type type_;
-    String text_str_;
+  enum Type { 
+    TEXT = 1, COPYRIGHT, TRACK_NAME, INSTRUMENT_NAME, LYRIC, 
+    MARKER, CUE_POINT
+  };
+  Mudela_text (Mudela_text::Type type,  String str);
+  virtual String str ();
+
+  //private:
+  Type type_;
+  String text_str_;
 };
 
 #endif // MUDELA_ITEM_HH
index 4d0992b35c2556d722a786cbb1de3a3123727a1a..8e75d028ccfdb7121fb7d5f31393059ec5bd78d4 100644 (file)
@@ -8,45 +8,43 @@
 
 #include "mi2mu-proto.hh"
 #include "proto.hh"
-#include "plist.hh"
+#include "cons.hh"
 #include "parray.hh"
 
 /// (mudela_score)
 class Mudela_score {
 public:
-    Mudela_score (int format_i, int tracks_i, int tempo_i);
-    ~Mudela_score();
+  Mudela_score (int format_i, int tracks_i, int tempo_i);
+  ~Mudela_score ();
 
-    void add_item (Mudela_item* mudela_item_p);
-    void add_staff (Mudela_staff* mudela_staff_p);
+  void add_item (Mudela_item* mudela_item_p);
+  void add_staff (Mudela_staff* mudela_staff_p);
 
-    Mudela_column* find_column_l (Moment mom);
-    Mudela_column* get_column_l (Moment mom);
+  Mudela_column* find_column_l (Moment mom);
+  Mudela_column* get_column_l (Moment mom);
 
-    void output (String filename_str);
-    void process();
-
-    // ugh
-    Mudela_key* mudela_key_l_;
-    Mudela_time_signature* mudela_time_signature_l_;
-    Mudela_tempo* mudela_tempo_l_;
+  void output (String filename_str);
+  void process ();
 
+  // ugh
+  Mudela_key* mudela_key_l_;
+  Mudela_time_signature* mudela_time_signature_l_;
+  Mudela_tempo* mudela_tempo_l_;
+  Mudela_staff * last_staff_l_;
 private:
-    void filter_tempo();
-    void quantify_columns();
-    void quantify_durations();
-    void settle_columns();
+  void filter_tempo ();
+  void quantify_columns ();
+  void quantify_durations ();
+  void settle_columns ();
 
-    Pointer_list<Mudela_staff*> mudela_staff_p_list_;
-   // wants Pointer_array!
-//    Pointer_list<Mudela_column*> mudela_column_p_list_;
-    Link_array<Mudela_column> column_l_array_;
+  Cons_list<Mudela_staff> mudela_staff_p_list_;
+  Link_array<Mudela_column> column_l_array_;
 
-// ugh, ugh, ugh
+  // ugh, ugh, ugh
 public:
-    int format_i_;
-    int tracks_i_;
-    int tempo_i_;
+  int format_i_;
+  int tracks_i_;
+  int tempo_i_;
 };
 
 #endif // MUDELA_SCORE_HH
index 4b4fd75c60e6719f2515465db1e0e059c35ee3b0..8c0afa044a4b53d6ca51ec133c9492445d5d9dbf 100644 (file)
@@ -8,20 +8,21 @@
 
 #include "mi2mu-proto.hh"
 #include "proto.hh"
-#include "plist.hh"
+#include "cons.hh"
 #include "string.hh"
 
 /// (mudela_staff)
-class Mudela_staff {
+class Mudela_staff
+{
 public:
   Mudela_staff (int number_i, String copyright_str, String track_name_str, String instrument_str);
 
   void add_item (Mudela_item* mudela_item_p);
-  void eat_voice (Link_list<Mudela_item*>& items);
-  String id_str();
-  String name_str();
+  void eat_voice (Cons_list<Mudela_item>& items);
+  String id_str ();
+  String name_str ();
   void output (Mudela_stream& mudela_stream_r);
-  void process();
+  void process ();
 
   String copyright_str_;
   String instrument_str_;
@@ -34,8 +35,8 @@ public:
 private:
   void output_mudela_begin_bar (Mudela_stream& mudela_stream_r, Moment now_mom, int bar_i);
 
-  Pointer_list<Mudela_voice*> mudela_voice_p_list_;
-  Pointer_list<Mudela_item*> mudela_item_p_list_;
+  Cons_list<Mudela_voice> mudela_voice_p_list_;
+  Cons_list<Mudela_item> mudela_item_p_list_;
 };
 
 #endif // MUDELA_STAFF_HH
index 28b4efcdb99e31bea3fe68f5b8b4ef3e2d315e48..db196da9e645305b06e5c671283fc61d56ea69e3 100644 (file)
@@ -7,22 +7,19 @@
 #define MUDELA_VOICE_HH
 
 #include "mi2mu-proto.hh"
-#include "plist.hh"
+#include "cons.hh"
 
 /// (mudela_voice)
-class Mudela_voice {
+class Mudela_voice
+{
 public:
-    Mudela_voice (Mudela_staff* mudela_staff_l);
-
-    void add_item (Mudela_item* mudela_item_l);
-    Moment begin_mom();
-    Moment end_mom();
-
-    void output (Mudela_stream& mudela_stream_r);
+  Mudela_voice (Mudela_staff* mudela_staff_l);
+  void add_item (Mudela_item* mudela_item_l);
+  void output (Mudela_stream& mudela_stream_r);
 
 private:
-    Mudela_staff* mudela_staff_l_;
-    Link_list<Mudela_item*> mudela_item_l_list_;
+  Mudela_staff* mudela_staff_l_;
+  Cons_list<Mudela_item> mudela_item_l_list_;
 };
 
 #endif // MUDELA_VOICE_HH
index ff7d4453d49f55fd9cab08c386c9b33a53c6973f..661d6a8bcb835354b56cfadfd4a9424b95495098 100644 (file)
@@ -53,19 +53,17 @@ Midi_track_parser::note_end (Mudela_column* col_l, int channel_i, int pitch_i, i
 
   assert (col_l);
 
-  for (PCursor<Mudela_note*> i (open_note_l_list_.top ()); i.ok (); )
+  for (Cons<Mudela_note>** pp = &open_note_l_list_.head_; *pp;)
     {
-      if ((i->pitch_i_ == pitch_i) && (i->channel_i_ == channel_i))
+      Cons<Mudela_note>* i = *pp;
+      if ((i->car_->pitch_i_ == pitch_i) && (i->car_->channel_i_ == channel_i))
        {
-         i->end_column_l_ = col_l;
-         // LOGOUT(DEBUG_ver) << "Note: " << pitch_i;
-         // LOGOUT(DEBUG_ver) << "; " << i->mudela_column_l_->at_mom_;
-         // LOGOUT(DEBUG_ver) << ", " << i->end_column_l_->at_mom_ << '\n';
-         i.remove_p();
+         i->car_->end_column_l_ = col_l;
+         delete open_note_l_list_.remove_cons (pp);
          return;
        }
       else
-       i++;
+       pp = &i->next_;
     }
   warning (_f ("junking note-end event: channel = %d, pitch = %d", 
               channel_i, pitch_i));
@@ -76,11 +74,12 @@ Midi_track_parser::note_end_all (Mudela_column* col_l)
 {
   // find
   assert (col_l);
-  for (PCursor<Mudela_note*> i (open_note_l_list_.top ()); i.ok (); )
+  for (Cons<Mudela_note>* i = open_note_l_list_.head_; i; i = i->next_)
     {
-      i->end_column_l_ = col_l;
-      i.remove_p ();
+      i->car_->end_column_l_ = col_l;
     }
+  // UGH UGH. MEMORY LEAK.
+  open_note_l_list_.init ();
 }
 
 Mudela_staff*
@@ -169,13 +168,14 @@ Midi_track_parser::parse_event (Mudela_column* col_l)
        {
          Mudela_note* p = new Mudela_note (col_l, channel_i, pitch_i, dyn_i);
          item_p = p;
-         open_note_l_list_.bottom ().add (p);
+         open_note_l_list_.append (new Cons<Mudela_note> (p, 0));
        }
       else
        {
          note_end (col_l, channel_i, pitch_i, dyn_i);
        }
     }
+    
   // POLYPHONIC_AFTERTOUCH     [\xa0-\xaf]
   else if ((byte >= 0xa0) && (byte <= 0xaf))
     {
index 5a00e8831054ce0d4f4c66cc54eaa730b6d875dc..833b351f81fe5ec67e905f61696b20295f796f26 100644 (file)
@@ -14,7 +14,7 @@ Mudela_column::Mudela_column (Mudela_score* mudela_score_l, Moment mom)
 void 
 Mudela_column::add_item (Mudela_item* mudela_item_l)
 {
-  mudela_item_l_list_.bottom().add (mudela_item_l);
+   mudela_item_l_list_.append (new Cons<Mudela_item> (mudela_item_l, 0));
 }
 
 Moment
index 4380edfcb2242415a4a842e0b550113b3868a4ac..6916d80df7b1b464caa68dea13c73e87547b1b64 100644 (file)
@@ -14,9 +14,7 @@
 #include "mudela-staff.hh"
 #include "mudela-stream.hh"
 
-// ugh, cygnus' b19 gcc
-#include "list.tcc"
-#include "cursor.tcc"
+#include "killing-cons.tcc"
 
 //static Mudela_key key_c (0, 0);
 static Mudela_time_signature time_sig_4 (4, 2, 24, 8);
@@ -25,6 +23,7 @@ static Mudela_tempo tempo_60 (1000000);
 
 Mudela_score::Mudela_score (int format_i, int tracks_i, int tempo_i)
 {
+  last_staff_l_ =0;
   format_i_ = format_i;
   tracks_i_ = tracks_i;
   tempo_i_ = tempo_i;
@@ -35,32 +34,26 @@ Mudela_score::Mudela_score (int format_i, int tracks_i, int tempo_i)
   mudela_tempo_l_ = &tempo_60;
 }
 
-Mudela_score::~Mudela_score()
+Mudela_score::~Mudela_score ()
 {
 }
 
 void
 Mudela_score::add_item (Mudela_item* mudela_item_p)
 {
-  mudela_staff_p_list_.bottom()->add_item (mudela_item_p);
+  last_staff_l_->add_item (mudela_item_p);
 }
 
 void
 Mudela_score::add_staff (Mudela_staff* mudela_staff_p)
 {
-  mudela_staff_p_list_.bottom().add (mudela_staff_p);
+  mudela_staff_p_list_.append (new Killing_cons<Mudela_staff> (mudela_staff_p, 0));
+  last_staff_l_ = mudela_staff_p;
 }
 
 Mudela_column*
 Mudela_score::find_column_l (Moment mom)
 {
-#if 0
-  // should do binary search
-  for (int i = 0; i < column_l_array_.size (); i++ )
-    if ( column_l_array_[i]->at_mom () == mom )
-      return column_l_array_[i];
-  return 0;
-#else
   int upper_i = max (0, column_l_array_.size () - 1);
   int lower_i = 0;
   int i = 0; //upper_i;
@@ -73,7 +66,7 @@ Mudela_score::find_column_l (Moment mom)
        upper_i = i;
       else
        lower_i = i;
-      if ((upper_i == lower_i) || (i == column_l_array_.size () - 1))
+      if ( (upper_i == lower_i) || (i == column_l_array_.size () - 1))
        {
          // we don't do inserts
          assert (0);
@@ -85,7 +78,6 @@ Mudela_score::find_column_l (Moment mom)
     }
   assert (0);
   return 0;
-#endif
 }
 
 Mudela_column*
@@ -93,7 +85,7 @@ Mudela_score::get_column_l (Moment mom)
 {
   int i;
   Mudela_column *c=0;
-  for (i=column_l_array_.size() - 1; !c && i >=0; i--)
+  for (i=column_l_array_.size () - 1; !c && i >=0; i--)
     {
       if (column_l_array_ [i]->at_mom () == mom )
        c = column_l_array_[i];
@@ -110,162 +102,152 @@ Mudela_score::get_column_l (Moment mom)
   return c;
 }
 
-
 void
 Mudela_score::output (String filename_str)
 {
-  LOGOUT(NORMAL_ver) << _f ("Lily output to %s...", filename_str) << endl;
-
+  LOGOUT (NORMAL_ver) << _f ("Lily output to %s...", filename_str) << endl;
+  
   // ugh, ugly midi type 1 fix
-  if  ( (mudela_staff_p_list_.size() == 1) && !mudela_staff_p_list_.top()->number_i_)
-    mudela_staff_p_list_.top()->number_i_ = 1;
-
+  if ( (mudela_staff_p_list_.size_i () == 1)
+       && !mudela_staff_p_list_.head_->car_->number_i_)
+    mudela_staff_p_list_.head_->car_->number_i_ = 1;
+  
   int track_i = 0;
   Mudela_stream mudela_stream (filename_str);
-  for  (PCursor<Mudela_staff*> i (mudela_staff_p_list_); i.ok(); i++)
+  for (Cons<Mudela_staff>* i = mudela_staff_p_list_.head_; i; i = i->next_)
     {
-      LOGOUT(NORMAL_ver) << _ ("track ") << track_i++ << ": " << flush;
-      i->output (mudela_stream);
+      LOGOUT (NORMAL_ver) << _ ("track ") << track_i++ << ": " << flush;
+      i->car_->output (mudela_stream);
       mudela_stream << '\n';
-      LOGOUT(NORMAL_ver) << endl;
+      LOGOUT (NORMAL_ver) << endl;
     }
-
+  
   mudela_stream << "\\score{\n";
-  if  (mudela_staff_p_list_.size() > 1)
+  if (mudela_staff_p_list_.size_i () > 1)
     mudela_stream << "< \n";
-  for  (PCursor<Mudela_staff*> i (mudela_staff_p_list_); i.ok(); i++)
+  for (Cons<Mudela_staff>* i = mudela_staff_p_list_.head_; i; i = i->next_)
     {
-      if  ( (mudela_staff_p_list_.size() != 1)
-           &&  (i == mudela_staff_p_list_.top()))
-       continue;
-      mudela_stream << "\\type Staff = \"" << i->id_str() << "\" ";
-      mudela_stream << String ("\\" +  i->id_str ()) << "\n";
+      if ( (mudela_staff_p_list_.size_i () != 1)
+          && (i->car_ == mudela_staff_p_list_.head_->car_))
+       continue;
+      mudela_stream << "\\type Staff = \"" << i->car_->id_str () << "\" ";
+      mudela_stream << String ("\\" +  i->car_->id_str ()) << "\n";
     }
-  if  (mudela_staff_p_list_.size() > 1)
+  if (mudela_staff_p_list_.size_i () > 1)
     mudela_stream << ">\n";
-
-
+  
   mudela_stream << "\\paper{}\n";
-
+  
+#if 0
   mudela_stream << "\\midi{\n";
+  
   // let's not use silly 0 track
-  mudela_staff_p_list_.bottom()->mudela_tempo_l_->output (mudela_stream);
+  last_cons (mudela_staff_p_list_.head_)->car_->mudela_tempo_l_->output (mudela_stream);
   mudela_stream << "}\n";
-
+#endif
+  
   mudela_stream << "}\n";
 }
-
+  
 void
-Mudela_score::process()
+Mudela_score::process ()
 {
-  LOGOUT(NORMAL_ver) << '\n' << _ ("Processing...") << endl;
-
-  LOGOUT(DEBUG_ver) << "columns\n";
-  //  for  (PCursor<Mudela_column*> i (mudela_column_p_list_); i.ok(); i++)
-  //   LOGOUT(DEBUG_ver) << "At: " << i->at_mom() << '\n';
-
-  settle_columns();
-  filter_tempo();
-  quantify_columns();
-  quantify_durations();
-
-  LOGOUT(NORMAL_ver) << '\n' << _ ("Creating voices...") << endl;
+  LOGOUT (NORMAL_ver) << '\n' << _ ("Processing...") << endl;
+  
+  LOGOUT (DEBUG_ver) << "columns\n";
+  
+  settle_columns ();
+  filter_tempo ();
+  quantify_columns ();
+  quantify_durations ();
+  
+  LOGOUT (NORMAL_ver) << '\n' << _ ("Creating voices...") << endl;
   int track_i = 0;
-  for  (PCursor<Mudela_staff*> i (mudela_staff_p_list_); i.ok(); i++)
+  for (Cons<Mudela_staff>* i = mudela_staff_p_list_.head_; i; i = i->next_)
     {
-      LOGOUT(NORMAL_ver) << _ ("track ") << track_i++ << ": " << flush;
-      i->process();
-      LOGOUT(NORMAL_ver) << endl;
+      LOGOUT (NORMAL_ver) << _ ("track ") << track_i++ << ": " << flush;
+      i->car_->process ();
+      LOGOUT (NORMAL_ver) << endl;
     }
 }
-
+  
 void
-Mudela_score::filter_tempo()
+Mudela_score::filter_tempo ()
 {
-  LOGOUT(NORMAL_ver) << '\n' << _ ("NOT Filtering tempo...") << endl;
+  LOGOUT (NORMAL_ver) << '\n' << _ ("NOT Filtering tempo...") << endl;
 }
-
+  
 void
-Mudela_score::quantify_columns()
+Mudela_score::quantify_columns ()
 {
   // ugh
-  if  (Duration_convert::no_quantify_b_s)
+  if (Duration_convert::no_quantify_b_s)
     {
-      LOGOUT(NORMAL_ver) << '\n' << _("NOT Quantifying columns...") << endl;
+      LOGOUT (NORMAL_ver) << '\n' << _ ("NOT Quantifying columns...") << endl;
       return;
     }
-
-  LOGOUT(NORMAL_ver) << '\n' << _("Quantifying columns...") << endl;
-
+  
+  LOGOUT (NORMAL_ver) << '\n' << _ ("Quantifying columns...") << endl;
+  
   int current_bar_i = 0;
-  Moment bar_mom = mudela_time_signature_l_->bar_mom();
-
+  Moment bar_mom = mudela_time_signature_l_->bar_mom ();
+  
   int n = 5 >? Duration_convert::no_smaller_than_i_s;
   n = Duration_convert::type2_i (n);
   Moment s = Moment (1, n);
-  Moment sh = Moment (1, 2 * n);
-  for  (int i = 0; i < column_l_array_.size(); i++)
+  for (int i = 0; i < column_l_array_.size (); i++)
     {
       column_l_array_ [i]->at_mom_ =
-       s * Moment( (int) ( (column_l_array_ [i]->at_mom()) / s));
-
+       s * Moment ( (int) ( (column_l_array_ [i]->at_mom ()) / s));
+  
       int bar_i = (int) (column_l_array_ [i]->at_mom () / bar_mom) + 1;
       if (bar_i > current_bar_i)
-       {
-         LOGOUT (NORMAL_ver) << "[" << bar_i << "]" << flush;
-         current_bar_i = bar_i;
-       }
+
+       {
+         LOGOUT (NORMAL_ver) << "[" << bar_i << "]" << flush;
+         current_bar_i = bar_i;
+       }
     }
-  LOGOUT(NORMAL_ver) << endl;
+  LOGOUT (NORMAL_ver) << endl;
 }
-
+  
 void
-Mudela_score::quantify_durations()
+Mudela_score::quantify_durations ()
 {
-  //    LOGOUT(NORMAL_ver) << '\n' << "Quantifying durations..." << endl;
+  
 }
-
+  
 void
-Mudela_score::settle_columns()
+Mudela_score::settle_columns ()
 {
-  //    LOGOUT(NORMAL_ver) << '\n' << "NOT Settling columns..." << endl;
-  //    return;
-  LOGOUT(NORMAL_ver) << '\n' << _("Settling columns...") << endl;
-
-#if 0
-  assert (!column_l_array_.size());
-  int n = mudela_column_p_list_.size();
-  // huh?
-  //    column_l_array_.set_size (n);
-  for  (PCursor<Mudela_column*> i (mudela_column_p_list_); i.ok(); i++)
-    column_l_array_.push (*i);
-#endif
-
-  int n = column_l_array_.size();
-
+  LOGOUT (NORMAL_ver) << '\n' << _ ("Settling columns...") << endl;
+  
+  int n = column_l_array_.size ();
+  
   int start_i = 0;
   int end_i = 0;
   Moment start_mom = 0;
+
   Duration smallest_dur;
   smallest_dur.durlog_i_ =  6;
   Moment const noise_mom = Duration_convert::dur2_mom (smallest_dur)
     / Moment (2);
-  for  (int i = 0; i < n; i++)
+  for (int i = 0; i < n; i++)
     {
-      if  (!start_i)
+      if (!start_i)
        {
          start_i = end_i = i;
-         start_mom = column_l_array_ [i]->at_mom();
+         start_mom = column_l_array_ [i]->at_mom ();
          continue;
        }
 
       // find all columns within noise's distance
-      while  ( (i < n)
-              &&  (column_l_array_ [i]->at_mom() - start_mom < noise_mom))
+      while ( (i < n)
+             && (column_l_array_ [i]->at_mom () - start_mom < noise_mom))
        end_i = ++i;
 
       // bluntly set all to time of first in group
-      for  (int j = start_i; j < end_i; j++)
+      for (int j = start_i; j < end_i; j++)
        column_l_array_ [j]->at_mom_ = start_mom;
 
       start_i = end_i = 0;
index 3c92577895a9c9ae7ff39ac5b51e6cf8ec814f75..d6088e1becd2436086b8c8d74ba5f2b7411de801 100644 (file)
@@ -17,6 +17,8 @@
 #include "mudela-voice.hh"
 #include "mudela-score.hh"
 
+#include "killing-cons.tcc"
+
 extern Mudela_score* mudela_score_l_g;
 
 Mudela_staff::Mudela_staff (int number_i, String copyright_str, String track_name_str, String instrument_str)
@@ -33,51 +35,53 @@ Mudela_staff::Mudela_staff (int number_i, String copyright_str, String track_nam
 void
 Mudela_staff::add_item (Mudela_item* mudela_item_p)
 {
-  mudela_item_p_list_.bottom().add (mudela_item_p);
-  if  (mudela_item_p->mudela_column_l_)
+  mudela_item_p_list_.append (new Killing_cons <Mudela_item> (mudela_item_p, 0));
+  if (mudela_item_p->mudela_column_l_)
     mudela_item_p->mudela_column_l_->add_item (mudela_item_p);
 }
 
 void
-Mudela_staff::eat_voice (Link_list<Mudela_item*>& items)
+Mudela_staff::eat_voice (Cons_list<Mudela_item>& items)
 {
   Mudela_voice* voice_p = new Mudela_voice (this);
-  mudela_voice_p_list_.bottom().add (voice_p);
+  mudela_voice_p_list_.append (new Killing_cons<Mudela_voice> (voice_p, 0));
 
-  //    Moment mom = items.top()->at_mom();
+  //    Moment mom = items.top ()->at_mom ();
   Moment mom = 0;
 
-  for  (PCursor<Mudela_item*> i (items); i.ok();)
+  for (Cons<Mudela_item>** pp = &items.head_; *pp;)
     {
-      LOGOUT(DEBUG_ver) << "At: " << i->at_mom ().str () << "; ";
-      LOGOUT(DEBUG_ver) << "dur: " << i->duration_mom ().str () << "; ";
-      LOGOUT(DEBUG_ver) << "mom: " << mom.str () << " -> ";
-      if  (i->at_mom() > mom)
+      Cons<Mudela_item>* i = *pp;
+      LOGOUT (DEBUG_ver) << "At: " << i->car_->at_mom ().str () << "; ";
+      LOGOUT (DEBUG_ver) << "dur: " << i->car_->duration_mom ().str () << "; ";
+      LOGOUT (DEBUG_ver) << "mom: " << mom.str () << " -> ";
+      if (i->car_->at_mom () > mom)
        {
-         Moment dur = i->at_mom() - mom;
+         Moment dur = i->car_->at_mom () - mom;
          // ugh, need score
          Mudela_column* start = mudela_score_l_g->find_column_l (mom);
          voice_p->add_item (new Mudela_skip (start, dur));
-         mom = i->at_mom();
+         mom = i->car_->at_mom ();
        }
-      if  (i->at_mom() == mom)
+      if (i->car_->at_mom () == mom)
        {
-         mom = i->at_mom() + i->duration_mom();
-         voice_p->add_item (i.remove_p());
-         // ugh
+         mom = i->car_->at_mom () + i->car_->duration_mom ();
+         Cons<Mudela_item>* c = items.remove_cons (pp);
+         voice_p->add_item (c->car_);
+         delete c;
        }
-      else if  (i.ok())
-       i++;
-      LOGOUT(DEBUG_ver) << "mom: " << mom.str () << '\n';
+      else if (*pp)
+       pp = &i->next_;
+      LOGOUT (DEBUG_ver) << "mom: " << mom.str () << '\n';
     }
 }
 
 String
-Mudela_staff::id_str()
+Mudela_staff::id_str ()
 {
   String id (name_str ());
   char *cp = id.ch_l ();
-  char *end = cp + id.length_i();
+  char *end = cp + id.length_i ();
   for (;cp < end; cp++)
     {
       if (!isalpha (*cp))
@@ -89,9 +93,9 @@ Mudela_staff::id_str()
 }
 
 String
-Mudela_staff::name_str()
+Mudela_staff::name_str ()
 {
-  if  (name_str_.length_i())
+  if (name_str_.length_i ())
     return name_str_;
   return String ("track") + to_str (char ('A' - 1 + number_i_));
 }
@@ -101,40 +105,40 @@ Mudela_staff::name_str()
 void
 Mudela_staff::output (Mudela_stream& mudela_stream_r)
 {
-  mudela_stream_r << id_str() << " = \\notes";
-  mudela_stream_r <<  (mudela_voice_p_list_.size() > 1 ? "<" : "{");
+  mudela_stream_r << id_str () << " = \\notes";
+  mudela_stream_r << (mudela_voice_p_list_.size_i () > 1 ? "<" : "{");
   mudela_stream_r << '\n';
   mudela_stream_r << _ ("% midi copyright:") << copyright_str_ << '\n';
   mudela_stream_r << _ ("% instrument:") << instrument_str_ << '\n';
 
   // don't use last duration mode
   //  mudela_stream_r << "\\duration 4;\n";
-  if  (mudela_voice_p_list_.size() == 1)
-    mudela_voice_p_list_.top()->output (mudela_stream_r);
+  if (mudela_voice_p_list_.size_i () == 1)
+    mudela_voice_p_list_.head_->car_->output (mudela_stream_r);
   else
-    for  (PCursor<Mudela_voice*> i (mudela_voice_p_list_); i.ok(); i++)
+      for (Cons<Mudela_voice>* i = mudela_voice_p_list_.head_; i; i = i->next_)
       {
        mudela_stream_r << "{ ";
-       i->output (mudela_stream_r);
+       i->car_->output (mudela_stream_r);
        mudela_stream_r << "} ";
       }
 
-  mudela_stream_r <<  (mudela_voice_p_list_.size() > 1 ? "\n>" : "\n}");
-  mudela_stream_r << " % " << name_str() << '\n';
+  mudela_stream_r << (mudela_voice_p_list_.size_i () > 1 ? "\n>" : "\n}");
+  mudela_stream_r << " % " << name_str () << '\n';
 }
 
 void
 Mudela_staff::output_mudela_begin_bar (Mudela_stream& mudela_stream_r, Moment now_mom, int bar_i)
 {
-  Moment bar_mom = mudela_time_signature_l_->bar_mom();
+  Moment bar_mom = mudela_time_signature_l_->bar_mom ();
   Moment into_bar_mom = now_mom - Moment (bar_i - 1) * bar_mom;
-  if  (bar_i > 1)
+  if (bar_i > 1)
     {
-      if  (!into_bar_mom)
+      if (!into_bar_mom)
        mudela_stream_r << "|\n";
     }
   mudela_stream_r << "% " << String_convert::i2dec_str (bar_i, 0, ' ');
-  if  (into_bar_mom)
+  if (into_bar_mom)
     mudela_stream_r << ":" << Duration_convert::dur2_str (Duration_convert::mom2_dur (into_bar_mom));
   mudela_stream_r << '\n';
 }
@@ -144,13 +148,13 @@ Mudela_staff::output_mudela_begin_bar (Mudela_stream& mudela_stream_r, Moment no
 void
 Mudela_staff::output_mudela_rest (Mudela_stream& mudela_stream_r, Moment begin_mom, Moment end_mom)
 {
-  Moment bar_mom = mudela_time_signature_l_->bar_mom();
+  Moment bar_mom = mudela_time_signature_l_->bar_mom ();
   Moment now_mom = begin_mom;
 
   int begin_bar_i = (int) (now_mom / bar_mom) + 1;
   int end_bar_i = (int) (end_mom / bar_mom) + 1;
 
-  if  (end_bar_i == begin_bar_i)
+  if (end_bar_i == begin_bar_i)
     {
       output_mudela_rest_remain (mudela_stream_r, end_mom - begin_mom);
       return;
@@ -161,14 +165,14 @@ Mudela_staff::output_mudela_rest (Mudela_stream& mudela_stream_r, Moment begin_m
 
   //fill current bar
   Moment begin_bar_mom = Moment (begin_bar_i - 1) * bar_mom;
-  if  (now_mom > begin_bar_mom)
+  if (now_mom > begin_bar_mom)
     {
       int next_bar_i = (int) (now_mom / bar_mom) + 2;
       Moment next_bar_mom = Moment (next_bar_i - 1) * bar_mom;
       assert (next_bar_mom <= end_mom);
 
       Moment remain_mom = next_bar_mom - now_mom;
-      if  (remain_mom > Moment (0))
+      if (remain_mom > Moment (0))
        {
          output_mudela_rest_remain (mudela_stream_r, remain_mom);
          now_mom += remain_mom;
@@ -179,28 +183,28 @@ Mudela_staff::output_mudela_rest (Mudela_stream& mudela_stream_r, Moment begin_m
 
   // fill whole bars
   int count_i = end_bar_i - bar_i;
-  for  (int i = 0; i < count_i; i++)
+  for (int i = 0; i < count_i; i++)
     {
       int begin_bar_i = check_begin_bar_i (now_mom, bar_i);
-      if  (begin_bar_i)
+      if (begin_bar_i)
        output_mudela_begin_bar (mudela_stream_r, now_mom, begin_bar_i);
       mudela_stream_r << "r1 ";
       //       *mudela_stream_r.os_p_ << flush;
-      if  (begin_bar_i)
-       LOGOUT(NORMAL_ver) << begin_bar_i << flush;
+      if (begin_bar_i)
+       LOGOUT (NORMAL_ver) << begin_bar_i << flush;
       bar_i = check_end_bar_i (now_mom, bar_i);
       now_mom += bar_mom;
     }
 
   // use "int i" here, and gcc 2.7.2 hits internal compiler error
   int ii = check_begin_bar_i (now_mom, bar_i);
-  if  (ii)
+  if (ii)
     output_mudela_begin_bar (mudela_stream_r, now_mom, ii);
 
   //    bar_i = check_end_bar_i (now_mom, bar_i);
 
   Moment remain_mom = end_mom - Moment (end_bar_i - 1) * bar_mom;
-  if  (remain_mom > Moment (0))
+  if (remain_mom > Moment (0))
     {
       output_mudela_rest_remain (mudela_stream_r, remain_mom);
       now_mom += remain_mom;
@@ -211,24 +215,24 @@ Mudela_staff::output_mudela_rest (Mudela_stream& mudela_stream_r, Moment begin_m
 void
 Mudela_staff::output_mudela_rest_remain (Mudela_stream& mudela_stream_r, Moment mom)
 {
-  if  (Duration_convert::no_quantify_b_s)
+  if (Duration_convert::no_quantify_b_s)
     {
       Duration dur = Duration_convert::mom2_dur (mom);
-      mudela_stream_r << "r" << dur.str() << " ";
-      //       assert (mom == dur.mom());
-      assert (mom == dur.length());
+      mudela_stream_r << "r" << dur.str () << " ";
+      //       assert (mom == dur.mom ());
+      assert (mom == dur.length ());
       return;
     }
 
   Duration dur = Duration_convert::mom2standardised_dur (mom);
-  if  (dur.type_i_>-10)
-    mudela_stream_r << "r" << dur.str() << " ";
+  if (dur.type_i_>-10)
+    mudela_stream_r << "r" << dur.str () << " ";
 }
 #endif
 
 
 void
-Mudela_staff::process()
+Mudela_staff::process ()
 {
   /*
      group items into voices
@@ -239,10 +243,10 @@ Mudela_staff::process()
   mudela_time_signature_l_ = mudela_score_l_g->mudela_time_signature_l_;
   mudela_tempo_l_ = mudela_score_l_g->mudela_tempo_l_;
 
-  Link_list<Mudela_item*> items;
-  for  (PCursor<Mudela_item*> i (mudela_item_p_list_); i.ok(); i++)
-    items.bottom().add (*i);
+  Cons_list<Mudela_item> items;
+  for (Cons<Mudela_item>* i = mudela_item_p_list_.head_; i; i = i->next_)
+    items.append (new Cons<Mudela_item> (i->car_, 0));
 
-  while  (items.size())
+  while (items.size_i ())
     eat_voice (items);
 }
index 6f92d03f2257fd3a4e8258dba6db7d2c79f06d63..1052b3149d6480be7c2af6ae9770e94721ddd020 100644 (file)
@@ -19,59 +19,46 @@ Mudela_voice::Mudela_voice (Mudela_staff* mudela_staff_l)
 void
 Mudela_voice::add_item (Mudela_item* mudela_item_l)
 {
-  mudela_item_l_list_.bottom().add (mudela_item_l);
+  mudela_item_l_list_.append (new Cons<Mudela_item> (mudela_item_l, 0));
 }
 
-Moment 
-Mudela_voice::begin_mom()
-{
-  return mudela_item_l_list_.size() ? 
-    mudela_item_l_list_.top()->at_mom() : Moment (0);
-}
-
-Moment 
-Mudela_voice::end_mom()
-{
-  return mudela_item_l_list_.size() ? 
-    mudela_item_l_list_.bottom()->at_mom() : Moment (0);
-}
 
 static int const FAIRLY_LONG_VOICE_i = 6;
 
 void
 Mudela_voice::output (Mudela_stream& mudela_stream_r)
 {
-  if  (!mudela_item_l_list_.size())
+  if (!mudela_item_l_list_.size_i ())
     return;
   
-  if  (mudela_item_l_list_.size() > FAIRLY_LONG_VOICE_i)
+  if (mudela_item_l_list_.size_i () > FAIRLY_LONG_VOICE_i)
     mudela_stream_r << '\n';
 
   int current_bar_i = 0;
-  Moment bar_mom = mudela_staff_l_->mudela_time_signature_l_->bar_mom();
+  Moment bar_mom = mudela_staff_l_->mudela_time_signature_l_->bar_mom ();
 
-  for  (PCursor<Mudela_item*> i (mudela_item_l_list_); i.ok(); i++) 
+  for (Cons<Mudela_item>* i = mudela_item_l_list_.head_; i; i = i->next_)
     {
-      Moment at_mom = i->mudela_column_l_->at_mom();
+      Moment at_mom = i->car_->mudela_column_l_->at_mom ();
       int bar_i = (int) (at_mom / bar_mom) + 1;
-      if  (bar_i > current_bar_i) 
+      if (bar_i > current_bar_i) 
        {
-         if  (current_bar_i) 
+         if (current_bar_i) 
            {
-             if  (at_mom == Moment (bar_i - 1) * bar_mom)
+             if (at_mom == Moment (bar_i - 1) * bar_mom)
                mudela_stream_r << "|";
              mudela_stream_r << "\n% ";
              mudela_stream_r << String_convert::i2dec_str (bar_i, 0, ' ');
              mudela_stream_r << '\n';
            }
-         LOGOUT(NORMAL_ver) << "[" << bar_i << "]" << flush; 
+         LOGOUT (NORMAL_ver) << "[" << bar_i << "]" << flush; 
          current_bar_i = bar_i;
        }
 
-      mudela_stream_r << **i;
+      mudela_stream_r << *i->car_;
     }
 
-  if  (mudela_item_l_list_.size() > FAIRLY_LONG_VOICE_i)
+  if (mudela_item_l_list_.size_i () > FAIRLY_LONG_VOICE_i)
     mudela_stream_r << '\n';
 }
 
diff --git a/mi2mu/template9.cc b/mi2mu/template9.cc
deleted file mode 100644 (file)
index 7d99a4b..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// template.cc -- implementemplate
-// ugh: must have unique name for Cygnus' gcc:
-// liblily.a(template.o): In function `GLOBAL_$I$template.cc':
-// template.cc:28: multiple definition of `global constructors keyed to template.cc'
-//
-// copyright 1997 Jan Nieuwenhuizen <janneke@gnu.org>
-
-#include "proto.hh"
-#include "list.hh"
-#include "list.tcc"
-#include "cursor.tcc"
-
-class istream;
-class ostream;
-
-#include "mudela-item.hh"
-#include "mudela-column.hh"
-#include "mudela-staff.hh"
-#include "mudela-voice.hh"
-#include "mudela-staff.hh"
-#include "mudela-score.hh"
-#include "pcursor.hh"
-#include "plist.hh"
-#include "pcursor.tcc"
-#include "plist.tcc"
-
-POINTERLIST_INSTANTIATE(Mudela_item);
-POINTERLIST_INSTANTIATE(Mudela_staff);
-POINTERLIST_INSTANTIATE(Mudela_voice);
-POINTERLIST_INSTANTIATE(Mudela_column);
-POINTERLIST_INSTANTIATE(Mudela_score);