From 96d394405f0ad9f1c3488d7cbc5ea46cf3190ca5 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:44:34 +0000 Subject: [PATCH] lilypond-0.0.65 --- lily/include/text-spanner.hh | 18 ++++++++++-------- lily/text-spanner.cc | 24 +++++++++++++++++++----- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/lily/include/text-spanner.hh b/lily/include/text-spanner.hh index dbdea979ad..a91d8d9691 100644 --- a/lily/include/text-spanner.hh +++ b/lily/include/text-spanner.hh @@ -1,5 +1,5 @@ /* - textspanner.hh -- part of LilyPond + textspanner.hh -- part of GNU LilyPond (c) 1996,97 Han-Wen Nienhuys */ @@ -13,22 +13,24 @@ /** a spanner which puts texts on top of other spanners. Use for triplets, eentweetjes, ottava, etc. */ -struct Text_spanner : Spanner { +class Text_spanner : public Spanner { +public: + Directional_spanner * support; Text_def spec; Offset text_off_; - Directional_spanner*support; + NAME_MEMBERS(Text_spanner); - /* *************** */ + void set_support(Directional_spanner*); + Text_spanner(); +protected: + SPANNER_CLONE(Text_spanner) - NAME_MEMBERS(Text_spanner); + virtual void do_substitute_dependency(Score_elem*,Score_elem*); virtual void do_pre_processing(); virtual void do_post_processing(); virtual Interval height() const ; virtual Molecule* brew_molecule_p()const; virtual void do_print() const; - virtual Spanner* do_break_at(PCol*,PCol*)const; - Text_spanner(); - void set_support(Directional_spanner*); }; #endif // TEXTSPANNER_HH diff --git a/lily/text-spanner.cc b/lily/text-spanner.cc index 2858a28641..6883dab0b0 100644 --- a/lily/text-spanner.cc +++ b/lily/text-spanner.cc @@ -1,3 +1,11 @@ +/* + text-spanner.cc -- implement Text_spanner + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + #include "molecule.hh" #include "boxes.hh" #include "text-spanner.hh" @@ -10,7 +18,10 @@ void Text_spanner::set_support(Directional_spanner*d) { - support = d; + if (support) + remove_dependency(support); + + support =d; add_dependency(d); } @@ -33,7 +44,7 @@ Text_spanner::do_post_processing() switch(spec.align_i_) { case 0: text_off_ = support->center() + - Offset(0,support->dir_i_ * paper()->internote() * 4); // todo + Offset(0,support->dir_i_ * paper()->internote_f() * 4); // todo break; default: assert(false); @@ -67,8 +78,11 @@ Text_spanner::height()const return brew_molecule_p()->extent().y; } -Spanner* -Text_spanner::do_break_at(PCol*c1, PCol*c2)const +void +Text_spanner::do_substitute_dependency(Score_elem* o, Score_elem*n) { - return new Text_spanner(*this); // todo + Directional_spanner * old = (Directional_spanner*)o->spanner(); + if (support == old) + support = (Directional_spanner*) n->spanner(); } + -- 2.39.5