]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/system.cc (set_loose_columns): use the right prebroken cols
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 20 Jan 2004 21:48:55 +0000 (21:48 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 20 Jan 2004 21:48:55 +0000 (21:48 +0000)
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.

13 files changed:
lily/axis-group-engraver.cc
lily/custos-engraver.cc
lily/grob.cc
lily/include/grob.hh
lily/metronome-engraver.cc
lily/moment.cc
lily/new-part-combine-iterator.cc
lily/ottava-bracket.cc
lily/ottava-engraver.cc
lily/span-arpeggio-engraver.cc
lily/system.cc
lily/text-spanner.cc
lily/tuplet-bracket.cc

index ac8b637b036b54ed64d9522591a0e15efac40940..8f03b706a78b35e620be2ae500f5d6a055b01b21 100644 (file)
@@ -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
index 46c82969c60fc7a89f35082eed9876fef7c65bf8..e344af671cde7baee2d9b2ee793728d5cb64154a 100644 (file)
@@ -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 ();
 }
index 0e82fef4907b5c346811ffe248e8c5fc8d72fb4c..00a1aa24383c50827603d8f47a2799736b79b94d 100644 (file)
@@ -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_));
index 8d50bf135bf9b5a29d64843005b3e6bd2218d871..3978a1ead36813ac388f7edc59c2f636ffcbab14 100644 (file)
@@ -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;
  
index 2aba83882d53662048dd0e29eee7486f877b4be8..39675ba541974ce76e0ce368b2dd3cec75aa71fd 100644 (file)
@@ -23,24 +23,24 @@ class Metronome_mark_engraver : public Engraver
 public:
   TRANSLATOR_DECLARATIONS(Metronome_mark_engraver);
 protected:
-  Itemtext_;
-  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);
index c23488e06856a4b82c3ce1a4920a09a58ca01047..d3c6703c397554f14a9b2d6b986b9843b4ba721c 100644 (file)
@@ -39,23 +39,23 @@ Moment::print_smob (SCM s, SCM port, scm_print_state *)
   scm_puts ("#<Mom ", port);
   String str = r->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)
 {
index 79595925f38ed25671845e1529b77581ada6ae4c..544041579745ba072e4b33c32a13ea910c585dc3 100644 (file)
@@ -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 <janneke@gnu.org>
+  (c) 2004 Han-Wen Nienhuys
  */
 
 #include "part-combine-music-iterator.hh"
index 1df2dbafbed885357c94d144931406e7fb68bdf3..2e991f7ec0924802105a4a68d9cf9413c3b7523e 100644 (file)
@@ -1,3 +1,12 @@
+/*   
+  ottava-bracket.cc --  implement Ottava_bracket
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ */
+
 #include "molecule.hh"
 #include "text-item.hh"
 #include "text-spanner.hh"
@@ -66,6 +75,12 @@ Ottava_bracket::brew_molecule (SCM smob)
 
   Drul_array<Real> 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);
index 042cf9e5ed8cae2cc37349fe5fb26e0805da045a..b18cf8e54e36f9b6b9782d71a033714a5a473fe3 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2000--2003 Han-Wen Nienhuys
-  Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "protected-scm.hh"
index ff5ba459ab3d014dc008f7ae760ad67a6bc0a048..58b7243ffc404e5bbfae989787f0f159b80e0182 100644 (file)
@@ -4,6 +4,8 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2000--2003 Jan Nieuwenhuizen <janneke@gnu.org>
+
+  Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #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
index 29ce5de93111e441eedc4c1dfabb11cd71c02c49..494fec63471b41788fa7744e315bfa867b6808f2 100644 (file)
@@ -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); 
     }
 }
index 41aa334d1f2c7351e25f1844300c9f9244d28be2..994019c76f8170323d0f41048648919aed00b9d6 100644 (file)
@@ -101,7 +101,7 @@ Text_spanner::brew_molecule (SCM smob)
     }
   
   Drul_array<Real> edge_height = robust_scm2interval (me->get_grob_property ("edge-height"),
-                                                     Interval (1.0, 1.0));
+                                                     Interval (0.0, 0.0));
   Drul_array<Molecule> edge_line;
     {
       Direction d = LEFT;
index be1e7aeed99b73ae429e624d157b02898ec3adcb..9501413dd29aac80f72c8cdd496e8f8cb0cc9e97 100644 (file)
@@ -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 <janneke@gnu.org>
+  Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 /*