From 76f13ab50fc726c89fa7c96f3deed519d2d773dc Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Fri, 26 May 2000 18:30:08 +0200 Subject: [PATCH] release: 1.3.55 =========== * Experimental property collapse for most score-elements. (notable exceptions: Scripts, pedals). Change all Score_element constructors to take a basic-property list. The suffix of a property list may be shared by several score-elements, for instance all default G-clefs in a score share the following settings (breakable . #t) (break-align-symbol . Clef_item) (visibility-lambda . ,begin-of-line-visible) This should reduce memory usage further. * Magically fixed the disappearing Lyrics problem. * Removed used_b_ field from Score_element. * Massive search-replace patch: store pointers and properties separately, in preparation of property collapse. 1.3 --- CHANGES | 46 +++--- VERSION | 4 +- buildscripts/set-lily.sh | 1 - input/trip.ly | 4 +- lily/align-note-column-engraver.cc | 2 +- lily/auto-beam-engraver.cc | 2 +- lily/axis-group-engraver.cc | 2 +- lily/axis-group-interface.cc | 26 +-- lily/bar-engraver.cc | 4 +- lily/bar-number-engraver.cc | 16 +- lily/bar.cc | 6 +- lily/beam-engraver.cc | 2 +- lily/beam.cc | 10 +- lily/break-align-engraver.cc | 13 +- lily/break-align-item.cc | 3 +- lily/breathing-sign-engraver.cc | 5 +- lily/breathing-sign.cc | 4 +- lily/chord-name-engraver.cc | 2 +- lily/chord-name.cc | 5 + lily/chord-tremolo-engraver.cc | 2 +- lily/clef-engraver.cc | 9 +- lily/clef-item.cc | 13 +- lily/collision-engraver.cc | 2 +- lily/collision.cc | 3 +- lily/crescendo.cc | 3 +- lily/dot-column-engraver.cc | 2 +- lily/dot-column.cc | 3 +- lily/dots.cc | 3 +- lily/dynamic-engraver.cc | 19 +-- lily/extender-engraver.cc | 2 +- lily/extender-spanner.cc | 5 +- lily/grace-align-item.cc | 3 +- lily/hara-kiri-engraver.cc | 2 +- lily/hara-kiri-vertical-group-spanner.cc | 3 +- lily/hyphen-engraver.cc | 2 +- lily/hyphen-spanner.cc | 4 +- lily/include/bar.hh | 2 +- lily/include/beam.hh | 2 +- lily/include/break-align-item.hh | 2 +- lily/include/breathing-sign.hh | 2 +- lily/include/chord-name.hh | 3 +- lily/include/clef-item.hh | 1 + lily/include/collision.hh | 2 +- lily/include/crescendo.hh | 2 +- lily/include/dot-column.hh | 2 +- lily/include/dots.hh | 2 +- lily/include/extender-spanner.hh | 2 +- lily/include/grace-align-item.hh | 2 +- .../hara-kiri-vertical-group-spanner.hh | 2 +- lily/include/hyphen-spanner.hh | 2 +- lily/include/item.hh | 2 +- lily/include/key-def.hh | 2 + lily/include/key-item.hh | 2 +- lily/include/key.hh | 4 + lily/include/local-key-item.hh | 4 +- lily/include/multi-measure-rest.hh | 2 +- lily/include/music-output-def.hh | 1 - lily/include/note-column.hh | 2 +- lily/include/note-head.hh | 2 +- lily/include/rest-collision.hh | 2 +- lily/include/rest.hh | 2 + lily/include/rhythmic-head.hh | 1 + lily/include/score-element.hh | 14 +- lily/include/script-column.hh | 2 +- lily/include/script.hh | 1 + lily/include/separating-group-spanner.hh | 2 +- lily/include/single-malt-grouping-item.hh | 2 +- lily/include/slur.hh | 2 +- lily/include/spacing-spanner.hh | 2 +- lily/include/span-bar.hh | 2 +- lily/include/spanner.hh | 2 +- lily/include/staff-bar.hh | 1 + lily/include/staff-symbol.hh | 3 + lily/include/stem-tremolo.hh | 2 +- lily/include/stem.hh | 2 +- lily/include/sustain-pedal.hh | 2 +- lily/include/system-start-delimiter.hh | 2 +- lily/include/text-item.hh | 1 + lily/include/tie-column.hh | 3 +- lily/include/tie.hh | 2 +- lily/include/time-signature.hh | 2 +- lily/include/tuplet-spanner.hh | 2 +- lily/include/volta-spanner.hh | 2 +- lily/instrument-name-engraver.cc | 7 +- lily/item.cc | 4 +- lily/key-engraver.cc | 13 +- lily/key-item.cc | 4 +- lily/line-group-group-engraver.cc | 2 +- lily/line-number-engraver.cc | 2 +- lily/line-of-score.cc | 1 + lily/local-key-engraver.cc | 2 +- lily/local-key-item.cc | 5 + lily/lyric-engraver.cc | 4 +- lily/mark-engraver.cc | 20 +-- lily/multi-measure-rest-engraver.cc | 2 +- lily/multi-measure-rest.cc | 3 +- lily/music-output-def.cc | 2 +- lily/note-column.cc | 3 +- lily/note-head.cc | 6 + lily/note-heads-engraver.cc | 4 +- lily/note-name-engraver.cc | 2 +- lily/paper-column.cc | 1 + lily/paper-def.cc | 33 +--- lily/parser.yy | 12 -- lily/piano-pedal-engraver.cc | 5 +- lily/pointer-group-interface.cc | 3 - lily/repeat-engraver.cc | 2 +- lily/rest-collision-engraver.cc | 2 +- lily/rest-collision.cc | 4 +- lily/rest-engraver.cc | 4 +- lily/rest.cc | 5 + lily/rhythmic-column-engraver.cc | 2 +- lily/rhythmic-head.cc | 4 + lily/score-element.cc | 108 +++++++------ lily/score-engraver.cc | 4 +- lily/script-column-engraver.cc | 2 +- lily/script-column.cc | 5 +- lily/script-engraver.cc | 3 +- lily/script.cc | 4 + lily/separating-group-spanner.cc | 3 +- lily/separating-line-group-engraver.cc | 7 +- lily/single-malt-grouping-item.cc | 4 +- lily/slur-engraver.cc | 2 +- lily/slur.cc | 3 +- lily/spacing-engraver.cc | 2 +- lily/spacing-spanner.cc | 3 +- lily/span-bar-engraver.cc | 9 +- lily/span-bar.cc | 10 +- lily/spanner.cc | 7 +- lily/staff-bar.cc | 6 + lily/staff-symbol-engraver.cc | 7 +- lily/staff-symbol-referencer.cc | 6 +- lily/staff-symbol.cc | 5 + lily/stem-engraver.cc | 4 +- lily/stem-tremolo.cc | 16 +- lily/stem.cc | 3 +- lily/sustain-pedal.cc | 4 + lily/system-start-delimiter-engraver.cc | 4 +- lily/system-start-delimiter.cc | 3 +- lily/text-engraver.cc | 2 +- lily/text-item.cc | 6 + lily/tie-column.cc | 3 +- lily/tie-engraver.cc | 6 +- lily/tie.cc | 3 +- lily/time-signature-engraver.cc | 4 +- lily/time-signature.cc | 3 +- lily/tuplet-engraver.cc | 2 +- lily/tuplet-spanner.cc | 3 +- lily/vertical-align-engraver.cc | 2 +- lily/volta-spanner.cc | 3 +- ly/engraver.ly | 122 +++++++++++--- ly/params.ly | 9 +- make/out/lilypond.lsm | 8 +- make/out/lilypond.spec | 4 +- scripts/linux-time.py | 151 ------------------ 155 files changed, 521 insertions(+), 551 deletions(-) delete mode 100644 scripts/linux-time.py diff --git a/CHANGES b/CHANGES index 8eff3a8ced..6495aaa3aa 100644 --- a/CHANGES +++ b/CHANGES @@ -1,38 +1,34 @@ ---- ../lilypond-1.3.54.hwn1/CHANGES Thu May 25 19:52:28 2000 -++ b/CHANGES Fri May 26 01:15:04 2000 -@@ -1,5 +1,4 @@ --1.3.1.3.54.hwn1 --=========== -* Experimental property collapse for clef and staff-symbol. - - * Massive search replace patch: store pointers and properties - separately, in preparation of property collapse.--- ../lilypond-1.3.54/CHANGES Thu May 25 00:20:46 2000 -++ b/CHANGES Thu May 25 23:22:02 2000 -@@ -1,3 +1,11 @@ -1.3.54.jcn1 +1.3.54.hwn2 =========== -* Fixed compile bug. +* Experimental property collapse for most score-elements. (notable +exceptions: Scripts, pedals). Change all Score_element constructors to +take a basic-property list. The suffix of a property list may be +shared by several score-elements, for instance all default G-clefs in +a score share the following settings + + (breakable . #t) + (break-align-symbol . Clef_item) + (visibility-lambda . ,begin-of-line-visible) + +This should reduce memory usage further. -* Added scripts/linux-time.py: simple utility to monitor memory (and later - maybe other) resource usage from Linux's proc fs. +* Magically fixed the disappearing Lyrics problem. - 1.3.53.uu1 - ========== - 1.3.1.3.54.hwn1 -=========== +* Removed used_b_ field from Score_element. -* Massive search replace patch: store pointers and properties +* Massive search-replace patch: store pointers and properties separately, in preparation of property collapse. -1.3.53.uu1 -========== + +1.3.54 +====== * Bugfix: don't crash on tuplet spanners that don't contain any notes. -* Small cleanup of Dimension_cache: removed a few redundant -fields. Slightly lower memory usage. Dimension_cache is now a `dumb' -struct again. +* Cleanup of Dimension_cache: removed a few redundant +fields. Slightly lower memory usage (32 bytes per +score-element). Dimension_cache is now a `dumb' struct again. * Add array index to priority field of text scripts to ensure that order is unique, and sensible. diff --git a/VERSION b/VERSION index 620725e0e7..4f9a3e7262 100644 --- a/VERSION +++ b/VERSION @@ -1,8 +1,8 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 -PATCH_LEVEL=54 -MY_PATCH_LEVEL=hwn2 +PATCH_LEVEL=55 +MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/buildscripts/set-lily.sh b/buildscripts/set-lily.sh index 383a116988..df01378c45 100755 --- a/buildscripts/set-lily.sh +++ b/buildscripts/set-lily.sh @@ -57,7 +57,6 @@ showln -sf $LILYPOND_SOURCEDIR/midi2ly/out/midi2ly $prefix/bin/midi2ly showln -sf $LILYPOND_SOURCEDIR/scripts/out/ly2dvi $prefix/bin/ly2dvi showln -sf $LILYPOND_SOURCEDIR/scripts/out/mudela-book $prefix/bin/mudela-book showln -sf $LILYPOND_SOURCEDIR/buildscripts/out/genheader $prefix/bin/genheader -showln -sf $LILYPOND_SOURCEDIR/scripts/out/linux-time $prefix/bin/linux-time showln -sf $LILYPOND_SOURCEDIR/scripts/out/as2text $prefix/bin/as2text diff --git a/input/trip.ly b/input/trip.ly index 1e4cbcb2b4..5cccdb146d 100644 --- a/input/trip.ly +++ b/input/trip.ly @@ -26,7 +26,7 @@ praeludiumRight = \notes { % 13 -- how to type -- where to split -- this more neatly? \context Staff < \context Voice = I \relative c'' { \stemup r4 dis4 e4. e8 ~ | - \shifton e4 [d8 fis8] \shiftoff gis4 ~ [gis8 fis16 e ] | + \shifton e4-.-^^\f [d8 fis8] \shiftoff gis4 ~ [gis8 fis16 e ] | fis4 ~ [fis8 e16 dis] e4 r8 e8 } \context Voice = III \relative c'' { \stemup \shifton r4 bis cis \shiftoff cis | a' ~ [a16 gis a b] \shifton dis,4 cis ~ | @@ -203,7 +203,7 @@ fugaIIPedal = \notes \relative c { b!-\lheel ais-\rtoe gis-\ltoe ~ ] | gis8 r4. ) - c2 + c2^^^-^\f \time 3/4; \fugaIIPedal } diff --git a/lily/align-note-column-engraver.cc b/lily/align-note-column-engraver.cc index 9bdd9a8240..c034b0df9c 100644 --- a/lily/align-note-column-engraver.cc +++ b/lily/align-note-column-engraver.cc @@ -45,7 +45,7 @@ Align_note_column_engraver::Align_note_column_engraver() void Align_note_column_engraver::do_creation_processing () { - align_item_p_ = new Grace_align_item; + align_item_p_ = new Grace_align_item (SCM_EOL); Side_position_interface (align_item_p_).set_axis (X_AXIS); Side_position_interface (align_item_p_).set_direction (LEFT); diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 26ef80cf7e..5a8661ae9c 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -205,7 +205,7 @@ Auto_beam_engraver::begin_beam () Beam* Auto_beam_engraver::create_beam_p () { - Beam* beam_p = new Beam; + Beam* beam_p = new Beam (get_property ("basicBeamProperties")); for (int i = 0; i < stem_l_arr_p_->size (); i++) { diff --git a/lily/axis-group-engraver.cc b/lily/axis-group-engraver.cc index 4639b176a9..2038f51e8a 100644 --- a/lily/axis-group-engraver.cc +++ b/lily/axis-group-engraver.cc @@ -31,7 +31,7 @@ Axis_group_engraver::do_creation_processing () Spanner* Axis_group_engraver::get_spanner_p () const { - return new Spanner; + return new Spanner (SCM_EOL); } void diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index a08865c19c..fc9e5fe128 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -25,11 +25,6 @@ Axis_group_interface (Score_element*s) void Axis_group_interface::add_element (Score_element *e) { - - // ugh. used_b_ should be junked. - elt_l_->used_b_ = true; - e->used_b_ = true; - for (SCM ax = elt_l_->get_elt_property ("axes"); ax != SCM_EOL ; ax = gh_cdr (ax)) { Axis a = (Axis) gh_scm2int (gh_car (ax)); @@ -87,7 +82,7 @@ Axis_group_interface::set_interface () { elt_l_->set_elt_pointer ("elements", SCM_EOL); elt_l_->set_elt_property ("transparent", SCM_BOOL_T); // junk this? - elt_l_->set_elt_property ("axes" , SCM_EOL); + Group_interface (elt_l_, "interfaces").add_thing (ly_symbol2scm ("Axis_group")); } } @@ -95,14 +90,21 @@ Axis_group_interface::set_interface () void Axis_group_interface::set_axes (Axis a1, Axis a2) { - // set_interface () ? - - SCM ax = gh_cons (gh_int2scm (a1), SCM_EOL); - if (a1 != a2) - ax= gh_cons (gh_int2scm (a2), ax); + // set_interface () ? + SCM sa1= gh_int2scm (a1); + SCM sa2 = gh_int2scm (a2); + SCM prop = elt_l_->get_elt_property ("axes"); - elt_l_->set_elt_property ("axes", ax); + if (prop == SCM_UNDEFINED + || scm_memq (sa1, prop) == SCM_BOOL_F + || scm_memq (sa2, prop) == SCM_BOOL_F) + { + SCM ax = gh_cons (sa1, SCM_EOL); + if (a1 != a2) + ax= gh_cons (sa2, ax); + elt_l_->set_elt_property ("axes", ax); + } if (a1 != X_AXIS && a2 != X_AXIS) elt_l_->set_extent_callback (0, X_AXIS); diff --git a/lily/bar-engraver.cc b/lily/bar-engraver.cc index a70b89db35..075cd56129 100644 --- a/lily/bar-engraver.cc +++ b/lily/bar-engraver.cc @@ -28,8 +28,8 @@ Bar_engraver::create_bar () { if (!bar_p_) { - bar_p_ = new Staff_bar; - bar_p_->property_alist_ = get_property ("basicBarlineProperties"); + bar_p_ = new Staff_bar (get_property ("basicBarlineProperties")); + // urg: "" != empty... /* diff --git a/lily/bar-number-engraver.cc b/lily/bar-number-engraver.cc index 926bc0b50a..f2961ee47f 100644 --- a/lily/bar-number-engraver.cc +++ b/lily/bar-number-engraver.cc @@ -21,7 +21,7 @@ class Bar_number_engraver : public Engraver { protected: Text_item* text_p_; - Protected_scm visibility_lambda_; + Protected_scm staffs_; protected: @@ -65,11 +65,6 @@ Bar_number_engraver::Bar_number_engraver () void Bar_number_engraver::do_creation_processing () { - String t = "barNumberVisibilityFunction"; - SCM proc = get_property (t); - - if (gh_procedure_p (proc)) - visibility_lambda_ = proc; } @@ -110,9 +105,9 @@ Bar_number_engraver::create_items () { if (text_p_) return; - - text_p_ = new Text_item; - text_p_->set_elt_property ("breakable", SCM_BOOL_T); // ugh + + SCM b = get_property ("basicBarNumberProperties"); + text_p_ = new Text_item (b); Side_position_interface staffside(text_p_); staffside.set_axis (Y_AXIS); @@ -135,9 +130,6 @@ Bar_number_engraver::create_items () gh_double2scm(paper_l ()->get_var ("interline"))); } - if (gh_procedure_p (visibility_lambda_)) - text_p_->set_elt_property ("visibility-lambda", - visibility_lambda_); announce_element (Score_element_info (text_p_, 0)); } diff --git a/lily/bar.cc b/lily/bar.cc index 3b5cf5fea0..ec2b812b3e 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -18,7 +18,8 @@ #include "debug.hh" #include "all-font-metrics.hh" -Bar::Bar () +Bar::Bar (SCM s) + : Item (s) { } @@ -123,6 +124,7 @@ void Bar::before_line_breaking () { SCM g = get_elt_property ("glyph"); + SCM orig = g; Direction bsd = break_status_dir (); if (gh_string_p (g)) { @@ -145,7 +147,7 @@ Bar::before_line_breaking () set_elt_property ("transparent", SCM_BOOL_T); set_extent_callback (0, X_AXIS); } - else + else if (! gh_equal_p (g, orig)) set_elt_property ("glyph", g); } diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index 075af92ed9..739b557944 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -87,7 +87,7 @@ Beam_engraver::do_process_music () } prev_start_req_ = reqs_drul_[START]; - beam_p_ = new Beam; + beam_p_ = new Beam (get_property ("basicBeamProperties")); SCM smp = get_property ("measurePosition"); Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0); diff --git a/lily/beam.cc b/lily/beam.cc index d7461746cc..108f543bc6 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -32,7 +32,8 @@ #include "staff-symbol-referencer.hh" #include "cross-staff.hh" -Beam::Beam () +Beam::Beam (SCM s) + : Spanner (s) { Pointer_group_interface g (this, "stems"); g.set_interface (); @@ -422,6 +423,8 @@ Real Beam::calc_stem_y_f (Stem* s, Real y, Real dy) const { Real thick = gh_scm2double (get_elt_property ("beam-thickness")); + thick *= paper_l ()->get_var ("staffspace"); + int beam_multiplicity = get_multiplicity (); int stem_multiplicity = (s->flag_i () - 2) >? 0; @@ -603,12 +606,13 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const programming_error ("Beams are not left-to-right"); Real staffline_f = paper_l ()->get_var ("stafflinethickness"); - int multiplicity = get_multiplicity (); + int multiplicity = get_multiplicity (); Real interbeam_f = paper_l ()->interbeam_f (multiplicity); Real thick = gh_scm2double (get_elt_property ("beam-thickness")); - + thick *= paper_l ()->get_var ("staffspace"); + Real bdy = interbeam_f; Real stemdx = staffline_f; diff --git a/lily/break-align-engraver.cc b/lily/break-align-engraver.cc index 6a3293c73e..f2b59eb272 100644 --- a/lily/break-align-engraver.cc +++ b/lily/break-align-engraver.cc @@ -84,25 +84,22 @@ Break_align_engraver::acknowledge_element (Score_element_info inf) if (item_l->empty_b (X_AXIS) || item_l->parent_l (X_AXIS)) return; - SCM bp=item_l->remove_elt_property ("breakable"); + SCM bp=item_l->get_elt_property ("breakable"); bool breakable = (to_boolean (bp)); if (!breakable) return ; - SCM align_name = item_l->remove_elt_property ("break-align-symbol"); + SCM align_name = item_l->get_elt_property ("break-align-symbol"); if (!gh_symbol_p (align_name)) return ; if (!align_l_) { - align_l_ = new Break_align_item; - align_l_->set_elt_property ("breakable", SCM_BOOL_T); + align_l_ = new Break_align_item (get_property ("basicBreakAlignProperties")); announce_element (Score_element_info (align_l_,0)); - - Item * edge = new Item; SCM edge_sym = ly_symbol2scm ("Left_edge_item"); - edge->set_elt_property ("break-align-symbol", edge_sym); + Item * edge = new Item (get_property ("leftEdgeBasicProperties")); /* If the element is empty, it will be ignored in the break @@ -129,7 +126,7 @@ Break_align_engraver::acknowledge_element (Score_element_info inf) } else { - group = new Item; + group = new Item (SCM_EOL); Axis_group_interface (group).set_interface (); Axis_group_interface (group).set_axes (X_AXIS,X_AXIS); diff --git a/lily/break-align-item.cc b/lily/break-align-item.cc index ca3925cf4a..c29a970cc5 100644 --- a/lily/break-align-item.cc +++ b/lily/break-align-item.cc @@ -157,7 +157,8 @@ Break_align_item::before_line_breaking () } -Break_align_item::Break_align_item () +Break_align_item::Break_align_item (SCM s) + : Item (s) { set_elt_property ("stacking-dir" , gh_int2scm (RIGHT)); diff --git a/lily/breathing-sign-engraver.cc b/lily/breathing-sign-engraver.cc index 2508bb8390..f72e5b2b97 100644 --- a/lily/breathing-sign-engraver.cc +++ b/lily/breathing-sign-engraver.cc @@ -46,9 +46,8 @@ Breathing_sign_engraver::do_process_music() { if(breathing_sign_req_l_) { - breathing_sign_p_ = new Breathing_sign; - breathing_sign_p_->set_elt_property ("break-align-symbol", - ly_symbol2scm ("Breathing_sign")); + SCM b = get_property ("basicBreathingSignProperties"); + breathing_sign_p_ = new Breathing_sign (b); Staff_symbol_referencer_interface st (breathing_sign_p_); st.set_interface (); diff --git a/lily/breathing-sign.cc b/lily/breathing-sign.cc index 64e588f727..d1473eb214 100644 --- a/lily/breathing-sign.cc +++ b/lily/breathing-sign.cc @@ -21,9 +21,9 @@ #include "direction.hh" -Breathing_sign::Breathing_sign () +Breathing_sign::Breathing_sign (SCM s) + : Item (s) { - set_elt_property ("breakable", SCM_BOOL_T); } Molecule diff --git a/lily/chord-name-engraver.cc b/lily/chord-name-engraver.cc index 32419e420c..b074cd8b75 100644 --- a/lily/chord-name-engraver.cc +++ b/lily/chord-name-engraver.cc @@ -73,7 +73,7 @@ Chord_name_engraver::do_process_music () if (gh_boolean_p (chord_inversion)) find_inversion_b = gh_scm2bool (chord_inversion); - chord_name_p_ = new Chord_name; + chord_name_p_ = new Chord_name (SCM_EOL); Chord chord = to_chord (pitch_arr_, tonic_req_, inversion_req_, bass_req_, find_inversion_b); diff --git a/lily/chord-name.cc b/lily/chord-name.cc index 0e8e1d0942..e8500f9c6c 100644 --- a/lily/chord-name.cc +++ b/lily/chord-name.cc @@ -162,3 +162,8 @@ Chord_name::do_brew_molecule () const return ly_text2molecule (text); } + +Chord_name::Chord_name (SCM s) + : Item (s) +{ +} diff --git a/lily/chord-tremolo-engraver.cc b/lily/chord-tremolo-engraver.cc index 291133c50e..4148b2bb62 100644 --- a/lily/chord-tremolo-engraver.cc +++ b/lily/chord-tremolo-engraver.cc @@ -90,7 +90,7 @@ Chord_tremolo_engraver::do_process_music () { if (repeat_ && !beam_p_) { - beam_p_ = new Beam; + beam_p_ = new Beam (SCM_EOL); beam_p_->set_elt_property ("chord-tremolo", SCM_BOOL_T); diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index aa7291d7c7..cfc26a629c 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -184,8 +184,7 @@ Clef_engraver::create_clef() { if (!clef_p_) { - Clef_item *c= new Clef_item; - c-> property_alist_ = current_settings_; + Clef_item *c= new Clef_item ( current_settings_); announce_element (Score_element_info (c, clef_req_l_)); Staff_symbol_referencer_interface si(c); @@ -198,16 +197,12 @@ Clef_engraver::create_clef() si.set_position (clef_position_i_); if (octave_dir_) { - Text_item * g = new Text_item; + Text_item * g = new Text_item (get_property ("basicOctavateEightProperties")); Side_position_interface spi (g); spi.set_axis (Y_AXIS); spi.add_support (clef_p_); - g->set_elt_property ("text", ly_str02scm ( "8")); - g->set_elt_property ("style", gh_str02scm ("italic")); g->set_parent (clef_p_, Y_AXIS); g->set_parent (clef_p_, X_AXIS); - - g->set_elt_property ("self-alignment-X", gh_int2scm (0)); g->add_offset_callback (Side_position_interface::aligned_on_self, X_AXIS); g->add_offset_callback (Side_position_interface::centered_on_parent, X_AXIS); g->set_elt_property ("direction", gh_int2scm (octave_dir_)); diff --git a/lily/clef-item.cc b/lily/clef-item.cc index 21d97d8075..ce7c057be4 100644 --- a/lily/clef-item.cc +++ b/lily/clef-item.cc @@ -12,6 +12,10 @@ #include "molecule.hh" #include "text-item.hh" +Clef_item::Clef_item (SCM s) + : Item (s) +{} + void Clef_item::before_line_breaking () { @@ -21,10 +25,17 @@ Clef_item::before_line_breaking () style = ly_scm2string (style_sym); SCM glyph = get_elt_property ("glyph"); + + /* + FIXME: should use symbol. + */ if (gh_string_p (glyph)) { String s = ly_scm2string (glyph); - + + /* + FIXME: should use fontsize property to set clef changes. + */ if (break_status_dir() != RIGHT && style != "fullSizeChanges") { s += "_change"; diff --git a/lily/collision-engraver.cc b/lily/collision-engraver.cc index c31121dae4..db736c8bb4 100644 --- a/lily/collision-engraver.cc +++ b/lily/collision-engraver.cc @@ -35,7 +35,7 @@ Collision_engraver::process_acknowledged () return ; if (!col_p_) { - col_p_ = new Collision; + col_p_ = new Collision (get_property ("basicCollisionProperties")); announce_element (Score_element_info (col_p_,0)); } for (int i=0; i< note_column_l_arr_.size (); i++) diff --git a/lily/collision.cc b/lily/collision.cc index b500fc8896..52498e533a 100644 --- a/lily/collision.cc +++ b/lily/collision.cc @@ -13,7 +13,8 @@ #include "axis-group-interface.hh" -Collision::Collision() +Collision::Collision(SCM s ) + : Item (s) { Axis_group_interface (this).set_interface (); Axis_group_interface (this).set_axes (X_AXIS, Y_AXIS); diff --git a/lily/crescendo.cc b/lily/crescendo.cc index 236fbfb53c..fd390e0826 100644 --- a/lily/crescendo.cc +++ b/lily/crescendo.cc @@ -15,7 +15,8 @@ #include "paper-column.hh" -Crescendo::Crescendo () +Crescendo::Crescendo (SCM s) + : Spanner (s) { set_elt_property ("dynamic-drul", gh_cons (SCM_BOOL_F, SCM_BOOL_F)); } diff --git a/lily/dot-column-engraver.cc b/lily/dot-column-engraver.cc index 5c2cfd49c4..fdcc919bfd 100644 --- a/lily/dot-column-engraver.cc +++ b/lily/dot-column-engraver.cc @@ -40,7 +40,7 @@ Dot_column_engraver::acknowledge_element (Score_element_info info) if (!dotcol_p_) { - dotcol_p_ = new Dot_column; + dotcol_p_ = new Dot_column( SCM_EOL); Side_position_interface (dotcol_p_).set_axis (X_AXIS); Side_position_interface (dotcol_p_).set_direction (RIGHT); announce_element (Score_element_info (dotcol_p_, 0)); diff --git a/lily/dot-column.cc b/lily/dot-column.cc index 322a188653..75b86cf657 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -48,7 +48,8 @@ Dot_column::compare (Dots * const &d1, Dots * const &d2) } -Dot_column::Dot_column () +Dot_column::Dot_column (SCM s) + : Item (s) { Pointer_group_interface gi (this, "dots"); gi.set_interface (); diff --git a/lily/dots.cc b/lily/dots.cc index 2487268c2b..a658d838e7 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -13,7 +13,8 @@ #include "staff-symbol-referencer.hh" #include "directional-element-interface.hh" -Dots::Dots () +Dots::Dots (SCM s) + : Item (s) { set_elt_property ("dot-count", gh_int2scm (0)); } diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index af10c5037d..15592c6c78 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -39,13 +39,14 @@ class Dynamic_line_spanner : public Spanner { public: - Dynamic_line_spanner (); + Dynamic_line_spanner (SCM); VIRTUAL_COPY_CONS(Score_element); void add_column (Note_column*); void add_element (Score_element*); }; -Dynamic_line_spanner::Dynamic_line_spanner () +Dynamic_line_spanner::Dynamic_line_spanner (SCM s) + : Spanner (s) { set_elt_property ("transparent", SCM_BOOL_T); Side_position_interface (this).set_axis (Y_AXIS); @@ -172,7 +173,7 @@ Dynamic_engraver::do_process_music () && !line_spanner_ && pending_element_arr_.size ()) { - line_spanner_ = new Dynamic_line_spanner; + line_spanner_ = new Dynamic_line_spanner (get_property ("basicDynamicLineSpannerProperties")); for (int i = 0; i < pending_column_arr_.size (); i++) line_spanner_->add_column (pending_column_arr_[i]); pending_column_arr_.clear (); @@ -262,16 +263,12 @@ Dynamic_engraver::do_process_music () { String loud = text_req_l_->text_str_; - text_p_ = new Text_item; - text_p_->set_elt_property ("text", - ly_str02scm (loud.ch_C ())); - text_p_->set_elt_property ("style", gh_str02scm ("dynamic")); - text_p_->set_elt_property ("script-priority", - gh_int2scm (100)); + text_p_ = new Text_item (get_property ("basicDynamicTextProperties")); + text_p_->set_elt_property ("text", ly_str02scm (loud.ch_C ())); if (Direction d=text_req_l_->get_direction ()) directional_element (text_p_).set (d); pending_element_arr_.push (text_p_); - text_p_->set_elt_property ("self-alignment-Y", gh_int2scm (0)); + text_p_->add_offset_callback (Side_position_interface::aligned_on_self, Y_AXIS); announce_element (Score_element_info (text_p_, text_req_l_)); @@ -307,7 +304,7 @@ Dynamic_engraver::do_process_music () else { span_start_req_l_ = span_req_l_drul_[START]; - cresc_p_ = new Crescendo; + cresc_p_ = new Crescendo (SCM_EOL); cresc_p_->set_elt_property ("grow-direction", gh_int2scm ((span_req_l_drul_[START]->span_type_str_ == "crescendo") diff --git a/lily/extender-engraver.cc b/lily/extender-engraver.cc index aba5025d69..9e869dc9c2 100644 --- a/lily/extender-engraver.cc +++ b/lily/extender-engraver.cc @@ -75,7 +75,7 @@ Extender_engraver::do_process_music () return; } - extender_spanner_p_ = new Extender_spanner; + extender_spanner_p_ = new Extender_spanner (SCM_EOL); extender_spanner_p_->set_textitem (LEFT, last_lyric_l_); announce_element (Score_element_info (extender_spanner_p_, req_l_)); } diff --git a/lily/extender-spanner.cc b/lily/extender-spanner.cc index 4c1dedbcd6..8a987bad27 100644 --- a/lily/extender-spanner.cc +++ b/lily/extender-spanner.cc @@ -20,8 +20,9 @@ #include "paper-def.hh" #include "extender-spanner.hh" -Extender_spanner::Extender_spanner () - : Spanner () +Extender_spanner::Extender_spanner (SCM s) + : Spanner (s) + { dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0; set_extent_callback (Score_element::point_dimension_callback, Y_AXIS); diff --git a/lily/grace-align-item.cc b/lily/grace-align-item.cc index 73ef013c07..654f44139e 100644 --- a/lily/grace-align-item.cc +++ b/lily/grace-align-item.cc @@ -13,7 +13,8 @@ #include "paper-column.hh" #include "paper-def.hh" -Grace_align_item::Grace_align_item () +Grace_align_item::Grace_align_item (SCM s) + : Item (s) { set_elt_property ("stacking-dir", gh_int2scm (RIGHT)); Align_interface (this).set_interface(); diff --git a/lily/hara-kiri-engraver.cc b/lily/hara-kiri-engraver.cc index 1d2e281c21..29211b6234 100644 --- a/lily/hara-kiri-engraver.cc +++ b/lily/hara-kiri-engraver.cc @@ -13,7 +13,7 @@ Spanner* Hara_kiri_engraver::get_spanner_p () const { - return new Hara_kiri_group_spanner; + return new Hara_kiri_group_spanner (SCM_EOL); } void diff --git a/lily/hara-kiri-vertical-group-spanner.cc b/lily/hara-kiri-vertical-group-spanner.cc index 76c95fcb8b..d028ed5ef9 100644 --- a/lily/hara-kiri-vertical-group-spanner.cc +++ b/lily/hara-kiri-vertical-group-spanner.cc @@ -13,7 +13,8 @@ #include "debug.hh" #include "item.hh" -Hara_kiri_group_spanner::Hara_kiri_group_spanner() +Hara_kiri_group_spanner::Hara_kiri_group_spanner(SCM s) + : Spanner (s) { set_elt_pointer ("items-worth-living", SCM_EOL); } diff --git a/lily/hyphen-engraver.cc b/lily/hyphen-engraver.cc index 72eb2268fe..071526f89a 100644 --- a/lily/hyphen-engraver.cc +++ b/lily/hyphen-engraver.cc @@ -73,7 +73,7 @@ Hyphen_engraver::do_process_music () return; } - hyphen_spanner_p_ = new Hyphen_spanner; + hyphen_spanner_p_ = new Hyphen_spanner (SCM_EOL); hyphen_spanner_p_->set_textitem (LEFT, last_lyric_l_); announce_element (Score_element_info (hyphen_spanner_p_, req_l_)); } diff --git a/lily/hyphen-spanner.cc b/lily/hyphen-spanner.cc index acc40be05a..d0b58fc3bd 100644 --- a/lily/hyphen-spanner.cc +++ b/lily/hyphen-spanner.cc @@ -22,8 +22,8 @@ #include "hyphen-spanner.hh" #include "dimension-cache.hh" -Hyphen_spanner::Hyphen_spanner () - : Spanner () +Hyphen_spanner::Hyphen_spanner (SCM s) + : Spanner (s) { dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0; diff --git a/lily/include/bar.hh b/lily/include/bar.hh index aa429c89bb..f770c3aac2 100644 --- a/lily/include/bar.hh +++ b/lily/include/bar.hh @@ -14,7 +14,7 @@ class Bar:public Item { public: VIRTUAL_COPY_CONS(Score_element); - Bar(); + Bar(SCM); Molecule compound_barline (String, Real height) const; Molecule simple_barline (Real wid, Real height) const; diff --git a/lily/include/beam.hh b/lily/include/beam.hh index 768d07aaa7..27a19a1769 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -34,7 +34,7 @@ public: Stem* first_visible_stem () const; Stem* last_visible_stem () const; - Beam (); + Beam (SCM); void add_stem (Stem*); void set_grouping (Rhythmic_grouping def, Rhythmic_grouping current); void set_beaming (Beaming_info_list *); diff --git a/lily/include/break-align-item.hh b/lily/include/break-align-item.hh index 49057bde8d..6ba3cc1b7a 100644 --- a/lily/include/break-align-item.hh +++ b/lily/include/break-align-item.hh @@ -29,7 +29,7 @@ class Break_align_item : public Item protected: virtual void before_line_breaking (); public: - Break_align_item (); + Break_align_item (SCM s); VIRTUAL_COPY_CONS(Score_element); }; #endif // BREAK_ALIGN_ITEM_HH diff --git a/lily/include/breathing-sign.hh b/lily/include/breathing-sign.hh index e0cda68c19..fb212868b5 100644 --- a/lily/include/breathing-sign.hh +++ b/lily/include/breathing-sign.hh @@ -21,7 +21,7 @@ class Breathing_sign : public Item { public: VIRTUAL_COPY_CONS(Score_element); - Breathing_sign (); + Breathing_sign (SCM s); protected: virtual void after_line_breaking (); virtual Molecule do_brew_molecule () const; diff --git a/lily/include/chord-name.hh b/lily/include/chord-name.hh index 3bdf747a0b..2f77bb4b1d 100644 --- a/lily/include/chord-name.hh +++ b/lily/include/chord-name.hh @@ -25,9 +25,10 @@ public: VIRTUAL_COPY_CONS (Score_element); Molecule ly_word2molecule (SCM scm) const; Molecule ly_text2molecule (SCM scm) const; - + Chord_name(SCM s); protected: virtual Molecule do_brew_molecule () const; + }; #endif // CHORD_NAME_HH diff --git a/lily/include/clef-item.hh b/lily/include/clef-item.hh index 111e416393..75aad9b0d8 100644 --- a/lily/include/clef-item.hh +++ b/lily/include/clef-item.hh @@ -29,6 +29,7 @@ protected: virtual void before_line_breaking (); public: VIRTUAL_COPY_CONS(Score_element); + Clef_item (SCM); }; #endif // CLEFITEM_HH diff --git a/lily/include/collision.hh b/lily/include/collision.hh index 4cb7b615ec..4cb1993856 100644 --- a/lily/include/collision.hh +++ b/lily/include/collision.hh @@ -45,6 +45,6 @@ protected: public: void add_column (Note_column*ncol_l); - Collision(); + Collision(SCM); }; #endif // COLLISION_HH diff --git a/lily/include/crescendo.hh b/lily/include/crescendo.hh index 115b98b9fd..b5a46c8433 100644 --- a/lily/include/crescendo.hh +++ b/lily/include/crescendo.hh @@ -18,7 +18,7 @@ */ class Crescendo : public Spanner { public: - Crescendo(); + Crescendo(SCM); protected: VIRTUAL_COPY_CONS(Score_element); virtual Molecule do_brew_molecule() const; diff --git a/lily/include/dot-column.hh b/lily/include/dot-column.hh index 4c3a211557..9fd7150b82 100644 --- a/lily/include/dot-column.hh +++ b/lily/include/dot-column.hh @@ -23,7 +23,7 @@ class Dot_column : public Item public: VIRTUAL_COPY_CONS (Score_element); void add_head (Rhythmic_head*); - Dot_column (); + Dot_column (SCM); protected: virtual void after_line_breaking (); diff --git a/lily/include/dots.hh b/lily/include/dots.hh index 2446e1f906..e1bf806390 100644 --- a/lily/include/dots.hh +++ b/lily/include/dots.hh @@ -30,7 +30,7 @@ protected: virtual void after_line_breaking (); public: - Dots (); + Dots (SCM); }; #endif // DOTS_HH diff --git a/lily/include/extender-spanner.hh b/lily/include/extender-spanner.hh index 261e758f4d..862318e7ea 100644 --- a/lily/include/extender-spanner.hh +++ b/lily/include/extender-spanner.hh @@ -30,7 +30,7 @@ class Extender_spanner : public Spanner { public: - Extender_spanner (); + Extender_spanner (SCM); void set_textitem (Direction, Item*); protected: diff --git a/lily/include/grace-align-item.hh b/lily/include/grace-align-item.hh index ed16719bca..b4f9e94e99 100644 --- a/lily/include/grace-align-item.hh +++ b/lily/include/grace-align-item.hh @@ -17,7 +17,7 @@ class Grace_align_item : public Item { public: VIRTUAL_COPY_CONS (Score_element); - Grace_align_item (); + Grace_align_item (SCM); protected: virtual void do_add_processing (); virtual void before_line_breaking (); diff --git a/lily/include/hara-kiri-vertical-group-spanner.hh b/lily/include/hara-kiri-vertical-group-spanner.hh index 389223cf34..1adc9480bf 100644 --- a/lily/include/hara-kiri-vertical-group-spanner.hh +++ b/lily/include/hara-kiri-vertical-group-spanner.hh @@ -27,7 +27,7 @@ class Hara_kiri_group_spanner : public Spanner { public: - Hara_kiri_group_spanner (); + Hara_kiri_group_spanner (SCM); virtual void after_line_breaking (); void add_interesting_item (Item* n); protected: diff --git a/lily/include/hyphen-spanner.hh b/lily/include/hyphen-spanner.hh index ec60dee675..24c1ab7299 100644 --- a/lily/include/hyphen-spanner.hh +++ b/lily/include/hyphen-spanner.hh @@ -21,7 +21,7 @@ class Hyphen_spanner : public Spanner { public: -Hyphen_spanner (); + Hyphen_spanner (SCM); void set_textitem (Direction, Item*); protected: diff --git a/lily/include/item.hh b/lily/include/item.hh index 7d327628ed..c036dd2e52 100644 --- a/lily/include/item.hh +++ b/lily/include/item.hh @@ -40,7 +40,7 @@ class Item : public Score_element public: VIRTUAL_COPY_CONS(Score_element); - Item(); + Item (SCM); Item (Item const &); bool breakable_b () const; diff --git a/lily/include/key-def.hh b/lily/include/key-def.hh index 2b9fdccff2..160e7c43cb 100644 --- a/lily/include/key-def.hh +++ b/lily/include/key-def.hh @@ -17,6 +17,8 @@ Universal key definition (Should rename class Key to 'Accidentals'?) FIXME: merge key.hh and key-def.hh classes. + + FIXME: use Scheme data structs for this. */ class Key_def { diff --git a/lily/include/key-item.hh b/lily/include/key-item.hh index c003a3094d..b8430c4272 100644 --- a/lily/include/key-item.hh +++ b/lily/include/key-item.hh @@ -28,7 +28,7 @@ class Key_item :public Item public: VIRTUAL_COPY_CONS(Score_element); - Key_item (); + Key_item (SCM); void add (int pitch, int acc); void add_old (int pitch, int acc); diff --git a/lily/include/key.hh b/lily/include/key.hh index 5c24db2f08..5e096997f3 100644 --- a/lily/include/key.hh +++ b/lily/include/key.hh @@ -10,6 +10,10 @@ #include "array.hh" #include "lily-proto.hh" +/* + JUNKME JUNKME JUNKME + */ + /// administration of current key in one octave. class Octave_key { diff --git a/lily/include/local-key-item.hh b/lily/include/local-key-item.hh index 39ad2ccac2..db072f0dfe 100644 --- a/lily/include/local-key-item.hh +++ b/lily/include/local-key-item.hh @@ -40,11 +40,13 @@ class Local_key_item : public Item Molecule accidental (int,bool,bool) const; public: - + Local_key_item (SCM ); void add_pitch (Musical_pitch, bool cautionary, bool natural); protected: virtual void before_line_breaking (); virtual Molecule do_brew_molecule() const; + + }; #endif // LOCALKEYITEM_HH diff --git a/lily/include/multi-measure-rest.hh b/lily/include/multi-measure-rest.hh index 8dfbba2f5f..0258c9a7ee 100644 --- a/lily/include/multi-measure-rest.hh +++ b/lily/include/multi-measure-rest.hh @@ -16,7 +16,7 @@ class Multi_measure_rest : public Spanner { public: - Multi_measure_rest (); + Multi_measure_rest (SCM); void add_column (Item*); Molecule compound_rest (int)const; diff --git a/lily/include/music-output-def.hh b/lily/include/music-output-def.hh index c19f9ce6fe..4b4c0f3d1c 100644 --- a/lily/include/music-output-def.hh +++ b/lily/include/music-output-def.hh @@ -26,7 +26,6 @@ public: Scope *scope_p_; Array filename_str_arr_; - Scheme_hash_table default_properties_; Music_output_def (Music_output_def const&); Music_output_def (); diff --git a/lily/include/note-column.hh b/lily/include/note-column.hh index 9ad0295ad7..88c2c36016 100644 --- a/lily/include/note-column.hh +++ b/lily/include/note-column.hh @@ -35,7 +35,7 @@ public: void translate_rests(int dy); Note_head * first_head ()const; Interval rest_dim ()const ; - Note_column (); + Note_column (SCM); void set_stem (Stem*); void set_dotcol (Dot_column*); void add_head (Rhythmic_head*); diff --git a/lily/include/note-head.hh b/lily/include/note-head.hh index 3354ecfb24..85442c0b00 100644 --- a/lily/include/note-head.hh +++ b/lily/include/note-head.hh @@ -25,8 +25,8 @@ public: static int compare (Note_head * const &a, Note_head *const &b) ; Molecule ledger_line (Interval) const; + Note_head (SCM); protected: - virtual void before_line_breaking (); virtual Molecule do_brew_molecule() const; }; diff --git a/lily/include/rest-collision.hh b/lily/include/rest-collision.hh index eac7a48a0f..d6f26fa718 100644 --- a/lily/include/rest-collision.hh +++ b/lily/include/rest-collision.hh @@ -18,7 +18,7 @@ public: void add_column (Note_column*); Interval rest_dim () const; - Rest_collision(); + Rest_collision(SCM); protected: virtual void before_line_breaking (); }; diff --git a/lily/include/rest.hh b/lily/include/rest.hh index dcd6b81628..cb62ce3883 100644 --- a/lily/include/rest.hh +++ b/lily/include/rest.hh @@ -24,5 +24,7 @@ class Rest : public Rhythmic_head protected: virtual void after_line_breaking (); virtual Molecule do_brew_molecule () const; +public: + Rest (SCM s); }; #endif // REST_HH diff --git a/lily/include/rhythmic-head.hh b/lily/include/rhythmic-head.hh index 5d3ca3d56c..b9fc4415b6 100644 --- a/lily/include/rhythmic-head.hh +++ b/lily/include/rhythmic-head.hh @@ -36,6 +36,7 @@ public: int dot_count () const; protected: virtual void after_line_breaking (); + Rhythmic_head (SCM s); }; #endif // RHYTHMIC_HEAD_HH diff --git a/lily/include/score-element.hh b/lily/include/score-element.hh index 1c0d7e4ef3..16a0d8b39a 100644 --- a/lily/include/score-element.hh +++ b/lily/include/score-element.hh @@ -17,6 +17,8 @@ typedef Interval (*Extent_callback)(Score_element const *,Axis); typedef Real (*Offset_callback)(Score_element const *,Axis); +#define READONLY_PROPS // FIXME. + /** for administration of what was done already @@ -69,6 +71,9 @@ class Score_element { public: // ugh. SCM property_alist_; SCM pointer_alist_; +#ifndef READONLY_PROPS + SCM basic_property_list_; +#endif public: Score_element *original_l_; @@ -79,13 +84,6 @@ public: 0 means ORPHAN, */ char status_i_; - /** - Set this if anyone points to me, or if I point to anyone. - - JUNKME. - */ - bool used_b_; - char const * name () const; /* @@ -95,7 +93,7 @@ public: */ Paper_score *pscore_l_; - Score_element (); + Score_element (SCM basic_props); Score_element (Score_element const&); /* diff --git a/lily/include/script-column.hh b/lily/include/script-column.hh index 0ba7cb1281..d79e25f3f8 100644 --- a/lily/include/script-column.hh +++ b/lily/include/script-column.hh @@ -15,7 +15,7 @@ class Script_column : public Item { public: - Script_column(); + Script_column(SCM); void add_staff_sided (Item*); protected: virtual void before_line_breaking (); diff --git a/lily/include/script.hh b/lily/include/script.hh index 05149c7b93..4d8441584d 100644 --- a/lily/include/script.hh +++ b/lily/include/script.hh @@ -22,6 +22,7 @@ class Script : public Item { Molecule get_molecule (Direction d) const; public: + Script (SCM); protected: virtual void before_line_breaking (); diff --git a/lily/include/separating-group-spanner.hh b/lily/include/separating-group-spanner.hh index 6deb0fba8e..bfbe265062 100644 --- a/lily/include/separating-group-spanner.hh +++ b/lily/include/separating-group-spanner.hh @@ -16,7 +16,7 @@ class Separating_group_spanner : public Spanner { public: void add_spacing_unit (Single_malt_grouping_item*); - Separating_group_spanner(); + Separating_group_spanner(SCM); protected: VIRTUAL_COPY_CONS(Score_element); virtual Array get_rods () const; diff --git a/lily/include/single-malt-grouping-item.hh b/lily/include/single-malt-grouping-item.hh index 17280a2b82..082a37b517 100644 --- a/lily/include/single-malt-grouping-item.hh +++ b/lily/include/single-malt-grouping-item.hh @@ -31,7 +31,7 @@ class Single_malt_grouping_item : public Item { VIRTUAL_COPY_CONS(Score_element); public: - Single_malt_grouping_item (); + Single_malt_grouping_item (SCM); Interval my_width () const; void add_item (Item*); }; diff --git a/lily/include/slur.hh b/lily/include/slur.hh index cb202f1e93..3ab1dff6bd 100644 --- a/lily/include/slur.hh +++ b/lily/include/slur.hh @@ -16,7 +16,7 @@ class Slur : public Spanner { public: - Slur (); + Slur (SCM); VIRTUAL_COPY_CONS(Score_element); void add_column (Note_column*); diff --git a/lily/include/spacing-spanner.hh b/lily/include/spacing-spanner.hh index 46a7d6f025..c6e4bdd7cd 100644 --- a/lily/include/spacing-spanner.hh +++ b/lily/include/spacing-spanner.hh @@ -15,7 +15,7 @@ class Spacing_spanner : public Spanner { public: - Spacing_spanner (); + Spacing_spanner (SCM); VIRTUAL_COPY_CONS(Score_element); Array do_measure (Link_array) const; diff --git a/lily/include/span-bar.hh b/lily/include/span-bar.hh index ff5c6b0700..17886676cd 100644 --- a/lily/include/span-bar.hh +++ b/lily/include/span-bar.hh @@ -25,7 +25,7 @@ class Span_bar : public Bar { Interval get_spanned_interval () const; public: - Span_bar(); + Span_bar (SCM); VIRTUAL_COPY_CONS(Score_element); void add_bar (Score_element*); diff --git a/lily/include/spanner.hh b/lily/include/spanner.hh index 2a50a826b2..b3e894804d 100644 --- a/lily/include/spanner.hh +++ b/lily/include/spanner.hh @@ -40,7 +40,7 @@ public: void set_bound (Direction d, Item*); Item *get_bound (Direction d) const; - Spanner (); + Spanner (SCM); Spanner (Spanner const &); bool broken_b () const; void do_break (); diff --git a/lily/include/staff-bar.hh b/lily/include/staff-bar.hh index c8f5049293..0932ef78a1 100644 --- a/lily/include/staff-bar.hh +++ b/lily/include/staff-bar.hh @@ -22,6 +22,7 @@ class Staff_bar : public Bar public: VIRTUAL_COPY_CONS(Score_element); virtual Real get_bar_size () const; + Staff_bar (SCM); }; #endif /* STAFF_BAR_HH */ diff --git a/lily/include/staff-symbol.hh b/lily/include/staff-symbol.hh index 88821052fe..676886c7ec 100644 --- a/lily/include/staff-symbol.hh +++ b/lily/include/staff-symbol.hh @@ -21,8 +21,11 @@ public: Real staff_space () const; int steps_i() const; int line_count () const; + Staff_symbol (SCM s); + protected: VIRTUAL_COPY_CONS(Score_element); virtual Molecule do_brew_molecule() const; + }; #endif // STAFFSYM_HH diff --git a/lily/include/stem-tremolo.hh b/lily/include/stem-tremolo.hh index 59ac84f3e1..11c1c93af8 100644 --- a/lily/include/stem-tremolo.hh +++ b/lily/include/stem-tremolo.hh @@ -20,7 +20,7 @@ protected: static Interval dim_callback (Score_element*, Axis); public: - Stem_tremolo (); + Stem_tremolo (SCM); void set_stem (Stem *); }; diff --git a/lily/include/stem.hh b/lily/include/stem.hh index d843a9846c..8ae9771fca 100644 --- a/lily/include/stem.hh +++ b/lily/include/stem.hh @@ -57,7 +57,7 @@ public: Drul_array extremal_heads () const; Score_element * support_head () const; - Stem (); + Stem (SCM); /// ensure that this Stem also encompasses the Notehead #n# void add_head (Rhythmic_head*n); diff --git a/lily/include/sustain-pedal.hh b/lily/include/sustain-pedal.hh index b2ae20e984..9f17f20361 100644 --- a/lily/include/sustain-pedal.hh +++ b/lily/include/sustain-pedal.hh @@ -32,7 +32,7 @@ class Sustain_pedal : public Item { public: VIRTUAL_COPY_CONS (Score_element); - + Sustain_pedal (SCM); protected: virtual Molecule do_brew_molecule () const; virtual void after_line_breaking (); diff --git a/lily/include/system-start-delimiter.hh b/lily/include/system-start-delimiter.hh index d594c7ff87..d84acd97d0 100644 --- a/lily/include/system-start-delimiter.hh +++ b/lily/include/system-start-delimiter.hh @@ -18,7 +18,7 @@ class System_start_delimiter : public Spanner { public: - System_start_delimiter (); + System_start_delimiter (SCM); VIRTUAL_COPY_CONS (Score_element); protected: virtual void after_line_breaking(); diff --git a/lily/include/text-item.hh b/lily/include/text-item.hh index f6aaa02928..818a5a3139 100644 --- a/lily/include/text-item.hh +++ b/lily/include/text-item.hh @@ -19,6 +19,7 @@ class Text_item : public Item { public: VIRTUAL_COPY_CONS (Score_element); + Text_item (SCM s); protected: virtual Molecule do_brew_molecule () const; }; diff --git a/lily/include/tie-column.hh b/lily/include/tie-column.hh index cdbe522201..6dfe54d82b 100644 --- a/lily/include/tie-column.hh +++ b/lily/include/tie-column.hh @@ -18,11 +18,10 @@ class Tie_column : public Spanner public: VIRTUAL_COPY_CONS (Score_element); void add_tie (Tie*); - Tie_column (); + Tie_column (SCM s); protected: virtual void after_line_breaking (); void set_directions (); - }; #endif /* TIE_COLUMN_HH */ diff --git a/lily/include/tie.hh b/lily/include/tie.hh index 4240193247..7de2697cfa 100644 --- a/lily/include/tie.hh +++ b/lily/include/tie.hh @@ -19,7 +19,7 @@ class Tie : public Spanner { public: - Tie (); + Tie (SCM); void set_head (Direction, Item*head_l); VIRTUAL_COPY_CONS(Score_element); diff --git a/lily/include/time-signature.hh b/lily/include/time-signature.hh index 3bdc1208e1..6744bff15e 100644 --- a/lily/include/time-signature.hh +++ b/lily/include/time-signature.hh @@ -26,7 +26,7 @@ class Time_signature: public Item protected: virtual Molecule do_brew_molecule() const; public: - Time_signature () ; + Time_signature (SCM); /* TODO: make this SCM! diff --git a/lily/include/tuplet-spanner.hh b/lily/include/tuplet-spanner.hh index b851d1f626..51789988b6 100644 --- a/lily/include/tuplet-spanner.hh +++ b/lily/include/tuplet-spanner.hh @@ -20,7 +20,7 @@ class Tuplet_spanner : public Spanner { public: - Tuplet_spanner (); + Tuplet_spanner (SCM); void add_column (Note_column*); void add_beam (Beam*); diff --git a/lily/include/volta-spanner.hh b/lily/include/volta-spanner.hh index e76d6e0537..a1f9b0ebfe 100644 --- a/lily/include/volta-spanner.hh +++ b/lily/include/volta-spanner.hh @@ -16,7 +16,7 @@ class Volta_spanner : public Spanner { public: - Volta_spanner (); + Volta_spanner (SCM); void add_column (Note_column*); void add_bar (Bar*); diff --git a/lily/instrument-name-engraver.cc b/lily/instrument-name-engraver.cc index 584d0d9cd7..1a9bd7da1f 100644 --- a/lily/instrument-name-engraver.cc +++ b/lily/instrument-name-engraver.cc @@ -55,17 +55,12 @@ Instrument_name_engraver::create_text (SCM txt) { if(!text_) { - text_ = new Text_item; + text_ = new Text_item (get_property ("basicInstrumentNameProperties")); text_->set_elt_property ("text", txt); - text_->set_elt_property ("breakable", SCM_BOOL_T); /* TODO: use more lispish names for break-align-symbols */ - text_->set_elt_property ("break-align-symbol", ly_symbol2scm ("Instrument_name")); - text_->set_elt_property ("visibility-lambda", - scm_eval (ly_symbol2scm ("begin-of-line-visible"))); - if (delim_) text_->set_parent (delim_, Y_AXIS); diff --git a/lily/item.cc b/lily/item.cc index 61c0a28f8e..ea8fde5d84 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -15,7 +15,9 @@ #include "lily-guile.hh" #include "line-of-score.hh" -Item::Item () +Item::Item (SCM s) + : Score_element (s) + { broken_to_drul_[LEFT] = broken_to_drul_[RIGHT]=0; } diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index 85419c2a19..250fb169ea 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -5,7 +5,7 @@ (c) 1997--2000 Han-Wen Nienhuys */ -// clean me up + #include "key-engraver.hh" #include "key-item.hh" #include "command-request.hh" @@ -16,6 +16,11 @@ #include "timing-translator.hh" #include "staff-symbol-referencer.hh" +/* + this is a large mess. Please clean this to use Basic properties and + Scheme data structs. + */ + Key_engraver::Key_engraver () { item_p_ = 0; @@ -33,11 +38,11 @@ Key_engraver::create_key (bool def) { if (!item_p_) { - item_p_ = new Key_item; - item_p_->property_alist_ = get_property ("basicKeyProperties"); - + item_p_ = new Key_item ( get_property ("basicKeyProperties")); item_p_->set_elt_property ("c0-position", gh_int2scm (0)); + + // todo: put this in basic props. item_p_->set_elt_property ("old-accidentals", SCM_EOL); item_p_->set_elt_property ("new-accidentals", SCM_EOL); diff --git a/lily/key-item.cc b/lily/key-item.cc index 2740a77a04..c9b74955b7 100644 --- a/lily/key-item.cc +++ b/lily/key-item.cc @@ -18,9 +18,9 @@ const int FLAT_TOP_PITCH=2; /* fes,ges,as and bes typeset in lower octave */ const int SHARP_TOP_PITCH=4; /* ais and bis typeset in lower octave */ -Key_item::Key_item () +Key_item::Key_item (SCM s) + : Item (s) { - set_elt_property ("breakable", SCM_BOOL_T); set_elt_property ("c0-position", gh_int2scm (0)); } diff --git a/lily/line-group-group-engraver.cc b/lily/line-group-group-engraver.cc index e08fae2289..aa4b6e8c20 100644 --- a/lily/line-group-group-engraver.cc +++ b/lily/line-group-group-engraver.cc @@ -52,7 +52,7 @@ Line_group_engraver_group::do_creation_processing() void Line_group_engraver_group::create_line_spanner () { - staffline_p_ = new Spanner ; + staffline_p_ = new Spanner (SCM_EOL); Axis_group_interface (staffline_p_).set_interface (); Axis_group_interface (staffline_p_).set_axes (Y_AXIS,Y_AXIS); } diff --git a/lily/line-number-engraver.cc b/lily/line-number-engraver.cc index fc9f639367..afde3217cd 100644 --- a/lily/line-number-engraver.cc +++ b/lily/line-number-engraver.cc @@ -36,7 +36,7 @@ Line_number_engraver::process_acknowledged () { if (!text_item_p_ && interesting_.size ()) { - text_item_p_ = new Text_item; + text_item_p_ = new Text_item (SCM_EOL); Side_position_interface si (text_item_p_); si.set_axis (Y_AXIS); text_item_p_->set_parent (interesting_[0].elem_l_, Y_AXIS); diff --git a/lily/line-of-score.cc b/lily/line-of-score.cc index 2f340aaf4f..2ca094bab9 100644 --- a/lily/line-of-score.cc +++ b/lily/line-of-score.cc @@ -21,6 +21,7 @@ #include "all-font-metrics.hh" Line_of_score::Line_of_score() + : Spanner (SCM_EOL) { set_elt_pointer ("columns", SCM_EOL); set_elt_pointer ("all-elements", SCM_EOL); diff --git a/lily/local-key-engraver.cc b/lily/local-key-engraver.cc index f917dc7e8a..8a5678fe1b 100644 --- a/lily/local-key-engraver.cc +++ b/lily/local-key-engraver.cc @@ -124,7 +124,7 @@ Local_key_engraver::process_acknowledged () { if (!key_item_p_) { - key_item_p_ = new Local_key_item; + key_item_p_ = new Local_key_item (SCM_EOL); Side_position_interface (key_item_p_).set_axis (X_AXIS); Side_position_interface (key_item_p_).set_direction (LEFT); staff_symbol_referencer(key_item_p_).set_interface (); diff --git a/lily/local-key-item.cc b/lily/local-key-item.cc index 9166bb2fd0..e730ad4ea0 100644 --- a/lily/local-key-item.cc +++ b/lily/local-key-item.cc @@ -136,3 +136,8 @@ Local_key_item::do_brew_molecule() const return mol; } +Local_key_item::Local_key_item (SCM s) + : Item (s) +{ + +} diff --git a/lily/lyric-engraver.cc b/lily/lyric-engraver.cc index 61e12a1c51..fce6048163 100644 --- a/lily/lyric-engraver.cc +++ b/lily/lyric-engraver.cc @@ -40,11 +40,11 @@ Lyric_engraver::do_process_music() { if (req_l_) { - text_p_= new Text_item; + text_p_= new Text_item (get_property ("basicLyricTextProperties")); text_p_->set_elt_property ("text", ly_str02scm ((req_l_->text_str_ + " ").ch_C ())); - text_p_->set_elt_property ("non-rhythmic", SCM_BOOL_T); + announce_element (Score_element_info (text_p_, req_l_)); } } diff --git a/lily/mark-engraver.cc b/lily/mark-engraver.cc index 7f79b1d210..88c1550606 100644 --- a/lily/mark-engraver.cc +++ b/lily/mark-engraver.cc @@ -34,7 +34,6 @@ public: Mark_engraver (); protected: Text_item* text_p_; - Protected_scm visibility_lambda_; Protected_scm staffs_; protected: @@ -63,15 +62,9 @@ Mark_engraver::Mark_engraver () void Mark_engraver::do_creation_processing () { - String t = "markVisibilityFunction"; - SCM proc = get_property (t); - - if (gh_procedure_p (proc)) - visibility_lambda_ = proc; } - void Mark_engraver::acknowledge_element (Score_element_info inf) { @@ -107,13 +100,17 @@ Mark_engraver::create_items (Request *rq) { if (text_p_) return; - - text_p_ = new Text_item; - text_p_->set_elt_property ("breakable", SCM_BOOL_T); // ugh + + SCM s = get_property ("basicMarkProperties"); + text_p_ = new Text_item (s); + Group_interface (text_p_, "interfaces").add_thing (ly_symbol2scm ("Mark")); Side_position_interface staffside(text_p_); staffside.set_axis (Y_AXIS); + /* + -> Generic props. + */ SCM prop = get_property ("markDirection"); if (!isdir_b (prop)) { @@ -133,9 +130,6 @@ Mark_engraver::create_items (Request *rq) gh_double2scm(paper_l ()->get_var ("interline"))); } - if (gh_procedure_p (visibility_lambda_)) - text_p_->set_elt_property ("visibility-lambda", - visibility_lambda_); announce_element (Score_element_info (text_p_, rq)); } diff --git a/lily/multi-measure-rest-engraver.cc b/lily/multi-measure-rest-engraver.cc index fa7573888c..5941e43ec8 100644 --- a/lily/multi-measure-rest-engraver.cc +++ b/lily/multi-measure-rest-engraver.cc @@ -109,7 +109,7 @@ Multi_measure_rest_engraver::do_process_music () if (busy_span_req_l_ && !mmrest_p_) { - mmrest_p_ = new Multi_measure_rest; + mmrest_p_ = new Multi_measure_rest (SCM_EOL); Staff_symbol_referencer_interface si (mmrest_p_); si.set_interface (); diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index ff02759d3c..cd770d0d04 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -20,7 +20,8 @@ #include "stem.hh" #include "staff-symbol-referencer.hh" -Multi_measure_rest::Multi_measure_rest () +Multi_measure_rest::Multi_measure_rest (SCM s) + : Spanner (s) { set_elt_pointer ("columns", SCM_EOL); } diff --git a/lily/music-output-def.cc b/lily/music-output-def.cc index a673d9fcb9..0805e3c242 100644 --- a/lily/music-output-def.cc +++ b/lily/music-output-def.cc @@ -39,7 +39,7 @@ Music_output_def::Music_output_def (Music_output_def const &s) { scope_p_ = new Scope (*s.scope_p_); translator_p_dict_p_ = new Scope (*s.translator_p_dict_p_); - default_properties_ = s.default_properties_; + // default_properties_ = s.default_properties_; for (Scope_iter i (*translator_p_dict_p_); i.ok (); i++) { diff --git a/lily/note-column.cc b/lily/note-column.cc index 7b8426077d..7c1dd5ae9c 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -38,7 +38,8 @@ Note_column::shift_compare (Note_column *const &p1, Note_column*const&p2) return h1 - h2; } -Note_column::Note_column() +Note_column::Note_column( SCM s) + : Item (s) { set_elt_pointer ("rests", SCM_EOL); set_elt_pointer ("note-heads", SCM_EOL); diff --git a/lily/note-head.cc b/lily/note-head.cc index 027f736c54..d5fa47e7ff 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -119,3 +119,9 @@ Note_head::do_brew_molecule() const return out; } + +Note_head::Note_head (SCM s) + : Rhythmic_head (s) +{ + +} diff --git a/lily/note-heads-engraver.cc b/lily/note-heads-engraver.cc index 780b642500..3090a6d111 100644 --- a/lily/note-heads-engraver.cc +++ b/lily/note-heads-engraver.cc @@ -60,7 +60,7 @@ Note_heads_engraver::do_process_music() for (int i=0; i < note_req_l_arr_.size (); i++) { - Note_head *note_p = new Note_head; + Note_head *note_p = new Note_head (SCM_EOL); Staff_symbol_referencer_interface si (note_p); si.set_interface (); @@ -73,7 +73,7 @@ Note_heads_engraver::do_process_music() if (note_req_l->duration_.dots_i_) { - Dots * d = new Dots; + Dots * d = new Dots (SCM_EOL); Staff_symbol_referencer_interface sd (d); sd.set_interface (); diff --git a/lily/note-name-engraver.cc b/lily/note-name-engraver.cc index 80e7651b6e..1f03a0ea1a 100644 --- a/lily/note-name-engraver.cc +++ b/lily/note-name-engraver.cc @@ -46,7 +46,7 @@ Note_name_engraver::do_process_music () } if (s.length_i()) { - Text_item * t = new Text_item; + Text_item * t = new Text_item (SCM_EOL); t->set_elt_property ("text", ly_str02scm ( s.ch_C())); announce_element (Score_element_info (t, req_l_arr_[0])); texts_.push (t); diff --git a/lily/paper-column.cc b/lily/paper-column.cc index a399a6acea..f7db1474a2 100644 --- a/lily/paper-column.cc +++ b/lily/paper-column.cc @@ -95,6 +95,7 @@ Paper_column::column_l () const } Paper_column::Paper_column (Moment w) + : Item (SCM_EOL) { SCM when = (new Moment (w))->smobify_self (); scm_unprotect_object (when); diff --git a/lily/paper-def.cc b/lily/paper-def.cc index 9234da4d1c..08adf11220 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -78,36 +78,17 @@ Paper_def::get_realvar (SCM s) const return *p; } - +/* + FIXME. This is broken until we have a generic way of + putting lists inside the \paper block. + */ Interval Paper_def::line_dimensions_int (int n) const { - SCM s = default_properties_.get (ly_symbol2scm ("margin-shape")); - if (!gh_pair_p (s)) - { - Real lw = get_var ("linewidth"); - Real ind = n? 0.0:get_var ("indent"); + Real lw = get_var ("linewidth"); + Real ind = n? 0.0:get_var ("indent"); - return Interval (ind, lw); - } - - - SCM last = SCM_EOL; - while (gh_pair_p (s) && n --) - { - last = s; - s = gh_cdr (s); - } - - if (s == SCM_EOL) - { - s = last; - } - - SCM pair = gh_car (s); - - return Interval (gh_scm2double (gh_car (pair)), - gh_scm2double (gh_cdr (pair))); + return Interval (ind, lw); } void diff --git a/lily/parser.yy b/lily/parser.yy index 3c0320699b..e6c4fe3c19 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -547,18 +547,6 @@ paper_def_body: } | paper_def_body assignment semicolon { - } - | paper_def_body SCM_T '=' SCM_T { - if (!gh_symbol_p ($2)) - THIS->parser_error ("expect a symbol as lvalue"); - else - $$->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_.set ($2, gh_double2scm ($4)); } | paper_def_body translator_spec_block { $$->assign_translator ($2); diff --git a/lily/piano-pedal-engraver.cc b/lily/piano-pedal-engraver.cc index 216670ca30..e51fff1c6e 100644 --- a/lily/piano-pedal-engraver.cc +++ b/lily/piano-pedal-engraver.cc @@ -185,12 +185,12 @@ Piano_pedal_engraver::do_process_music () { if (p->name_ == String ("Sustain")) { - p->item_p_ = new Sustain_pedal; + p->item_p_ = new Sustain_pedal (SCM_EOL); p->item_p_->set_elt_property ("text", s); } else { - p->item_p_ = new Text_item; + p->item_p_ = new Text_item (SCM_EOL); p->item_p_->set_elt_property ("text", s); // guh p->item_p_->set_elt_property ("style", ly_str02scm ("italic")); @@ -199,6 +199,7 @@ Piano_pedal_engraver::do_process_music () Side_position_interface si (p->item_p_); si.set_axis (Y_AXIS); + // todo: init with basic props. p->item_p_->set_elt_property ("no-spacing-rods" , SCM_BOOL_T); p->item_p_->set_elt_property ("self-alignment-X", gh_int2scm (0)); p->item_p_->add_offset_callback (Side_position_interface::aligned_on_self, X_AXIS); diff --git a/lily/pointer-group-interface.cc b/lily/pointer-group-interface.cc index dd40723e39..f20aea2b05 100644 --- a/lily/pointer-group-interface.cc +++ b/lily/pointer-group-interface.cc @@ -33,9 +33,6 @@ Pointer_group_interface::has_interface_b () void Pointer_group_interface::add_element (Score_element*p) { - p->used_b_ = true; - elt_l_->used_b_ = true; - elt_l_->set_elt_pointer (name_.ch_C(), gh_cons (p->self_scm_, elt_l_->get_elt_pointer (name_.ch_C()))); diff --git a/lily/repeat-engraver.cc b/lily/repeat-engraver.cc index 67fa3e661e..8c838c3474 100644 --- a/lily/repeat-engraver.cc +++ b/lily/repeat-engraver.cc @@ -180,7 +180,7 @@ Repeat_engraver::do_process_music () else { assert (!volta_span_p_); - volta_span_p_ = new Volta_spanner; + volta_span_p_ = new Volta_spanner (SCM_EOL); announce_element (Score_element_info (volta_span_p_,0)); volta_span_p_->set_elt_property ("text", ly_str02scm (t.ch_C())); diff --git a/lily/rest-collision-engraver.cc b/lily/rest-collision-engraver.cc index c735a03205..606dfe30d6 100644 --- a/lily/rest-collision-engraver.cc +++ b/lily/rest-collision-engraver.cc @@ -27,7 +27,7 @@ Rest_collision_engraver::process_acknowledged () if (rest_collision_p_ || note_column_l_arr_.size () < 2) return; - rest_collision_p_ = new Rest_collision; + rest_collision_p_ = new Rest_collision (get_property ("basicRestCollisionProperties")); announce_element (Score_element_info (rest_collision_p_, 0)); for (int i=0; i< note_column_l_arr_.size (); i++) diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index d713630dbe..34d39fbe3b 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -188,11 +188,11 @@ Rest_collision::before_line_breaking () } -Rest_collision::Rest_collision() +Rest_collision::Rest_collision(SCM s) + : Item (s) { set_elt_pointer ("rests", SCM_EOL); set_elt_pointer ("notes", SCM_EOL); - set_elt_property ("transparent", SCM_BOOL_T); set_extent_callback (0, X_AXIS); set_extent_callback (0, Y_AXIS); } diff --git a/lily/rest-engraver.cc b/lily/rest-engraver.cc index fce8f71bbd..37b3e6ee1f 100644 --- a/lily/rest-engraver.cc +++ b/lily/rest-engraver.cc @@ -46,7 +46,7 @@ Rest_engraver::do_process_music () { if (rest_req_l_ && !rest_p_) { - rest_p_ = new Rest; + rest_p_ = new Rest (SCM_EOL); Staff_symbol_referencer_interface si (rest_p_); si.set_interface (); @@ -55,7 +55,7 @@ Rest_engraver::do_process_music () if (rest_req_l_->duration_.dots_i_) { - dot_p_ = new Dots; + dot_p_ = new Dots (SCM_EOL); Staff_symbol_referencer_interface si (dot_p_); si.set_interface (); diff --git a/lily/rest.cc b/lily/rest.cc index 89c2d1a9e0..b01d47896d 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -62,3 +62,8 @@ Rest::do_brew_molecule () const +Rest::Rest (SCM s) + : Rhythmic_head (s) +{ +} + diff --git a/lily/rhythmic-column-engraver.cc b/lily/rhythmic-column-engraver.cc index a8bf90263a..ad0c6acbdd 100644 --- a/lily/rhythmic-column-engraver.cc +++ b/lily/rhythmic-column-engraver.cc @@ -30,7 +30,7 @@ Rhythmic_column_engraver::process_acknowledged () { if (!ncol_p_) { - ncol_p_ = new Note_column; + ncol_p_ = new Note_column (SCM_EOL); announce_element (Score_element_info (ncol_p_, 0)); } diff --git a/lily/rhythmic-head.cc b/lily/rhythmic-head.cc index 83aa03820b..1b735cd5ee 100644 --- a/lily/rhythmic-head.cc +++ b/lily/rhythmic-head.cc @@ -67,3 +67,7 @@ Rhythmic_head::add_dots (Dots *dot_l) } +Rhythmic_head::Rhythmic_head (SCM s) + : Item (s) +{ +} diff --git a/lily/score-element.cc b/lily/score-element.cc index ec4221cad0..ea3ac9cbac 100644 --- a/lily/score-element.cc +++ b/lily/score-element.cc @@ -37,20 +37,22 @@ remove dynamic_cast and put this code into respective subclass. */ -Score_element::Score_element() + + +Score_element::Score_element(SCM basicprops) { - // junkme. - used_b_ = false; set_extent_callback (molecule_extent, X_AXIS); set_extent_callback (molecule_extent, Y_AXIS); - used_b_ = false; pscore_l_=0; lookup_l_ =0; status_i_ = 0; self_scm_ = SCM_EOL; original_l_ = 0; - property_alist_ = SCM_EOL; +#ifndef READONLY_PROPS + basic_property_list_ = basicprops; +#endif READONLY_PROPS + property_alist_ = basicprops; pointer_alist_ = SCM_EOL; smobify_self (); @@ -63,9 +65,19 @@ Score_element::Score_element (Score_element const&s) : dim_cache_ (s.dim_cache_) { self_scm_ = SCM_EOL; - used_b_ = true; original_l_ =(Score_element*) &s; - property_alist_ = s.property_alist_; + property_alist_ = s.property_alist_; +#ifndef READONLY_PROPS + basic_property_list_ = s.basic_property_list_; + /* + TODO: should copy the private part of the list. + */ + SCM y ; + for (SCM *sp = &s.property_alist_; *sp != basic_property_list_; sp = &SCM_CDR(*sp)) + { + *sp = gh_cons ( + } +#endif pointer_alist_ = SCM_EOL; status_i_ = s.status_i_; @@ -79,6 +91,16 @@ Score_element::~Score_element() { } + +SCM +Score_element::get_elt_pointer (const char *nm) const +{ + SCM sym = ly_symbol2scm (nm); + SCM s = scm_assq(sym, pointer_alist_); + + return (s == SCM_BOOL_F) ? SCM_UNDEFINED : gh_cdr (s); +} + // should also have one that takes SCM arg. SCM Score_element::get_elt_property (String nm) const @@ -89,53 +111,49 @@ Score_element::get_elt_property (String nm) const if (s != SCM_BOOL_F) return gh_cdr (s); - /* - JUNKME - */ - 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::get_elt_pointer (const char *nm) const -{ - SCM sym = ly_symbol2scm (nm); - SCM s = scm_assq(sym, pointer_alist_); - - return (s == SCM_BOOL_F) ? SCM_UNDEFINED : gh_cdr (s); -} - +/* + Remove the value associated with KEY, and return it. The result is + that a next call will yield SCM_UNDEFINED (and not the underlying + `basic' property. +*/ SCM Score_element::remove_elt_property (const char* key) { - SCM s = get_elt_property (key); - SCM sym = ly_symbol2scm (key); - - property_alist_ = gh_cons (gh_cons (sym, SCM_UNDEFINED), property_alist_); - - return s; + SCM val = get_elt_property (key); + if (val != SCM_UNDEFINED) + set_elt_property (key, SCM_UNDEFINED); + return val; } void -Score_element::set_elt_property (String k, SCM v) +Score_element::set_elt_property (String k, SCM val) { - SCM s = ly_symbol2scm (k.ch_C ()); - // non destructive - property_alist_ = gh_cons (gh_cons (s, v),property_alist_); + SCM sym = ly_symbol2scm (k.ch_C ()); +#ifndef READONLY_PROPS + /* + destructive if found in my part of the list. + */ + for (SCM s = property_alist_; s != basic_property_list_; s =gh_cdr (s)) + { + if (gh_caar (s)== sym) + { + gh_set_cdr_x (gh_car (s), val); + return; + } + } +/* + not found in private list. Override in private list. + */ + +#endif + + property_alist_ = gh_cons (gh_cons (sym, val), property_alist_); } + void Score_element::set_elt_pointer (const char* k, SCM v) { @@ -462,12 +480,6 @@ Score_element::handle_prebroken_dependencies() } -bool -Score_element::linked_b() const -{ - return used_b_; -} - Score_element* Score_element::find_broken_piece (Line_of_score*) const { diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index 21b7350a83..b84406fa15 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -144,7 +144,7 @@ Score_engraver::typeset_all() { if (!elem_p->parent_l (X_AXIS)) { - bool br = to_boolean (elem_p->remove_elt_property ("breakable")); + bool br = to_boolean (elem_p->get_elt_property ("breakable")); Axis_group_interface gi ((br) ? command_column_l_ : musical_column_l_) ; gi.add_element(elem_p); } @@ -182,7 +182,7 @@ Score_engraver::set_columns (Paper_column *new_command_l, if (*current[i]) { if ((*current[i])->used_b()) - // if ((*current[i])->linked_b()) + { scoreline_l_->add_column ((*current[i])); } diff --git a/lily/script-column-engraver.cc b/lily/script-column-engraver.cc index 131bf4bb63..9fbf4f567d 100644 --- a/lily/script-column-engraver.cc +++ b/lily/script-column-engraver.cc @@ -73,7 +73,7 @@ Script_column_engraver::process_acknowledged () { if (!scol_p_ && script_l_arr_.size () > 1) { - scol_p_ = new Script_column; + scol_p_ = new Script_column (SCM_EOL); announce_element (Score_element_info (scol_p_, 0)); } diff --git a/lily/script-column.cc b/lily/script-column.cc index ad776158a2..c4123815d4 100644 --- a/lily/script-column.cc +++ b/lily/script-column.cc @@ -25,9 +25,10 @@ Script_column::add_staff_sided (Item *i) add_dependency (i); } -Script_column::Script_column () +Script_column::Script_column (SCM s) + : Item (s) { - set_elt_property ("scripts", SCM_EOL); + set_elt_pointer ("scripts", SCM_EOL); } static int diff --git a/lily/script-engraver.cc b/lily/script-engraver.cc index 3ea13a879a..7136ba6841 100644 --- a/lily/script-engraver.cc +++ b/lily/script-engraver.cc @@ -70,7 +70,8 @@ Script_engraver::do_process_music() l->articulation_str_.ch_C ())); continue; } - Script *p =new Script; + // todo -> use result of articulation-to-scriptdef directly as basic prop list. + Script *p =new Script (SCM_EOL); Side_position_interface stafy (p); diff --git a/lily/script.cc b/lily/script.cc index 3e78d6acd8..20c799cd96 100644 --- a/lily/script.cc +++ b/lily/script.cc @@ -14,6 +14,10 @@ #include "paper-def.hh" #include "dimension-cache.hh" +Script ::Script (SCM s) + : Item (s) +{ +} Molecule Script::get_molecule(Direction d) const diff --git a/lily/separating-group-spanner.cc b/lily/separating-group-spanner.cc index ea15f96c09..9ce1156d17 100644 --- a/lily/separating-group-spanner.cc +++ b/lily/separating-group-spanner.cc @@ -106,7 +106,8 @@ Separating_group_spanner::add_spacing_unit (Single_malt_grouping_item*i) } -Separating_group_spanner::Separating_group_spanner () +Separating_group_spanner::Separating_group_spanner (SCM s) + : Spanner (s) { set_elt_pointer ("elements", SCM_EOL); } diff --git a/lily/separating-line-group-engraver.cc b/lily/separating-line-group-engraver.cc index 7d99122fd5..4abc0d3aaf 100644 --- a/lily/separating-line-group-engraver.cc +++ b/lily/separating-line-group-engraver.cc @@ -23,7 +23,7 @@ Separating_line_group_engraver::Separating_line_group_engraver () void Separating_line_group_engraver::do_creation_processing () { - sep_span_p_ = new Separating_group_spanner; + sep_span_p_ = new Separating_group_spanner (SCM_EOL); announce_element (Score_element_info (sep_span_p_, 0)); sep_span_p_->set_bound (LEFT, get_staff_info ().command_pcol_l ()); } @@ -48,7 +48,10 @@ Separating_line_group_engraver::acknowledge_element (Score_element_info i) if (!p_ref_) { - p_ref_ = new Single_malt_grouping_item; + p_ref_ + = new Single_malt_grouping_item + (get_property ("basicSingleMaltGroupingItemProperties")); + if (ib) p_ref_->set_elt_property ("breakable", SCM_BOOL_T); announce_element (Score_element_info (p_ref_, 0)); diff --git a/lily/single-malt-grouping-item.cc b/lily/single-malt-grouping-item.cc index e12f7ed0c1..84d10f7230 100644 --- a/lily/single-malt-grouping-item.cc +++ b/lily/single-malt-grouping-item.cc @@ -12,9 +12,9 @@ #include "debug.hh" #include "group-interface.hh" -Single_malt_grouping_item ::Single_malt_grouping_item() +Single_malt_grouping_item ::Single_malt_grouping_item(SCM s) + : Item (s) { - set_elt_property ("transparent", SCM_BOOL_T); set_elt_pointer ("elements", SCM_EOL); // this is weird! , but needed! diff --git a/lily/slur-engraver.cc b/lily/slur-engraver.cc index 5d7114482d..89edf59ca9 100644 --- a/lily/slur-engraver.cc +++ b/lily/slur-engraver.cc @@ -106,7 +106,7 @@ Slur_engraver::do_process_music() { // push a new slur onto stack. //(use temp. array to wait for all slur STOPs) - Slur * s_p =new Slur; + Slur * s_p =new Slur (SCM_EOL); requests_arr_.push (slur_req_l); start_slur_l_arr_.push (s_p); diff --git a/lily/slur.cc b/lily/slur.cc index 8439b6a35c..f15b9a3bb8 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -215,7 +215,8 @@ Slur_bezier_bow::fit_factor () const Slur */ -Slur::Slur () +Slur::Slur (SCM s) + : Spanner (s) { // URG dy_f_drul_[LEFT] = dy_f_drul_[RIGHT] = 0.0; diff --git a/lily/spacing-engraver.cc b/lily/spacing-engraver.cc index 83b3ab1337..5e05094bdb 100644 --- a/lily/spacing-engraver.cc +++ b/lily/spacing-engraver.cc @@ -34,7 +34,7 @@ Spacing_engraver::Spacing_engraver() void Spacing_engraver::do_creation_processing () { - spacing_p_ =new Spacing_spanner; + spacing_p_ =new Spacing_spanner (SCM_EOL); spacing_p_->set_bound (LEFT, get_staff_info ().command_pcol_l ()); announce_element (Score_element_info (spacing_p_, 0)); } diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index 4b413ec6a8..d9de35e5f3 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -16,7 +16,8 @@ #include "line-of-score.hh" #include "misc.hh" -Spacing_spanner::Spacing_spanner () +Spacing_spanner::Spacing_spanner (SCM s) + : Spanner (s) { set_extent_callback (0, X_AXIS); set_extent_callback (0, Y_AXIS); diff --git a/lily/span-bar-engraver.cc b/lily/span-bar-engraver.cc index 5a3e29b968..f2659b0923 100644 --- a/lily/span-bar-engraver.cc +++ b/lily/span-bar-engraver.cc @@ -31,7 +31,7 @@ public: protected: virtual void acknowledge_element (Score_element_info); virtual void do_pre_move_processing(); - virtual Span_bar* get_span_bar_p() const; + virtual Span_bar* get_span_bar_p(SCM) const; }; @@ -41,9 +41,9 @@ Span_bar_engraver::Span_bar_engraver() } Span_bar* -Span_bar_engraver::get_span_bar_p() const +Span_bar_engraver::get_span_bar_p(SCM s) const { - Span_bar * sp= new Span_bar; + Span_bar * sp= new Span_bar (s); return sp; } @@ -59,8 +59,7 @@ Span_bar_engraver::acknowledge_element (Score_element_info i) if (bar_l_arr_.size() >= 2 && !spanbar_p_) { - spanbar_p_ = get_span_bar_p(); - spanbar_p_-> property_alist_ = bar_l_arr_[0]->property_alist_; + spanbar_p_ = get_span_bar_p( bar_l_arr_[0]->property_alist_); spanbar_p_->set_parent (bar_l_arr_[0], Y_AXIS); spanbar_p_->set_parent (bar_l_arr_[0], X_AXIS); diff --git a/lily/span-bar.cc b/lily/span-bar.cc index f33f70fdce..741d7c00f0 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -58,7 +58,7 @@ Span_bar::after_line_breaking () void Span_bar::evaluate_empty () { - if (!gh_pair_p (get_elt_property ("elements"))) + if (!gh_pair_p (get_elt_pointer ("elements"))) { set_elt_property ("transparent", SCM_BOOL_T); set_extent_callback (0, X_AXIS); @@ -74,6 +74,7 @@ Span_bar::evaluate_empty () } else { String type_str = ly_scm2string (gl); + String orig = type_str; if (type_str == "|:") { type_str= ".|"; @@ -86,8 +87,8 @@ Span_bar::evaluate_empty () { type_str= ".|."; } - - set_elt_property ("glyph", ly_str02scm (type_str.ch_C())); + if (orig != type_str) + set_elt_property ("glyph", ly_str02scm (type_str.ch_C())); } } @@ -110,7 +111,8 @@ Span_bar::get_bar_size () const return iv.length (); } -Span_bar::Span_bar () +Span_bar::Span_bar (SCM s) + : Bar (s) { Pointer_group_interface(this).set_interface (); set_extent_callback (width_callback, X_AXIS); diff --git a/lily/spanner.cc b/lily/spanner.cc index c384224889..01ae90892c 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -159,10 +159,6 @@ void Spanner::set_bound(Direction d, Item*i) { spanned_drul_[d] =i; - if (i) - { - i->used_b_ = true; - } /** We check for Line_of_score to prevent the column -> line_of_score @@ -179,7 +175,8 @@ Spanner::set_bound(Direction d, Item*i) } -Spanner::Spanner () +Spanner::Spanner (SCM s) + : Score_element (s) { spanned_drul_[LEFT]=0; spanned_drul_[RIGHT]=0; diff --git a/lily/staff-bar.cc b/lily/staff-bar.cc index c1aba6ca96..c74c0bcfb7 100644 --- a/lily/staff-bar.cc +++ b/lily/staff-bar.cc @@ -23,3 +23,9 @@ Staff_bar::get_bar_size () const } } + +Staff_bar::Staff_bar (SCM s) + : Bar (s) +{ + +} diff --git a/lily/staff-symbol-engraver.cc b/lily/staff-symbol-engraver.cc index f749d7d007..e5bc48cd62 100644 --- a/lily/staff-symbol-engraver.cc +++ b/lily/staff-symbol-engraver.cc @@ -1,5 +1,5 @@ /* - staff-sym-reg.cc -- implement Staff_symbol_engraver + staff-symbol-engraver.cc -- implement Staff_symbol_engraver source file of the GNU LilyPond music typesetter @@ -46,12 +46,9 @@ Staff_symbol_engraver::Staff_symbol_engraver() void Staff_symbol_engraver::do_creation_processing() { - span_p_ = new Staff_symbol; + span_p_ = new Staff_symbol (get_property ("staffSymbolBasicProperties")); span_p_->set_bound(LEFT,get_staff_info().command_pcol_l ()); - - // ugh, should do generic - span_p_->property_alist_ = get_property ("staffSymbolBasicProperties"); announce_element (Score_element_info (span_p_, 0)); } diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc index 0540f9f0ae..9c52f04256 100644 --- a/lily/staff-symbol-referencer.cc +++ b/lily/staff-symbol-referencer.cc @@ -91,6 +91,8 @@ Staff_symbol_referencer_interface::position_f () const Real Staff_symbol_referencer_interface::callback (Score_element const* sc,Axis ) { + Score_element* me = (Score_element*)sc; // UGH. + SCM pos = sc->get_elt_property ("staff-position"); Real off =0.0; if (gh_number_p (pos)) @@ -98,8 +100,8 @@ Staff_symbol_referencer_interface::callback (Score_element const* sc,Axis ) Real space = staff_symbol_referencer (sc).staff_space (); off = gh_scm2double (pos) * space/2.0; } - Score_element* urg = (Score_element*)sc; - urg->set_elt_property ("staff-position", gh_double2scm (0.0)); + + me->set_elt_property ("staff-position", gh_double2scm (0.0)); return off; } diff --git a/lily/staff-symbol.cc b/lily/staff-symbol.cc index d4b83618c3..50399d33b5 100644 --- a/lily/staff-symbol.cc +++ b/lily/staff-symbol.cc @@ -63,3 +63,8 @@ Staff_symbol::staff_space ()const return gh_scm2double (get_elt_property ("staff-space")) * paper_l ()->get_var ("staffspace"); } + +Staff_symbol::Staff_symbol( SCM s) + : Spanner (s) +{ +} diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index 2af08ac71b..d4d92a7a4f 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -76,7 +76,7 @@ Stem_engraver::acknowledge_element(Score_element_info i) int duration_log = r->duration_.durlog_i_; if (!stem_p_) { - stem_p_ = new Stem; + stem_p_ = new Stem (SCM_EOL); Staff_symbol_referencer_interface st(stem_p_); st.set_interface (); @@ -101,7 +101,7 @@ Stem_engraver::acknowledge_element(Score_element_info i) if (requested_type) { - tremolo_p_ = new Stem_tremolo; + tremolo_p_ = new Stem_tremolo (get_property ("basicStemTremoloProperties")); announce_element (Score_element_info (tremolo_p_, tremolo_req_l_)); /* The number of tremolo flags is the number of flags of diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index 4cb96a2e83..4a23d14c35 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -23,7 +23,8 @@ lengthen stem if necessary */ -Stem_tremolo::Stem_tremolo () +Stem_tremolo::Stem_tremolo (SCM s) + : Item (s) { set_elt_pointer ("stem", SCM_EOL); } @@ -38,7 +39,7 @@ Stem_tremolo::stem_l ()const } Interval -Stem_tremolo::dim_callback (Score_element * se, Axis a) +Stem_tremolo::dim_callback (Score_element * se, Axis ) { Stem_tremolo * s = dynamic_cast (se); Real space = Staff_symbol_referencer_interface (s->stem_l ()) @@ -68,8 +69,12 @@ Stem_tremolo::do_brew_molecule () const // urg dydx = 0.25; + Real ss = Staff_symbol_referencer_interface (stem).staff_space (); Real thick = gh_scm2double (get_elt_property ("beam-thickness")); Real width = gh_scm2double (get_elt_property ("beam-width")); + width *= ss; + thick *= ss; + Molecule a (lookup_l ()->beam (dydx, width, thick)); a.translate (Offset (-width/2, width / 2 * dydx)); @@ -92,15 +97,12 @@ Stem_tremolo::do_brew_molecule () const } if (tremolo_flags) mol.translate_axis (-mol.extent (Y_AXIS).center (), Y_AXIS); - - Real half_space = Staff_symbol_referencer_interface (stem).staff_space () - / 2; if (beam) { // ugh, rather calc from Stem_tremolo_req int beams_i = stem->beam_count(RIGHT) >? stem->beam_count (LEFT); mol.translate (Offset(stem->relative_coordinate (0, X_AXIS) - relative_coordinate (0, X_AXIS), - stem->stem_end_position () * half_space - + stem->stem_end_position () * ss / 2 - directional_element (beam).get () * beams_i * interbeam_f)); } else @@ -108,7 +110,7 @@ Stem_tremolo::do_brew_molecule () const /* Beams should intersect one beamthickness below stem end */ - Real dy = stem->stem_end_position () * half_space; + Real dy = stem->stem_end_position () * ss / 2; dy -= mol.extent (Y_AXIS).length () / 2 * stem->get_direction (); /* diff --git a/lily/stem.cc b/lily/stem.cc index a6ae80f1e9..583d777c5c 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -214,7 +214,8 @@ Stem::add_head (Rhythmic_head *n) gi.add_element (n); } -Stem::Stem () +Stem::Stem (SCM s) + : Item (s) { set_elt_pointer ("heads", SCM_EOL); set_elt_pointer ("rests", SCM_EOL); diff --git a/lily/sustain-pedal.cc b/lily/sustain-pedal.cc index a6388d658e..f94867bbf4 100644 --- a/lily/sustain-pedal.cc +++ b/lily/sustain-pedal.cc @@ -60,3 +60,7 @@ Sustain_pedal::do_brew_molecule () const } + +Sustain_pedal ::Sustain_pedal(SCM s ) + : Item (s) +{} diff --git a/lily/system-start-delimiter-engraver.cc b/lily/system-start-delimiter-engraver.cc index d84e707b2c..4841e19a48 100644 --- a/lily/system-start-delimiter-engraver.cc +++ b/lily/system-start-delimiter-engraver.cc @@ -64,7 +64,7 @@ System_start_delimiter_engraver::System_start_delimiter_engraver() void System_start_delimiter_engraver::do_creation_processing() { - delim_ = new System_start_delimiter; + delim_ = new System_start_delimiter (get_property ("basicSystemStartDelimiterProperties")); delim_->set_bound (LEFT, get_staff_info ().command_pcol_l ()); /* @@ -87,8 +87,6 @@ System_start_delimiter_engraver::do_removal_processing () SCM collapse = get_property ("bracketCollapseHeight"); if (gh_number_p (collapse)) delim_->set_elt_property ("collapse-height", collapse); - else - delim_->set_elt_property ("collapse-height", gh_double2scm (1)); delim_->set_bound (RIGHT, get_staff_info ().command_pcol_l ()); typeset_element (delim_); diff --git a/lily/system-start-delimiter.cc b/lily/system-start-delimiter.cc index 763b3a5773..aeb2bfd9c1 100644 --- a/lily/system-start-delimiter.cc +++ b/lily/system-start-delimiter.cc @@ -38,7 +38,8 @@ System_start_delimiter::staff_bracket (Real height) const return mol; } -System_start_delimiter::System_start_delimiter () +System_start_delimiter::System_start_delimiter (SCM s) + : Spanner (s) { set_extent_callback (0, Y_AXIS); Pointer_group_interface (this).set_interface(); diff --git a/lily/text-engraver.cc b/lily/text-engraver.cc index 7c1e15c829..a3d72332f9 100644 --- a/lily/text-engraver.cc +++ b/lily/text-engraver.cc @@ -78,7 +78,7 @@ Text_engraver::do_process_music () { Text_script_req * r = reqs_[i]; - Text_item *text = new Text_item; + Text_item *text = new Text_item (SCM_EOL); Side_position_interface stafy (text); SCM axisprop = get_property ("scriptHorizontal"); diff --git a/lily/text-item.cc b/lily/text-item.cc index 9eb3047356..9e3be5ce81 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -14,6 +14,12 @@ #include "lookup.hh" #include "staff-symbol-referencer.hh" +Text_item::Text_item (SCM s) + : Item (s) +{ + +} + Molecule Text_item::do_brew_molecule () const { diff --git a/lily/tie-column.cc b/lily/tie-column.cc index 01935d3526..146e94d3a1 100644 --- a/lily/tie-column.cc +++ b/lily/tie-column.cc @@ -13,7 +13,8 @@ #include "directional-element-interface.hh" #include "note-head.hh" -Tie_column::Tie_column () +Tie_column::Tie_column (SCM s) + : Spanner (s) { set_elt_pointer ("ties", SCM_EOL); set_extent_callback (0, X_AXIS); diff --git a/lily/tie-engraver.cc b/lily/tie-engraver.cc index 273d66843e..b507048eed 100644 --- a/lily/tie-engraver.cc +++ b/lily/tie-engraver.cc @@ -173,7 +173,7 @@ Tie_engraver::process_acknowledged () SCM pair = gh_list_ref (head_list, gh_int2scm (i/2)); - Tie * p = new Tie; + Tie * p = new Tie (SCM_EOL); p->set_head (LEFT, dynamic_cast (unsmob_element (gh_car (pair)))); p->set_head (RIGHT, dynamic_cast (unsmob_element (gh_cdr (pair)))); @@ -182,7 +182,7 @@ Tie_engraver::process_acknowledged () } else for (SCM s = head_list; gh_pair_p (s); s = gh_cdr (s)) { - Tie * p = new Tie; + Tie * p = new Tie (SCM_EOL); p->set_head (LEFT, dynamic_cast (unsmob_element (gh_caar (s)))); p->set_head (RIGHT, dynamic_cast (unsmob_element (gh_cdar (s)))); @@ -196,7 +196,7 @@ Tie_engraver::process_acknowledged () } else if (tie_p_arr_.size () > 1 && !tie_column_p_) { - tie_column_p_ = new Tie_column; + tie_column_p_ = new Tie_column (SCM_EOL); for (int i = tie_p_arr_.size (); i--; ) tie_column_p_->add_tie (tie_p_arr_ [i]); announce_element (Score_element_info (tie_column_p_, 0)); diff --git a/lily/tie.cc b/lily/tie.cc index baba2c7061..daf09ecdab 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -30,7 +30,8 @@ Tie::set_head (Direction d, Item * head_l) add_dependency (head_l); } -Tie::Tie() +Tie::Tie(SCM s) + : Spanner (s) { set_elt_pointer ("heads", gh_cons (SCM_EOL, SCM_EOL)); dy_f_drul_[LEFT] = dy_f_drul_[RIGHT] = 0.0; diff --git a/lily/time-signature-engraver.cc b/lily/time-signature-engraver.cc index 3c42d78d96..77f1e75e94 100644 --- a/lily/time-signature-engraver.cc +++ b/lily/time-signature-engraver.cc @@ -35,8 +35,8 @@ Time_signature_engraver::do_process_music() Time_signature_change_req *req = timing_grav_l->time_signature_req_l(); if (req) { - time_signature_p_ = new Time_signature; - time_signature_p_->property_alist_ = get_property ("basicTimeSignatureProperties"); + time_signature_p_ = new Time_signature (get_property ("basicTimeSignatureProperties")); + time_signature_p_->set_elt_property ("fraction", gh_cons (gh_int2scm (req->beats_i_), gh_int2scm (req->one_beat_i_))); diff --git a/lily/time-signature.cc b/lily/time-signature.cc index 6a24d2bc69..15d419a94f 100644 --- a/lily/time-signature.cc +++ b/lily/time-signature.cc @@ -13,7 +13,8 @@ #include "paper-def.hh" #include "lookup.hh" -Time_signature::Time_signature () +Time_signature::Time_signature (SCM s) + : Item (s) { } diff --git a/lily/tuplet-engraver.cc b/lily/tuplet-engraver.cc index 1dccd22122..04918610d3 100644 --- a/lily/tuplet-engraver.cc +++ b/lily/tuplet-engraver.cc @@ -73,7 +73,7 @@ Tuplet_engraver::do_process_music () if (i < started_span_p_arr_.size () && started_span_p_arr_[i]) continue; - Tuplet_spanner* glep = new Tuplet_spanner; + Tuplet_spanner* glep = new Tuplet_spanner (SCM_EOL); if (i >= started_span_p_arr_.size ()) started_span_p_arr_.push (glep); else diff --git a/lily/tuplet-spanner.cc b/lily/tuplet-spanner.cc index 7b9a4531eb..70ad67dd4e 100644 --- a/lily/tuplet-spanner.cc +++ b/lily/tuplet-spanner.cc @@ -22,7 +22,8 @@ #include "directional-element-interface.hh" -Tuplet_spanner::Tuplet_spanner () +Tuplet_spanner::Tuplet_spanner (SCM s) + : Spanner (s) { set_elt_pointer ("beams", SCM_EOL); set_elt_pointer ("columns", SCM_EOL); diff --git a/lily/vertical-align-engraver.cc b/lily/vertical-align-engraver.cc index 9718a8a53b..0a9c319294 100644 --- a/lily/vertical-align-engraver.cc +++ b/lily/vertical-align-engraver.cc @@ -37,7 +37,7 @@ Vertical_align_engraver::Vertical_align_engraver() void Vertical_align_engraver::do_creation_processing() { - valign_p_ =new Spanner; //Axis_align_spanner + valign_p_ =new Spanner (SCM_EOL); // todo -> basic props Align_interface (valign_p_).set_interface (); Align_interface (valign_p_).set_axis (Y_AXIS); valign_p_->set_elt_property ("stacking-dir", diff --git a/lily/volta-spanner.cc b/lily/volta-spanner.cc index 357a9072d4..0ad6860ade 100644 --- a/lily/volta-spanner.cc +++ b/lily/volta-spanner.cc @@ -22,7 +22,8 @@ #include "side-position-interface.hh" #include "directional-element-interface.hh" -Volta_spanner::Volta_spanner () +Volta_spanner::Volta_spanner (SCM s) + : Spanner (s) { set_elt_pointer ("bars", SCM_EOL); Side_position_interface (this).set_axis (Y_AXIS); diff --git a/ly/engraver.ly b/ly/engraver.ly index c60ee1a510..7db035d55a 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -23,31 +23,6 @@ StaffContext=\translator { \consists "Repeat_engraver"; - staffSymbolBasicProperties = #'( - (staff-space . 1.0 ) - (line-count . 5 ) - ) - basicTimeSignatureProperties = #`( - (break-align-symbol . Time_signature) - (visibility-lambda . ,all-visible) - (breakable . #t) - ) - basicBarlineProperties = #`( - (break-align-symbol . Staff_bar) - (visibility-lambda . `begin-of-line-invisible) - (breakable . #t) - ) - - basicKeyProperties = #`( - (break-align-symbol . Key_item) - (visibility-lambda . ,begin-of-line-visible) - (breakable . #t) - ) - basicClefItemProperties = #`( - (breakable . #t) - (break-align-symbol . Clef_item) - (visibility-lambda . ,begin-of-line-visible) - ) % name, glyph id, c0 position supportedClefTypes = #'( @@ -170,6 +145,7 @@ VoiceContext = \translator { textScriptPadding = #3.0 \consists "Text_engraver"; + startSustain = #"Ped." stopSustain = #"*" stopStartSustain = #"*Ped." @@ -403,6 +379,101 @@ ScoreContext = \translator { defaultBarType = #"|" systemStartDelimiterGlyph = #'bar-line + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % default settings, mainly for breakable items + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + basicBarNumberProperties = #`( + (breakable . #t) + (visibility-lambda . ,begin-of-line-visible) + ) + basicMarkProperties = #'( + (breakable . #t) + (visibility-lambda . end-of-line-invisible) + ) + leftEdgeBasicProperties = #'( + (break-align-symbol . Left_edge_item) + (breakable . #t) + ) + + staffSymbolBasicProperties = #'( + (staff-space . 1.0 ) + (line-count . 5 ) + ) + basicTimeSignatureProperties = #`( + (break-align-symbol . Time_signature) + (visibility-lambda . ,all-visible) + (breakable . #t) + ) + basicBarlineProperties = #`( + (break-align-symbol . Staff_bar) + (visibility-lambda . ,begin-of-line-invisible) + (breakable . #t) + ) + basicSystemStartDelimiterProperties = #'( + (collapse-height . 1.0) + ) + basicKeyProperties = #`( + (break-align-symbol . Key_item) + (visibility-lambda . ,begin-of-line-visible) + (breakable . #t) + ) + basicClefItemProperties = #`( + (breakable . #t) + (break-align-symbol . Clef_item) + (visibility-lambda . ,begin-of-line-visible) + ) + + basicBeamProperties = #`( + (beam-thickness . 0.42) ; interline! + ) + basicStemTremoloProperties = #'( + (beam-width . 4.0) ; interline! + ) + + basicBreathingSignProperties = #'( + (break-align-symbol . Breathing_sign) + (breakable . #t ) + (visibility-lambda . ,begin-of-line-invisible) + ) + basicOctavateEightProperties = #'( + (self-alignment-X . 0) + (text . "8") + (style . "italic") + ) + basicDynamicLineSpannerProperties = #`( + (transparent . #t) + ) + basicDynamicTextProperties = # `( + (style . "dynamic") + (script-priority . 100) + (self-alignment-Y . 0) + ) + basicLyricTextProperties = #`( + (non-rhythmic . #t) + ) + basicRestCollisionProperties = #`( + (transparent . #t) + ) + basicCollisionProperties = #`( + (transparent . #t) + (axes 0 1) + ) + basicSingleMaltGroupingItemProperties = #'( + (transparent . #t) + ) + basicBreakAlignProperties = #'( + (breakable . #t) + ) + basicInstrumentNameProperties = #`( + (breakable . #t) + (break-align-symbol . Instrument_name) + (visibility-lambda . ,begin-of-line-visible) + ) + basicLocalKeyProperties = #`( + (left-padding . 0.2) + (right-padding . 0.4) + ) + \accepts "Staff"; \accepts "StaffGroup"; \accepts "RhythmicStaff"; @@ -415,7 +486,6 @@ ScoreContext = \translator { markVisibilityFunction = #end-of-line-invisible - barNumberVisibilityFunction = #begin-of-line-visible }; \translator { \ScoreContext } diff --git a/ly/params.ly b/ly/params.ly index b31166dcd7..15e9bbbb1e 100644 --- a/ly/params.ly +++ b/ly/params.ly @@ -266,13 +266,6 @@ Wordwrap =0.0; \include "engraver.ly"; -#'margin-shape = #'() -#'Local_key_item::left-padding = #'0.2 -#'Local_key_item::right-padding = #'0.4 -#'staff-height = \staffheight; -#'beam-thickness = \beam_thickness; %% UGR -#'Stem_tremolo::beam-width = 1.5 * \quartwidth ; -#'Breathing_sign::visibility-lambda = #begin-of-line-invisible -#'Left_edge_item::visibility-lambda = #begin-of-line-visible + diff --git a/make/out/lilypond.lsm b/make/out/lilypond.lsm index 067d6f4816..0a7749c512 100644 --- a/make/out/lilypond.lsm +++ b/make/out/lilypond.lsm @@ -1,15 +1,15 @@ Begin3 Title: LilyPond -Version: 1.3.54 -Entered-date: 25MAY00 +Version: 1.3.55 +Entered-date: 26MAY00 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.54.tar.gz + 1000k lilypond-1.3.55.tar.gz Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/ - 1000k lilypond-1.3.54.tar.gz + 1000k lilypond-1.3.55.tar.gz Copying-policy: GPL End diff --git a/make/out/lilypond.spec b/make/out/lilypond.spec index d33d426034..cfc1d1320e 100644 --- a/make/out/lilypond.spec +++ b/make/out/lilypond.spec @@ -1,9 +1,9 @@ Name: lilypond -Version: 1.3.54 +Version: 1.3.55 Release: 1 Copyright: GPL Group: Applications/Publishing -Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.54.tar.gz +Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.55.tar.gz Summary: A program for printing sheet music. URL: http://www.cs.uu.nl/~hanwen/lilypond # Icon: lilypond-icon.gif diff --git a/scripts/linux-time.py b/scripts/linux-time.py deleted file mode 100644 index b41abc4355..0000000000 --- a/scripts/linux-time.py +++ /dev/null @@ -1,151 +0,0 @@ -#!@PYTHON@ -# linux-time.py -- Print resourse usage of a command executing on GNU/Linux -# -# awaiting PC's linux-mm patch for getrusage -# -# source file of the GNU LilyPond music typesetter -# -# (c) 2000 Jan Nieuwenhuizen -# - -name = 'linux-time' -version = '@TOPLEVEL_VERSION@' -if version == '@' + 'TOPLEVEL_VERSION' + '@': - version = '(unknown version)' # uGUHGUHGHGUGH - -import string -import getopt -import sys -import os -import time -import posix -import signal - -def identify(): - sys.stderr.write ("%s from LilyPond %s\n" % (name, version)) - -def help (): - print (r""" -Usage: %s [OPTION]... COMMAND - -Print resourse usage of a command executing on GNU/Linux. - -Options: - -h, --help this help - -v, --version version information -""" % name) - -def print_version (): - print (r"""%s (GNU LilyPond) %s""" % (name, version)) - -(options, files) = getopt.getopt (sys.argv[1:], 'vh', ['help','version']) - -for opt in options: - o = opt[0] - a = opt[1] - if o== '--help' or o == '-h': - help () - sys.exit (0) - if o == '--version' or o == '-v': - print_version () - sys.exit (0) - else: - print o - raise getopt.error - -# identify () - -if len (files) < 1: - help () - sys.exit (2) - -#command = files[0] -#sys.system ("/usr/bin/time %s" % command) -pid = 0 -status = 0 -t = 0 -avg_size = 0 -max_size = 0 -avg_rss = 0 -max_rss = 0 -INTERVAL = 0.1 - -# why doesn't it work when put in a function? -#def time (): -# global status, t; -# #child_pid = os.fork () -# child_pid = forkit () -# if child_pid: -# #Parent -# while 1: -# try: -# # AARg, wait takes only 1 argument, -# # but this still compiled -# #(pid, status) = os.wait (child_pid, os.WNOHANG) -# (pid, status) = os.waitpid (child_pid, os.WNOHANG) -# if not pid: -# time.sleep (INTERVAL) -# t = t + 1 -# print ("s: %d" % t) -# except: -# break -# else: -# # Child -# status = os.system ("/usr/bin/time %s" % string.join (files, " ")) -# sys.exit (status) - - -if 0: - # cute, but this doesn't work: we get resources of /usr/bin/time - command = "/usr/bin/time" - args = files -else: - # we should do 'time' ourselves: - # man 5 proc - command = files[0] - args = files[1:] - - -child_pid = os.fork () -if child_pid: - #Parent - statm = "/proc/%d/statm" % child_pid - while 1: - try: - # AARg, wait takes only 1 argument, - # but this still compiled - #(pid, status) = os.wait (child_pid, os.WNOHANG) - (pid, status) = os.waitpid (child_pid, os.WNOHANG) - except: - break - if pid: - break - - time.sleep (INTERVAL) - f = open (statm, "r") - stats = f.readline () - f.close () - (size, rss, drie, vier, vijf, zes, zeven) = string.split (stats, " ") - t = t + 1 - size = string.atoi (size) - max_size = max (size, max_size) - avg_size = avg_size + size - rss = string.atoi (rss) - max_rss = max (rss, max_rss) - avg_rss = avg_rss + rss -else: - # Child - #status = os.system ("/usr/bin/time %s" % string.join (files, " ")) - #sys.exit (status) - os.execvp (command, (command,) + tuple (args)) - - -ms = max_size * 4.0/1024 -mr = max_size * 4.0/1024 -avg_size = avg_size / t -avg_rss = avg_rss / t -as = avg_size * 4.0/1024 -ar = avg_rss * 4.0/1024 -print ("MAXSIZE: %6.3fM(%d), MAXRSS: %6.3fM(%d)" % (ms, max_size, mr, max_rss)) -print ("AVGSIZE: %6.3fM(%d), AVGRSS: %6.3fM(%d)" % (as, avg_size, ar, avg_rss)) -sys.exit (status) -- 2.39.2