]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.1.34
authorfred <fred>
Tue, 26 Mar 2002 21:47:46 +0000 (21:47 +0000)
committerfred <fred>
Tue, 26 Mar 2002 21:47:46 +0000 (21:47 +0000)
41 files changed:
NEWS
lily/axis-group-element.cc
lily/axis-group-spanner.cc
lily/bar-script-engraver.cc
lily/base-span-bar-engraver.cc
lily/clef-item.cc
lily/font-size-engraver.cc
lily/graphical-element.cc
lily/include/audio-column.hh
lily/include/axis-group-element.hh
lily/include/axis-group-item.hh
lily/include/axis-group-spanner.hh
lily/include/graphical-element.hh
lily/include/horizontal-group-item.hh
lily/include/horizontal-vertical-group-item.hh
lily/include/item.hh
lily/include/line-of-score.hh
lily/include/midi-item.hh
lily/include/midi-stream.hh
lily/include/performance.hh
lily/include/score-element.hh
lily/include/span-bar.hh
lily/include/spanner.hh
lily/include/stem.hh
lily/include/super-element.hh
lily/include/translator.hh
lily/include/vertical-group-spanner.hh
lily/item.cc
lily/line-of-score.cc
lily/lookup.cc
lily/midi-item.cc
lily/p-score.cc
lily/performance.cc
lily/score-element.cc
lily/span-bar-engraver.cc
lily/span-bar.cc
lily/span-score-bar-engraver.cc
lily/spanner.cc
lily/super-element.cc
lily/translator.cc
scm/lily.scm

diff --git a/NEWS b/NEWS
index 6034166157f26e10059602a43a8e91ee67922823..c5226923835a1d9aea56cbfb2964c154851fe53d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,29 @@
+pl 33.uu2
+       - some performance cleanups: junked PointerList instance, plugged some leaks.
+       - style -> fontname now in scheme.
+       - minor Score_element brainsurgery:
+               * generic element properties.
+               * junked Score_element::junk_links, Score_element::unlink
+               * junked Directed_graph_node as superclass of
+Score_element, this should reduce mem usage a bit.
+
+pl 33.jcn2
+       - fixed autobeamer's beam->unlink ()
+
+pl 33.jcn1
+       - allow autobeaming according to duration iso (crude) multiplicity
+
+pl 33.jbr1
+         - change my email address
+         - Windows platform does a cp -r instead of a ln -s
+
+pl 33.uu1
+       - bf: ^ and _
+       - junked poor man's dynamics.
+
+*********
+pl 33
+
 pl 32.mb1
        - bf: \> and \< were interchanged!!
        - Added property: textScriptPadding
index 85850655b4ef49c15a871effc6292934c0e3dc9f..5b42c70e8af3e11c102de639f9c236c96cf4d7fc 100644 (file)
@@ -9,17 +9,6 @@
 #include "axis-group-element.hh"
 #include "graphical-axis-group.hh"
 
-void
-Axis_group_element::do_unlink()
-{
-  remove_all();
-}
-
-void
-Axis_group_element::do_junk_links()
-{
-  elem_l_arr_.set_size (0);
-}
 
 
 Link_array<Score_element>
index 8517e938623fda5370464d7e43c911a1f9291aa7..b78887ef6ca30c0f5485681ac5777ad515bd07a7 100644 (file)
@@ -102,8 +102,6 @@ Axis_group_spanner::do_break_processing()
                    {
                      my_item->transparent_b_ = true;
                      my_item->set_empty (true);
-                     /*my_item->unlink ();
-                     delete my_item;*/
                    }
 
                }
index 14c26b6e0313215589c6b65769579f41045ba0d4..7262b1fc08c96a2d62021d26dc160601abbce84e 100644 (file)
@@ -138,8 +138,11 @@ Bar_script_engraver::create_items (Request *rq)
       staff_side_p_->padding_f_ = Real(padding);
     }
 
-  staff_side_p_->visibility_lambda_  = visibility_lambda_;
-  text_p_->visibility_lambda_ = visibility_lambda_;  
+  
+  staff_side_p_->set_elt_property (ly_symbol ("visibility_lambda"),
+                                  visibility_lambda_);
+  text_p_->set_elt_property (ly_symbol ("visibility_lambda"),
+                            visibility_lambda_);
   
   announce_element (Score_element_info (text_p_, rq));
   announce_element (Score_element_info (staff_side_p_, rq));
index d36a15dee6e7b0d53eac10b28f61786768c67ccf..92fe5ee248edd87cea8f6e1ed03669982ee9e29f 100644 (file)
@@ -6,6 +6,7 @@
   (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
+#include "lily-guile.hh"
 #include "span-bar.hh"
 #include "base-span-bar-engraver.hh"
 #include "vertical-align-spanner.hh"
@@ -50,6 +51,10 @@ Base_span_bar_engraver::acknowledge_element (Score_element_info i)
         */
        {
          spanbar_p_ = get_span_bar_p();
+         String visnam =  String(name()) + "_visibility";
+         
+         spanbar_p_->set_elt_property (ly_symbol ("visibility_lambda"),
+                                       gh_eval_str (visnam.ch_C()));
 
          if (use_priority_b_)
            {
index 456688dc862f8cc9b02e1f4128cb9191c7ad28a7..08eb9ea4c4f94ecfaec3795179f1d95e6aa96781 100644 (file)
@@ -56,21 +56,19 @@ Clef_item::do_add_processing ()
          Real r = do_height ()[octave_dir_] + g->extent (Y_AXIS)[-octave_dir_];
          g->dim_cache_[Y_AXIS].set_offset (r);
        }
+      
       if (default_b_)
        {
-         visibility_lambda_ = defvis;
+         set_elt_property (ly_symbol ("visibility_lambda"),
+                           defvis);
+
          if (g)
-           g->visibility_lambda_ = defvis;
+           g->set_elt_property (ly_symbol ("visibility_lambda"),
+                                defvis);
        }
     }
-
-
 }
 
-
-
-
-
 Molecule*
 Clef_item::do_brew_molecule_p() const
 {
index fa5e1e420063b1b71bc4ca5a80bc5526dff8ca4e..22436f0aba28c5c775bfa0f2f07ab0484dea829b 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "font-size-engraver.hh"
 #include "score-element.hh"
+#include "lily-guile.hh"
 
 Font_size_engraver::Font_size_engraver ()
 {
@@ -29,7 +30,8 @@ Font_size_engraver::do_process_requests ()
 void
 Font_size_engraver::acknowledge_element (Score_element_info e)
 {
-  e.elem_l_->size_i_ = size_i_;
+  e.elem_l_->set_elt_property (ly_symbol ("fontsize"),
+                              gh_int2scm (size_i_));
 }
 
 ADD_THIS_TRANSLATOR (Font_size_engraver);
index e4e217f093e597adca807a1d84adf3ad18d80692..98c3c02b62eac6c2f1f7abc3bb734d60edc3825b 100644 (file)
@@ -96,22 +96,6 @@ Graphical_element::extent (Axis a) const
   return d->get_dim ();
 }
 
-void
-Graphical_element::unlink ()
-{
-  for (int a=X_AXIS; a < NO_AXES; a++)
-    if (Dimension_cache * d = dim_cache_[a].parent_l_)
-      {
-       if (Graphical_axis_group * eg
-           = dynamic_cast<Graphical_axis_group*> (d->elt_l_))
-         eg->remove_element (this);
-      }
-}
-
-void
-Graphical_element::junk_links ()
-{
-}
 
 void
 Graphical_element::do_print () const
index f1df72b631b65454f8187bad40e6c98f1b0cf293..42836a54b4e6159f60f3c82fea1fae1fc2aab0fe 100644 (file)
 #include "lily-proto.hh"
 #include "moment.hh"
 #include "pcursor.hh"
-
+#include "audio-element.hh"
 
 /**
     generic audio grouped vertically.
  */
 
-class Audio_column { 
+class Audio_column : public Audio_element  
 public:
     Audio_column (Moment at_mom);
 
index 130dbfdda500b4cdde03a80e016e3210d4140540..e272ffca0db23dbde6d3190033fa3daffa34a925 100644 (file)
@@ -22,8 +22,6 @@ class Axis_group_element : public virtual Score_element,
 protected:
   virtual void do_print() const;
   virtual Link_array<Score_element> get_extra_dependencies() const;
-  virtual void do_unlink();
-  virtual void do_junk_links();
 
 public:
   virtual Link_array<Score_element> elem_l_arr() const;
index 7ad8e643290c51877abc1d4c427bda2ec7a50f71..9d0852b64a028600e4ae850ed0e44cfbab51b8ad 100644 (file)
@@ -22,16 +22,6 @@ protected:
   virtual void do_breakable_col_processing();
   void OK() const;
   virtual void do_print() const;
-  virtual void do_junk_links() { 
-    Item::do_junk_links();
-    Axis_group_element::do_junk_links();
-  }
-  virtual void do_unlink() {
-    Item::do_unlink();
-    Axis_group_element::do_unlink();
-  }
-public:
-  
 };
 
 #endif // AXIS_ITEM_HH
index 029693125d5eb02a292cb112fb8794f5a414674c..138c58787a5da57e6337dd84e707929fe872c03d 100644 (file)
@@ -19,14 +19,6 @@ class Axis_group_spanner : public Spanner, public virtual Axis_group_element
 {
   void do_break_processing_if_unbroken();
 protected:
-  virtual void do_junk_links () { 
-    Spanner::do_junk_links();
-    Axis_group_element::do_junk_links();
-  }
-  virtual void do_unlink() {
-    Spanner::do_unlink();
-    Axis_group_element::do_unlink();
-  }
   virtual void do_break_processing();
   virtual void do_print() const;
 
index 49e069d0659cdc0a8b1f784fdf2092ab95a88771..70e0ea9c2f17cfa264e80e70760b27d065b056b8 100644 (file)
@@ -59,8 +59,6 @@ public:
   
   Graphical_element *parent_l (Axis a) const;
   
-  void unlink ();
-  void junk_links ();
   virtual void do_print () const;
 protected:
   virtual Interval do_height () const=0;
index 6d5a85a7388ed879286ed2f97203f512f44ba55d..0c96d29c955bdd75125d15294baa54d582632852 100644 (file)
  */
 class Horizontal_group_item : public Axis_group_item, public Horizontal_group_element {
 protected:
-  virtual void do_unlink () { 
-    Axis_group_item::do_unlink ();
-  }
-  virtual void do_junk_links() {
-    Axis_group_item::do_junk_links();
-  }
   virtual void do_print() const;
 public:
   Horizontal_group_item ();
index bea2065a5d65fd8a4b9e79a9c61deadf731fff86..e5f7bbfe1732097faab18ac65d6183c25a322528 100644 (file)
@@ -20,9 +20,6 @@
 class Horizontal_vertical_group_item  : public Axis_group_item, public Horizontal_vertical_group_element {
 protected:
   virtual void do_print() const;
-  virtual void do_unlink () {
-    Axis_group_item::do_unlink ();
-  }
   VIRTUAL_COPY_CONS(Score_element);
 public:
   Horizontal_vertical_group_item ();
index 75f1bbf8d09062dbd4b12fa35c219af374775a61..db8e5c4cf9c26855ed26a450298407160afd2725 100644 (file)
   NB. This doesn't mean an Item has to initialize the output field before
   spacing calculation. 
   
-*/
+
+  
+  @signature
+  visibility_lambda :: int -> (bool . bool)
+     
+  @in
+  break direction
+     
+  @out
+  (transparent, empty) cons
+     
+   */
 class Item : public virtual Score_element {
   void do_break ();
   void try_visibility_lambda ();
@@ -34,22 +45,10 @@ public:
   Drul_array<Item*> broken_to_drul_;
   Item *unbroken_original_l_;
 
-  /**
-     
-     visibility_lambda :: int -> (bool . bool)
-     
-     @in
-     break direction
-     
-     @out
-     (transparent, empty) cons
-     
-   */
-  Protected_scm visibility_lambda_;
   /// should be put in a breakable col.
   bool breakable_b_;
 
-  /// I am really  to  be broken?
+  /// I am really to be broken?
   virtual bool breakable_b () const;
   
   Direction break_status_dir_;
@@ -70,9 +69,7 @@ public:
   
   Item (Item const &);
 protected:
-  virtual void do_unlink ();
-  virtual void do_junk_links();
-  virtual void  do_breakable_col_processing();
+  virtual void do_breakable_col_processing();
   virtual void handle_prebroken_dependencies();
   virtual void do_print() const;
   virtual bool linked_b() const;
index 1fd877f9a0303972e21eb3a0df669a57ffedef94..c98ae4dd50faf6678b6aac54d32c96d570eadb9a 100644 (file)
@@ -32,8 +32,6 @@ public:
 protected:
   virtual Link_array<Score_element> get_extra_dependencies () const;
 
-  virtual void do_unlink ();
-  virtual void do_junk_links ();
 
   virtual Interval do_width() const;
   virtual void do_print() const;
index 61f374f6685cfc5da7fcd738ef5984176065eb35..51996efa7ff60c384c7e2ca39ab77f11b00b8f08 100644 (file)
@@ -7,11 +7,10 @@
 #ifndef MIDI_ITEM_HH
 #define MIDI_ITEM_HH
 
+#include "cons.hh"
 #include "string.hh"
 #include "lily-proto.hh"
 #include "proto.hh"
-#include "plist.hh"
-#include "virtual-methods.hh"
 #include "moment.hh"
 
 /**
@@ -20,7 +19,6 @@
   Maybe use base classes for RIFF files?
  */
 struct Midi_item {
-  
   Midi_item (Audio_item* audio_item_l); 
   virtual ~Midi_item ();
   static String i2varint_str (int i);
@@ -64,7 +62,6 @@ private:
 };
 
 struct Midi_duration : public Midi_item {
-  
   Midi_duration (Real seconds_f);
 
   virtual String str () const;
@@ -72,8 +69,6 @@ struct Midi_duration : public Midi_item {
 };
 
 struct Midi_header : Midi_chunk {
-  
-
   Midi_header (int format_i, int tracks_i, int clocks_per_4_i);
 };
 
@@ -81,7 +76,6 @@ struct Midi_header : Midi_chunk {
   Change instrument event
  */
 struct Midi_instrument : public Midi_item {
-  
   Midi_instrument (int channel_i, String instrument_str);
 
   virtual String str () const;
@@ -90,15 +84,12 @@ struct Midi_instrument : public Midi_item {
                                       
 
 struct Midi_key : public Midi_item {
-  
   Midi_key (Audio_item* audio_item_l);
        
   virtual String str () const;
 };
 
 struct Midi_time_signature : Midi_item {
-
-  
   Midi_time_signature (Audio_item* audio_item_l); 
   
   virtual String str () const;
@@ -109,7 +100,6 @@ struct Midi_time_signature : Midi_item {
   Turn a note on (blond).
  */
 struct Midi_note : public Midi_item {
-  
   Midi_note (Audio_item* audio_item_l); 
 
   Moment length_mom () const;
@@ -124,7 +114,6 @@ struct Midi_note : public Midi_item {
   Turn a note off (dark).
  */
 struct Midi_note_off : public Midi_item {
-  
   Midi_note_off (Midi_note*); 
 
   int pitch_i () const;
@@ -150,7 +139,6 @@ struct Midi_text : Midi_item {
 };
 
 struct Midi_tempo : Midi_item {
-  
   Midi_tempo (int per_minute_4_i);
   Midi_tempo (Audio_item* audio_item_l); 
   
@@ -160,10 +148,9 @@ struct Midi_tempo : Midi_item {
 };
 
 struct Midi_track : Midi_chunk {
-  
   int number_i_;
-  Pointer_list<Midi_event*> event_p_list_;
-    
+  Cons_list<Midi_event> event_p_list_;
+  
   Midi_track ();
   ~Midi_track ();
 
index fef0d537bafb0f2e203971141110de334205cdaf..08643bb8d1d44e81d37b76fcb23208aad0493362 100644 (file)
 
 /// Midi outputfile
 struct Midi_stream {
-    Midi_stream (String filename_str);
-    ~Midi_stream();
+  Midi_stream (String filename_str);
+  ~Midi_stream();
 
-    Midi_stream& operator <<( String str);
-    Midi_stream& operator <<( Midi_item const& mitem_c_r);
-    Midi_stream& operator <<( int i);
+  Midi_stream& operator <<( String str);
+  Midi_stream& operator <<( Midi_item const& mitem_c_r);
+  Midi_stream& operator <<( int i);
 
-    void open();
+  void open();
 
-    ostream* os_p_;
-    String filename_str_;
+  ostream* os_p_;
+  String filename_str_;
 };
 
 #endif // MIDI_STREAM_HH
index 9aa8b3af8975e0f7e3aba59c0551302652e1c677..3e34dc7cf595d9b48e68363aa49489724339459d 100644 (file)
@@ -7,8 +7,9 @@
 #ifndef PERFORMANCE_HH
 #define PERFORMANCE_HH
 
+#include "parray.hh"
 #include "lily-proto.hh"
-#include "plist.hh"
+#include "cons.hh"
 #include "music-output.hh"
 
 /** all stuff which goes onto midi. notes, signs, symbols in a score
@@ -18,7 +19,7 @@
 class Performance : public Music_output {
 public:
   Performance ();
-  ~Performance () {}
+  ~Performance ();
 
   void add_column (Audio_column*);
   void add_staff (Audio_staff* l);
@@ -31,9 +32,9 @@ public:
   void print() const;
   void process();
 
-  Pointer_list<Audio_column*> audio_column_p_list_;
-  Link_list<Audio_staff*> audio_staff_l_list_;
-  Pointer_list<Audio_element*> audio_elem_p_list_;
+
+  Link_array<Audio_staff> audio_staff_l_arr_;
+  Cons<Audio_element> *audio_elem_p_list_;
   Midi_def  * midi_l_;
 };
 
index 69f8eb998fc420f0a795106f46209a38554a0065..a3cfd50f69a76304bc285ff7f62c71bb9c709e27 100644 (file)
@@ -11,7 +11,7 @@
 #include "virtual-methods.hh"
 #include "directed-graph.hh"
 #include "graphical-element.hh"
-
+#include "protected-scm.hh"
 
 
 typedef void (Score_element::*Score_element_method_pointer) (void);
@@ -24,7 +24,10 @@ typedef void (Score_element::*Score_element_method_pointer) (void);
   form an acyclic graph.
 
   (elem) */
-class Score_element : private Directed_graph_node, public virtual Graphical_element {
+class Score_element : public virtual Graphical_element {
+  Protected_scm element_property_alist_;
+  Link_array<Score_element> dependency_arr_;
+  
 public:
   /// delete after linebreak calculation.
   bool break_helper_only_b_;
@@ -33,19 +36,16 @@ public:
   Score_element ();
   Score_element (Score_element const&);
   virtual void print () const;
-    
+
+  SCM get_elt_property (SCM sym);
+  void set_elt_property (SCM sym, SCM val);
+  
   Paper_def *paper () const;
   Lookup const *lookup_l () const;
 
   virtual ~Score_element ();
-      
-
   void add_processing ();
 
-  /**
-    Remove all  links (dependencies, dependents, Axis_group_elements.
-    */
-  void unlink ();
   void substitute_dependency (Score_element*,Score_element*);
   void remove_dependency (Score_element*);
   /**
@@ -60,12 +60,10 @@ public:
   /// do not print anything black
   bool transparent_b_;
 
-  int size_i_;
-  
   // ugh: no protection. Denk na, Vrij Veilig
   void calculate_dependencies (int final, int busy, Score_element_method_pointer funcptr);
 
-protected:
+public:
   /**
     Administration: Where are we?. This is mainly used by Super_element and
     Score_element::calcalute_dependencies ()
@@ -74,21 +72,18 @@ protected:
     -1 means deleted
     
    */
-public:
   int status_i_;
+
 protected:
   Score_element* dependency (int) const;
-  Score_element* dependent (int) const;
-  int dependent_size () const;
   int dependency_size () const;
   
   virtual void output_processing ();
-  void junk_links ();
   virtual Interval do_height () const;
   virtual Interval do_width () const;
     
   /// do printing of derived info.
-  virtual void do_print () const {}
+  virtual void do_print () const;
   /// generate the molecule    
   virtual Molecule* do_brew_molecule_p () const;
   ///executed directly after the item is added to the Paper_score
@@ -109,8 +104,6 @@ protected:
   virtual void handle_prebroken_dependencies ();
   virtual void handle_prebroken_dependents ();
   virtual Link_array<Score_element> get_extra_dependencies () const;
-  virtual void do_unlink ();
-  virtual void do_junk_links ();
 };
 
 
index 42a2937cbf1fd6fdbeab1a018a7f65158f95c13b..f55c5f8626b3eb5bbdefd5eada3bcbc3f4c47c8f 100644 (file)
@@ -27,7 +27,6 @@ class Span_bar : public Bar
   Interval get_spanned_interval () const;
 public:
   Real extra_x_off_;
-  bool no_width_b_;
   Span_bar();
     
   VIRTUAL_COPY_CONS(Score_element);
index b046ab1a5f94c97b9c3bed5bbfc9650ec1528b18..0c7bf2a5f5b03eb89f324baa98d968e2cd30b257 100644 (file)
@@ -71,8 +71,6 @@ protected:
 
   Spanner * unbroken_original_l_;
 
-  virtual void do_unlink ();
-  virtual void do_junk_links ();
   virtual void output_processing ();
   virtual void do_space_processing ();
   virtual void do_break_processing ();
index db26221ab8f033d94b61f267004a1b88642924c5..eb31f3a9f2b6d92178419aadcff0ebdcc43a56cf 100644 (file)
@@ -28,8 +28,6 @@
   Stem size depends on flag.
   */
 class Stem : public Item {
-
-    
   Drul_array<Real> yextent_drul_;
     
   /// needed for determining direction/length
index da982a31db864ac347d457c58d803c828da2fdcd..8c3342a4e6a7f03aabb3db97a6e7c1f75c425fb2 100644 (file)
@@ -24,7 +24,6 @@ public:
   void break_processing();
   void post_processing();
   void output_all ();
-  void unlink_all ();
 
 protected:
   
index f9d6071849c35544881fe2a0763a44fbd0badbd5..0f945fc3f5d53b67a8bce2cb3bcd8e6e867ce32e 100644 (file)
@@ -26,10 +26,9 @@ class Translator : public Input {
 public:
   Music_output_def * output_def_l_;
   String  type_str_;
-
-  bool is_alias_b (String) const;
   
-
+  virtual const char *name() const;
+  bool is_alias_b (String) const;
     
   VIRTUAL_COPY_CONS(Translator);
   Translator (Translator const &);
index 49be1529f33b9ec4f221f54f2645b5f41e0ba9e0..9726ca64b2287e01d2755a89e340ddbbf207ff85 100644 (file)
@@ -19,8 +19,6 @@ class Vertical_group_spanner : public Axis_group_spanner, public Vertical_group_
 {
 protected:
   VIRTUAL_COPY_CONS(Score_element);
-  virtual void do_junk_links () { Axis_group_spanner::do_junk_links (); }
-  virtual void do_unlink () { Axis_group_spanner::do_unlink (); }
 public:
   
   Vertical_group_spanner ();
index 6ff6400b9925cd378dae57d01f375d1577b060bf..9a8d10aea41a3f0efe6084e36db531c006d75801 100644 (file)
@@ -11,6 +11,7 @@
 #include "item.hh"
 #include "p-col.hh"
 #include "spanner.hh"
+#include "lily-guile.hh"
 
 Item::Item ()
 {
@@ -92,10 +93,11 @@ Item::copy_breakable_items()
 void
 Item::try_visibility_lambda ()
 {
-  if (visibility_lambda_)
+  SCM vis = get_elt_property (ly_symbol ("visibility_lambda"));
+  if (vis != SCM_BOOL_F)
     {
       SCM args = scm_listify (gh_int2scm (break_status_dir_), SCM_UNDEFINED);
-      SCM result = gh_apply (visibility_lambda_, args);
+      SCM result = gh_apply ( SCM_CDR(vis), args);
       int trans = gh_scm2bool (gh_car (result));
       int empty = gh_scm2bool (gh_cdr (result));
 
@@ -170,32 +172,7 @@ Item::linked_b() const
   return Score_element::linked_b() || attached_span_l_arr_.size();
 }
 
-void
-Item::do_junk_links()
-{
-  attached_span_l_arr_.set_size(0);
-}
 
-void
-Item::do_unlink()
-{
-  Link_array<Spanner> attached=attached_span_l_arr_;
-  for (int i=0; i < attached.size (); i++)
-    {
-      Spanner *s= attached[i];
-
-      Direction d= LEFT;
-      do {
-       if (s->spanned_drul_[d] == this)
-         s->set_bounds (d, 0);
-       if (unbroken_original_l_
-           && unbroken_original_l_-> broken_to_drul_[d] == this)
-         unbroken_original_l_->broken_to_drul_[d] = 0;
-      } while (flip (&d) != LEFT);
-    }
-  assert (!attached_span_l_arr_.size ());
-  unbroken_original_l_ =0;
-}
 
 Paper_column *
 Item::column_l () const
@@ -209,7 +186,6 @@ Item::Item (Item const &s)
   unbroken_original_l_ = 0;
   /* do not copy attached_span_l_arr_ */
   breakable_b_ = s.breakable_b_;
-  visibility_lambda_ = s.visibility_lambda_;
   broken_to_drul_[LEFT] = broken_to_drul_[RIGHT] =0;
   break_status_dir_ = s.break_status_dir_;
   break_priority_i_ = s.break_priority_i_;
index 9d563be580885368a300c3632f12745926c7a13e..ac6c0a10bbf67b98c13fd25910e461dd9a1befe0 100644 (file)
@@ -95,18 +95,5 @@ Line_of_score::get_extra_dependencies () const
   return r;
 }
 
-void
-Line_of_score::do_unlink () 
-{
-  Spanner::do_unlink ();
-  for (int i=0; i < cols_.size (); i++)
-    cols_[i]->line_l_ =0;
-  cols_.set_size (0);
-}
 
 
-void
-Line_of_score::do_junk_links () 
-{
-  cols_.set_size (0);
-}
index 7bf26da20b295d940b1ef0013fbabcfd81224ca2..07b57f0b9bd114b909f9280c6be98e3bb7908645 100644 (file)
@@ -26,6 +26,7 @@
 #include "scope.hh"
 #include "molecule.hh"
 #include "atom.hh"
+#include "lily-guile.hh"
 
 SCM
 array_to_list (SCM *a , int l)
@@ -379,27 +380,13 @@ Lookup::stem (Real y1, Real y2) const
 }
 
 
-static Dict_initialiser<char const*> cmr_init[] = {
-  {"bold", "cmbx"},
-  {"dynamic", "feta-din"},
-  {"finger", "feta-nummer"},
-  {"typewriter", "cmtt"},
-  {"italic", "cmti"},
-  {"roman", "cmr"},
-  {"large", "cmbx"},
-  {"Large", "cmbx"},
-  {"mark", "feta-nummer"},
-  {"number", "feta-nummer"},
-  {"volta", "feta-nummer"},
-  {0,0}
-};
 
 /**
    Magnification steps.  These are powers of 1.2. The numbers are
  taken from Knuth's plain.tex: */
 static Real mag_steps[] = {1, 1, 1.200, 1.440, 1.7280,  2.074, 2.488};
 
-static Dictionary<char const *> cmr_dict (cmr_init);
+
 
 Molecule
 Lookup::text (String style, String text) const
@@ -418,9 +405,13 @@ Lookup::text (String style, String text) const
       font_mag = (int)paper_l_->get_var ("magnification_" + style);
     }
 
-  if (cmr_dict.elem_b (style))
+  SCM l = gh_eval_str (("(style-to-cmr \"" + style + "\")").ch_C());
+  if (l != SCM_BOOL_F)
     {
-      style = String (cmr_dict [style]) + to_str  ((int)font_h); // ugh
+      int len ;
+      char * s = gh_scm2newstr(SCM_CDR (l), &len);
+      style = String (s) + to_str  ((int)font_h);
+      delete s;
     }
 
   Real w = 0;
@@ -436,7 +427,8 @@ Lookup::text (String style, String text) const
          ;
       else
        {
-         Character_metric *c = afm_l->get_char (text[i],false);
+          Character_metric *c = afm_l->get_char ((unsigned char)text[i],false);
+
          w += c->dimensions()[X_AXIS].length ();
          ydims.unite (c->dimensions()[Y_AXIS]);
        }
@@ -444,6 +436,7 @@ Lookup::text (String style, String text) const
 
   if (font_mag > 1 && font_mag < 7 )
     {
+      /* UGH  */ 
       style = style + String(" scaled \\magstep ") + to_str (font_mag);
       w *= mag_steps[font_mag];
       ydims *= mag_steps[font_mag];
@@ -452,6 +445,8 @@ Lookup::text (String style, String text) const
   DOUT << "\n" << to_str (w) << "\n";
   m.dim_.x () = Interval (0, w);
   m.dim_.y () = ydims;
+
+  
   Atom at  (gh_list (ly_symbol ("text"),
                     gh_str02scm (text.ch_C()),
                     SCM_UNDEFINED));
index 96c992c3fec5b88060444c18235b55e693ff12e5..a753b7cc9f4317e9134ff5410c3b31ba2fad4735 100644 (file)
 #include "midi-stream.hh"
 #include "audio-item.hh"
 
-
-
-
-
-
-
-
-
-
-
-
-
+#include "killing-cons.tcc"
 
 Midi_chunk::Midi_chunk ()
   : Midi_item (0)
@@ -122,13 +111,14 @@ Midi_header::Midi_header (int format_i, int tracks_i, int clocks_per_4_i)
   set ("MThd", str, "");
 }
 
+/* why doesn't this start at 0 ?
+ */
 char const* const instrument_name_sz_a_[ ] = {
-
   /* default is usually piano */
   /* 0 "piano", */
 
-         /* (1-8 piano) */
-         /* 1 */ "acoustic grand",
+  /* (1-8 piano) */
+  /* 1 */ "acoustic grand",
          /* 2 */ "bright acoustic",
          /* 3 */ "electric grand",
          /* 4 */ "honky-tonk",
@@ -435,9 +425,11 @@ Midi_note::str () const
   String str = to_str ((char)status_byte);
   str += to_str ((char) (pitch_i () + c0_pitch_i_c_));
 
+#if 0
   // poor man's staff dynamics:
   str += to_str ((char) (dynamic_byte_ - 0x10 * channel_i_));
-
+#endif
+  
   return str;
 }
 
@@ -556,7 +548,8 @@ Midi_track::add (Moment delta_time_mom, Midi_item* mitem_p)
 {
   assert (delta_time_mom >= Moment (0));
 
-  event_p_list_.bottom ().add (new Midi_event (delta_time_mom, mitem_p));
+  Midi_event * e = new Midi_event (delta_time_mom, mitem_p);
+  event_p_list_.append (new Killing_cons<Midi_event> (e, 0));
 }
 
 String
@@ -565,9 +558,9 @@ Midi_track::data_str () const
   String str = Midi_chunk::data_str ();
   if (check_debug && !monitor->silent_b ("Midistrings"))
     str += "\n";
-  for (PCursor<Midi_event*> i (event_p_list_); i.ok (); i++
+  for (Cons<Midi_event> *i=event_p_list_.head_; i; i = i->next_
     {
-      str += i->str ();
+      str += i->car_->str ();
       if (check_debug && !monitor->silent_b ("Midistrings"))
         str += "\n";
     }
index c1d512e5c9b39bc52d0eb6bc85ef8990201d6f6e..3d25f617395877413c04735a95acbfb5642ce415 100644 (file)
@@ -145,10 +145,6 @@ void delete_array_contents (Link_array<Score_element> const&to_remove, Dictionar
         else if (dynamic_cast<Spanner*>(e))
           type_stats["Spanner"] ++;
         type_stats["Total"] ++;
-        
-        e->unlink ();
-        assert (!e->linked_b ());
-        delete e;
        }
 
 }
index 87392b5153dfcac0fc7f0a25df47df6b60bf9060..e10a51c229e258d3595f534ce9518b0cee214463 100644 (file)
 #include "file-results.hh"
 #include "lily-version.hh"
 
+#include "killing-cons.tcc"
+
 Performance::Performance ()
 {
   midi_l_ =0;
+  audio_elem_p_list_ = 0;
 }
 
 void
 Performance::add_column (Audio_column* p)
 {
   p->performance_l_ = this;
-  audio_column_p_list_.bottom().add (p);
+  add_element (p);
+}
+
+Performance::~Performance()
+{
+  delete audio_elem_p_list_;
 }
 
 void
-Performance::output (Midi_stream& midi_stream_r)
+Performance::output (Midi_stream& midi_stream)
 {
-  int tracks_i = audio_staff_l_list_.size() + 1;
+  int tracks_i = audio_staff_l_arr_.size() + 1;
+
   // ugh
   int clocks_per_4_i = 384;
-  midi_stream_r << Midi_header (1, tracks_i, clocks_per_4_i);
-  output_header_track (midi_stream_r);
+
+  midi_stream << Midi_header (1, tracks_i, clocks_per_4_i);
+  output_header_track (midi_stream);
   int n = 1;
-  for (PCursor<Audio_staff*> i (audio_staff_l_list_); i.ok(); i++)
-    i->output (midi_stream_r, n++);
+  for (int i =0; i < audio_staff_l_arr_.size (); i++)
+    {
+      Audio_staff *s = audio_staff_l_arr_[i];
+      /*
+       Aargh, let's hear it for the MIDI standard.
+       MIDI players tend to ignore instrument settings on
+       channel 10, the percussion channel by default.
+       */
+      if (n == 10)
+       n++;
+      s->output (midi_stream, n++);
+    }
 }
 
 void
-Performance::output_header_track (Midi_stream& midi_stream_r)
+Performance::output_header_track (Midi_stream& midi_stream)
 {
   Midi_track midi_track;
 
@@ -87,19 +107,19 @@ Performance::output_header_track (Midi_stream& midi_stream_r)
   Midi_tempo tempo (midi_l_->get_tempo_i (Moment (1, 4)));
   midi_track.add (Moment (0), &tempo);
 
-  midi_stream_r  << midi_track;
+  midi_stream << midi_track;
 }
 
 void
 Performance::add_staff (Audio_staff* l)
 {
-  audio_staff_l_list_.bottom().add (l);
+  audio_staff_l_arr_.push (l);
 }
 
 void
 Performance::add_element (Audio_element *p)
 {
-  audio_elem_p_list_.bottom().add (p);
+  audio_elem_p_list_ = new Killing_cons<Audio_element> (p, audio_elem_p_list_);
 }
 
 void
@@ -108,13 +128,9 @@ Performance::print() const
 #ifndef NPRINT
   DOUT << "Performance { ";
   DOUT << "Items: ";
-  for (PCursor<Audio_element*> i (audio_elem_p_list_.top ()); i.ok (); i++)
-    i->print ();
-
-  DOUT << "\ncolumns: ";
-  for (PCursor<Audio_column*> i (audio_column_p_list_); i.ok(); i++)
-    i->print();
-  DOUT << "}\n";
+  for (Cons<Audio_element>* i =audio_elem_p_list_; i; i = i->next_)
+    i->car_->print ();
+  DOUT << "}";
 #endif
 }
 
index c3e00d4611eb35f3029770ce6cbd6bc9256efccc..1cd16cdfbd45dd45c0e7e7baf871a2325a4a62ee 100644 (file)
@@ -28,30 +28,30 @@ Score_element::Score_element()
   output_p_ =0;
   break_helper_only_b_ = false;
   transparent_b_ = false;
-  size_i_ = 0;
   pscore_l_=0;
   status_i_ = 0;
+  element_property_alist_ = SCM_EOL;
 }
 
 Score_element::Score_element (Score_element const&s)
-  :  Directed_graph_node (s), Graphical_element (s)
+  :   Graphical_element (s)
 {
   /* called from derived ctor, so most info points to the same deps
      as (Directed_graph_node&)s. Nobody points to us, so don't copy
      dependents.      
    */
-  copy_edges_out (s);
+  
+
+  // deep copy ?
+  element_property_alist_ = s.element_property_alist_;
+  dependency_arr_ = s.dependency_arr_;
   output_p_ =0;
   break_helper_only_b_ = s.break_helper_only_b_;
   transparent_b_ = s.transparent_b_;
   status_i_ = s.status_i_;
   pscore_l_ = s.pscore_l_;
-  size_i_ = s.size_i_;
 }
 
-
-  
-
 Score_element::~Score_element()
 {
   delete output_p_; 
@@ -62,29 +62,29 @@ Score_element::~Score_element()
 Score_element*
 Score_element::dependency (int i) const
 {
-  return (Score_element*) (get_out_edge_arr ()[i]);
+  return dependency_arr_ [i];
 }
 
 int
 Score_element::dependency_size () const
 {
-  return get_out_edge_arr ().size ();
+  return dependency_arr_.size ();
 }
 
-Score_element*
-Score_element::dependent (int i) const
+
+
+SCM
+Score_element::get_elt_property (SCM s)
 {
-  return (Score_element *)( get_in_edge_arr()[i]);
+  return scm_assq(s, element_property_alist_);
 }
-
-int
-Score_element::dependent_size() const
+void
+Score_element::set_elt_property (SCM s, SCM v)
 {
-  return get_in_edge_arr().size ();
+  element_property_alist_ =
+    scm_assoc_set_x (element_property_alist_, s, v);
 }
 
-
-
 Interval
 Score_element::do_width() const 
 {
@@ -120,8 +120,7 @@ Score_element::print() const
 {
 #ifndef NPRINT
   DOUT << classname(this) << "{\n";
-  DOUT << "dets: " << dependent_size() << "dependencies: " << 
-    dependency_size();
+  DOUT << "dependencies: " << dependency_size();
  
   Graphical_element::do_print ();
   do_print();
@@ -141,7 +140,11 @@ Score_element::paper()  const
 Lookup const *
 Score_element::lookup_l () const
 {
-  return pscore_l_->paper_l_->lookup_l (size_i_);
+  SCM sz = scm_assq (ly_symbol ("fontsize"), element_property_alist_);
+  if (sz != SCM_BOOL_F)
+    return pscore_l_->paper_l_->lookup_l (gh_scm2int (SCM_CDR (sz)));
+  else
+    return pscore_l_->paper_l_->lookup_l (0);
 }
 
 void
@@ -237,17 +240,6 @@ Score_element::do_substitute_element_pointer (Score_element*,Score_element*)
 {
 }
 
-void
-Score_element::do_unlink()
-{
-}
-
-void
-Score_element::do_junk_links()
-{
-}
-
-
 
 Molecule*
 Score_element::do_brew_molecule_p() const
@@ -272,14 +264,21 @@ Score_element::line_l() const
 void
 Score_element::remove_dependency (Score_element*e)
 {
-  remove_edge_out (e);
+  int i;
+  while ((i = dependency_arr_.find_i (e)) >=0 )
+    dependency_arr_.unordered_del (i);
+
   substitute_dependency (e, 0);
 }
 
 void
 Score_element::add_dependency (Score_element*e)
 {
-  Directed_graph_node::add_edge (e);
+  if (e)
+    dependency_arr_.push (e);
+  else
+    warning("Null dependency added");
+      
 }
 void
 Score_element::substitute_dependency (Score_element* old, Score_element* new_l)
@@ -378,30 +377,6 @@ Score_element::handle_prebroken_dependents()
 }
 
 
-void
-Score_element::junk_links ()
-{
-  Directed_graph_node::junk_links();
-  Graphical_element::junk_links ();
-  do_junk_links();
-}
-
-void
-Score_element::unlink()
-{
-  do_unlink();
-  while (dependency_size()) 
-    {
-      do_substitute_element_pointer (dependency (0),0);
-      remove_edge_out_idx (0);
-    }
-  while  (dependent_size()) 
-    {
-      dependent (0)->remove_dependency (this);
-    }
-  Graphical_element::unlink ();
-}
-
 
 Link_array<Score_element>
 Score_element::get_extra_dependencies() const
@@ -416,3 +391,7 @@ Score_element::linked_b() const
   return get_extra_dependencies().size() || 
     dependency_size();
 }
+void
+Score_element::do_print () const
+{
+}
index 3848b84164daa58e39762735a6b7dfe312d3128e..135d978c15864841a09858bdaa4441a38485d1fa 100644 (file)
@@ -3,8 +3,6 @@
 
 class Span_bar_engraver : public Base_span_bar_engraver
 {
-protected:
-  Span_bar *get_span_bar_p ();
 public:
   Span_bar_engraver ();
   VIRTUAL_COPY_CONS (Translator);
index 62c2c66fac81b964a309b5edd1bcc40d6c48a2d6..67d1e2ea9230b02cf73390d5a16c579fcf2f4baf 100644 (file)
@@ -36,11 +36,6 @@ Span_bar::set_align (Align_element *a)
 Interval
 Span_bar::do_width () const
 {
-  if (no_width_b_)
-    {
-      return Interval (0,0);
-    }
-  
   Molecule m = lookup_l ()->bar (type_str_, 40 PT);
   
   return m.extent (X_AXIS);
@@ -136,5 +131,4 @@ Span_bar::Span_bar ()
 {
   type_str_ = "";
   extra_x_off_ = 0.0;
-  no_width_b_ = false;
 }
index 1efa242c6a753991ef6f1e8b0e34ed92e2ff5157..bcf62430b8f313eb3145538a8b85c47bdefa9937 100644 (file)
@@ -15,8 +15,6 @@ Span_bar*
 Span_score_bar_engraver::get_span_bar_p () const
 {
   Span_bar*s =  new Span_bar;
-  s->visibility_lambda_
-    = gh_eval_str ("Span_score_bar_visibility");
   s->type_str_ = "scorebar";
     
   return s;
@@ -33,9 +31,7 @@ Span_bar*
 Piano_bar_engraver::get_span_bar_p () const
 {
   Span_bar *s= new Span_bar;
-  s->visibility_lambda_
-    = gh_eval_str ("Piano_bar_visibility");
-  s->no_width_b_ =true;
+  s->dim_cache_[X_AXIS].set_empty (true);
   s->type_str_ = "{";
   return s;
 }
@@ -44,9 +40,7 @@ Span_bar*
 Staff_group_bar_engraver::get_span_bar_p () const
 {
   Span_bar *s= new Span_bar;
-  s->visibility_lambda_
-    = gh_eval_str ("Staff_group_bar_visibility");
-  s->no_width_b_ =true;
+  s->dim_cache_[X_AXIS].set_empty (true);
   s->type_str_ = "[";
   return s;
 }
index b9c3f00247415a9a00c3bb0a6d543e5eb53369cb..f829026a6c4d4764fa9027b4fe022c793a1837a4 100644 (file)
@@ -203,28 +203,8 @@ Spanner::broken_b() const
   return broken_info_.size();
 }
 
-void
-Spanner::do_unlink() 
-{
-  set_bounds (LEFT, 0);
-  set_bounds (RIGHT, 0);
 
-  if (unbroken_original_l_)
-    {
-      for (int i=0; i < unbroken_original_l_->broken_info_.size (); i++)
-       {
-         if (unbroken_original_l_->broken_info_[i].broken_spanner_l_ == this)
-           unbroken_original_l_->broken_info_[i].broken_spanner_l_ = 0;
-       }
-      
-    }
-}
 
-void
-Spanner::do_junk_links()
-{
-  spanned_drul_[LEFT] = spanned_drul_[RIGHT] =0;
-}
 
 Array<Rod>
 Spanner::get_rods () const
index 7b927de55e4a74c19990aad0c2545613bd98e672..c5ee89e9fbe2388ca94618fddb409aa301121bf4 100644 (file)
@@ -18,8 +18,6 @@ Super_element::Super_element()
 }
 
 
-
-
 /**
     for administration of what was done already
     */
@@ -37,8 +35,6 @@ enum Score_element_status {
   POSTCALCED,          // after spacing calcs done
   BREWING,
   BREWED,
-  UNLINKING,
-  UNLINKED,
 };
 
 void
@@ -85,9 +81,4 @@ Super_element::output_all ()
 
 
 
-void
-Super_element::unlink_all ()
-{
-  calculate_dependencies (UNLINKING, UNLINKED, &Score_element::junk_links);
-}
 
index 122b34d98e66f145da4626fb07c8de2ae26c0519..a6df5e884ab576aea19bbf6caf9b08f77fce53e7 100644 (file)
 
 #include "rational.hh"
 
+char const*
+Translator::name() const
+{
+  return classname(this);
+}
+
 Translator::~Translator ()
 {
 }
index a87b677c266824442e1899329516656db69b1a46..d473805efe96467e50336289a2e074841a2924c6 100644 (file)
 
 ;; Score_span_bars are only visible at start of line
 ;; i.e. if break_dir == RIGHT == 1
-(define Span_score_bar_visibility postbreak_only_visibility)
-(define Piano_bar_visibility postbreak_only_visibility)
-(define Staff_group_bar_visibility postbreak_only_visibility)
+(define Span_score_bar_engraver_visibility postbreak_only_visibility)
+(define Span_bar_engraver_visibility non_postbreak_visibility)
+(define Piano_bar_engraver_visibility postbreak_only_visibility)
+(define Staff_group_bar_engraver_visibility postbreak_only_visibility)
 
 
 
 
 ;;;;;;;; TeX
 
+(define cmr-alist 
+  '(("bold" . "cmbx") 
+    ("dynamic" . "feta-din") 
+    ("finger" . "feta-nummer") 
+    ("typewriter" . "cmtt") 
+    ("italic" . "cmti") 
+    ("roman" . "cmr") 
+    ("large" . "cmbx") 
+    ("Large" . "cmbx") 
+    ("mark" . "feta-nummer") 
+    ("number" . "feta-nummer") 
+    ("volta" . "feta-nummer"))
+)
+
+
+;; Map style names to TeX font names.  Return false if 
+;; no font name found. 
+(define (style-to-cmr s)
+  (assoc s cmr-alist )
+  )
+
+
 (define (tex-scm action-name)
 
   (define (unknown) 
 ;;;;;;;;;;;; PS
 (define (ps-scm action-name)
 
+
+  ;; alist containing fontname -> fontcommand assoc (both strings)
   (define font-alist '())
   (define font-count 0)
   (define current-font "")
                  (set! font-count (+ 1 font-count))
                  (string-append "\n/" font-cmd " {/"
                                 font-name
-                                " findfont 12 scalefont setfont} bind def\n"
-                                font-cmd "\n"))
-               (cdr font-cmd)))
-         ""                            ;no switch needed
+                                " findfont 12 scalefont setfont} bind def \n"
+                                font-cmd " \n"))
+               (string-append (cdr font-cmd) " ")))
+         ; font-name == current-font no switch needed
+         ""                            
          ))
                  
   (define (beam width slope thick)
     (string-append
      "\n/" (font i) " {/" 
      (substring s 0 (- (string-length s) 4))
-     " findfont 12 scalefont setfont} bind def\n"))
+     " findfont 12 scalefont setfont} bind def \n"))
 
   (define (font-switch i)
     (string-append (font i) " "))
   (define (placebox x y s) 
     (string-append 
      (number->string x) " " (number->string y) " {" s "} placebox "))
+  (define (pianobrace y)
+    ""
+    )
 
   (define (rulesym x y) 
     (string-append 
   (define (stop-line)
       "}\nstop_line\n")
 
-  (define (text s)
-    (string-append "(" s ") set" f " "))
+  (define (text s)
+    (string-append "(" s ") show  "))
 
 
   (define (volta w thick last)
            (define font-def ,font-def)
            (define font-switch ,font-switch)
            (define generalmeter ,generalmeter)
+           (define pianobrace ,pianobrace)
            (define header-end ,header-end)
            (define lily-def ,lily-def)
            (define header ,header)