From: Han-Wen Nienhuys Date: Sat, 29 Sep 2001 11:09:44 +0000 (+0200) Subject: release: 1.5.14 X-Git-Tag: release/1.5.14 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=635827994d372f4bd0e9c719238380337bae9477;p=lilypond.git release: 1.5.14 =========== * Bugfix: revert font-relative-size for grace Accidentals * Bugfix: hara kiri'd piano staffs doesn't take space anymore. * Bugfix: reinstate rest-collisions. * Bugfix: key items have the c0 position again. * Make \property Voice.GrobName = \turnOff work again. * More intelligent symbol-cache, in less code. Turned off by default, doesn't work with -O2 yet. * Documentation fixes: change documentation of Moment and make-moment, add Translator::{name,description} * Junk STL implementation of Scheme_hash_table in favor of GUILE hashtables with automatic resizing. 1.5.12.j --- diff --git a/CHANGES b/CHANGES index d6cbd881b6..260e05ce78 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,26 @@ +1.5.13.hwn2 +=========== + +* Bugfix: revert font-relative-size for grace Accidentals + +* Bugfix: hara kiri'd piano staffs doesn't take space anymore. + +* Bugfix: reinstate rest-collisions. + +* Bugfix: key items have the c0 position again. + +* Make \property Voice.GrobName = \turnOff work again. + +* More intelligent symbol-cache, in less code. Turned off by default, doesn't +work with -O2 yet. + +* Documentation fixes: change documentation of Moment and make-moment, +add Translator::{name,description} + +* Junk STL implementation of Scheme_hash_table in favor of GUILE +hashtables with automatic resizing. + + 1.5.12.jcn2 =========== diff --git a/Documentation/user/GNUmakefile b/Documentation/user/GNUmakefile index 85afa59a41..6d9035e8ab 100644 --- a/Documentation/user/GNUmakefile +++ b/Documentation/user/GNUmakefile @@ -24,7 +24,7 @@ LOCALSTEPMAKE_TEMPLATES=lilypond ly # Hmm, what about? # local-dist: check-info -info: check-info +info: # check-info # -> reinstate when actively hacking doco. include $(depth)/make/stepmake.make diff --git a/Documentation/user/internals.itely b/Documentation/user/internals.itely index 030961124e..51fc93f048 100644 --- a/Documentation/user/internals.itely +++ b/Documentation/user/internals.itely @@ -115,15 +115,17 @@ Type predicate, return true if @var{obj} is an input location. @node Moment @section Moment -Moment is a rational number. Since GUILE doesn't support them natively, -so we created our own rational data type. +Moment is a point in musical time. It is consists of a pair of +rationals (@var{m},@var{g}), where @var{m} is the timing for the main +notes, and @var{g} the timing for grace notes. In absence of grace +notes, @var{g} is zero. @defun moment? obj Type predicate, return true if @var{obj} is a moment. @end defun @defun make-moment num den -create the rational number @var{num}/@var{den}. +create the rational number with main timing @var{num}/@var{den}. @end defun @node Duration @@ -236,6 +238,13 @@ retrieve the value of @var{sym} from context @var{tr} set value of property @var{sym} in context @var{tr} to @var{val}. @end defun +@defun Translator::name tr +Return the type name of the translator @var{tr}. +@end defun + +@defun Translator::description tr +Return an alist of properties of translator @var{tr}. +@end defun @node Grobs @section Grobs diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 10a69dcbfc..e9ba808c3c 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -1004,7 +1004,6 @@ beams) can be tweaked through grob-properties @code{height} and span. Both are measured in half staff-spaces, @code{staff-position=0} corresponds to the middle staff line. - Set @code{height} to zero, to get horizontal beams: @lilypond[fragment,relative,verbatim] @@ -1021,7 +1020,9 @@ horizontal, falls two staff spaces: \property Voice.Beam \set #'height = #-4 [c8 c] @end lilypond -@cindex @code{default-neutral-direction} + +@c TODO -> why this ref? Document? +@cindex @code{neutral-direction} @node Expressive marks @section Expressive marks diff --git a/VERSION b/VERSION index 9872a2184a..b236aa99dc 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=5 -PATCH_LEVEL=13 +PATCH_LEVEL=14 MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a diff --git a/input/regression/hara-kiri-pianostaff.ly b/input/regression/hara-kiri-pianostaff.ly new file mode 100644 index 0000000000..786e49f9d8 --- /dev/null +++ b/input/regression/hara-kiri-pianostaff.ly @@ -0,0 +1,18 @@ +\header { +texidoc = "Hara kiri should not upset fixed distance alignment like in pianostaff. In this example the middle staff is harakiried." +} + + +\score { \notes \transpose c''' + \context PianoStaff < + \context Staff = up { c c c c \break } + \context Staff = mid { s1 \break } + \context Staff = down { c4 c c c \break } + > + \paper { + \translator { + \HaraKiriStaffContext + } + } +} + diff --git a/input/regression/stem-direction-down.ly b/input/regression/stem-direction-down.ly index 857dea910d..74ecc47b3a 100644 --- a/input/regression/stem-direction-down.ly +++ b/input/regression/stem-direction-down.ly @@ -8,7 +8,7 @@ texidoc="Similarly, if @code{'neutral-direction} is set to @code{-1}. " \score{ \notes\relative c{ - \property Voice.Stem \override #'default-neutral-direction = #-1 + \property Voice.Stem \override #'neutral-direction = #-1 b''4 ~ b8()b8 e4 e, } diff --git a/input/test/beam-neutral-direction.ly b/input/test/beam-neutral-direction.ly index 2e41028339..422b54bc66 100644 --- a/input/test/beam-neutral-direction.ly +++ b/input/test/beam-neutral-direction.ly @@ -3,7 +3,7 @@ fragment = \notes { [b''8 b] - \property Voice.Beam \set #'default-neutral-direction = #-1 + \property Voice.Beam \set #'neutral-direction = #-1 [b b] } diff --git a/input/test/default-neutral-dir.ly b/input/test/default-neutral-dir.ly index 2bbfff601a..11e51df31c 100644 --- a/input/test/default-neutral-dir.ly +++ b/input/test/default-neutral-dir.ly @@ -2,12 +2,12 @@ \header { texidoc = " The direction of a perfectly centred beams can be controlled through @code{Voice.Beam}'s grob-property -@code{default-neutral-direction} +directly@code{neutral-direction} "} \paper { linewidth = -1.} \score {\notes \relative c { [b''8 b] - \property Voice.Beam \set #'default-neutral-direction = #-1 + \property Voice.Beam \set #'neutral-direction = #-1 [b b] }} diff --git a/lily/align-interface.cc b/lily/align-interface.cc index 8211c349af..42d7846cb4 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -11,6 +11,7 @@ #include "grob.hh" #include "group-interface.hh" #include "axis-group-interface.hh" +#include "hara-kiri-group-spanner.hh" #include "paper-def.hh" MAKE_SCHEME_CALLBACK (Align_interface,alignment_callback,2); @@ -50,13 +51,11 @@ Align_interface::align_to_fixed_distance (Grob *me , Axis a) me->set_grob_property ("alignment-done", SCM_BOOL_T); SCM d = me->get_grob_property ("stacking-dir"); - Direction stacking_dir = gh_number_p (d) ? to_dir (d) : CENTER; if (!stacking_dir) stacking_dir = DOWN; - SCM force = me->get_grob_property ("forced-distance"); Real dy = 0.0; @@ -74,7 +73,26 @@ Align_interface::align_to_fixed_distance (Grob *me , Axis a) v.set_empty (); Array translates; - for (int j=0 ; j < elems.size (); j++) + for (int j= elems.size (); j--; ) + { + /* + This is not very elegant, in that we need special support for + hara kiri. Unfortunately, the generic wiring of + force_hara_kiri_callback () (extent and offset callback) is + such that we might get into a loop if we call extent() or + offset() the elements. + + + */ + if (a == Y_AXIS + && Hara_kiri_group_spanner::has_interface (elems[j])) + Hara_kiri_group_spanner::consider_suicide (elems[j]); + + if (!ly_pair_p (elems[j]-> immutable_property_alist_)) + elems.del(j); + } + + for (int j =0; j < elems.size (); j++) { where_f += stacking_dir * dy; translates.push (where_f); diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index 4d2da95856..a04db27dac 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -83,16 +83,6 @@ Clef_engraver::acknowledge_grob (Grob_info info) && gh_string_p (get_property ("clefGlyph"))) create_clef (); - if (Key_item::has_interface (item)) - { - /* - Key_item adapts its formatting to make sure that the - accidentals stay in the upper half of the staff. It needs - to know c0-pos for this. (?) - */ - - item->set_grob_property ("c0-position", get_property ("centralCPosition")); - } } } @@ -204,6 +194,6 @@ Clef_engraver::start_translation_timestep () ENTER_DESCRIPTION(Clef_engraver, /* descr */ "Determine and set reference point for pitches", /* creats*/ "Clef OctavateEight", -/* acks */ "bar-line-interface key-interface", +/* acks */ "bar-line-interface", /* reads */ "clefPosition clefGlyph centralCPosition clefOctavation explicitClefVisibility", /* write */ ""); diff --git a/lily/dot-column-engraver.cc b/lily/dot-column-engraver.cc index 9523b7ea91..f36be6ed05 100644 --- a/lily/dot-column-engraver.cc +++ b/lily/dot-column-engraver.cc @@ -84,6 +84,6 @@ ENTER_DESCRIPTION(Dot_column_engraver, If omitted, then dots appear on top of the notes. ", /* creats*/ "DotColumn", -/* acks */ "dot-column-interface stem-interface", +/* acks */ "rhythmic-head-interface dot-column-interface stem-interface", /* reads */ "", /* write */ ""); diff --git a/lily/engraver-group-engraver.cc b/lily/engraver-group-engraver.cc index 56fe566fca..8dd6e1a4ce 100644 --- a/lily/engraver-group-engraver.cc +++ b/lily/engraver-group-engraver.cc @@ -56,7 +56,15 @@ Engraver_group_engraver::acknowledge_grobs () nm = ly_cdr (nm); else { - assert (info.grob_l_->immutable_property_alist_ == SCM_EOL); + /* + it's tempting to put an assert for + immutable_property_alist_ == '(), but in fact, some + engravers (clef-engraver) add some more information to the + immutable_property_alist_ (after it has been '()-ed). + + We ignore the grob anyway. He who has no name, shall not + be helped. */ + continue; } diff --git a/lily/grob.cc b/lily/grob.cc index f1f80e720a..82b1771516 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -92,12 +92,14 @@ Grob::Grob (SCM basicprops) } SCM meta = get_grob_property ("meta"); - SCM ifs = scm_assoc (ly_symbol2scm ("interfaces"), meta); + if (gh_pair_p (meta)) + { + SCM ifs = scm_assoc (ly_symbol2scm ("interfaces"), meta); - set_grob_property ("interfaces",ly_cdr (ifs)); + set_grob_property ("interfaces",ly_cdr (ifs)); + } } - Grob::Grob (Grob const&s) : dim_cache_ (s.dim_cache_) { diff --git a/lily/include/hara-kiri-group-spanner.hh b/lily/include/hara-kiri-group-spanner.hh index 9f1fc528db..1b2f1b30cd 100644 --- a/lily/include/hara-kiri-group-spanner.hh +++ b/lily/include/hara-kiri-group-spanner.hh @@ -13,7 +13,6 @@ #include "lily-guile.hh" #include "lily-proto.hh" - class Hara_kiri_group_spanner { public: diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 65ca5ebb2d..f49e505447 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -73,7 +73,27 @@ SCM ly_last (SCM list); SCM ly_str02scm (char const*c); SCM ly_write2scm (SCM s); SCM ly_deep_copy (SCM); -SCM ly_symbol2scm (char const *); + +#ifdef CACHE_SYMBOLS +/* + Using this trick we cache the value of gh_symbol2scm ("fooo") where + "fooo" is a constant string. This is done at the cost of one static + variable per ly_symbol2scm() use, and one boolean evaluation for + every call. + + The overall speedup of lily is about 5% on a run of wtk1-fugue2 + +*/ +#define ly_symbol2scm(x) ({ static SCM cached; \ + (__builtin_constant_p (x)) \ + ? ((cached) ? cached : scm_permanent_object (cached = gh_symbol2scm((char*)x))) \ + : gh_symbol2scm(x); }) +#else +inline SCM ly_symbol2scm(char const* x) { return gh_symbol2scm((char*)x); } +#endif + + + String ly_scm2string (SCM s); String ly_symbol2string (SCM); SCM ly_offset2scm (Offset); diff --git a/lily/include/scm-hash.hh b/lily/include/scm-hash.hh index 5b50c22c01..ba13e2ef06 100644 --- a/lily/include/scm-hash.hh +++ b/lily/include/scm-hash.hh @@ -11,22 +11,10 @@ #define SCM_HASH_HH -#include - #include "lily-guile.hh" #include "smobs.hh" -struct SCM_less -{ - bool operator () (SCM s1, SCM s2) const - { - return long (s1) < long (s2); - } -}; - -typedef std::map Scm_stl_map; - /** auto resizing hash table. @@ -58,8 +46,9 @@ typedef std::map Scm_stl_map; - use GUILE hashtables iso STL. */ -class Scheme_hash_table : private Scm_stl_map -{ + +class Scheme_hash_table +{ public: bool try_retrieve (SCM key, SCM *val); bool elem_b (SCM key) const; @@ -75,8 +64,13 @@ public: Scheme_hash_table (Scheme_hash_table const &); SCM to_alist () const; +private: + SCM hash_tab_; + unsigned elt_count_; + DECLARE_SMOBS (Scheme_hash_table,foo); }; + #endif /* SCM_HASH_HH */ diff --git a/lily/include/symbol-cache.hh b/lily/include/symbol-cache.hh deleted file mode 100644 index 82023eeec4..0000000000 --- a/lily/include/symbol-cache.hh +++ /dev/null @@ -1,79 +0,0 @@ -/* - symbol-cache.hh -- declare Symbol cacher. - - source file of the GNU LilyPond music typesetter - - (c) 2000--2001 Han-Wen Nienhuys - - */ - -#ifndef SYMBOL_CACHE_HH -#define SYMBOL_CACHE_HH - -#if 1 - -/* - A per file cache: for each compilation unit, there is a separate - cache that maps the address of a string directly to a SCM value - - */ -struct Symbol_cache_pair{ - const char * key; - SCM val ; -}; - -static Symbol_cache_pair *private_symbol_cache; -static Symbol_cache_pair *private_symbol_cache_end; - -static SCM -symbol (const char *ch) __attribute__ ((unused)); - - SCM -symbol (const char *ch) -{ - Symbol_cache_pair * lo = private_symbol_cache; - Symbol_cache_pair * hi = private_symbol_cache_end -1; - - if (lo) - { - do - { - Symbol_cache_pair * mid = lo + (hi - lo) / 2 ; - if (mid->key > ch) - hi = mid; - else - lo = mid; - } - while ((hi - lo) > 1); - if (lo->key== ch) - return lo->val; - } - - - Symbol_cache_pair * p = private_symbol_cache; - for (; p < private_symbol_cache_end - && p->key < ch ; p++) - ; - - int idx = p - private_symbol_cache; - - SCM sym = gh_symbol2scm ((char*) ch); - scm_permanent_object (sym); - - int sz = private_symbol_cache_end - private_symbol_cache; - sz ++ ; - private_symbol_cache - = (Symbol_cache_pair*) realloc (private_symbol_cache, - sizeof (Symbol_cache_pair)* sz); - private_symbol_cache_end = private_symbol_cache + sz; - for (p = private_symbol_cache_end -1; - p != private_symbol_cache + idx; p --) - *p = * (p - 1); - - p->key = ch; - p->val = sym; - - return sym; -} -#endif /* SYMBOL_CACHE_HH */ -#endif diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index 17ffce3237..445d197265 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -26,14 +26,12 @@ class Key_engraver : public Engraver { void create_key (bool); void read_req (Key_change_req const * r); + Key_change_req * keyreq_l_; + Item * item_p_; public: TRANSLATOR_DECLARATIONS(Key_engraver); - Key_change_req * keyreq_l_; - Item * item_p_; - Protected_scm old_accs_; // ugh. -> property - protected: virtual void initialize (); virtual void finalize (); @@ -48,15 +46,16 @@ protected: void Key_engraver::finalize () { - old_accs_ = SCM_EOL; // unprotect can not be called from dtor. } + Key_engraver::Key_engraver () { keyreq_l_ = 0; item_p_ = 0; } + void Key_engraver::create_key (bool def) { @@ -64,20 +63,18 @@ Key_engraver::create_key (bool def) { item_p_ = new Item (get_property ("KeySignature")); - item_p_->set_grob_property ("c0-position", gh_int2scm (0)); - + item_p_->set_grob_property ("c0-position", + get_property ("centralCPosition")); + // todo: put this in basic props. - item_p_->set_grob_property ("old-accidentals", old_accs_); + item_p_->set_grob_property ("old-accidentals", get_property ("lastKeySignature")); item_p_->set_grob_property ("new-accidentals", get_property ("keySignature")); Staff_symbol_referencer::set_interface (item_p_); Key_item::set_interface (item_p_); - - announce_grob (item_p_,keyreq_l_); } - if (!def) { SCM vis = get_property ("explicitKeySignatureVisibility"); @@ -106,6 +103,7 @@ Key_engraver::try_music (Music * req_l) return false; } + void Key_engraver::acknowledge_grob (Grob_info info) { @@ -122,21 +120,21 @@ Key_engraver::acknowledge_grob (Grob_info info) { create_key (true); } - } + void Key_engraver::create_grobs () { - if (keyreq_l_ || old_accs_ != get_property ("keySignature")) - { - create_key (false); - } + if (keyreq_l_ || + get_property ("lastKeySignature") != get_property ("keySignature")) + create_key (false); } + void Key_engraver::stop_translation_timestep () -{ +{ if (item_p_) { typeset_grob (item_p_); @@ -144,6 +142,7 @@ Key_engraver::stop_translation_timestep () } } + void Key_engraver::read_req (Key_change_req const * r) { @@ -162,34 +161,36 @@ Key_engraver::read_req (Key_change_req const * r) n = scm_delete_x (ly_car (s), n); } } + for (SCM s = n ; gh_pair_p (s); s = ly_cdr (s)) if (gh_scm2int (ly_cdar (s))) accs = gh_cons (ly_car (s), accs); - old_accs_ = get_property ("keySignature"); + daddy_trans_l_->set_property ("lastKeySignature", + get_property ("keySignature")); daddy_trans_l_->set_property ("keySignature", accs); } + void Key_engraver::start_translation_timestep () { keyreq_l_ = 0; - old_accs_ = get_property ("keySignature"); + daddy_trans_l_->set_property ("lastKeySignature", get_property ("keySignature")); } + void Key_engraver::initialize () { daddy_trans_l_->set_property ("keySignature", SCM_EOL); - old_accs_ = SCM_EOL; + daddy_trans_l_->set_property ("lastKeySignature", SCM_EOL); } - - ENTER_DESCRIPTION(Key_engraver, /* descr */ "", /* creats*/ "KeySignature", /* acks */ "bar-line-interface clef-interface", -/* reads */ "keySignature explicitKeySignatureVisibility createKeyOnClefChange keyAccidentalOrder keySignature", -/* write */ ""); +/* reads */ "keySignature lastKeySignature explicitKeySignatureVisibility createKeyOnClefChange keyAccidentalOrder keySignature", +/* write */ "lastKeySignature"); diff --git a/lily/key-item.cc b/lily/key-item.cc index 563910435f..47526b042d 100644 --- a/lily/key-item.cc +++ b/lily/key-item.cc @@ -95,11 +95,16 @@ Key_item::brew_molecule (SCM smob) SCM newas = me->get_grob_property ("new-accidentals"); Molecule mol; + + SCM c0s = me->get_grob_property ("c0-position"); + int c0p=0; + if (gh_number_p (c0s)) + c0p = gh_scm2int (c0s); + /* SCM lists are stacks, so we work from right to left, ending with the cancellation signature. */ - int c0p = gh_scm2int (me->get_grob_property ("c0-position")); for (SCM s = newas; gh_pair_p (s); s = ly_cdr (s)) { @@ -154,10 +159,6 @@ Key_item::brew_molecule (SCM smob) return mol.smobbed_copy (); } - - - - bool Key_item::has_interface (Grob*m) { diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 12b259ea83..e613c2041c 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -115,12 +115,6 @@ ly_quote_scm (SCM s) } -SCM -ly_symbol2scm (const char *s) -{ - return gh_symbol2scm ((char *)s); -} - String ly_symbol2string (SCM s) @@ -167,7 +161,6 @@ void read_lily_scm_file (String fn) { gh_eval_str ((char *) gulp_file_to_string (fn).ch_C ()); - // scm_c_eval_string ((char *) gulp_file_to_string (fn).ch_C ()); } extern "C" { diff --git a/lily/music-output-def.cc b/lily/music-output-def.cc index c37cf1178b..308b025773 100644 --- a/lily/music-output-def.cc +++ b/lily/music-output-def.cc @@ -128,9 +128,9 @@ Music_output_def::get_global_translator_p () int Music_output_def::print_smob (SCM s, SCM p, scm_print_state *) { - Translator_def * def = unsmob_translator_def (s); + Music_output_def * def = unsmob_music_output_def (s); scm_puts ("#type_name_, p); + //scm_write (def->type_name_, p); scm_puts (">", p); return 1; } diff --git a/lily/rhythmic-column-engraver.cc b/lily/rhythmic-column-engraver.cc index 8c6faa3d70..ac1515162a 100644 --- a/lily/rhythmic-column-engraver.cc +++ b/lily/rhythmic-column-engraver.cc @@ -122,6 +122,6 @@ Rhythmic_column_engraver::start_translation_timestep () ENTER_DESCRIPTION(Rhythmic_column_engraver, /* descr */ "Generates NoteColumn, an objects that groups stems, noteheads and rests.", /* creats*/ "NoteColumn", -/* acks */ "stem-interface note-head-interface dot-column-interface", +/* acks */ "stem-interface rhythmicb-head-interface dot-column-interface", /* reads */ "", /* write */ ""); diff --git a/lily/scm-hash.cc b/lily/scm-hash.cc index 08cac97094..b8bc8d8d03 100644 --- a/lily/scm-hash.cc +++ b/lily/scm-hash.cc @@ -11,41 +11,53 @@ #include "scm-hash.hh" #include "ly-smobs.icc" +void +copy_scm_hashes (SCM dest, SCM src) +{ + for (int i = SCM_LENGTH(src); i--;) + for (SCM s = scm_vector_ref (src, SCM_MAKINUM (i)); ly_pair_p(s); s = ly_cdr (s)) + { + scm_hashq_set_x (dest, ly_caar (s), ly_cdar (s)); + } +} + Scheme_hash_table::Scheme_hash_table () { + hash_tab_ = SCM_EOL; smobify_self (); + hash_tab_ = scm_make_vector (gh_int2scm (119), SCM_EOL); + elt_count_ = 0; } Scheme_hash_table::Scheme_hash_table (Scheme_hash_table const &src) - : Scm_stl_map (src) + { + hash_tab_ = SCM_EOL; + elt_count_ = src.elt_count_; smobify_self (); + + hash_tab_ = scm_make_vector (gh_int2scm (src.elt_count_ >? 11 ), SCM_EOL); + copy_scm_hashes (hash_tab_, src.hash_tab_); } void Scheme_hash_table::operator = (Scheme_hash_table const & src) { - Scm_stl_map::operator = (src); - - // we do not copy the self_scm () field! + if (&src == this) + return; + + elt_count_ = src.elt_count_; + hash_tab_ = scm_make_vector (gh_int2scm (src.elt_count_ >? 11), SCM_EOL); + copy_scm_hashes (hash_tab_, src.hash_tab_); } SCM Scheme_hash_table::mark_smob (SCM s) { - /* - can't typecheck naively, since GC bit lives in CAR of S - */ - Scheme_hash_table *me = (Scheme_hash_table*) SCM_CELL_WORD_1 (s); - - for (Scm_stl_map::const_iterator i= me->begin (); i != me->end (); i++) - { - scm_gc_mark ((*i).first); - scm_gc_mark ((*i).second); - } + scm_gc_mark (me->hash_tab_); return SCM_EOL; } @@ -54,54 +66,72 @@ Scheme_hash_table::print_smob (SCM s, SCM p, scm_print_state*) { assert (unsmob (s)); char str[1000]; - sprintf (str, "#begin (); i != me->end (); i++) - { - scm_display ((*i).first, p); - scm_puts (" = ",p); - scm_display ((*i).second, p); - scm_puts ("\n",p); - } - scm_puts ("> ",p); - return 1; + sprintf (str, "#hash_tab_, p); + scm_puts ("> ",p); + return 1; } bool Scheme_hash_table::try_retrieve (SCM k, SCM *v) { - Scm_stl_map ::const_iterator i (find (k)); - bool found = i != end (); - if (found) - *v = (*i).second; - return found; + SCM handle = scm_hashq_get_handle (hash_tab_, k); + if (ly_pair_p (handle)) + { + *v = ly_cdr (handle); + return true; + } + else + return false; + } bool Scheme_hash_table::elem_b (SCM k) const { - Scm_stl_map::const_iterator i (find (k)); - return i != end (); + return ly_pair_p (scm_hashq_get_handle (hash_tab_, k)); } void Scheme_hash_table::set (SCM k, SCM v) { - (*this)[k] = v; + assert (gh_symbol_p (k)); + SCM handle = scm_hashq_create_handle_x (hash_tab_, k, SCM_UNDEFINED); + if (ly_cdr (handle) == SCM_UNDEFINED) + { + elt_count_++; + } + + gh_set_cdr_x (handle, v); + + /* + resize if getting too large. + */ + if (elt_count_ > 2 * SCM_LENGTH (hash_tab_)) + { + SCM nh = scm_make_vector (gh_int2scm (3* elt_count_+1), SCM_EOL); + copy_scm_hashes (nh, hash_tab_); + hash_tab_ = nh; + } + } // UGH. SCM Scheme_hash_table::get (SCM k)const { - return (* (Scheme_hash_table*)this)[k]; + /* + 42 will stick out like a sore thumb, hopefully. + */ + return scm_hashq_ref (hash_tab_, k, SCM_MAKINUM(42)); } void Scheme_hash_table::remove (SCM k) { - Scm_stl_map::erase (k); + scm_hashq_remove_x (hash_tab_, k); + elt_count_ --; } Scheme_hash_table::~Scheme_hash_table () @@ -112,13 +142,17 @@ SCM Scheme_hash_table::to_alist () const { SCM l = SCM_EOL; - for (Scm_stl_map ::const_iterator i = begin (); i != end (); i++) - l = gh_cons (gh_cons ((*i).first, (*i).second), l); + for (int i = SCM_LENGTH(hash_tab_); i--;) + for (SCM s = scm_vector_ref (hash_tab_, gh_int2scm (i)); ly_pair_p(s); s = ly_cdr (s)) + { + l = scm_acons (ly_caar (s), ly_cdar (s), l); + } return l; } + IMPLEMENT_UNSMOB (Scheme_hash_table,scheme_hash); IMPLEMENT_SMOBS (Scheme_hash_table); IMPLEMENT_DEFAULT_EQUAL_P (Scheme_hash_table); diff --git a/lily/score.cc b/lily/score.cc index 024810c1b5..9cc2f6d0c6 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -51,9 +51,7 @@ Score::Score (Score const &s) /* TODO: this is not very elegant.... */ - /* store_locations_global_b = (scm_c_eval_string ("point-and-click") != SCM_BOOL_F);*/ store_locations_global_b = (gh_eval_str ("point-and-click") != SCM_BOOL_F); - Music * m =unsmob_music (s.music_); music_ = m?m->clone ()->self_scm () : SCM_EOL; diff --git a/lily/separating-group-spanner.cc b/lily/separating-group-spanner.cc index 89bceab5d4..f989389674 100644 --- a/lily/separating-group-spanner.cc +++ b/lily/separating-group-spanner.cc @@ -95,7 +95,6 @@ Separating_group_spanner::set_spacing_rods (SCM smob) if (rb) find_rods (rb, ly_cdr (s)); } - find_musical_sequences (me); #if 0 /* diff --git a/lily/symbol-cache.cc b/lily/symbol-cache.cc deleted file mode 100644 index d247ccd3d5..0000000000 --- a/lily/symbol-cache.cc +++ /dev/null @@ -1,77 +0,0 @@ -/* - symbol-cache.cc -- implement a cache for literal symbols, eg - symbol ("foo-bar") - - - source file of the GNU LilyPond music typesetter - - (c) 2000--2001 Han-Wen Nienhuys - - */ - -#include -#include "lily-guile.hh" - -#if 0 - -typedef map Literal_symbol_map; -Literal_symbol_map literal_map; - - -SCM -symbol (const char*s) -{ - Literal_symbol_map::const_iterator i = literal_map.find (s); - if (i != literal_map.end ()) - return (*i).second; - - SCM sym = gh_symbol2scm ((char*)s); - scm_permanent_object (sym); - literal_map[s] = sym; - return sym; -} - - -/* - This is a gory trick to cache the value gh_symbol2scm (), without - cluttering up the C code with snarf macros. - - You should *ONLY* use symbol () for arguments that are literal - strings! - - without (wtk1-fugue2) - - real 0m20.157s - user 0m19.800s - sys 0m0.140s - - with: (per file.) - - real 0m19.284s - user 0m18.630s - sys 0m0.190s - - - global with STL map - - real 0m20.616s - user 0m19.360s - sys 0m0.080s - - global with binsearch. - - real 0m19.352s - user 0m18.710s - sys 0m0.230s - - local binsearch - - user 18.8 - - local with binsearch, and other optimizations. - - 17.7 -*/ -#endif - - diff --git a/ly/german-chords-init.ly b/ly/german-chords-init.ly index cb741eba14..644b6efe3c 100644 --- a/ly/german-chords-init.ly +++ b/ly/german-chords-init.ly @@ -1,10 +1,10 @@ -\version "1.3.148" +\version "1.5.12" -% german-chords.ly: +% german-chords-init.ly: % german/norwegian/danish? % To get Bb instead of B, use -% \include "german-chords.ly" +% \include "german-chords-init.ly" % #(set! german-Bb #t) #(define german-Bb #f) @@ -14,7 +14,8 @@ (list 7 (+ (if german-Bb 0 1) (caddr pitch))) (cdr pitch) ))) - (cons + (list + 'columns (list-ref '("C" "D" "E" "F" "G" "A" "H" "B") (car dopitch)) (accidental->text-super (cadr dopitch)) ) diff --git a/ly/grace-init.ly b/ly/grace-init.ly index 691498d1bd..b33942fde1 100644 --- a/ly/grace-init.ly +++ b/ly/grace-init.ly @@ -26,6 +26,7 @@ startGraceMusic = { } stopGraceMusic = { + \property Staff.Accidentals \revert #'font-relative-size \property Voice.Beam \revert #'space-function \property Voice.Beam \revert #'thickness @@ -41,5 +42,4 @@ stopGraceMusic = { % be smaller as well. \property Voice.fontSize \unset - \property Staff.LocalKeyItem \revert #'font-relative-size } diff --git a/ly/params-init.ly b/ly/params-init.ly index 8bf36b2906..afc951023f 100644 --- a/ly/params-init.ly +++ b/ly/params-init.ly @@ -5,7 +5,7 @@ papersizename = \papersize % ly2dvi now uses `papersize' internally (and on cmd line) -papersize = \papersize +%papersize = \papersize % FIXME % direct PostScript line height for single line staves diff --git a/ly/property-init.ly b/ly/property-init.ly index 83ea32eb9a..1d26dc2a03 100644 --- a/ly/property-init.ly +++ b/ly/property-init.ly @@ -164,4 +164,4 @@ hideStaffSwitch = \property PianoStaff.followVoice = ##f % To remove a Volta bracet or some other graphical object, % set it to turnOff. Example: \property Staff.VoltaBracket = \turnOff -turnOff = #'((meta . ((interfaces . ())))) +turnOff = #'() diff --git a/make/out/lilypond.lsm b/make/out/lilypond.lsm index cb7289fd43..d12c232a55 100644 --- a/make/out/lilypond.lsm +++ b/make/out/lilypond.lsm @@ -1,15 +1,15 @@ Begin3 Title: LilyPond -Version: 1.5.13 -Entered-date: 24SEP01 +Version: 1.5.14 +Entered-date: 29SEP01 Description: @BLURB@ 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.5.13.tar.gz + 1000k lilypond-1.5.14.tar.gz Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/ - 1000k lilypond-1.5.13.tar.gz + 1000k lilypond-1.5.14.tar.gz Copying-policy: GPL End diff --git a/make/out/lilypond.mandrake.spec b/make/out/lilypond.mandrake.spec index 307132114c..0c791bdf09 100644 --- a/make/out/lilypond.mandrake.spec +++ b/make/out/lilypond.mandrake.spec @@ -1,5 +1,5 @@ %define name lilypond -%define version 1.5.13 +%define version 1.5.14 %define release 1mdk Name: %{name} diff --git a/make/out/lilypond.redhat.spec b/make/out/lilypond.redhat.spec index 1f2c5eda2e..89aac55231 100644 --- a/make/out/lilypond.redhat.spec +++ b/make/out/lilypond.redhat.spec @@ -1,11 +1,11 @@ %define info yes Name: lilypond -Version: 1.5.13 +Version: 1.5.14 Release: 1 License: GPL Group: Applications/Publishing -Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.13.tar.gz +Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.14.tar.gz Summary: Create and print music notation URL: http://www.lilypond.org/ BuildRoot: /tmp/lilypond-install diff --git a/make/out/lilypond.suse.spec b/make/out/lilypond.suse.spec index 2626254926..aade408344 100644 --- a/make/out/lilypond.suse.spec +++ b/make/out/lilypond.suse.spec @@ -14,11 +14,11 @@ Distribution: SuSE Linux 7.0 (i386) Name: lilypond -Version: 1.5.13 +Version: 1.5.14 Release: 2 Copyright: GPL Group: Applications/Publishing -Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.13.tar.gz +Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.14.tar.gz # music notation software for.. ? Summary: A program for printing sheet music. URL: http://www.lilypond.org/ diff --git a/scm/backend-documentation-lib.scm b/scm/backend-documentation-lib.scm index 63d2937e15..3ea5632c0b 100644 --- a/scm/backend-documentation-lib.scm +++ b/scm/backend-documentation-lib.scm @@ -11,6 +11,10 @@ ;; alist of property descriptions +;;;;;; TODO: sort out symbol vs. string stuff. +;;;;;; TODO: use flatten write iso. string-append; might be possible to fold +;;;;;; in symbol->string integrally. + (define (backend-property->texi sym) (let* ((name (symbol->string sym)) (type (object-property sym 'backend-type?)) @@ -84,21 +88,21 @@ (node (grob-name name)) (texi-section 2 (grob-name name) #f) "\n" - (let* ((grob (string->symbol name)) + (let* ((grob name) (engravers (filter-list (lambda (x) (engraver-makes-grob? name x)) all-engravers-list)) (engraver-names (map Translator::name engravers)) ) (string-append - name " grobs are created by: " + (symbol->string name) " grobs are created by: " (human-listify (map ref-ify (map engraver-name engraver-names))))) (apply string-append ifacedoc)))) -(define (engraver-makes-grob? name grav) - (memq name (assoc 'grobs-created (Translator::description grav))) +(define (engraver-makes-grob? name-symbol grav) + (memq name-symbol (assoc 'grobs-created (Translator::description grav))) ) (define (document-all-grobs name) diff --git a/scm/engraver-documentation-lib.scm b/scm/engraver-documentation-lib.scm index 6183686e0c..e19bce865b 100644 --- a/scm/engraver-documentation-lib.scm +++ b/scm/engraver-documentation-lib.scm @@ -28,7 +28,7 @@ (name (Translator::name engraver)) (name-sym (string->symbol name)) (desc (cdr (assoc 'description (Translator::description engraver)))) - (grobs (cdr (assoc 'grobs-created (Translator::description engraver)))) + (grobs (engraver-grobs engraver)) ) (string-append @@ -141,14 +141,17 @@ (apply string-append (map document-engraver-by-name consists)))))) -(define (engraver-grobs name) +(define (engraver-grobs grav) (let* ( - (eg (find-engraver-by-name name all-engravers-list)) - ) + (eg (if (string? grav) + (find-engraver-by-name grav all-engravers-list) + grav)) + + ) (if (eq? eg #f) '() - (cdr (assoc 'grobs-created (Translator::description eg))) + (map symbol->string (cdr (assoc 'grobs-created (Translator::description eg)))) ) )) diff --git a/scm/generate-documentation.scm b/scm/generate-documentation.scm index 5e3f8f805f..9dad6f22f9 100644 --- a/scm/generate-documentation.scm +++ b/scm/generate-documentation.scm @@ -1,4 +1,3 @@ - ;;; generate-documentation.scm -- Generate documentation ;;; ;;; source file of the GNU LilyPond music typesetter @@ -30,7 +29,7 @@ (document-music "LilyPond music properties") (document-paper "LilyPond interpretation contexts") (document-all-engravers "LilyPond engravers") - (document-all-engraver-properties "LilyPond context properties") + (document-all-engraver-properties "LilyPond context properties") (document-all-grobs "LilyPond backend") (document-all-interfaces "LilyPond interfaces") (document-all-backend-properties "LilyPond backend properties") diff --git a/scm/translator-property-description.scm b/scm/translator-property-description.scm index fe6c8252fd..ed548ddeee 100644 --- a/scm/translator-property-description.scm +++ b/scm/translator-property-description.scm @@ -210,6 +210,9 @@ The format is (NAME . ALTER), where NAME is from 0 .. 6 and ALTER from -1, 1. ") (translator-property-description 'keySignature list? "The current key signature. This is an alist containing (NAME . ALTER) or ((OCTAVE . NAME) . ALTER) pairs, where NAME is from 0.. 6 and ALTER from -2,-1,0,1,2 ") +(translator-property-description 'lastKeySignature list? "Last key +signature before a key signature change.") + (translator-property-description 'localKeySignature list? "the key signature at this point in the measure. The format is the same as for keySignature. " ) diff --git a/tex/lily-ps-defs.tex b/tex/lily-ps-defs.tex index 79cb916235..0172a73d18 100644 --- a/tex/lily-ps-defs.tex +++ b/tex/lily-ps-defs.tex @@ -9,6 +9,7 @@ % % escape the colon with \string to avoid problems with french babel % +\def\PSsetTeXdimen#1{\expandafter\special{! /#1 (\csname #1\endcsname) set_tex_dimen}} \def\lilySpace{ } \def\turnOnPostScript{% % This sets CTM so that you get to the currentpoint @@ -20,8 +21,7 @@ % FUCKING REDHAT XDVI -- ARG! skeel ##1 @endspecial}% } + \PSsetTeXdimen{lilypondpaperblotdiameter} } -\def\PSsetTeXdimen#1{\expandafter\special{! /#1 (\csname #1\endcsname) set_tex_dimen}} -\PSsetTeXdimen{lilypondpaperblotdiameter} \def\turnOnExperimentalFeatures{}