From: fred Date: Tue, 26 Mar 2002 21:46:58 +0000 (+0000) Subject: lilypond-1.1.30 X-Git-Tag: release/1.5.59~2596 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=45a6d2b3a3dd4dce038758337ef9e5cb2f761493;p=lilypond.git lilypond-1.1.30 --- diff --git a/input/test/staff-side-slur.ly b/input/test/staff-side-slur.ly new file mode 100644 index 0000000000..d099cf6116 --- /dev/null +++ b/input/test/staff-side-slur.ly @@ -0,0 +1,19 @@ +\score{ + \type Staff \notes\relative c''{ + \property Staff.instrument = "Toeters" + c c c c(\break + )c c c c ~\break + c c c c\break + } + \paper{ + linewidth=60.0\mm; +% \translator { \HaraKiriStaffContext } + \translator { \OrchestralScoreContext } + \translator { + \StaffContext + \consists "Staff_margin_engraver"; + marginHangOnClef = 1; + } + } +} + diff --git a/lily/bar-script-engraver.cc b/lily/bar-script-engraver.cc index e197da6a9c..63e6155438 100644 --- a/lily/bar-script-engraver.cc +++ b/lily/bar-script-engraver.cc @@ -9,6 +9,7 @@ #include "bar-script-engraver.hh" #include "bar.hh" +#include "clef-item.hh" #include "g-staff-side.hh" #include "g-text-item.hh" #include "lily-guile.hh" @@ -18,31 +19,69 @@ Bar_script_engraver::Bar_script_engraver () axis_ = Y_AXIS; staff_side_p_ = 0; text_p_ =0; + hang_on_clef_b_ = false; visibility_lambda_ = gh_eval_str ("non_postbreak_visibility"); } void -Bar_script_engraver::acknowledge_element (Score_element_info i) +Bar_script_engraver::do_creation_processing () +{ + Scalar prop = get_property (type_ + "HangOnClef", 0); + if (prop.to_bool ()) + { + hang_on_clef_b_ = true; + } +} + +void +Bar_script_engraver::do_acknowledge_element (Item *i) { Axis other_axis = Axis((axis_ + 1)%2); - if (staff_side_p_ && !staff_side_p_->dim_cache_[other_axis].parent_l_) { - Bar * bar_l = dynamic_cast (i.elem_l_); - if (!bar_l) + staff_side_p_->dim_cache_[other_axis].parent_l_ + = &i->dim_cache_[other_axis]; + staff_side_p_->dim_cache_[axis_].parent_l_ + = &i->dim_cache_[axis_]; + + staff_side_p_->add_support (i); + i->add_dependency (staff_side_p_); // UGH. + } +} + + +Item* +Bar_script_engraver::cast_to_interesting_item (Score_element *e) +{ + Item * i =0; + if (hang_on_clef_b_) + { + i = dynamic_cast (e); + } + else + { + i = dynamic_cast (e); + } + return i; +} + +void +Bar_script_engraver::acknowledge_element (Score_element_info inf) +{ + if (inf.origin_grav_l_arr_.size () == 1) + { + Item *i=cast_to_interesting_item (inf.elem_l_); + if (!i) return; - + /* Only put numbers on bars that are at our own level (don't put numbers over the staffs of a GrandStaff, only over the GrandStaff itself */ - if (i.origin_grav_l_arr_.size () == 1) - { - staff_side_p_->dim_cache_[other_axis].parent_l_ = &bar_l->dim_cache_[other_axis]; - // staff_side_p_->dim_cache_[axis_].parent_l_ = &bar_l->dim_cache_[axis_]; - staff_side_p_->add_support (i.elem_l_); - bar_l->add_dependency (staff_side_p_); // UGH. - } + if (inf.origin_grav_l_arr_.size () != 1) + return; + + do_acknowledge_element (i); } } diff --git a/lily/bow.cc b/lily/bow.cc index 146969f025..873613b121 100644 --- a/lily/bow.cc +++ b/lily/bow.cc @@ -92,6 +92,7 @@ Bow::do_height () const return iv; } +#if 0 Interval Bow::do_width () const { @@ -99,6 +100,7 @@ Bow::do_width () const Real dx = i.length(); return Interval (0, dx); } +#endif Array Bow::get_controls () const diff --git a/lily/dimension-cache.cc b/lily/dimension-cache.cc index 4d96032f69..6fb7842dcf 100644 --- a/lily/dimension-cache.cc +++ b/lily/dimension-cache.cc @@ -78,10 +78,15 @@ Dimension_cache::absolute_coordinate () const return r; } +/* + what *should* these functions *do* anyway. + */ Real Dimension_cache::relative_coordinate (Dimension_cache *d) const { Real r =0.0; + if (d == this) // UGH + return 0.0; for (Dimension_cache* c = parent_l_; c != d; diff --git a/lily/extender-engraver.cc b/lily/extender-engraver.cc index 000568dfa4..3cf5b3455c 100644 --- a/lily/extender-engraver.cc +++ b/lily/extender-engraver.cc @@ -63,10 +63,7 @@ Extender_engraver::do_removal_processing () if (extender_spanner_p_) { span_reqs_drul_[LEFT]->warning (_ ("unterminated extender")); - extender_spanner_p_->unlink (); - delete extender_spanner_p_; - extender_spanner_p_ = 0; - span_reqs_drul_[RIGHT] = span_reqs_drul_[LEFT] = 0; + extender_spanner_p_->set_bounds(RIGHT, get_staff_info ().command_l ()); } } diff --git a/lily/include/bar-script-engraver.hh b/lily/include/bar-script-engraver.hh index cfd2b7c266..7b9ddbfde7 100644 --- a/lily/include/bar-script-engraver.hh +++ b/lily/include/bar-script-engraver.hh @@ -13,7 +13,8 @@ #include "protected-scm.hh" /** - put stuff over or next to bars + put stuff over or next to bars. Examples: bar numbers, marginal notes, + rehearsal marks. */ class Bar_script_engraver : public Engraver { @@ -23,9 +24,18 @@ protected: Protected_scm visibility_lambda_; String type_; Axis axis_; - + bool hang_on_clef_b_; protected: + /** + Put the script on #it# + */ + void do_acknowledge_element (Item *it); + /** + Return non-nil if we want to hang something on this. + */ + Item *cast_to_interesting_item (Score_element*); Bar_script_engraver (); + virtual void do_creation_processing (); virtual void do_pre_move_processing (); virtual void acknowledge_element (Score_element_info); void create_items(Request*); diff --git a/lily/include/bow.hh b/lily/include/bow.hh index 359a03e545..ba7e20ff6e 100644 --- a/lily/include/bow.hh +++ b/lily/include/bow.hh @@ -31,7 +31,7 @@ public: protected: virtual Molecule* do_brew_molecule_p () const; - virtual Interval do_width () const; + // virtual Interval do_width () const; Array get_controls () const; virtual Array get_encompass_offset_arr () const; virtual Interval do_height () const; diff --git a/lily/include/cons.hh b/lily/include/cons.hh index 4b4de47e55..472f0a89a8 100644 --- a/lily/include/cons.hh +++ b/lily/include/cons.hh @@ -1,5 +1,5 @@ /* - cons.hh -- declare + cons.hh -- declare LISP like datatypes source file of the GNU LilyPond music typesetter @@ -9,6 +9,30 @@ #ifndef CONS_HH #define CONS_HH +#if 0 +template +class NCons +{ +public: + T car_; + U cdr_; + NCons (T t, U u) : car_ (t), cdr_ (u) {} + virtual ~NCons () {} +}; + +template +class Pointer_cons : public NCons +{ + Pointer_cons () : Cons (0,0){} + Pointer_cons (T t, Pointer_cons*c) + : Cons (t,c) + { + car_ = t; + next_ = c; + } +}; +#endif + template class Cons @@ -16,7 +40,6 @@ class Cons public: T * car_; Cons * next_; - virtual ~Cons (); Cons () { car_=0; next_ =0; @@ -26,6 +49,10 @@ public: car_ = t; next_ = c; } + virtual ~Cons () + { + delete next_; + } }; template @@ -39,5 +66,22 @@ public: virtual ~Killing_cons (); }; + +template +class Cons_list +{ +public: + Cons * head_; + Cons ** tail_; + Cons_list () { head_ =0; tail_ = &head_; } +}; + + +template +Cons_list copy_killing_cons_list (Cons *src); +template +Cons_list clone_killing_cons_list (Cons *src); + + #endif /* CONS_HH */ diff --git a/lily/include/killing-cons.tcc b/lily/include/killing-cons.tcc index 3c9a9710e7..d67e6b56b7 100644 --- a/lily/include/killing-cons.tcc +++ b/lily/include/killing-cons.tcc @@ -10,16 +10,43 @@ #ifndef KILLING_CONS_TCC #define KILLING_CONS_TCC + template -Cons::~Cons () +Killing_cons::~Killing_cons () { + delete car_; } template -Killing_cons::~Killing_cons () +Cons_list +copy_killing_cons_list (Cons *src) { - delete car_; - delete next_; + Cons_list kl; + + for (; src; src = src->next_) + { + T *t = new T(*src->car_); + *kl.tail_ = new Killing_cons (t, 0); + kl.tail_ = &(*kl.tail_)->next_; + } + + return kl; +} + +template +Cons_list +clone_killing_cons_list (Cons *src) +{ + Cons_list kl; + + for (; src; src = src->next_) + { + T *t = src->car_->clone (); + *kl.tail_ = new Killing_cons (t, 0); + kl.tail_ = &(*kl.pp)->next_; + } + + return kl; } diff --git a/lily/include/mark-engraver.hh b/lily/include/mark-engraver.hh index 952df5a356..314da60c17 100644 --- a/lily/include/mark-engraver.hh +++ b/lily/include/mark-engraver.hh @@ -12,7 +12,7 @@ #include "bar-script-engraver.hh" -/** +/**Print rehearsal marks. */ class Mark_engraver : public Bar_script_engraver { diff --git a/lily/include/molecule.hh b/lily/include/molecule.hh index de52b56e5f..461993e482 100644 --- a/lily/include/molecule.hh +++ b/lily/include/molecule.hh @@ -20,7 +20,7 @@ to the top, to the right, etc. */ class Molecule { // Protected_scm atom_list_; // change to List? - Killing_cons *atom_list_; + Cons *atom_list_; friend class Paper_outputter; public: Box dim_; diff --git a/lily/include/slur.hh b/lily/include/slur.hh index 6e94b024ce..affb2d0c0a 100644 --- a/lily/include/slur.hh +++ b/lily/include/slur.hh @@ -31,7 +31,6 @@ protected: virtual void do_add_processing (); virtual void do_pre_processing (); virtual void do_substitute_dependency (Score_element*, Score_element*); - virtual Interval do_width () const; Array get_rods () const; }; diff --git a/lily/include/tie.hh b/lily/include/tie.hh index c4488caef0..861c93fb4f 100644 --- a/lily/include/tie.hh +++ b/lily/include/tie.hh @@ -21,8 +21,6 @@ class Tie : public Bow public: Tie (); void set_head (Direction, Note_head*head_l); - - VIRTUAL_COPY_CONS(Score_element); bool same_pitch_b_; @@ -33,8 +31,7 @@ protected: virtual void do_post_processing (); virtual void set_default_dir(); virtual void do_substitute_dependency (Score_element*,Score_element*); - virtual Interval do_width () const; - Array get_rods () const; + virtual Array get_rods () const; Array get_controls () const; }; diff --git a/lily/paper-def.cc b/lily/paper-def.cc index aaaa2e610b..68d95c238b 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -248,11 +248,14 @@ Paper_def::paper_outputter_p (Paper_stream* os_p, Header* header_l, String origi if (scope_p_) p->output_scope (scope_p_, "mudelapaper"); +#if 0 if (output_global_ch == String("tex")) { *p->outstream_l_ << *scope_p_->elem ("texsetting")->access_content_String (false); } - +#endif + + *p->outstream_l_ << *scope_p_->elem (String (output_global_ch) + "setting")->access_content_String (false); SCM scm = gh_list (ly_symbol ("experimental-on"), SCM_UNDEFINED); p->output_scheme (scm); diff --git a/lily/spanner.cc b/lily/spanner.cc index cf4932b47f..c2358c2cb9 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -146,6 +146,8 @@ Spanner::output_processing () Interval Spanner::do_width() const { + + Real l = spanned_drul_[LEFT]->absolute_coordinate (X_AXIS); Real r = spanned_drul_[RIGHT]->absolute_coordinate (X_AXIS); diff --git a/lily/staff-margin-engraver.cc b/lily/staff-margin-engraver.cc index 7363f07a99..ce66cb5265 100644 --- a/lily/staff-margin-engraver.cc +++ b/lily/staff-margin-engraver.cc @@ -23,10 +23,8 @@ Staff_margin_engraver::Staff_margin_engraver () } - /* TODO - fix alignment/support should be able to set whole paragraph (multiple lines, centre) to left (right?) of staff, e.g.: @@ -37,13 +35,10 @@ Staff_margin_engraver::Staff_margin_engraver () |______________ */ void -Staff_margin_engraver::acknowledge_element (Score_element_info i) +Staff_margin_engraver::acknowledge_element (Score_element_info inf) { - Bar * b =dynamic_cast (i.elem_l_); - if (!b) - return ; - - if (i.origin_grav_l_arr_.size() != 1) + Item *i = cast_to_interesting_item (inf.elem_l_); + if (!i || inf.origin_grav_l_arr_.size() != 1) return; @@ -58,7 +53,7 @@ Staff_margin_engraver::acknowledge_element (Score_element_info i) create_items (0); text_p_->text_str_ = long_str; staff_side_p_->dir_ = LEFT; - Bar_script_engraver::acknowledge_element(i); + Bar_script_engraver::do_acknowledge_element (i); } diff --git a/lily/tie.cc b/lily/tie.cc index e559e8ed0e..20b63a8cf9 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -151,13 +151,15 @@ Tie::do_substitute_dependency (Score_element*o, Score_element*n) head_l_drul_[RIGHT] = new_l; } +#if 0 Interval Tie::do_width () const { - Real min_f = paper ()->get_var ("tie_x_minimum"); + Real min_f = Interval width_int = Bow::do_width (); return width_int.length () < min_f ? Interval (0, min_f) : width_int; } +#endif Array Tie::get_rods () const @@ -165,7 +167,7 @@ Tie::get_rods () const Array a; Rod r; r.item_l_drul_ = spanned_drul_; - r.distance_f_ = do_width ().length (); + r.distance_f_ = paper ()->get_var ("tie_x_minimum"); a.push (r); return a; } diff --git a/lily/volta-spanner.cc b/lily/volta-spanner.cc index a9836484d0..5162ac429c 100644 --- a/lily/volta-spanner.cc +++ b/lily/volta-spanner.cc @@ -81,7 +81,8 @@ Volta_spanner::do_add_processing () set_bounds (RIGHT, column_arr_.top ()); } - number_p_->style_str_ = "number"; + // number_p_->style_str_ = "number-1"; + number_p_->style_str_ = "volta"; } Interval diff --git a/ly/paper20.ly b/ly/paper20.ly index 2f4958a23c..61f5951ed9 100644 --- a/ly/paper20.ly +++ b/ly/paper20.ly @@ -9,8 +9,17 @@ paper_twenty = \paper { font_large = 12.; font_Large = 12.; font_normal = 10.; + font_finger = 5.; - "font_number-1" = 7.; + font_volta = 8.; + font_number = 10.; + font_mark = 12.; + + % what about: + "font_number-1" = 8.; + %"font_number" = 10.; + "font_number+1" = 12.; + % ugh see table20 for sizes quartwidth = 6.61\pt; diff --git a/ps/lily.ps b/ps/lily.ps index 9c1710e3b2..87a5895d90 100644 --- a/ps/lily.ps +++ b/ps/lily.ps @@ -4,6 +4,15 @@ % round cappings 1 setlinecap +% URG +% staffheight 4 div /interline exch def +% interline 3 div /bracket_b exch def +% interline 2 mul /bracket_w exch def +% stafflinethickness 2 mul /bracket_t exch def +% interline 1.5 mul /bracket_v exch def +% bracket_v /bracket_u exch def +% 50 /bracket_alpha exch def + /draw_beam % width slope thick { 2 div /beam_thick exch def diff --git a/ps/lilyponddefs.ps b/ps/lilyponddefs.ps index a862db2153..7bc7ae58ea 100644 --- a/ps/lilyponddefs.ps +++ b/ps/lilyponddefs.ps @@ -3,6 +3,9 @@ % hmm /setgray { 1 add } bind def +% urg +1 /stafflinethickness exch def + /xoffset 30 def /yoffset 700 def /staffrulethickness 1 def