From: hanwen Date: Tue, 20 Jan 2004 21:48:55 +0000 (+0000) Subject: * lily/system.cc (set_loose_columns): use the right prebroken cols X-Git-Tag: release/2.1.14~11 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8697f07a536f7a1758891adcf0efa926affb594a;p=lilypond.git * lily/system.cc (set_loose_columns): use the right prebroken cols for interpolating loose column position. * lily/text-spanner.cc (brew_molecule): default to no vertical lines. * lily/ottava-bracket.cc (brew_molecule): vertical line doesn't take space. --- diff --git a/lily/axis-group-engraver.cc b/lily/axis-group-engraver.cc index ac8b637b03..8f03b706a7 100644 --- a/lily/axis-group-engraver.cc +++ b/lily/axis-group-engraver.cc @@ -29,11 +29,9 @@ protected: virtual Spanner* get_spanner () const; virtual void add_element (Grob*) ; public: -TRANSLATOR_DECLARATIONS(Axis_group_engraver ); + TRANSLATOR_DECLARATIONS(Axis_group_engraver); }; - - Axis_group_engraver::Axis_group_engraver () { staffline_ = 0; @@ -121,7 +119,7 @@ Axis_group_engraver::process_acknowledged_grobs () Grob *par = elts_[i]->get_parent (Y_AXIS); if (!par || !Axis_group_interface::has_interface (par)) - if (elts_[i]->empty_b (Y_AXIS)) + if (elts_[i]->is_empty (Y_AXIS)) { /* We have to do _something_, otherwise staff objects will diff --git a/lily/custos-engraver.cc b/lily/custos-engraver.cc index 46c82969c6..e344af671c 100644 --- a/lily/custos-engraver.cc +++ b/lily/custos-engraver.cc @@ -25,6 +25,7 @@ class Custos_engraver : public Engraver { public: TRANSLATOR_DECLARATIONS( Custos_engraver); + virtual void start_translation_timestep (); virtual void acknowledge_grob (Grob_info); virtual void process_acknowledged_grobs (); virtual void stop_translation_timestep (); @@ -47,19 +48,24 @@ Custos_engraver::Custos_engraver () void Custos_engraver::stop_translation_timestep () { + /* + delay typeset until we're at the next moment, so we can silence custodes at the end of the piece. + */ for (int i = custodes_.size (); i--;) { typeset_grob (custodes_[i]); } - - /* - delay clear until we're at the next moment, so we can silence - custodes at the end of the piece. - */ pitches_.clear (); + custos_permitted = false; } +void +Custos_engraver::start_translation_timestep () +{ + custodes_.clear (); +} + void Custos_engraver::acknowledge_grob (Grob_info info) @@ -133,6 +139,7 @@ Custos_engraver::finalize () for (int i = custodes_.size (); i--;) { custodes_[i]->suicide (); + typeset_grob (custodes_[i]); } custodes_.clear (); } diff --git a/lily/grob.cc b/lily/grob.cc index 0e82fef490..00a1aa2438 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -496,7 +496,7 @@ Grob::point_dimension_callback (SCM , SCM) } bool -Grob::empty_b (Axis a)const +Grob::is_empty (Axis a)const { return ! (gh_pair_p (dim_cache_[a].dimension_) || gh_procedure_p (dim_cache_[a].dimension_)); diff --git a/lily/include/grob.hh b/lily/include/grob.hh index 8d50bf135b..3978a1ead3 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -135,7 +135,7 @@ public: void init (); public: - bool empty_b (Axis a) const; + bool is_empty (Axis a) const; Interval extent (Grob * refpoint, Axis) const; diff --git a/lily/metronome-engraver.cc b/lily/metronome-engraver.cc index 2aba83882d..39675ba541 100644 --- a/lily/metronome-engraver.cc +++ b/lily/metronome-engraver.cc @@ -23,24 +23,24 @@ class Metronome_mark_engraver : public Engraver public: TRANSLATOR_DECLARATIONS(Metronome_mark_engraver); protected: - Item* text_; - Grob * bar_line_; + Item *text_; + Grob *bar_line_; protected: virtual void stop_translation_timestep (); virtual void acknowledge_grob (Grob_info); void create_items (Music*); - virtual bool try_music (Music *req); + virtual bool try_music (Music *ev); virtual void process_music (); private: - Music * mark_req_; + Music *mark_ev_; }; Metronome_mark_engraver::Metronome_mark_engraver () { text_ =0; - mark_req_ = 0; + mark_ev_ = 0; } void @@ -68,7 +68,7 @@ Metronome_mark_engraver::stop_translation_timestep () typeset_grob (text_); text_ =0; } - mark_req_ = 0; + mark_ev_ = 0; } @@ -88,19 +88,19 @@ Metronome_mark_engraver::create_items (Music *rq) bool Metronome_mark_engraver::try_music (Music* r) { - mark_req_ = r; + mark_ev_ = r; return true; } void Metronome_mark_engraver::process_music () { - if (mark_req_) + if (mark_ev_) { - create_items (mark_req_); + create_items (mark_ev_); SCM proc = get_property ("metronomeMarkFormatter"); - SCM result= scm_call_2 (proc, mark_req_->self_scm (), + SCM result= scm_call_2 (proc, mark_ev_->self_scm (), daddy_trans_->self_scm()); text_->set_grob_property ("text", result); diff --git a/lily/moment.cc b/lily/moment.cc index c23488e068..d3c6703c39 100644 --- a/lily/moment.cc +++ b/lily/moment.cc @@ -39,23 +39,23 @@ Moment::print_smob (SCM s, SCM port, scm_print_state *) scm_puts ("#to_string (); scm_puts ((char *)str.to_str0 (), port); - scm_puts (" >", port); + scm_puts (">", port); return 1; } /* TODO: add optional factor argument. - */ +*/ LY_DEFINE (make_moment,"ly:make-moment", 2,0,0, (SCM n, SCM d), "create the rational number with main timing @var{n}/@var{d}. \n" -"\n" -"\n" -"Moment is a point in musical time. It is consists of a pair of\n" -"rationals (@var{m},@var{g}), where @var{m} is the timing for the main\n" -"notes, and @var{g} the timing for grace notes. In absence of grace\n" -"notes, @var{g} is zero.\n" -) + "\n" + "\n" + "Moment is a point in musical time. It is consists of a pair of\n" + "rationals (@var{m},@var{g}), where @var{m} is the timing for the main\n" + "notes, and @var{g} the timing for grace notes. In absence of grace\n" + "notes, @var{g} is zero.\n" + ) { SCM_ASSERT_TYPE(SCM_INUMP (n), n, SCM_ARG1, __FUNCTION__, "integer"); SCM_ASSERT_TYPE(SCM_INUMP (d), d, SCM_ARG2, __FUNCTION__, "integer"); @@ -65,7 +65,7 @@ LY_DEFINE (make_moment,"ly:make-moment", 2,0,0, (SCM n, SCM d), LY_DEFINE (add_moment,"ly:add-moment", 2,0,0, (SCM a, SCM b), "Add two moments." -) + ) { Moment * ma = unsmob_moment (a); Moment * mb = unsmob_moment (b); @@ -78,7 +78,7 @@ LY_DEFINE (add_moment,"ly:add-moment", 2,0,0, (SCM a, SCM b), LY_DEFINE (mul_moment,"ly:mul-moment", 2,0,0, (SCM a, SCM b), "Multiply two moments." -) + ) { Moment * ma = unsmob_moment (a); Moment * mb = unsmob_moment (b); @@ -92,7 +92,7 @@ LY_DEFINE (mul_moment,"ly:mul-moment", 2,0,0, (SCM a, SCM b), LY_DEFINE (div_moment,"ly:div-moment", 2,0,0, (SCM a, SCM b), "Divide two moments." -) + ) { Moment * ma = unsmob_moment (a); Moment * mb = unsmob_moment (b); @@ -169,7 +169,7 @@ Moment::operator -= (Moment const &src) /* only take the main part of SRC for multiplication. - */ +*/ void Moment::operator *= (Moment const &src) { @@ -179,7 +179,7 @@ Moment::operator *= (Moment const &src) /* only take the main part of SRC for multiplication. - */ +*/ void Moment::operator /= (Moment const &src) { diff --git a/lily/new-part-combine-iterator.cc b/lily/new-part-combine-iterator.cc index 79595925f3..5440415797 100644 --- a/lily/new-part-combine-iterator.cc +++ b/lily/new-part-combine-iterator.cc @@ -1,9 +1,9 @@ /* - part-combine-music-iterator.cc -- implement New_pc_iterator + new-part-combine-music-iterator.cc -- implement New_pc_iterator source file of the GNU LilyPond music typesetter - (c) 2000--2003 Jan Nieuwenhuizen + (c) 2004 Han-Wen Nienhuys */ #include "part-combine-music-iterator.hh" diff --git a/lily/ottava-bracket.cc b/lily/ottava-bracket.cc index 1df2dbafbe..2e991f7ec0 100644 --- a/lily/ottava-bracket.cc +++ b/lily/ottava-bracket.cc @@ -1,3 +1,12 @@ +/* + ottava-bracket.cc -- implement Ottava_bracket + + source file of the GNU LilyPond music typesetter + + (c) 2004 Han-Wen Nienhuys + + */ + #include "molecule.hh" #include "text-item.hh" #include "text-spanner.hh" @@ -66,6 +75,12 @@ Ottava_bracket::brew_molecule (SCM smob) Drul_array shorten = robust_scm2interval (me->get_grob_property ("shorten-pair"), Interval (0,0)); + + + /* + TODO: we should check if there are ledgers, and modify length of + the spanner to that. + */ do { Item *b = me->get_bound (d); @@ -122,7 +137,20 @@ Ottava_bracket::brew_molecule (SCM smob) edge_height, 0.0, flare, shorten); + + /* + The vertical lines should not take space, for the following scenario: + + 8 -----+ + o | + | + | + + */ + b = Molecule (Box (b.extent (X_AXIS), + Interval (0.1,0.1)), + b.get_expr ()); b.translate_axis (bracket_span_points[LEFT], X_AXIS); text.translate_axis (span_points[LEFT], X_AXIS); diff --git a/lily/ottava-engraver.cc b/lily/ottava-engraver.cc index 042cf9e5ed..b18cf8e54e 100644 --- a/lily/ottava-engraver.cc +++ b/lily/ottava-engraver.cc @@ -4,7 +4,6 @@ source file of the GNU LilyPond music typesetter (c) 2000--2003 Han-Wen Nienhuys - Jan Nieuwenhuizen */ #include "protected-scm.hh" diff --git a/lily/span-arpeggio-engraver.cc b/lily/span-arpeggio-engraver.cc index ff5ba459ab..58b7243ffc 100644 --- a/lily/span-arpeggio-engraver.cc +++ b/lily/span-arpeggio-engraver.cc @@ -4,6 +4,8 @@ source file of the GNU LilyPond music typesetter (c) 2000--2003 Jan Nieuwenhuizen + + Han-Wen Nienhuys */ #include "engraver.hh" @@ -54,11 +56,10 @@ void Span_arpeggio_engraver::process_acknowledged_grobs () { /* - connectArpeggios is slightly brusque; we should really read a elt + connectArpeggios is slightly brusque; we should really read a grob property of the caught non-span arpeggios. That way, we can have both non-connected and connected arps in one pianostaff. - */ if (!span_arpeggio_ && arpeggios_.size () > 1 diff --git a/lily/system.cc b/lily/system.cc index 29ce5de931..494fec6347 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -238,7 +238,6 @@ set_loose_columns (System* which, Column_x_positions const *posns) if (col->system_) continue; - Item * left = 0; Item * right = 0; @@ -258,13 +257,17 @@ set_loose_columns (System* which, Column_x_positions const *posns) if (!left && l) { left = l->get_column (); + if (!left->get_system ()) + left = left->find_prebroken_piece (RIGHT); } divide_over ++; - loose = right = r->get_column (); } while (1); + + if (!right->get_system ()) + right = right->find_prebroken_piece (LEFT); /* We divide the remaining space of the column over the left and @@ -274,7 +277,7 @@ set_loose_columns (System* which, Column_x_positions const *posns) Grob * common = right->common_refpoint (left, X_AXIS); Real rx = right->extent(common, X_AXIS)[LEFT]; - Real lx = left->extent(common, X_AXIS)[RIGHT]; + Real lx = left->extent(common, X_AXIS)[RIGHT]; Real total_dx = rx - lx; Interval cval =col->extent (col, X_AXIS); @@ -302,6 +305,7 @@ set_loose_columns (System* which, Column_x_positions const *posns) dx *= 0.5; col->system_ = which; + col->translate_axis (- col->relative_coordinate (common, X_AXIS), X_AXIS); col->translate_axis (lx + dx - cval[LEFT], X_AXIS); } } diff --git a/lily/text-spanner.cc b/lily/text-spanner.cc index 41aa334d1f..994019c76f 100644 --- a/lily/text-spanner.cc +++ b/lily/text-spanner.cc @@ -101,7 +101,7 @@ Text_spanner::brew_molecule (SCM smob) } Drul_array edge_height = robust_scm2interval (me->get_grob_property ("edge-height"), - Interval (1.0, 1.0)); + Interval (0.0, 0.0)); Drul_array edge_line; { Direction d = LEFT; diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index be1e7aeed9..9501413dd2 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -1,9 +1,10 @@ /* - plet-spanner.cc -- implement Tuplet_bracket + tuplet-bracket.cc -- implement Tuplet_bracket source file of the GNU LilyPond music typesetter (c) 1997--2003 Jan Nieuwenhuizen + Han-Wen Nienhuys */ /*