From: fred Date: Tue, 26 Mar 2002 22:45:35 +0000 (+0000) Subject: lilypond-1.3.25 X-Git-Tag: release/1.5.59~1892 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4111d7e5b5eb2756af5846733a3b88dbaab41306;p=lilypond.git lilypond-1.3.25 --- diff --git a/lily/include/bezier-bow.hh b/lily/include/bezier-bow.hh index 903088dece..93a453359c 100644 --- a/lily/include/bezier-bow.hh +++ b/lily/include/bezier-bow.hh @@ -41,8 +41,6 @@ public: Real vertical_offset_needed () const; - - SCM ugly_scm () const; Bezier_bow (Array points, Direction dir); void calculate (); Bezier get_curve () const; diff --git a/lily/include/lookup.hh b/lily/include/lookup.hh index d86f04e62a..2a227470fe 100644 --- a/lily/include/lookup.hh +++ b/lily/include/lookup.hh @@ -23,28 +23,27 @@ class Lookup { public: + String font_name_; + Adobe_font_metric * afm_l_; + + Lookup (); Lookup (Lookup const&); Molecule simple_bar (String s, Real w, Paper_def*) const; Molecule afm_find (String, bool warn=true) const; Molecule bar (String, Real height, Paper_def*) const; - Molecule beam (Real, Real, Real) const; - Molecule dashed_slur (Bezier, Real thick, Real dash) const; - Molecule ledger_line (Interval) const; - Molecule fill (Box b) const; - Molecule filledbox (Box b) const; Molecule accordion (SCM arg, Real interline_f) const; - Molecule slur (Bezier controls, Real cthick, Real thick) const; - Molecule text (String style, String text, Paper_def*) const; - Molecule staff_brace (Real dy, int) const; - Molecule staff_bracket (Real height, Paper_def* paper_l) const; - Molecule volta (Real h, Real w, Real thick, bool vert_start, bool vert_end) const; - Molecule special_time_signature (String, int,int, Paper_def*) const; - Molecule time_signature (int n,int d, Paper_def*) const; - String font_name_; - Adobe_font_metric * afm_l_; + static Molecule frame (Box b, Real thick); + static Molecule slur (Bezier controls, Real cthick, Real thick) ; + static Molecule beam (Real, Real, Real) ; + static Molecule dashed_slur (Bezier, Real thick, Real dash) ; + static Molecule fill (Box b) ; + static Molecule filledbox (Box b) ; + static Molecule text (String style, String text, Paper_def*) ; + static Molecule staff_brace (Real dy, int) ; + static Molecule staff_bracket (Real height, Paper_def* paper_l) ; }; #endif // LOOKUP_HH diff --git a/lily/include/note-head.hh b/lily/include/note-head.hh index 17f2a977f2..25fdda52b4 100644 --- a/lily/include/note-head.hh +++ b/lily/include/note-head.hh @@ -19,6 +19,8 @@ class Note_head : public Rhythmic_head { public: static int compare (Note_head * const &a, Note_head *const &b) ; + + Molecule ledger_line (Interval) const; protected: virtual void do_pre_processing(); diff --git a/lily/note-head.cc b/lily/note-head.cc index f1b3bf192d..d7da247660 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -18,6 +18,39 @@ +/* + build a ledger line for small pieces. + */ +Molecule +Note_head::ledger_line (Interval xwid) const +{ + Drul_array endings; + endings[LEFT] = lookup_l()->afm_find ("noteheads-ledgerending"); + Molecule * e = &endings[LEFT]; + endings[RIGHT] = *e; + + Real thick = e->dim_[Y_AXIS].length(); + Real len = e->dim_[X_AXIS].length () - thick; + + Molecule total; + Direction d = LEFT; + do { + endings[d].translate_axis (xwid[d] - endings[d].dim_[X_AXIS][d], X_AXIS); + total.add_molecule (endings[d]); + } while ((flip(&d)) != LEFT); + + Real xpos = xwid [LEFT] + len; + + while (xpos + len + thick /2 <= xwid[RIGHT]) + { + e->translate_axis (len, X_AXIS); + total.add_molecule (*e); + xpos += len; + } + + return total; +} + void Note_head::do_pre_processing () @@ -76,9 +109,8 @@ Note_head::do_brew_molecule_p() const Interval hd = out->dim_[X_AXIS]; Real hw = hd.length ()/4; - Molecule ledger - = lookup_l ()->ledger_line (Interval (hd[LEFT] - hw, - hd[RIGHT] + hw)); + Molecule ledger (ledger_line (Interval (hd[LEFT] - hw, + hd[RIGHT] + hw))); int parity = abs(int (p)) % 2; diff --git a/lily/score-element.cc b/lily/score-element.cc index 7bbf22594d..768f07f7c7 100644 --- a/lily/score-element.cc +++ b/lily/score-element.cc @@ -80,7 +80,8 @@ Score_element::Score_element (Score_element const&s) /* should protect because smobify_self () might trigger GC. */ - element_property_alist_ = scm_protect_object (ly_deep_copy (s.element_property_alist_)); + SCM onstack = ly_deep_copy (s.element_property_alist_); + element_property_alist_ = onstack; output_p_ =0; status_i_ = s.status_i_; @@ -639,7 +640,6 @@ Score_element::print_smob (SCM s, SCM port, scm_print_state *) void Score_element::do_smobify_self () { - scm_unprotect_object (element_property_alist_); // ugh } SCM diff --git a/lily/volta-spanner.cc b/lily/volta-spanner.cc index 9ea8b7a2c7..6258b17008 100644 --- a/lily/volta-spanner.cc +++ b/lily/volta-spanner.cc @@ -19,6 +19,8 @@ #include "stem.hh" #include "dimension-cache.hh" #include "group-interface.hh" +#include "atom.hh" + Volta_spanner::Volta_spanner () { @@ -65,8 +67,20 @@ Volta_spanner::do_brew_molecule_p () const Real dx = half_staff_space; Real w = spanner_length() - dx - get_broken_left_end_align (); Real h = paper_l()->get_var ("volta_spanner_height"); - Molecule volta (lookup_l ()->volta (h, w, t, no_vertical_start, no_vertical_end)); + Molecule volta; + + Atom *at = new Atom(gh_list (ly_symbol2scm ("volta"), + gh_double2scm (h), + gh_double2scm (w), + gh_double2scm (t), + gh_int2scm (no_vertical_start), + gh_int2scm (no_vertical_end), + SCM_UNDEFINED)); + + volta.dim_[Y_AXIS] = Interval (- h/2, h/2); + volta.dim_[X_AXIS] = Interval (0, w); + volta.add_atom (at->self_scm_); Molecule num (lookup_l ()->text ("volta", ly_scm2string (get_elt_property("text")),