]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 1.3.27 release/1.3.27
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 24 Feb 2000 17:30:43 +0000 (18:30 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 24 Feb 2000 17:30:43 +0000 (18:30 +0100)
===========

* Bugfix: font used in volta-spanner calculation.

* Added simple selection list to webpage, inspired by sawmill.

* Devised kludge for ascii 5 character font pitches.

* Substitutions: interline, 1997,1998, @stack.nl and small typo fixes.

1.3.26.h

41 files changed:
CHANGES
Documentation/topdocs/index.tely
Documentation/user/refman.itely
TODO
VERSION
input/bugs/b.ly [new file with mode: 0644]
input/test/generic-output-property.ly [new file with mode: 0644]
lily/dynamic-engraver.cc
lily/engraver.cc
lily/group-interface.cc
lily/include/group-interface.hh
lily/include/output-property.hh [new file with mode: 0644]
lily/include/request-iterator.hh
lily/include/scm-hash.hh
lily/include/score-element.hh
lily/include/translator.hh
lily/lily-guile.cc
lily/moment.cc
lily/music-iterator.cc
lily/my-lily-lexer.cc
lily/output-property-engraver.cc [new file with mode: 0644]
lily/output-property-engraver.hh [new file with mode: 0644]
lily/output-property.cc [new file with mode: 0644]
lily/paper-column.cc
lily/paper-outputter.cc
lily/parser.yy
lily/request-iterator.cc
lily/scm-hash.cc
lily/score-element.cc
lily/score-element.cc.orig [deleted file]
lily/score-engraver.cc
lily/score.cc
lily/slur.cc
lily/spacing-engraver.cc
lily/staff-symbol-referencer.cc
ly/engraver.ly
make/out/lilypond.lsm
make/out/lilypond.spec
mf/feta-accordion.mf
scm/lily.scm
scripts/ly2dvi.py

diff --git a/CHANGES b/CHANGES
index eae8018ba12c2585a6e5cd45feffa548a937134a..d0896a7d87bf4302832367c9d7754df845ead6b2 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,9 +1,22 @@
---- ../lilypond-1.3.26.hwn2/CHANGES    Thu Feb 24 13:52:54 2000
-++ b/CHANGES   Thu Feb 24 17:15:46 2000
-@@ -2,6 +2,14 @@
- 1.3.26.hwn2
- ===========
+1.3.26.jcn2
+===========
+
+* Bugfix: font used in volta-spanner calculation.
+
+* Added simple selection list to webpage, inspired by sawmill.
  
+* Devised kludge for ascii 5 character font pitches.
+* Substitutions: interline, 1997,1998, @stack.nl and small typo fixes.
+
+1.3.26.hwn1
+===========
+
+* Plug memory leaks related to Moment:
+  - Spacing_engraver::do_pre_move_processing ()
+  - make_rational ()/make-rational
+  - Paper_column::Paper_column ()
+
 * Plug memory leak in Paper_outputter::output_{String,Real,int}_def()
 
 * Plug memory leak in Score_engraver::set_columns ()
 
 * Plug memory leak in Score_element::molecule_extent ()
 
- * Bugfix: don't crash if a slur doesn't span anything.
- * Bugfix: don't crash if doing beams without a staff symbol.1.3.26.jcn2
-===========
+* Bugfix: don't crash if a slur doesn't span anything.
 
-* Bugfix: font used in volta-spanner calculation.
+* Bugfix: don't crash if doing beams without a staff symbol.
 
-* Added simple selection list to webpage, inspired by sawmill.
+* Generic element property setting:
 
-1.3.26.jcn1
-===========
+       \outputproperty #predicate #'symbol = #value
 
-* Devised kludge for ascii 5 character font pitches.
-
-* Substitutions: interline, 1997,1998, @stack.nl and small typo fixes.
+Will set the element property symbol to value, for any elements that
+return true for PREDICATE.  This allows you to virtually tweak *ANY*
+property of the output. Example in input/test/generic-output-property.ly
 
-1.3.25.jcn2
-===========
+1.3.26
+======
 
 * lilypond as as2ly: --help and --version to stdout.  Regular identify 
   to stderr.  This fixes help2man's manpage generation.
index 90142fb51e3a86284e4e01f1fa4c3e60cf9d3106..e87837690fc7b0e12bb4d60d0580abe6b638f875 100644 (file)
@@ -144,6 +144,25 @@ If you have questions, do write to the mailing lists!
  (But don't forget to read the @uref{Documentation/out-www/faq.html,
 Frequently Asked Questions} first.)
 
+@html
+<p align=center>
+[
+    <a href="#download">Download</a>
+    |
+    <a href="Documentation/out-www/faq.html">FAQ</a>
+    |
+    <a href="Documentation/out-www/index.html">Documentation</a>
+    |
+    <a href="#music">Music archives</a>
+    |
+    <a href="#mailing-lists">Mailing lists</a>
+    |
+    <a href="Documentation/programmer/out-www/regression-test.html">
+    Regression test</a>
+    |
+    <a href="Documentation/out-www/CHANGES.txt">News</a>
+]
+@end html
 
 @table @samp
 @item info-gnu-music@@gnu.org
index 4a5a95c7a2a5a6763a27b6d22042cc8ee1a706e9..1d222f5953196da90a8f8a9ff46951f35374e547 100644 (file)
@@ -784,6 +784,33 @@ Usually this is used to switch staffs in Piano music, e.g.
 @end example
 
 
+@cindex output properties
+
+
+These allow you to tweak what is happening in the back-end
+directly. If you want to control every detail of the output
+formatting, this is the feature to use. The downside to this is that
+you need to know exactly how the backend works. Example:
+
+
+@mudela[fragment,verbatim]
+\relative c'' { c4
+       \context Staff \outputproperty
+               #(make-type-checker 'Note_head)
+               #'extra-offset = #'(5.0 . 7.5)
+<c8 e g> }
+@end mudela
+
+This selects all note heads occurring at current staff level, and sets
+the extra-offset of those heads to (5,7.5), shifting them up and
+right.
+
+Use of this feature is entirely on your own risk: if you use this, the
+result will depend very heavily on the implentation of the backend,
+which we change unscrupulously.
+
+
+
 
 @cindex commands
 
diff --git a/TODO b/TODO
index 1f0b03638b96cbe1fd2da9a5b2bff1f65037be26..9fb9933e9f8beaffd5ce9f3122c3f3d3259d7714 100644 (file)
--- a/TODO
+++ b/TODO
@@ -19,6 +19,30 @@ Grep -i for TODO, FIXME and ugh/ugr/urg.
 . * change ) c4  to c4-)
 . * internationalize GUILE msgs.
 . * unbroken marks.
+. * chubb:
+-- Take a piece of early music, and typeset it as closely as possible to
+the original edition.  This means: moveable clefs, sometimes funny or no
+time signatures, few or no bar lines, few or no ties, slurs or
+phrasemarks, ornaments implied by the structure of the music, or
+indicated by, e.g., one or more thick lines through the stem of a note
+(Purcell and Farnaby both use this extensively, but with rather
+different meanings).  For Dowland's music it may also mean being able
+to rotate one or more staves (but I can do this in LaTeX).
+
+-- Add to this music a set of critical marks that:
+   * regularises clef, time and key signature.
+   * add slurs, phrase marks, articulation, etc.
+   * Halve or quarter the durations, so that minims become crotchets, say.
+   * add ornaments (mordents, trills, turns etc)
+   * add regular barlines (which sometimes will mean splitting a note
+     and adding a tie, e.g., in some of Byrd's music)
+   * Add footnotes to particular symbols, groups of notes, etc.
+   * When translating from chant notation, add a square bracket over a
+     group of notes to indicate a ligature in the original
+etc.
+   * Discretionary sharp or flat signs, for Musica Ficta
+
+-- print out both editions from the same source.
 . * write smobifying howto.
 . * put property test files in refman.
 . * alignment within @itemize
@@ -28,7 +52,6 @@ Grep -i for TODO, FIXME and ugh/ugr/urg.
 . * \grace { c d } c1 in midi
 . * \prop slurdir in grace notes
 . * Make fingering and playing instructions Music_wrappers?
-. * \eltproperty "=Context" "Elt_name" "prop-name" #value
 . * script columns
 . * Must stop before this music ends:
 verse=\lyrics {
@@ -72,9 +95,6 @@ level elements (key, clef, meter, etc). This construction makes
 - if I change the property minVerticalAlign in a multi staff score with
 lyrics the change affects the lyrics too. I would like the change to
 _only_ affect staves.
-
-- I would like to be able to influence the sloping of xtuplet brackets
-
 - after the leading measure in the above mentioned score I want a double
 bar line fully drawn across the staves and after that keep to the
 ChoirStaff bar line types in the rest of the scores
@@ -102,8 +122,6 @@ ChoirStaff bar line types in the rest of the scores
 . * [c8. c16 c16 c16] in 6/8 timesig.
 . * Rewrite Stem, Beam (hairy)
 .  * beams over barlines
-. * Rests and beams don't work too well together. Example:
-   [ r8 g''16 des'] [r8 c16 a] 
 . * autoBeamMelisma: if I explicitly beam notes in a staff with auto
 beaming disabled I would like to have these beams also to be
 melismatic.
@@ -193,12 +211,10 @@ repeated section with different words for each repeat.
 . * \selectmusic to cut pieces from music. 
 . * formatting of input stuff. 
 .  * deps for ly2dvi
-. * TODO: merge atom & molecule; make  tree from molecule.
 . * Align_element::padding  ?
 . * use streambufs and iostream
 to provide IO handling for TeX stream, mudela stream, data-file.
 . * seriously buffer TeX output (do profile of writing .5 mb TeX file.)
-. * fix partial measures in meaningful way.
 . * uniformise recent feta contributions.
 .  * bigger and fatter 4/4 C
 . * relative mode for midi2ly
@@ -216,10 +232,6 @@ to provide IO handling for TeX stream, mudela stream, data-file.
 . * text-items clash with stems/beams
 . * --include, -I option for ly2dvi (pass on to lily)
 . * fix placement of beam-less abbrev
-. * \meter 3/4;
-       <{\voiceone cis4. cis8 cis4 | cis4 cis cis | r1 }
-        {\voicetwo cis,4 r r | r2. | r1 }> |
-       }
 . * Musical_pitch (analogous to Duration and Rhythmic_req)
          think about, analogous to pitch: 
           * { a4 a16 } c <-- duration of c?
@@ -236,15 +248,12 @@ to provide IO handling for TeX stream, mudela stream, data-file.
   I understand the implementation of repeats well enough.
 . * add mudela-book-doc source to webstie.
 . * fix singleStaffBracket
-. * rename
-.  * partial -> anacrouse
 . * move paper vars into engraver properties
 . * add new glyphs to font.ly
 . * more intelligent file searching
 . * disable spaces in TeX stuff
 . * handle ^C for tmp/file creation.
 . * make LilyPond RPM fully relocatable
-. * better hshift (dots, distance, head dependent)
 . * didot / big point.
 . * clefs (AG): The "8" should appear closer to the actual clef,
 touching it.
@@ -254,6 +263,7 @@ touching it.
 
 .* FONT
 . * the bracket is ugly (wings are too parabolic, should be more circular)
+. * fix accordion turning paths.
 . * versioning for Feta
 . * rewrite dynamic signs.  They're kind of spaghetti now. 
 . * The `3' in the meter key is a one or two pixels too thin (at 600dpi)
@@ -267,7 +277,6 @@ touching it.
 . * work out sizes of character fonts.
 . * more symbols
 .  * piano pedals: Ped/*
-.  * maxima notehead
 .  * coda signs: Segno, O+
 .  * glissando, arpeggio
 .  * lengthened trill
@@ -286,34 +295,11 @@ touching it.
             do_one_file(String,String) [scores.cc:124]
       Reading 4 bytes from 0xefffeca8 on the stack.
       Address 0xefffeca8 is 728 bytes below frame pointer in function 
-. *  Array<Axis [2] > axeses;
-
-  for (int i=0; i < loose_elems.size (); i++)
-    {
-      Score_element* elt = loose_elems[i];
-      /*
-           with which axes do we have to meddle?
-      */
-      int j =0;
-      Axis as [2];
-      for (int a = X_AXIS; a < NO_AXES; ++a)
-       if (elt->parent_l (Axis (a)) == this)
-         as[j++] = Axis (a);
-      if (j == 1)
-       as[j++] = as[0];
-
-      axeses.push (as);
-    }
-
 . * patch: don't touch timestamp if all patches fail.
 . * MetaPost: should not generate setgray for unfill
-. * check out GCC signatures?
 . * glibc 2.0:
          f = fopen ("/dev/null", "r")
          assert (feof (f))
-. * tetex: mfplain.mem -> INSTALL
-. * mfplain.ini not in tetex 0.9 -> INSTALL
-
 
 .* PROJECTS
 . * Scripts:
@@ -365,14 +351,6 @@ touching it.
 .  * output header info to MIDI too.
 .  * dump \header into easily parsable format.
 
-. * a musical dictionary. See Documentation/vocabulary-*, other
-languages:
-.  * explanations
-.  * italian
-.  * german
-.  * dutch
-.  * swedish
-
 . * chords
 .  * guitar chords (fret diagrams)
 .  * other chord name styles (american(?) style)
diff --git a/VERSION b/VERSION
index 6ea5f58835d12df6fb8a9323c076dd31849ad408..4e6268cb091ee66d1c67a5db17cdaceaaf061ba1 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,8 +1,8 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
-PATCH_LEVEL=26
-MY_PATCH_LEVEL=hwn3
+PATCH_LEVEL=27
+MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/input/bugs/b.ly b/input/bugs/b.ly
new file mode 100644 (file)
index 0000000..87ff53e
--- /dev/null
@@ -0,0 +1,2 @@
+
+\score { \notes <{  [ r8 g''16 des'] [r8 c16 a] }>}
diff --git a/input/test/generic-output-property.ly b/input/test/generic-output-property.ly
new file mode 100644 (file)
index 0000000..3a7661e
--- /dev/null
@@ -0,0 +1,10 @@
+
+\score
+{
+\notes {
+  c''4
+  \outputproperty #(make-type-checker 'Note_head) #'staff-position = #20
+  c''4
+
+}
+}
index c6c35a908f7ad1c19abc4b0cc684605274616417..7f519db38b220b235587685b039b640771a16ee7 100644 (file)
@@ -18,6 +18,7 @@
 #include "engraver.hh"
 #include "stem.hh"
 #include "note-head.hh"
+#include "group-interface.hh"
 
 /**
    print text & hairpin dynamics.
@@ -36,6 +37,9 @@ public:
   Dynamic_engraver();
   
 protected:
+
+  void announce_element (Score_element_info);
+  
   virtual void do_removal_processing ();
   virtual void acknowledge_element (Score_element_info);
   virtual bool do_try_music (Music *req_l);
@@ -45,6 +49,13 @@ protected:
   virtual void typeset_element (Score_element*);
 };
 
+void
+Dynamic_engraver::announce_element (Score_element_info i)
+{
+  group (i.elem_l_, "interfaces").add_thing (ly_symbol2scm ("dynamic"));
+  
+  Engraver::announce_element (i);
+}
 
 
 Dynamic_engraver::Dynamic_engraver()
index 7b2fb0c90c3e99b8cca3b71b85ad245cd5823fd5..40bc87f9c1b649e976aba629e106f3cd4db9bc65 100644 (file)
@@ -1,7 +1,7 @@
 /*
   engraver.cc -- implement Engraver
 
-  Sourcefile of GNU LilyPond musictypesetter
+  Sourcefile of GNU LilyPond music type setter
 
   (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
@@ -13,6 +13,7 @@
 #include "debug.hh"
 #include "paper-def.hh"
 #include "score-element.hh"
+#include "group-interface.hh"
 
 void
 Engraver::fill_staff_info (Staff_info&)
@@ -23,6 +24,9 @@ Engraver::fill_staff_info (Staff_info&)
 void
 Engraver::announce_element (Score_element_info i)
 {
+  Score_element *  e = i.elem_l_;
+  group (e, "interfaces").add_thing (ly_symbol2scm (e->name()));
+  
   if (!i.origin_trans_l_)
     i.origin_trans_l_ = this;
   daddy_grav_l()->announce_element (i);
index d9ae970c193633e93f90d6f225a7dbf929c821d7..628a9fff582087f40b18fa3ca8fc7f7a81968e41 100644 (file)
@@ -35,11 +35,19 @@ Group_interface::add_element (Score_element*p)
 {
   p->used_b_ =  true;
   elt_l_->used_b_ = true;
-  
+
+  add_thing (p->self_scm_);
+}
+
+void
+Group_interface::add_thing (SCM s)
+{
   elt_l_->set_elt_property (name_,
-                           gh_cons (p->self_scm_, elt_l_->get_elt_property (name_)));
+                           gh_cons (s, elt_l_->get_elt_property (name_)));
+
 }
 
+
 int
 Group_interface::count ()
 {
index bf461a4052320e209157520c39092452acaa0b28..eb21db6ee6ec4baced96048e55781ca1993b54d1 100644 (file)
 #include "lily-guile.hh"
 #include "smobs.hh"
 
+/*
+  rename to list interface?
+ */
+
+/**
+   Look at Score element ELT as thing which has a list property called
+   NAME_. Normally the list would contain Score_elements, but
+   sometimes it can be different things.
+*/
 struct Group_interface
 {
   Score_element * elt_l_;
@@ -23,6 +32,7 @@ public:
   Group_interface (Score_element const*);
   Group_interface (Score_element const*, String);
   int count ();
+  void add_thing (SCM);
   bool has_interface_b ();
   void set_interface ();
   void add_element (Score_element*);
@@ -31,10 +41,9 @@ public:
 Group_interface group (Score_element*);
 Group_interface group (Score_element*, String);
 
-/*
-  template<class T>
-  Link_array<T> Group_interface__extract_elements (T *, String name);
-*/
+/** 
+  Put all score elements of ELT's property called NAME into an array,
+  and return it.  */
 template<class T>
 Link_array<T>
 Group_interface__extract_elements (Score_element const *elt, T *, String name)
diff --git a/lily/include/output-property.hh b/lily/include/output-property.hh
new file mode 100644 (file)
index 0000000..f266642
--- /dev/null
@@ -0,0 +1,27 @@
+/*   
+  output-property.hh -- declare Output_property
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#ifndef OUTPUT_PROPERTY_HH
+#define OUTPUT_PROPERTY_HH
+
+#include "music.hh"
+#include "protected-scm.hh"
+
+class Output_property : public Music
+{
+public:
+  Output_property(SCM, SCM, SCM);
+
+  /**
+    relevant stuff: the predicate, the symbol, the value
+   */
+  Protected_scm pred_sym_val_list_;
+};
+
+#endif /* OUTPUT_PROPERTY_HH */
index 53a7a760704ec0cdac6226f9e0a9b115d476afbb..ea2b07b026b221caf0579b1a00ac986fb6ca094d 100644 (file)
 
 #include "music-iterator.hh"
 
-class Request_iterator : public Music_iterator
+class Simple_music_iterator : public Music_iterator
 {
 public:
-  Request_iterator ();
 protected:
   virtual void do_process_and_next (Moment );
 };
index 3bc455f88a9c4ba8360467a993eec75438eecb1b..0a15bfce9a99a67785295249db04bff9d53a20ee 100644 (file)
@@ -27,7 +27,7 @@ public:
      WARNING: putting something in assumes responsibility for cleaning
      up.  */
   void set (SCM k, SCM v);
-  SCM get (SCM k);
+  SCM get (SCM k) const; 
   
   Scheme_hash_table ();
   void operator = (Scheme_hash_table const &); 
index f37990f7ee71c83a71a351f75612bc78ecf0357b..2a962607fd387180003333718397ab366b8ea0cf 100644 (file)
@@ -154,6 +154,9 @@ protected:
 
   static Interval dim_cache_callback (Dimension_cache const*);
 public:
+  static SCM ly_set_elt_property (SCM, SCM,SCM);
+  static SCM ly_get_elt_property (SCM, SCM);  
+  
   virtual void handle_broken_dependencies ();
   virtual void handle_prebroken_dependencies ();
 
index 6c4e314941a12756b6e4f9ebfb013e6c8f97f731..df5f2532541488171fba727d56be88e214155320 100644 (file)
@@ -67,6 +67,9 @@ public:
   virtual Moment now_mom () const;  
 
 protected:
+  /*
+    UGH. Clean this up.
+   */
    enum { 
     ORPHAN,
     VIRGIN,
index e317ea543815e3a466ef1f2440f75eb0235fa652..036bd19039bfe4614ba41f1a2f6291c56d9802f8 100644 (file)
@@ -220,7 +220,7 @@ ly_isdir_p (SCM s)
 }
 
 
-void
+static void
 init_functions ()
 {
   scm_make_gsubr ("ly-warn", 1, 0, 0, (SCM(*)(...))ly_warning);
@@ -310,9 +310,7 @@ to_boolean (SCM s)
 /*
   Appendable list L: the cdr contains the list, the car the last cons
   in the list.
-  
  */
-
 SCM
 appendable_list ()
 {
index ebe3b0b190b3d3e1584bd257b59d58eba8c8549c..3d7a69474e88fcfa3f2781dc68338a83bde7ecab 100644 (file)
@@ -39,21 +39,27 @@ Moment::print_smob (SCM s, SCM port, scm_print_state *)
 
 void
 Moment::do_smobify_self ()
-{}
+{
+}
 
 SCM
 make_rational (SCM n, SCM d)
 {
+  Moment *r;
+  SCM retval = SCM_EOL;
   if (SCM_INUMP (n) && SCM_INUMP(d))
     {
-      Moment *r = new Moment (gh_scm2int (n), gh_scm2int (d));
-      return r->smobify_self ();
+      r= new Moment (gh_scm2int (n), gh_scm2int (d));
     }
   else
     {
-      ::error ("Not a number");
-      assert(false);
+      ::error ("make-moment takes two integer arguments.");
+      r = new Moment (1,1);
     }
+
+  retval = r->smobify_self ();
+  scm_unprotect_object (r->self_scm_);
+  return retval ;  
 }
 
 #include "ly-smobs.icc"
index 590271201cc062f1ff092a890ddb22b0cff88556..edbb722e24993471aa7357f20b9df7ad7ee49e91 100644 (file)
@@ -5,6 +5,10 @@
 
   (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
+
+/*
+  UGH. too many includes.
+ */
 #include "debug.hh"
 #include "music-list.hh"
 #include "music-iterator.hh"
@@ -32,6 +36,7 @@
 #include "auto-change-iterator.hh"
 #include "request.hh"
 #include "request-iterator.hh"
+#include "output-property.hh"
 
 void
 Music_iterator::do_print() const
@@ -149,12 +154,10 @@ Music_iterator::static_get_iterator_p (Music const *m)
       else
        p = new Unfolded_repeat_iterator;
     }
-  else if (Request const * r = dynamic_cast<Request const* > (m))
+  else
     {
-      p = new Request_iterator ;
+      p = new Simple_music_iterator ;
     }
-  else
-    assert (0);
 
   p->music_l_ = m;
   return p;
index f413a5dc9a1a4ff815d0f4f863e2621ca2cf2786..0e74531f07ecc547d3c5ae04c21bef6980882073 100644 (file)
@@ -57,6 +57,7 @@ static Keyword_ent the_key_tab[]={
   {"name", NAME},
   {"notenames", NOTENAMES},
   {"notes", NOTES},
+  {"outputproperty", OUTPUTPROPERTY},
   {"partial", PARTIAL},
   {"paper", PAPER},
   {"penalty", PENALTY},
diff --git a/lily/output-property-engraver.cc b/lily/output-property-engraver.cc
new file mode 100644 (file)
index 0000000..6f0b6cf
--- /dev/null
@@ -0,0 +1,66 @@
+/*   
+  output-property-engraver.cc --  implement Output_property_engraver
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#include "output-property.hh"
+#include "engraver.hh"
+#include "score-element.hh"
+
+class Output_property_engraver : public Engraver
+{
+public:
+  VIRTUAL_COPY_CONS(Translator);
+protected:
+  
+  Link_array<Output_property> props_;
+
+  virtual void do_pre_move_processing ();
+  virtual void acknowledge_element (Score_element_info);
+  virtual bool do_try_music (Music*);
+};
+
+
+bool
+Output_property_engraver::do_try_music (Music* m)
+{
+  if (Output_property * o = dynamic_cast<Output_property*> (m))
+    {
+      props_.push (o);
+      return true;
+    }
+  return false;
+}
+
+void
+Output_property_engraver::acknowledge_element (Score_element_info inf)
+{
+  for (int i=props_.size (); i--; )
+    {
+      Output_property * o = props_[i];
+      SCM pred = gh_car (o->pred_sym_val_list_);
+      /*
+       should typecheck pred. 
+       */
+      SCM result=gh_apply (pred,
+                          gh_list (inf.elem_l_->self_scm_, SCM_UNDEFINED));
+      if (to_boolean (result))
+       {
+         Score_element::ly_set_elt_property (inf.elem_l_->self_scm_,
+                                             gh_cadr (o->pred_sym_val_list_),
+                                             gh_caddr (o->pred_sym_val_list_));
+       }
+    }
+}
+
+void
+Output_property_engraver::do_pre_move_processing ()
+{
+  props_.clear ();
+}
+
+ADD_THIS_TRANSLATOR(Output_property_engraver);
diff --git a/lily/output-property-engraver.hh b/lily/output-property-engraver.hh
new file mode 100644 (file)
index 0000000..ef30fdf
--- /dev/null
@@ -0,0 +1,61 @@
+/*   
+  output-property-engraver.cc --  implement Output_property_engraver
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#include "output-property.hh"
+#include "engraver.hh"
+
+class Output_property_engraver : public Engraver
+{
+public:
+  Output_property_engraver();
+  VIRTUAL_COPY_CONS(Translator);
+protected:
+  
+  Link_array<Output_property> props_;
+
+  virtual void do_acknowledge_element (Score_element_info);
+  virtual bool do_try_music (Music*);
+};
+
+
+Output_property_engraver::do_try_music (Music* m)
+{
+  if (Output_property * o = dynamic_cast<Output_property*> (m))
+    {
+      props_.push (m);
+      return true;
+    }
+  return false;
+}
+
+void
+Output_property_engraver::do_acknowledge_element (Score_element_info i)
+{
+  for (int i=props_.size (); i--; )
+    {
+      Output_property * o = props_[i];
+      SCM pred = gh_car (o->pred_sym_val_list_);
+      /*
+       should typecheck pred. 
+       */
+      SCM result=gh_apply (pred,
+                          gh_listify (i.elem_l_->self_scm_, SCM_UNDEFINED));
+      if (to_boolean (result))
+       {
+         i.elem_l_->set_elt_property (gh_cadr (o->pred_sym_val_list_),
+                                      gh_caddr (o->pred_sym_val_list_));
+       }
+    }
+}
+
+void
+Output_property_engraver::do_pre_move_processing ()
+{
+  props_.clear ();
+}
diff --git a/lily/output-property.cc b/lily/output-property.cc
new file mode 100644 (file)
index 0000000..e8a2d6a
--- /dev/null
@@ -0,0 +1,16 @@
+/*   
+  output-property.cc --  implement Output_property
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+#include "output-property.hh"
+#include "lily-guile.hh"
+
+Output_property::Output_property(SCM pred, SCM sym, SCM val)
+{
+  pred_sym_val_list_ = gh_list (pred, sym, val, SCM_UNDEFINED);
+}
+
index 7b3309513ba3e246dbebc93386da662397fa8f4d..59d61683abfb7193783c009661a21829c732e242 100644 (file)
@@ -122,7 +122,10 @@ Paper_column::column_l () const
 
 Paper_column::Paper_column (Moment w)
 {
-  set_elt_property ("when", (new Moment (w))->smobify_self ());
+  SCM when = (new Moment (w))->smobify_self ();;
+  scm_unprotect_object (when);
+  set_elt_property ("when", when);
+  
   set_axes (X_AXIS, X_AXIS);
 
   line_l_=0;
index 40a4b966fe2a1a605156cbc622485b8aaf966dac..c8dbed177dcba4a0d42a4697f83ed2e736c981b6 100644 (file)
@@ -222,9 +222,6 @@ Paper_outputter::dump_onto (Paper_stream *ps)
          *ps << c;
          free (c);
        }
-      cout << "\nCells in use: " <<  scm_cells_allocated << endl;
-  cout <<    "protects "  << scm_ilength (scm_protects) << endl;
-
   }
 }
 
index a3a54d31f98b16bdee5b305bfb0fdc151f724b15..83669c3717f1f3ab23cdf0b4d0cc468fdd0343dc 100644 (file)
@@ -41,6 +41,7 @@
 #include "mudela-version.hh"
 #include "grace-music.hh"
 #include "auto-change-music.hh"
+#include "output-property.hh"
 
 // mmm
 Mudela_version oldest_version ("1.3.4");
@@ -111,7 +112,6 @@ of the parse stack onto the heap. */
     Translator_group* trans;
     char c;
     int i;
-    int ii[10];
 }
 %{
 
@@ -182,6 +182,7 @@ yylex (YYSTYPE *s,  void * v_l)
 %token SPANREQUEST
 %token COMMANDSPANREQUEST
 %token TEMPO
+%token OUTPUTPROPERTY
 %token TIME_T
 %token TIMES
 %token TRANSLATOR
@@ -558,13 +559,13 @@ paper_def_body:
                if (!gh_symbol_p ($2))
                        THIS->parser_error ("expect a symbol as lvalue");
                else
-                       $$->default_properties_[$2] = $4;
+                       $$->default_properties_.set ($2, $4);
        }
        | paper_def_body SCM_T '=' real semicolon {
                if (!gh_symbol_p ($2))
                        THIS->parser_error ("expect a symbol as lvalue");
                else
-                       $$->default_properties_[$2] = gh_double2scm ($4);
+                       $$->default_properties_.set ($2, gh_double2scm ($4));
        }
        | paper_def_body translator_spec_block {
                $$->assign_translator ($2);
@@ -742,6 +743,20 @@ Simultaneous_music:
 
 Simple_music:
        request_chord           { $$ = $1; }
+       | OUTPUTPROPERTY embedded_scm embedded_scm '=' embedded_scm     {
+               SCM pred = $2;
+               if (!gh_symbol_p ($3))
+               {
+                       THIS->parser_error (_("Second argument must be a symbol")); 
+               }
+               /*hould check # args */
+               if (!gh_procedure_p (pred))
+               {
+                       THIS->parser_error (_("First argument must be a procedure taking 1 argument"));
+               }
+       
+               $$ = new Output_property (pred,$3, $5);
+       }
        | MUSIC_IDENTIFIER { $$ = $1->access_content_Music (true); }
        | property_def
        | translator_change
index 94d5e90dcc1e7b8c146e2b3139cdae6bc57b93d5..6cefe8b5b5cf166e9c76199b34efa1640ef7fb86 100644 (file)
@@ -1,5 +1,5 @@
 /*   
-  request-iterator.cc --  implement 
+  request-iterator.cc --  implement Simple_music_iterator
   
   source file of the GNU LilyPond music typesetter
   
@@ -9,19 +9,15 @@
 #include "request-iterator.hh"
 #include "music.hh"
 
-Request_iterator::Request_iterator()
-{
-}
-
 
 void
-Request_iterator::do_process_and_next (Moment m)
+Simple_music_iterator::do_process_and_next (Moment m)
 {
   if (first_b_)
     {
       bool g= try_music (music_l_);
       if (!g)
-       music_l_->warning (_f ("Junking request: `%s'", classname(music_l_)));
+       music_l_->warning (_f ("Junking music: `%s'", classname(music_l_)));
 
       first_b_ = false;
     }
index ca0920fd42de2141a0c3edd6be15f970c9b61dee..e864d60875993f4168232cf5fcdff9e931211c20 100644 (file)
@@ -65,7 +65,7 @@ Scheme_hash_table::print_smob (SCM s, SCM p, scm_print_state*)
 {
   assert (SMOB_IS_TYPE_B (Scheme_hash_table, s));
   char str[1000];
-  sprintf (str, "#<Scheme_hash_table 0x%0ulx ", s);
+  sprintf (str, "#<Scheme_hash_table 0x%0x ", s);
   scm_puts (str, p);      
   Scheme_hash_table *me = SMOB_TO_TYPE(Scheme_hash_table,s);
   for (Hash_table_iter<SCM,SCM> i (*me); i.ok(); i++)
@@ -88,9 +88,9 @@ Scheme_hash_table::set (SCM k, SCM v)
 }
 
 SCM
-Scheme_hash_table::get (SCM k)
+Scheme_hash_table::get (SCM k)const
 {
-  return elem (k);
+  return const_elem (k);
 }
 
 
index 5a46ce458ce35dd74b3f461f59a4921aea292987..cfa1bfd569d5dae824d8287882ca46f9af6ccfee 100644 (file)
@@ -51,6 +51,7 @@ Score_element::Score_element()
 
 
   set_elt_property ("dependencies", SCM_EOL);
+  set_elt_property ("interfaces", SCM_EOL);
 }
 
 SCM ly_deep_copy (SCM);
@@ -651,3 +652,62 @@ Score_element::equal_p (SCM a, SCM b)
 {
   return gh_cdr(a) == gh_cdr(b) ? SCM_BOOL_T : SCM_BOOL_F;
 }
+
+
+SCM
+Score_element::ly_set_elt_property (SCM elt, SCM sym, SCM val)
+{
+  Score_element * sc = unsmob_element (elt);
+
+  if (!gh_symbol_p (sym))
+    {
+      error ("Not a symbol");
+      ly_display_scm (sym);
+      return SCM_UNDEFINED;
+    }
+
+  if (sc)
+    {
+      sc->element_property_alist_ = scm_assoc_set_x (sc->element_property_alist_, sym, val);
+    }
+  else
+    {
+      error ("Not a score element");
+      ly_display_scm (elt);
+    }
+
+  return SCM_UNDEFINED;
+}
+
+
+SCM
+Score_element::ly_get_elt_property (SCM elt, SCM sym)
+{
+  Score_element * sc = unsmob_element (elt);
+  
+  if (sc)
+    {
+      SCM s = scm_assq(sym, sc->element_property_alist_);
+
+      if (s != SCM_BOOL_F)
+       return gh_cdr (s); 
+      else
+       return SCM_UNDEFINED;
+    }
+  else
+    {
+      error ("Not a score element");
+      ly_display_scm (elt);
+    }
+  return SCM_UNDEFINED;
+}
+
+
+static void
+init_functions ()
+{
+  scm_make_gsubr ("ly-get-elt-property", 2, 0, 0, (SCM(*)(...))Score_element::ly_get_elt_property);
+  scm_make_gsubr ("ly-set-elt-property", 3, 0, 0, (SCM(*)(...))Score_element::ly_set_elt_property);
+}
+
+ADD_SCM_INIT_FUNC(scoreelt, init_functions);
diff --git a/lily/score-element.cc.orig b/lily/score-element.cc.orig
deleted file mode 100644 (file)
index 42a7d08..0000000
+++ /dev/null
@@ -1,649 +0,0 @@
-/*
-  score-elem.cc -- implement Score_element
-
-  source file of the GNU LilyPond music typesetter
-
-  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#include <string.h>
-
-#include "group-interface.hh"
-#include "misc.hh"
-#include "paper-score.hh"
-#include "paper-def.hh"
-#include "lookup.hh"
-#include "molecule.hh"
-#include "score-element.hh"
-#include "debug.hh"
-#include "spanner.hh"
-#include "line-of-score.hh"
-#include "item.hh"
-#include "paper-column.hh"
-#include "molecule.hh"
-#include "misc.hh"
-#include "paper-outputter.hh"
-#include "dimension-cache.hh"
-#include "side-position-interface.hh"
-#include "item.hh"
-
-Score_element::Score_element()
-{
-  output_p_ =0;
-  dim_cache_[X_AXIS] = new Dimension_cache;
-  dim_cache_[Y_AXIS] = new Dimension_cache;
-  dim_cache_[X_AXIS]->elt_l_ = dim_cache_[Y_AXIS]->elt_l_ = this;
-  
-  used_b_ = false;
-
-  dim_cache_[X_AXIS]->set_callback (molecule_extent);
-  dim_cache_[Y_AXIS]->set_callback (molecule_extent); 
-  used_b_ = false;
-  pscore_l_=0;
-  lookup_l_ =0;
-  status_i_ = 0;
-  self_scm_ = SCM_EOL;
-  original_l_ = 0;
-  element_property_alist_ = SCM_EOL;
-
-  smobify_self ();
-
-
-  set_elt_property ("dependencies", SCM_EOL);
-}
-
-SCM ly_deep_copy (SCM);
-
-SCM
-ly_deep_copy (SCM l)
-{
-  if (gh_pair_p (l))
-    {
-      return gh_cons (ly_deep_copy (gh_car (l)), ly_deep_copy (gh_cdr (l)));
-    }
-  else
-    return l;
-}
-
-
-Score_element::Score_element (Score_element const&s)
-{
-  dim_cache_[X_AXIS] = new Dimension_cache (*s.dim_cache_[X_AXIS]);
-  dim_cache_[Y_AXIS] = new Dimension_cache (*s.dim_cache_[Y_AXIS]);
-  dim_cache_[X_AXIS]->elt_l_ = dim_cache_[Y_AXIS]->elt_l_ = this;
-  
-  self_scm_ = SCM_EOL;
-  used_b_ = true;
-  original_l_ =(Score_element*) &s;
-
-  /*
-    should protect because smobify_self () might trigger GC.
-   */
-  SCM onstack = ly_deep_copy (s.element_property_alist_);
-  element_property_alist_ = onstack;
-
-  output_p_ =0;
-  status_i_ = s.status_i_;
-  lookup_l_ = s.lookup_l_;
-  pscore_l_ = s.pscore_l_;
-
-  smobify_self ();
-}
-
-Score_element::~Score_element()
-{
-  assert (!output_p_);
-  assert (status_i_ >=0);
-  status_i_  = -1;
-
-  delete dim_cache_[X_AXIS];
-  delete dim_cache_[Y_AXIS];  
-}
-
-
-Real
-Score_element::get_real (String s) const
-{
-  return gh_scm2double (get_elt_property (s));
-}
-
-void
-Score_element::set_real (String s, Real r)
-{
-  set_elt_property (s, gh_double2scm (r));
-}
-
-// should also have one that takes SCM arg. 
-SCM
-Score_element::get_elt_property (String nm) const
-{
-  SCM sym =  ly_symbol2scm (nm.ch_C());
-  SCM s = scm_assq(sym, element_property_alist_);
-
-  if (s != SCM_BOOL_F)
-    return gh_cdr (s); 
-  
-  if (pscore_l_)
-    {
-      SCM sym2 = ly_symbol2scm ((name () + ("::" + nm)).ch_C());
-      SCM val;
-      
-      // should probably check for Type::sym as well.
-      Paper_def * p= pscore_l_->paper_l_;
-      if (p->default_properties_.try_retrieve (sym2, &val))
-       return val;
-      else if (p->default_properties_.try_retrieve (sym, &val))
-       return val;
-    }
-  
-  return SCM_UNDEFINED;
-}
-
-SCM
-Score_element::remove_elt_property (String key)
-{
-  SCM s = get_elt_property (key); 
-  SCM sym = ly_symbol2scm (key.ch_C());
-  element_property_alist_ =  scm_assq_remove_x (element_property_alist_, sym);
-  return s;
-}
-
-/*
-  UGH. assoc vs. assq
- */
-void
-Score_element::set_elt_property (String k, SCM v)
-{
-  SCM s = ly_symbol2scm (k.ch_C( ));
-  element_property_alist_ = scm_assoc_set_x (element_property_alist_, s, v);
-}
-
-Interval
-Score_element::molecule_extent(Dimension_cache const *c)
-{
-  Score_element *s = dynamic_cast<Score_element*>(c->element_l());
-  Molecule*m = s->do_brew_molecule_p();
-  return  m->extent()[c->axis ()];
-}
-
-
-void
-Score_element::print() const
-{
-#ifndef NPRINT
-  DEBUG_OUT << classname(this) << "{\n";
-    
-  if (flower_dstream && !flower_dstream->silent_b ("Score_element"))
-    ly_display_scm (element_property_alist_);
-
-  if (original_l_)
-    DEBUG_OUT << "Copy ";
-  do_print();
-  
-  DEBUG_OUT <<  "}\n";
-#endif
-}
-
-Paper_def*
-Score_element::paper_l ()  const
-{
- return pscore_l_ ? pscore_l_->paper_l_ : 0;
-}
-
-Lookup const *
-Score_element::lookup_l () const
-{
-  if (!lookup_l_)
-    {
-      Score_element * urg = (Score_element*)this;
-      SCM sz = urg->remove_elt_property ("fontsize");
-      int i = (gh_number_p (sz))
-       ? gh_scm2int  (sz)
-       : 0;
-
-      urg->lookup_l_ =  (Lookup*)pscore_l_->paper_l_->lookup_l (i);
-    }
-  return lookup_l_;
-}
-
-void
-Score_element::add_processing()
-{
-  assert (status_i_ >=0);
-  if (status_i_)
-    return;
-  status_i_ ++;
-
-#if 0
-    /*
-    UGH. UGH. UGH.
-   */
-  if (get_elt_property ("self-alignment-X") != SCM_UNDEFINED
-      && !dim_cache_[X_AXIS]->off_callback_l_)
-    {
-      dim_cache_[X_AXIS]->off_callbacks_.push (Side_position_interface::aligned_on_self);
-    }
-  
-  if (get_elt_property ("self-alignment-Y") != SCM_UNDEFINED
-      && !dim_cache_[X_AXIS]->off_callback_l_)
-      
-    {
-      dim_cache_[Y_AXIS]->set_offset_callback (Side_position_interface::aligned_on_self);
-    }
-#endif
-  
-  do_add_processing();
-}
-
-void
-Score_element::calculate_dependencies (int final, int busy,
-                                      Score_element_method_pointer funcptr)
-{
-  assert (status_i_ >=0);
-
-  if (status_i_ >= final)
-    return;
-
-  assert (status_i_!= busy);
-  status_i_= busy;
-
-  Link_array<Score_element> dependency_arr =
-    Group_interface__extract_elements (this, (Score_element*)0, "dependencies");
-  
-  for (int i=0; i < dependency_arr.size(); i++)
-    dependency_arr[i]->calculate_dependencies (final, busy, funcptr);
-
-  Link_array<Score_element> extra (get_extra_dependencies());
-  for (int i=0; i < extra.size(); i++)
-    extra[i]->calculate_dependencies (final, busy, funcptr);
-  
-  (this->*funcptr)();
-  status_i_= final;
-}
-
-void
-Score_element::output_processing () 
-{
-  if (to_boolean  (get_elt_property ("transparent")))
-    return;
-
-  // we're being silly here. 
-  if (output_p_)
-    delete output_p_;
-  
-  output_p_ = do_brew_molecule_p ();
-  Offset o (relative_coordinate (0, X_AXIS), relative_coordinate (0, Y_AXIS));
-
-  SCM s = get_elt_property ("extra-offset");
-  if (gh_pair_p (s))
-    {
-      Real il = paper_l ()->get_var ("interline");
-      o[X_AXIS] += il * gh_scm2double (gh_car (s));
-      o[Y_AXIS] += il * gh_scm2double (gh_cdr (s));      
-    }
-  
-  pscore_l_->outputter_l_->output_molecule (output_p_,
-                                           o,
-                                           classname(this));
-
-  delete output_p_;
-  output_p_ =0;
-}
-
-/*
-  
-  VIRTUAL STUBS
-
- */
-void
-Score_element::do_break_processing()
-{
-}
-
-void
-Score_element::do_post_processing()
-{
-}
-
-void
-Score_element::do_breakable_col_processing()
-{
-  handle_prebroken_dependencies();
-}
-
-void
-Score_element::do_pre_processing()
-{
-}
-
-void
-Score_element::do_space_processing ()
-{
-}
-
-void
-Score_element::do_add_processing()
-{
-}
-
-
-
-Molecule*
-Score_element::do_brew_molecule_p() const
-{
-  SCM glyph = get_elt_property ("glyph");
-  if (gh_string_p (glyph))
-    {
-      Molecule*output = new Molecule (lookup_l ()->afm_find (String (ly_scm2string (glyph))));
-      
-      return output;
-    }
-  else
-    {
-      Interval emp;
-      emp.set_empty ();
-      Molecule a (lookup_l ()->fill (Box (emp,emp)));
-      return new Molecule (a);
-    }
-}
-
-
-Line_of_score *
-Score_element::line_l() const
-{
-  return 0;
-}
-
-void
-Score_element::add_dependency (Score_element*e)
-{
-  if (e)
-    {
-      Group_interface gi (this, "dependencies");
-      gi.add_element (e);
-    }
-  else
-    programming_error ("Null dependency added");
-}
-
-
-
-
-/**
-      Do break substitution in S, using CRITERION. Return new value.
-         CRITERION is either a SMOB pointer to the desired line, or a number
-        representing the break direction.  */
-SCM
-Score_element::handle_broken_smobs (SCM s, SCM criterion)
-{
- again:
-
-  
-  Score_element *sc = unsmob_element ( s);
-  if (sc)
-    {
-      if (criterion == SCM_UNDEFINED)
-       return SCM_UNDEFINED;
-      else if (gh_number_p (criterion))
-       {
-         Item * i = dynamic_cast<Item*> (sc);
-         Direction d = to_dir (criterion);
-         if (i && i->break_status_dir () != d)
-           {
-             Item *br = i->find_broken_piece (d);
-             return  (br) ? br->self_scm_ : SCM_UNDEFINED;
-           }
-       }
-      else
-       {
-         Score_element * ln = unsmob_element ( criterion);
-         Line_of_score * line = dynamic_cast<Line_of_score*> (ln);
-         Score_element * br =0;
-         Line_of_score * dep_line = sc->line_l ();
-         if (dep_line != line)
-           {
-             br = sc->find_broken_piece (line);
-             return  (br) ?  br->self_scm_ : SCM_UNDEFINED;
-           }
-         if (!dep_line)
-           return SCM_UNDEFINED;
-       }
-    }
-  else if (gh_pair_p (s))
-    {
-      /*
-       UGH! breaks on circular lists.
-      */
-      SCM car = handle_broken_smobs (gh_car (s), criterion);
-      SCM cdr = gh_cdr (s);
-      
-      if (car == SCM_UNDEFINED
-         && (gh_pair_p (cdr) || cdr == SCM_EOL))
-       {
-         /*
-           This is tail-recursion, ie. 
-           
-           return handle_broken_smobs (cdr, criterion);
-
-           We don't want to rely on the compiler to do this.  */
-         s =  cdr;     
-         goto again;
-       }
-
-      gh_set_car_x (s, car);
-      gh_set_cdr_x (s, handle_broken_smobs (cdr, criterion));
-      return s;
-    }
-  return s;
-}
-
-void
-Score_element::handle_broken_dependencies()
-{
-  Line_of_score *line  = line_l();
-  element_property_alist_ = handle_broken_smobs (element_property_alist_,
-                                                line ? line->self_scm_ : SCM_UNDEFINED);
-
-  if (!line)
-    return;
-}
-
-
-/*
-  TODO: cleanify.
- */
-void
-Score_element::handle_prebroken_dependencies()
-{
-  if (Item*i =dynamic_cast<Item*> (this))
-    {
-      element_property_alist_
-       = handle_broken_smobs (element_property_alist_,
-                              gh_int2scm (i->break_status_dir ()));
-    }
-}
-
-
-
-
-
-Link_array<Score_element>
-Score_element::get_extra_dependencies() const
-{
-  Link_array<Score_element> empty;
-  return empty;
-}
-
-bool
-Score_element::linked_b() const
-{
-  return used_b_;
-}
-
-void
-Score_element::do_print () const
-{
-}
-
-Score_element*
-Score_element::find_broken_piece (Line_of_score*) const
-{
-  return 0;
-}
-
-
-
-void
-Score_element::translate_axis (Real y, Axis a)
-{
-  dim_cache_[a]->translate (y);
-}  
-
-Real
-Score_element::relative_coordinate (Score_element const*e, Axis a) const
-{
-  return dim_cache_[a]->relative_coordinate (e ? e->dim_cache_[a] : 0);
-}
-
-Score_element * 
-Score_element::common_refpoint (Score_element const* s, Axis a) const
-{
-  Dimension_cache *dim = dim_cache_[a]->common_refpoint (s->dim_cache_[a]);
-  return  dim ? dim->element_l () : 0;
-}
-
-void
-Score_element::set_empty (Axis a)
-{
-  dim_cache_[a]->callback_l_ =0;
-}
-
-bool
-Score_element::empty_b (Axis a)const
-{
-  return !dim_cache_[a]->callback_l_;
-}
-
-Interval
-Score_element::extent (Axis a) const
-{
-  Dimension_cache const * d = dim_cache_[a];
-
-  return d->get_dim ();
-}
-
-
-Score_element*
-Score_element::parent_l (Axis a) const
-{
-  Dimension_cache*d= dim_cache_[a]->parent_l_;
-  return d ? d->elt_l_ : 0;
-}
-
-Score_element *
-Score_element::common_refpoint (Link_array<Score_element> gs, Axis a) const
-{
-  Dimension_cache * common = dim_cache_[a];
-  for (int i=0; i < gs.size (); i++)
-    {
-      common = common->common_refpoint (gs[i]->dim_cache_[a]);
-    }
-
-  return common->element_l ();
-}
-
-char const *
-Score_element::name () const
-{
-  return classname (this);
-}
-
-
-void
-Score_element::set_parent (Score_element *g, Axis a)
-{
-  dim_cache_[a]->parent_l_ = g ? g->dim_cache_[a]: 0;
-}
-
-void
-Score_element::fixup_refpoint ()
-{
-  for (int a = X_AXIS; a < NO_AXES; a ++)
-    {
-      Axis ax = (Axis)a;
-      Score_element * par = parent_l (ax);
-
-      if (!par)
-       continue;
-      
-      if (par->line_l () != line_l ())
-       {
-         Score_element * newpar = par->find_broken_piece (line_l ());
-         set_parent (newpar, ax);
-       }
-
-      if (Item * i  = dynamic_cast<Item*> (this))
-       {
-         Item *pari = dynamic_cast<Item*> (par);
-
-         if (pari && i)
-           {
-             Direction  my_dir = i->break_status_dir () ;
-             if (my_dir!= pari->break_status_dir())
-               {
-                 Item *newpar =  pari->find_broken_piece (my_dir);
-                 set_parent (newpar, ax);
-               }
-           }
-       }
-    }
-}
-
-
-
-/****************************************************
-  SMOB funcs
- ****************************************************/
-
-
-#include "ly-smobs.icc"
-
-IMPLEMENT_SMOBS(Score_element);
-IMPLEMENT_UNSMOB(Score_element, element);
-SCM
-Score_element::mark_smob (SCM ses)
-{
-  Score_element * s = SMOB_TO_TYPE (Score_element, ses);
-  if (s->self_scm_ != ses)
-    {
-      programming_error ("SMOB marking gone awry");
-      return SCM_EOL;
-    }
-  return s->element_property_alist_;
-}
-
-int
-Score_element::print_smob (SCM s, SCM port, scm_print_state *)
-{
-  Score_element *sc = (Score_element *) gh_cdr (s);
-     
-  scm_puts ("#<Score_element ", port);
-  scm_puts ((char *)sc->name (), port);
-
-  // scm_puts (" properties = ", port);
-  // scm_display (sc->element_property_alist_, port);
-  scm_puts (" >", port);
-  return 1;
-}
-
-void
-Score_element::do_smobify_self ()
-{
-}
-
-SCM
-Score_element::equal_p (SCM a, SCM b)
-{
-  return gh_cdr(a) == gh_cdr(b) ? SCM_BOOL_T : SCM_BOOL_F;
-}
index 8b9c53e05f5026892150d16c58e482a3a6906e3b..ed74043951ade9dc3910b25d933193ee158543e3 100644 (file)
@@ -176,21 +176,23 @@ Score_engraver::set_columns (Paper_column *new_command_l,
 
   for (int i=00; i< 2; i++) 
     {
-      if (*current[i] && (*current[i])->linked_b()) 
+      if (*current[i])
        {
-         pscore_p_->add_column ((*current[i]));
-         scoreline_l_->add_column ((*current[i]));
-       }
-      else
-       {
-         *current[i]  =0;
-         
-         /*
-           We're forgetting about this column. Dump it, and make SCM
-           forget it.
-
-           (UGH.)  */
-         scm_unprotect_object ((*current[i])->self_scm_);
+         if ((*current[i])->linked_b()) 
+           {
+             pscore_p_->add_column ((*current[i]));
+             scoreline_l_->add_column ((*current[i]));
+           }
+         else
+           {
+             /*
+               We're forgetting about this column. Dump it, and make SCM
+               forget it.
+
+               (UGH.)  */
+             scm_unprotect_object ((*current[i])->self_scm_);
+             *current[i]  =0;
+           }
        }
       if (news[i])
        *current[i] = news[i];
index af396f13afe9aafaf6110a8bbbbf6940161724e8..da9c2d1da155c0fe206f45f8154f4319c1c35d34 100644 (file)
@@ -52,9 +52,6 @@ void
 Score::run_translator (Music_output_def *odef_l)
 {
   Cpu_timer timer;
-  scm_gc();
-  cout << "\nCells in use: " <<  scm_cells_allocated << endl;
-  cout <<    "protects: " << scm_ilength (scm_protects) << endl;
 
   
   Global_translator * trans_p = odef_l->get_global_translator_p();
@@ -102,11 +99,12 @@ Score::run_translator (Music_output_def *odef_l)
   output->process();
   delete output ;
 
-  // force GC
+  /*
+    force GC. At this point, GUILE may give back mallocated area to
+    the system.
+  */
+    
   scm_gc();
-  cout << "\nCells in use: " <<  scm_cells_allocated <<endl;
-  cout <<    "protects " << scm_ilength (scm_protects) << endl;
-
 }
 
 void
index 9cd4ab1d2de4ae343d8d2adda850692be87e5248..57a01433b34d18285a87529d7740bfda176b38a4 100644 (file)
@@ -73,9 +73,13 @@ Slur::do_add_processing ()
 {
   Link_array<Note_column> encompass_arr =
     Group_interface__extract_elements (this, (Note_column*)0, "note-columns");
-  set_bounds (LEFT, encompass_arr[0]);    
-  if (encompass_arr.size () > 1)
-    set_bounds (RIGHT, encompass_arr.top ());
+
+  if (encompass_arr.size ())
+    {
+      set_bounds (LEFT, encompass_arr[0]);    
+      if (encompass_arr.size () > 1)
+       set_bounds (RIGHT, encompass_arr.top ());
+    }
 }
 
 
index 8f4672537e35faa4c2b16b9431e8cea1f96cb1de..7f3ac132fce5c00f41ab4c8cda00e155f739f34a 100644 (file)
@@ -97,11 +97,14 @@ Spacing_engraver::do_pre_move_processing ()
   Paper_column * sc
     = dynamic_cast<Paper_column*> (get_staff_info ().musical_pcol_l ());
 
-  sc->set_elt_property ("shortest-playing-duration",
-                       (new Moment (shortest_playing))->smobify_self ());
+  SCM sh = (new Moment (shortest_playing))->smobify_self ();
+  SCM st = (new Moment (starter))->smobify_self ();
+
+  scm_unprotect_object (st);
+  scm_unprotect_object (sh);
   
-  sc->set_elt_property ("shortest-starter-duration",
-                       (new Moment (starter))->smobify_self ());
+  sc->set_elt_property ("shortest-playing-duration", sh);  
+  sc->set_elt_property ("shortest-starter-duration", st);
 }
 
 void
index d08cee919edb108f27a0c9188636c166754fd9d6..64522e734f59e6371b1c486acf3b2b132be39445 100644 (file)
@@ -55,7 +55,7 @@ Staff_symbol_referencer_interface::staff_space () const
   if (st)
     return st->staff_space ();
   else if (elt_l_->pscore_l_ && elt_l_->paper_l ())
-    elt_l_->paper_l ()->get_var ("interline");
+    return elt_l_->paper_l ()->get_var ("interline");
  
   return 0.0;
 }
index 5604407d63fde49d1b69bfe6dcc74b4377fe8ae5..177cbb8d53a72912091703e5e85b4cd10b14c0c1 100644 (file)
@@ -5,7 +5,7 @@
 StaffContext=\translator {
        \type "Engraver_group_engraver";
        \name Staff ;
-       
+       \consists "Output_property_engraver";   
        barAuto = ##t
        voltaVisibility = ##t
        Generic_property_list = #generic-staff-properties
@@ -92,7 +92,8 @@ RhythmicStaffContext=\translator{
        \type "Engraver_group_engraver";
        numberOfStaffLines  = #1
        \consists "Property_engraver";
-       
+       \consists "Output_property_engraver";   
+
        Generic_property_list = #generic-staff-properties
        
        barSize = #'staff-height
@@ -113,6 +114,7 @@ VoiceContext = \translator {
        \type "Engraver_group_engraver";
        dynamicPadding = #5.0
        Generic_property_list = #generic-voice-properties
+       \consists "Output_property_engraver";   
 
        \consists "Dynamic_engraver";   % must come before text_engraver.
        \name Voice ;
@@ -145,6 +147,7 @@ VoiceContext = \translator {
 GraceContext=\translator {
        \type "Grace_engraver_group";
        \name "Grace";
+       \consists "Output_property_engraver";   
 
        Generic_property_list = #generic-grace-properties
        
@@ -179,6 +182,7 @@ GraceContext=\translator {
 ThreadContext = \translator{
        \type Engraver_group_engraver;
        \consists "Note_heads_engraver" ;
+       \consists "Output_property_engraver";   
        Generic_property_list = #generic-thread-properties
        \consists "Property_engraver";
        \name Thread;
@@ -211,6 +215,7 @@ PianoStaffContext = \translator{\GrandStaffContext
 StaffGroupContext= \translator {
        \type "Engraver_group_engraver";
        \consists "Span_bar_engraver";
+       \consists "Output_property_engraver";   
        
        \consists "Staff_group_bar_engraver";
        \name StaffGroup;
@@ -251,6 +256,7 @@ LyricsContext = \translator {
 
 \translator{
        \type "Engraver_group_engraver";
+       \consists "Output_property_engraver";   
 
        \consistsend "Axis_group_engraver";
        \name ChordNameVoice ;
@@ -311,6 +317,7 @@ ScoreContext = \translator {
        \name Score;
 
        \consists "Timing_engraver";
+       \consists "Output_property_engraver";   
 
        \consists "Span_score_bar_engraver";
 %      \consists "Score_priority_engraver";
index 51583cc76406f85ced8abc749191d76fd5f2a7dd..568d4527b90f49de4a46651ad78808ca86442660 100644 (file)
@@ -1,15 +1,15 @@
 Begin3
 Title: LilyPond
-Version: 1.3.26
-Entered-date: 23FEB00
+Version: 1.3.27
+Entered-date: 24FEB00
 Description: 
 Keywords: music notation typesetting midi fonts engraving
 Author: hanwen@cs.uu.nl (Han-Wen Nienhuys)
        janneke@gnu.org (Jan Nieuwenhuizen)
 Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
 Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
-       1000k lilypond-1.3.26.tar.gz 
+       1000k lilypond-1.3.27.tar.gz 
 Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
-       1000k lilypond-1.3.26.tar.gz 
+       1000k lilypond-1.3.27.tar.gz 
 Copying-policy: GPL
 End
index 2d6bb4ef299182c25044fdb1f57c7903fd09b246..06fa453754e28c3febf3a4406b03fb349a6feebf 100644 (file)
@@ -1,9 +1,9 @@
 Name: lilypond
-Version: 1.3.26
+Version: 1.3.27
 Release: 1
 Copyright: GPL
 Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.26.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.27.tar.gz
 Summary: A program for printing sheet music.
 URL: http://www.cs.uu.nl/~hanwen/lilypond
 # get Packager from (undocumented?) ~/.rpmmacros!
index 2ac7cdecbedf50199a838555fade12b804704f8a..7694cc3a18e3679441f275bb09692c01ab5df92b 100644 (file)
@@ -62,6 +62,7 @@ fet_beginchar("accStdbase", "accStdbase", "accStdbase")
        currentpicture := currentpicture shifted (0, r);
 fet_endchar;
 
+%%% strange turning path.
 fet_beginchar("accBayanbase", "accBayanbase", "accBayanbase")
        save lh;
        lh = accreg_lh;
@@ -143,6 +144,7 @@ def def_some_vars =
        cTwo = 0.60;
 enddef;
 
+%%% strange turning path.
 fet_beginchar("accSB", "accSB", "accSB")
        set_char_box(.4staffsize#, .4staffsize#, 0, 2.4staff_space#);
        def_some_vars;
@@ -172,6 +174,7 @@ fet_beginchar("accSB", "accSB", "accSB")
        currentpicture := currentpicture shifted (0, 2.4staff_space);
 fet_endchar;
 
+%%% strange turning path.
 fet_beginchar("accBB", "accBB", "accBB")
        set_char_box(.4staffsize#, .4staffsize#, 0, 2.4staff_space#);
        def_some_vars;
@@ -196,6 +199,7 @@ fet_beginchar("accBB", "accBB", "accBB")
 fet_endchar;
 
 
+%%% strange turning path.
 fet_beginchar("accOldEE", "accOldEE", "accOldEE")
        set_char_box(staff_space#, staff_space#, 0, 2staff_space#);
        show w;
index a57d0e9e081e97cad323e2ee79ac7f2c2489a0fd..b6ea62e1df2dc049d3cb04cef482195e7b286f93 100644 (file)
                (font-load-command (car x) (cdr x))) font-name-alist)
   ))
   
+;;;;;;;;;;;;;;;;;;;;
 
+
+; Make a function that checks score element for being of a specific type. 
+(define (make-type-checker name)
+  (lambda (elt)
+    (not (not (memq name (ly-get-elt-property elt 'interfaces))))))
+
+       
+
+
+
+
+
+
+
+
+
+
+
+;;;;;;;;;;;;;;;;;;; TeX output
 (define (tex-scm action-name)
   (define (unknown) 
     "%\n\\unknown%\n")
index e9a09c595915f956acc3bd0aa71d7963ba1cae73..6c27cae35ff88abd31817e386450d1ba22bb40f9 100644 (file)
@@ -341,7 +341,7 @@ class TeXOutput:
         this.write(r"""
 %% \vfill\hfill{\mudelatagline}
 \makeatletter
-\renewcommand{\@oddfoot}{\thefooter\hfill{\mudelatagline}}%
+\renewcommand{\@oddfoot}{\mudelatagline}%
 \makeatother
 \end{document}
 """)