]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 1.5.26 release/1.5.26
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 14 Dec 2001 00:19:19 +0000 (01:19 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 14 Dec 2001 00:19:19 +0000 (01:19 +0100)
28 files changed:
ChangeLog
VERSION
input/test/accidentals.ly [deleted file]
lily/bar-engraver.cc
lily/bar-number-engraver.cc
lily/beam.cc
lily/engraver-group-engraver.cc
lily/include/engraver-group-engraver.hh
lily/include/score-engraver.hh
lily/include/staff-symbol.hh
lily/lily-guile.cc
lily/line-of-score.cc
lily/mark-engraver.cc
lily/rhythmic-column-engraver.cc
lily/score-engraver.cc
lily/separating-line-group-engraver.cc
lily/staff-collecting-engraver.cc [new file with mode: 0644]
lily/third-try.cc
lily/volta-engraver.cc
lilypond-mode.el
ly/engraver-init.ly
ly/property-init.ly
make/out/lilypond.lsm
make/out/lilypond.mandrake.spec
make/out/lilypond.redhat.spec
make/out/lilypond.suse.spec
scripts/lilypond-book.py
scripts/ly2dvi.py

index df4321bea53e8b80fc85e3778c55064b9ce1919d..262ee9a07b7dc14f4ecf80409c5dd2be190dd0ab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
+2001-12-14  Han-Wen  <hanwen@cs.uu.nl>
+
+       * scripts/lilypond-book.py (LatexPaper.set_geo_option):
+       Convert strings with dimensions to numbers.
+
+       * lily/volta-engraver.cc:  only make a  bracket for the top staff,
+       as found in stavesFound. 
+
+       * lily/bar-number-engraver.cc: remove staff administration. 
+
+       * lily/mark-engraver.cc (acknowledge_grob): remove staff
+       administration. This breaks support for invisible-staff.
+
+       * lily/staff-collecting-engraver.cc: new engraver. Collects staff
+       symbols into stavesFound.
+
+       * lily/score-engraver.cc (acknowledge_grob): Acknowledge spacing
+       grobs, and put them into columns.
+
+       * lily/engraver-group-engraver.cc (acknowledge_grobs): Include the
+       Engraver_group_engraver as a potential candidate for ack'ing grobs.
+
+2001-12-13  Heikki Junes  <hjunes@cc.hut.fi>
+
+       * lilypond-mode.el (LilyPond-command-next-midi): Play next (or last)
+       midi section in the Emacs-mode, so it is possible to play certain
+       score in a multiscore lilypond-file.
+        
 2001-12-09  Rune Zedeler  <rune@zedeler.dk>
        * lily/lily-guile.cc: Added ly_assoc_front_x() and ly_assoc_cdr()
        (FIXME: not accessible from guile)
        * Documentation/regression-test.tely: Added quick test of new
        accidentals.
 
+2001-12-13  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * scripts/lilypond-book.py (scan_latex_preamble): don't crash if
+       header not found
+
+2001-12-07  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * lily/beam.cc (before_line_breaking): Make beams  without stems
+       or with only one stem disappear.
+
 2001-12-05  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
        * bibtools/bib2html.py: Add simple bib2html convertor, and .bst
diff --git a/VERSION b/VERSION
index 4c89cef31a426b0672384599c9297bac80f2e223..d5f4d365ee2b85b5389c05ded77e3900903b0fd9 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,8 +1,8 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=5
-PATCH_LEVEL=25
-MY_PATCH_LEVEL=rz1
+PATCH_LEVEL=26
+MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/input/test/accidentals.ly b/input/test/accidentals.ly
deleted file mode 100644 (file)
index e69de29..0000000
index b18bdf251da3805ac41fea4247fcc1a835a020fb..3e4c5f58d4b3743a8f81870f7061037db7348067 100644 (file)
@@ -106,5 +106,5 @@ ENTER_DESCRIPTION(Bar_engraver,
 @code{whichBar} property. If it has no bar line to create, it will forbid a linebreak at this point",
 /* creats*/       "BarLine",
 /* acks  */       "",
-/* reads */       "whichBar stavesFound",
+/* reads */       "whichBar",
 /* write */       "");
index d9951589249a3d00678a0744b216d2ab7178f501..b6226d176d73aebfa03bdf86e5c41fca947903c2 100644 (file)
@@ -11,7 +11,6 @@
 #include "paper-column.hh"
 #include "paper-def.hh"
 #include "side-position-interface.hh"
-#include "staff-symbol.hh"
 #include "item.hh"
 #include "moment.hh"
 #include "engraver.hh"
@@ -26,7 +25,6 @@ protected:
 protected:
   virtual void stop_translation_timestep ();
   virtual void acknowledge_grob (Grob_info);
-  virtual void initialize ();
   virtual void create_grobs ();
   void create_items ();
   TRANSLATOR_DECLARATIONS(  Bar_number_engraver );
@@ -63,31 +61,14 @@ Bar_number_engraver::Bar_number_engraver ()
   text_p_ =0;
 }
 
-void
-Bar_number_engraver::initialize ()
-{
-  /*
-    ugh: need to share code with mark_engraver
-   */
-  daddy_trans_l_->set_property ("stavesFound", SCM_EOL); 
-}
-
-
                                               
 void
 Bar_number_engraver::acknowledge_grob (Grob_info inf)
 {
   Grob * s = inf.grob_l_;
-  if (Staff_symbol::has_interface (s))
-    {
-      SCM sts = get_property ("stavesFound");
-      SCM thisstaff = inf.grob_l_->self_scm ();
-      if (scm_memq (thisstaff, sts) == SCM_BOOL_F)
-       daddy_trans_l_->set_property ("stavesFound", gh_cons (thisstaff, sts));
-    }
-  else if (text_p_
-          && dynamic_cast<Item*> (s)
-          && s->get_grob_property ("break-align-symbol") == ly_symbol2scm ("Left_edge_item"))
+  if (text_p_
+      && dynamic_cast<Item*> (s)
+      && s->get_grob_property ("break-align-symbol") == ly_symbol2scm ("Left_edge_item"))
     {
       /*
        By default this would land on the Paper_column -- so why
@@ -125,6 +106,6 @@ ENTER_DESCRIPTION(Bar_number_engraver,
 /* descr */       "A bar number is created whenever measurePosition is zero. It is
 put on top of all staves, and appears only at  left side of the staff.",
 /* creats*/       "BarNumber",
-/* acks  */       "staff-symbol-interface break-aligned-interface",
-/* reads */       "currentBarNumber",
+/* acks  */       "break-aligned-interface",
+/* reads */       "currentBarNumber stavesFound" ,
 /* write */       "");
index 8bedaa22aff5b318e4131aa76a425e0fefcafd35..1c0ed8e545d44e2efd64822e5ed2400aa8bba642 100644 (file)
@@ -78,14 +78,35 @@ Beam::before_line_breaking (SCM smob)
 {
   Grob * me =  unsmob_grob (smob);
 
-  // Why?
   /*
-    Why what?  Why the warning (beams with less than 2 stems are
-    degenerate beams, should never happen), or why would this ever
-    happen (don't know). */
+    Beams with less than 2 two stems don't make much sense, but could happen
+    when you do
+
+    [r8 c8 r8].
+    
+    For a beam that  only has one stem, we try to do some disappearance magic:
+    we revert the flag, and move on to The Eternal Engraving Fields.*/
+  
+  
   if (visible_stem_count (me) < 2)
     {
-      warning (_ ("beam has less than two stems"));
+      warning (_ ("beam has less than two visible stems"));
+
+      SCM stems = me->get_grob_property ("stems");
+      if (scm_ilength (stems) == 1)
+       {
+         warning (_("Beam has less than two stems. Removing beam."));
+
+         unsmob_grob (gh_car (stems))->remove_grob_property ("beam");
+         me->suicide ();
+
+         return SCM_UNSPECIFIED;
+       }
+      else if (scm_ilength (stems) == 0)
+       {
+         me->suicide ();
+         return SCM_UNSPECIFIED;         
+       }
     }
   if (visible_stem_count (me) >= 1)
     {
index c0cc4eb51d9592a2dd22b8664046f26efd9e0a30..e1c251152de55952bda71725d009c3fa4779b93e 100644 (file)
@@ -22,9 +22,8 @@ Engraver_group_engraver::announce_grob (Grob_info info)
 
 
 void
-Engraver_group_engraver::create_grobs ()
+Engraver_group_engraver::create_grobs_in_simple_children ()
 {
-
   for (SCM p = simple_trans_list_; gh_pair_p (p); p = ly_cdr (p))
     {
       Translator * t = unsmob_translator (ly_car (p));
@@ -34,6 +33,10 @@ Engraver_group_engraver::create_grobs ()
     }
 }
 
+/*
+  TODO: use this mechanism for the current Engraver_group_engraver as well.
+  
+ */
 SCM find_acknowledge_engravers (SCM gravlist, SCM meta);
 void
 Engraver_group_engraver::acknowledge_grobs ()
@@ -71,7 +74,7 @@ Engraver_group_engraver::acknowledge_grobs ()
       SCM acklist = scm_hashq_ref (tab, nm, SCM_UNDEFINED);
       if (acklist == SCM_BOOL_F)
        {
-         acklist= find_acknowledge_engravers (simple_trans_list_, meta);
+         acklist= find_acknowledge_engravers (gh_cons (self_scm (), simple_trans_list_), meta);
          scm_hashq_set_x (tab, nm, acklist);
        }
 
@@ -94,13 +97,13 @@ Engraver_group_engraver::do_announces ()
       dynamic_cast<Engraver_group_engraver*> (t)->do_announces ();
     }
 
-  create_grobs ();
+  create_grobs_in_simple_children ();
     
   while (announce_info_arr_.size ())
     {
       acknowledge_grobs ();
       announce_info_arr_.clear ();
-      create_grobs ();
+      create_grobs_in_simple_children ();
     }
 }
 
@@ -129,8 +132,6 @@ Engraver_group_engraver::process_music ()
     }
 }
 
-void find_all_acknowledge_engravers (SCM tab, SCM gravlist, SCM allgrobs);
-
 void
 Engraver_group_engraver::initialize ()
 {
@@ -145,7 +146,7 @@ Engraver_group_engraver::Engraver_group_engraver() {}
 ENTER_DESCRIPTION(Engraver_group_engraver,
 /* descr */       "A group of engravers taken together",
 /* creats*/       "",
-/* acks  */       "grob-interface",
+/* acks  */       "",
 /* reads */       "",
 /* write */       "");
 
index 5f0f5c6439c66a04885d1143cdb8112d0ffd7390..fb1f87141f37685ace5d35cb32040ffca02cdc37 100644 (file)
@@ -38,8 +38,8 @@ public:
   virtual void announce_grob (Grob_info);
   virtual void process_music ();
 private:
-  void create_grobs ();
-  void acknowledge_grobs ();
+  virtual void acknowledge_grobs ();
+  virtual void create_grobs_in_simple_children ();
 };
 
 #endif // ENGRAVERGROUP_HH
index 74631131bcba9a3e920742635ebbfb81301f6262..f984a5f6ccb1d8ee03a7dfc18ca1b2566872d8e3 100644 (file)
@@ -45,16 +45,15 @@ protected:
 
 protected:
   /* Engraver_group_engraver interface */
+  virtual void acknowledge_grob (Grob_info);
 
   virtual bool try_music (Music*);
   virtual void initialize ();
   virtual void finalize ();
   virtual void announce_grob (Grob_info);
-  virtual void do_announces ();
   virtual void typeset_grob (Grob*elem_p);
 
   virtual void stop_translation_timestep ();
-
 };
 
 #endif // SCORE_GRAV_HH
index 2bc13a4e9083a388a4d5e1092c5556a6e0fc0c21..1968458fadf000eb1d1fb22bcc27ce5dc2615212 100644 (file)
@@ -11,6 +11,7 @@
 #define STAFF_SYMBOL_HH
 
 #include "lily-guile.hh"
+#include "lily-proto.hh"
 
 /**
   TODO: add stafflinethickness as parameter.
index 2cf476fbbf587ff8c7ffccd1ac4de85917e95b71..cf8dff1c2aa1fa9c079eee59e6a40a7e51241960 100644 (file)
@@ -522,7 +522,23 @@ ly_assoc_chain (SCM key, SCM achain)
 
 /* looks the key up in the cdrs of the alist-keys
    - ignoring the car and ignoring non-pair keys.
-   Returns first match found. */
+   Returns first match found, i.e.
+
+   alist = ((1 . 10)
+                   ((1 . 2) . 11)
+                   ((2 . 1) . 12)
+                   ((3 . 0) . 13)
+                   ((4 . 1) . 14) )
+
+I would like (ly_assoc_cdr 1) to return 12 - because it's the first
+element with the cdr of the key = 1.  In other words (alloc_cdr key)
+corresponds to call
+
+(alloc (anything . key))
+
+
+
+*/
 SCM
 ly_assoc_cdr (SCM key, SCM alist)
 {
index 5ae17470b196773e4c8c08ddc20d026227e9c3e5..96f00ce5ba18578e386cf5ba10416300ed2c3304 100644 (file)
@@ -147,7 +147,6 @@ set_loose_columns (Line_of_score* which, Column_x_positions const *posns)
       Item * right = 0;
       while (1)
        {
-         
          SCM between = loose->get_grob_property ("between-cols");
          if (!gh_pair_p (between))
            break;
index 1a366e68b4d0f359636b79e9add90b11c2a08625..30384c392983e1b37c58040275cbe902c94c18c1 100644 (file)
@@ -15,7 +15,6 @@
 #include "lily-guile.hh"
 #include "paper-column.hh"
 #include "paper-def.hh"
-
 #include "side-position-interface.hh"
 #include "staff-symbol-referencer.hh"
 #include "item.hh"
@@ -38,7 +37,6 @@ protected:
   void create_items (Request*);
   virtual bool try_music (Music *req_l);
   virtual void start_translation_timestep ();
-  virtual void initialize ();
   virtual void process_music ();
   
 private:
@@ -55,34 +53,11 @@ Mark_engraver::Mark_engraver ()
   mark_req_l_ = 0;
 }
 
-void
-Mark_engraver::initialize ()
-{
-  daddy_trans_l_->set_property ("stavesFound", SCM_EOL); // ugh: sharing with barnumber grav.
-}
-
-
-
-
-/*
-
-which grobs carry INVISIBLE-STAFF ?
-
-*/
-
 void
 Mark_engraver::acknowledge_grob (Grob_info inf)
 {
   Grob * s = inf.grob_l_;
-  if (Staff_symbol::has_interface (s)
-      || to_boolean (s->get_grob_property ("invisible-staff")))
-    {
-      SCM sts = get_property ("stavesFound");
-      SCM thisstaff = inf.grob_l_->self_scm ();
-      if (scm_memq (thisstaff, sts) == SCM_BOOL_F)
-       daddy_trans_l_->set_property ("stavesFound", gh_cons (thisstaff, sts));
-    }
-  else if (text_p_ && Bar::has_interface (s))
+ if (text_p_ && Bar::has_interface (s))
     {
       /*
        Ugh. Figure out how to do this right at beginning of line, (without
@@ -218,6 +193,6 @@ Mark_engraver::process_music ()
 ENTER_DESCRIPTION(Mark_engraver,
 /* descr */       "",
 /* creats*/       "RehearsalMark",
-/* acks  */       "grob-interface", 
+/* acks  */       "bar-line-interface", 
 /* reads */       "rehearsalMark stavesFound",
 /* write */       "");
index 2957a3f0cf0fe6b96296f1a122741cce783f2d7a..c87409c450567a0dc6311bc46077f85475362f4f 100644 (file)
@@ -122,6 +122,13 @@ Rhythmic_column_engraver::stop_translation_timestep ()
       typeset_grob (note_column_);
       note_column_ =0;
     }
+
+  if (spacing_)
+    {
+      typeset_grob (spacing_);
+      last_spacing_ = spacing_;
+      spacing_ =0;
+    }
 }
 
 void
index 09bb7c4b33a1325a02cab8164626a9f3ab1640cf..6aad0e533e26b7a96d8d92aaa076bbfa1239d6d4 100644 (file)
@@ -18,6 +18,8 @@
 #include "axis-group-interface.hh"
 #include "translator-def.hh"
 
+#include "staff-spacing.hh"
+#include "note-spacing.hh"
 
 /*
   TODO: the column creation logic is rather hairy. Revise it.
@@ -38,7 +40,6 @@ Score_engraver::make_columns ()
     ugh.
    */
   if (!command_column_l_)
-    //      || *unsmob_moment (command_column_l_->get_grob_property ("when")) != w)
     {
       set_columns (new Paper_column (get_property ("NonMusicalPaperColumn")),
                   new Paper_column (get_property ("PaperColumn")));
@@ -134,20 +135,8 @@ Score_engraver::announce_grob (Grob_info info)
 {
   announce_info_arr_.push (info);
   pscore_p_->line_l_->typeset_grob (info.grob_l_);
-}
 
-/* All elements are propagated to the top upon announcement. If
-   something was created during one run of
-   Engraver_group_engraver::do_announces, then
-   announce_info_arr_.size () will be nonzero again
-*/
-/* junkme? Done by Engraver_group_engraver::do_announces ()?
- */
-   
-void
-Score_engraver::do_announces ()
-{
-  Engraver_group_engraver::do_announces ();
+
 }
 
 
@@ -294,7 +283,23 @@ Score_engraver::forbid_breaks ()
    */
   command_column_l_->remove_grob_property ("breakable");
 }
-
+  
+void
+Score_engraver::acknowledge_grob (Grob_info gi)
+{
+  if (Staff_spacing::has_interface (gi.grob_l_))
+    {
+      Pointer_group_interface::add_element (command_column_l_,
+                                           ly_symbol2scm ("spacing-wishes"),
+                                           gi.grob_l_);
+    }
+  if (Note_spacing::has_interface (gi.grob_l_))
+    {
+      Pointer_group_interface::add_element (musical_column_l_,
+                                           ly_symbol2scm ("spacing-wishes"),
+                                           gi.grob_l_);
+    }
+}
 
 
 
@@ -312,6 +317,6 @@ that there are no beams or notes that prevent a breakpoint.)
 
 ",
 /* creats*/       "LineOfScore PaperColumn NonMusicalPaperColumn",
-/* acks  */       "grob-interface",
+/* acks  */       "note-spacing-interface staff-spacing-interface",
 /* reads */       "currentMusicalColumn currentCommandColumn",
 /* write */       "");
index fc4a8c290f1e6605b6ba72c070641d266d393441..fc8679494ff79591bd4451b13f6c0618f8f710dd 100644 (file)
@@ -22,9 +22,9 @@ protected:
   Item * musical_malt_p_;
   Item * last_musical_malt_p_;
 
-  Grob * last_note_spacing_;
-  Grob * current_note_spacing_;
-  Grob * staff_spacing_;
+  Item * last_note_spacing_;
+  Item * current_note_spacing_;
+  Item * staff_spacing_;
   
   Spanner * sep_span_p_;
   
diff --git a/lily/staff-collecting-engraver.cc b/lily/staff-collecting-engraver.cc
new file mode 100644 (file)
index 0000000..6efb537
--- /dev/null
@@ -0,0 +1,45 @@
+/*   
+staff-collecting-engraver.cc --  implement Staff_collecting_engraver
+
+source file of the GNU LilyPond music typesetter
+
+(c) 2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+#include "staff-symbol.hh"
+#include "engraver.hh"
+#include "grob.hh"
+#include "translator-group.hh"
+
+class Staff_collecting_engraver : public Engraver
+{
+public:
+  TRANSLATOR_DECLARATIONS(Staff_collecting_engraver);
+  virtual void acknowledge_grob (Grob_info);
+};
+
+Staff_collecting_engraver::Staff_collecting_engraver ()
+{
+  
+}
+
+void
+Staff_collecting_engraver::acknowledge_grob (Grob_info gi)
+{
+  if (Staff_symbol::has_interface (gi.grob_l_))
+    {
+      SCM staffs = get_property ("stavesFound");
+      staffs = gh_cons (gi.grob_l_->self_scm (), staffs);
+
+      daddy_trans_l_->set_property ("stavesFound", staffs);
+    }
+}
+
+
+ENTER_DESCRIPTION(Staff_collecting_engraver,
+/* descr */       "Maintain the stavesFound variable",
+
+/* creats*/       "",
+/* acks  */       "staff-symbol-interface",
+/* reads */       "stavesFound",
+/* write */       "stavesFound");
index 15a2cbf74819d4b165a49403fb9eafc571df7d4a..b66e5f61290a18381697e5772d340e13a489d130 100644 (file)
@@ -1,5 +1,5 @@
 /*   
-  spacing-spanner.cc --  implement Spacing_spanner
+  spacing-spanner.cc -- implement Spacing_spanner
   
   source file of the GNU LilyPond music typesetter
   
@@ -7,9 +7,102 @@
   
  */
 
+
+#include "paper-column.hh"
+
+
 class Third_spacing_spanner
 {
 public:
   void find_loose_columns () {}
-  
+  void prune_loose_colunms (Link_array<Grob> *cols);
+  void find_loose_columns (Link_array<Grob> cols);
 };
+
+
+
+static bool
+fixed_neighbor (Grob *col, SCM nm)
+{
+  SCM l = col->internal_get_grob_property (nm);
+
+  if (!gh_pair_p (l))
+    return false;
+
+  Item * left = dynamic_cast<Item*>  (unsmob_grob (gh_car (l)));
+  return abs (Paper_column::rank_i (left->column_l ()) - Paper_column::rank_i (col)) == 1 ;
+}
+
+void
+Third_spacing_spanner::prune_loose_colunms (Link_array<Grob> *cols)
+{
+   for (int i=cols->size ();  i--; )
+     {
+
+       if (Item::breakable_b (cols->elem(i)))
+        continue;
+       
+       if (!fixed_neighbor (cols->elem(i), ly_symbol2scm ("left-neighbors"))
+          || !fixed_neighbor (cols->elem(i), ly_symbol2scm ("right-neighbors")))
+        cols->del (i);
+     }
+}
+
+void
+Third_spacing_spanner::find_loose_columns (Link_array<Grob> cols)
+{
+  for (int i=0; i< cols.size(); i++)
+    {
+      SCM right_neighbors = SCM_EOL;
+      int min_rank = 100000;   // inf.
+      
+      for (SCM s = cols[i]-> get_grob_property ("spacing-wishes");
+          gh_pair_p (s); s = gh_cdr (s))
+       {
+         Grob * wish = unsmob_grob (gh_car (s));
+
+         Grob * left = unsmob_grob (wish->get_grob_property ("left-item"));
+         Grob * right = unsmob_grob (wish->get_grob_property ("right-item"));
+
+         Item * li = dynamic_cast<Item*> (left);
+         Item * ri = dynamic_cast<Item*> (right);        
+
+         assert (li->column_l () == cols[i]);
+
+         Item * rc = ri->column_l ();
+         Item * lc = li->column_l ();
+         int newrank = Paper_column::rank_i (lc);
+
+         SCM neighbors = rc->get_grob_property ("left-neighbors");
+         Item  * left_neighbor = gh_pair_p (neighbors)
+           ? dynamic_cast<Item*> (unsmob_grob (gh_car (neighbors))) : 0;
+
+         left_neighbor = left_neighbor->column_l ();
+         if (left_neighbor)
+           {
+             int oldrank = Paper_column::rank_i (left_neighbor->column_l ());
+
+             if (newrank > oldrank)
+               {
+                 neighbors= gh_cons (wish->self_scm (), SCM_EOL);
+               }
+             else if (newrank == oldrank)
+               {
+                 neighbors = gh_cons (wish->self_scm (), neighbors); 
+               }
+           }
+
+         if (newrank < min_rank)
+           {
+             right_neighbors = gh_cons (wish->self_scm(), SCM_EOL);
+             min_rank = newrank;
+           }
+         else if (newrank == min_rank)
+           {
+             right_neighbors = gh_cons (wish->self_scm (), right_neighbors); 
+           }
+       }
+
+      cols[i]->set_grob_property ("right-neighbors", right_neighbors);
+    }
+}
index cc163f9bc93779288ca17bd990a5c27c8a7ed327..e9026e63f5999330d23544102ecf2dd1100da508 100644 (file)
@@ -14,6 +14,7 @@
 #include "note-column.hh"
 #include "bar.hh"
 #include "side-position-interface.hh"
+#include "staff-symbol.hh"
 
 /*
   Create Volta spanners, by reading repeatCommands  property, usually
@@ -34,12 +35,13 @@ protected:
   Moment started_mom_;
   Spanner *volta_span_p_;
   Spanner *end_volta_span_p_;
-
+  SCM staff_;
   SCM start_str_;
 };
 
 Volta_engraver::Volta_engraver ()
 {
+  staff_ = SCM_EOL;
   volta_span_p_ = 0;
   end_volta_span_p_ = 0;
 }
@@ -48,6 +50,27 @@ Volta_engraver::Volta_engraver ()
 void
 Volta_engraver::process_music ()
 {
+  if (unsmob_grob (staff_))
+    {
+      /*
+       TODO: this does weird things when you open a piece with a
+       volta spanner.
+       
+       */
+      SCM staffs = get_property ("stavesFound");
+
+      /*
+       only put a volta on the top staff.
+       
+       May be this is a bit convoluted, and we should have a single
+       volta engraver in score context or somesuch.
+       
+      */
+      if (ly_car (scm_last_pair (staffs)) != staff_)
+       return ;
+    }
+       
+  
   SCM cs = get_property ("repeatCommands");
 
   bool  end = false;
@@ -147,6 +170,17 @@ Volta_engraver::acknowledge_grob (Grob_info i)
            Volta_spanner::add_bar (end_volta_span_p_ , item);
        }
     }
+  else if (Staff_symbol::has_interface (i.grob_l_))
+    {
+      /*
+       We only want to know about a single staff: then we add to the
+       support.  */
+      if (staff_ != SCM_EOL)
+       staff_ = SCM_UNDEFINED;
+
+      if (staff_ != SCM_UNDEFINED)
+       staff_ = i.grob_l_->self_scm();
+    }
 }
 
 void
@@ -169,8 +203,6 @@ Volta_engraver::stop_translation_timestep ()
 {
   if (end_volta_span_p_)
     {
-      Side_position_interface::add_staff_support (end_volta_span_p_);
-      
       typeset_grob (end_volta_span_p_);
       end_volta_span_p_ =0;
     }
@@ -183,6 +215,6 @@ Volta_engraver::stop_translation_timestep ()
 ENTER_DESCRIPTION(Volta_engraver,
 /* descr */       "Make volta brackets",
 /* creats*/       "VoltaBracket",
-/* acks  */       "bar-line-interface note-column-interface",
-/* reads */       "repeatCommands voltaSpannerDuration",
+/* acks  */       "bar-line-interface staff-symbol-interface note-column-interface",
+/* reads */       "repeatCommands voltaSpannerDuration stavesFound",
 /* write */       "");
index 647f03862af862e22fc398817584cd5971e7a08e..57c60489d6c439113d3541d93d5142c4def237ba 100644 (file)
@@ -143,12 +143,6 @@ in LilyPond-include-path."
   :group 'LilyPond
   :type 'string)
 
-(defcustom LilyPond-midi-command "timidity"
-  "Command used to play MIDI files."
-
-  :group 'LilyPond
-  :type 'string)
-
 (defcustom LilyPond-gv-command "gv -watch"
   "Command used to display PS files."
 
@@ -318,46 +312,47 @@ Must be the car of an entry in `LilyPond-command-alist'."
 )
 
 (defun LilyPond-command-midi ()
-  "View the ps output of current document."
+  "Play midi corresponding to the current document."
   (interactive)
   (LilyPond-command (LilyPond-command-menu "Midi") 'LilyPond-master-file)
 )
 
-(defun LilyPond-command-formatdvi ()
-  "Format the dvi output of the current document."
-  (interactive)
-  (LilyPond-command (LilyPond-command-menu "2Dvi") 'LilyPond-master-file)
-)
-
-(defun LilyPond-command-formatps ()
-  "Format the ps output of the current document."
-  (interactive)
-  (LilyPond-command (LilyPond-command-menu "2PS") 'LilyPond-master-file)
-)
-
-(defun LilyPond-command-smartview ()
-  "View the dvi output of current document."
-  (interactive)
-  (LilyPond-command (LilyPond-command-menu "SmartView") 'LilyPond-master-file)
-)
-
-(defun LilyPond-command-view ()
-  "View the dvi output of current document."
+(defun count-rexp (start end rexp)
+  "Print number of found regular expressions in the region."
+  (interactive "r")
+  (save-excursion
+    (save-restriction
+      (narrow-to-region start end)
+      (goto-char (point-min))
+      (count-matches rexp))))
+
+(defun count-midi-words ()
+  "Print number of scores before the curser."
   (interactive)
-  (LilyPond-command (LilyPond-command-menu "View") 'LilyPond-master-file)
-)
-
-(defun LilyPond-command-viewps ()
-  "View the ps output of current document."
+  (count-rexp (point-min) (point-max) "\\\\midi"))
+(defun count-midi-words-backwards ()
+  "Print number of scores before the curser."
   (interactive)
-  (LilyPond-command (LilyPond-command-menu "ViewPS") 'LilyPond-master-file)
-)
-
-(defun LilyPond-command-midi ()
-  "View the ps output of current document."
+  (count-rexp (point-min) (point) "\\\\midi"))
+(defun LilyPond-command-next-midi ()
+  "Play next midi score of the current document."
   (interactive)
-  (LilyPond-command (LilyPond-command-menu "Midi") 'LilyPond-master-file)
-)
+  (LilyPond-compile-file 
+   (let ((allscores (count-midi-words))
+        (scores (count-midi-words-backwards))
+        (fname (LilyPond-master-file)))
+     (let ((count (string-to-number (substring scores 0 (+ (length scores) -12)))))
+       (concat  LilyPond-midi-command " "
+               (substring fname 0 (+ (length fname) -3)) ; suppose ".ly"
+               (if (not (string= "1 occurrences" allscores)) ; only one score
+                   (if (not (eq count 0))                    ; first score
+                       (if (string= scores allscores)        ; last score
+                           (concat "-" (number-to-string (+ count -1)))
+                         (concat "-" (number-to-string count)))))
+               ".midi")))
+   "Midi"))
 
 ;; FIXME, this is broken
 (defun LilyPond-region-file (begin end)
@@ -473,15 +468,15 @@ command."
   (define-key LilyPond-mode-map "\C-c\C-s" 'LilyPond-command-smartview)
   (define-key LilyPond-mode-map "\C-c\C-v" 'LilyPond-command-view)
   (define-key LilyPond-mode-map "\C-c\C-p" 'LilyPond-command-viewps)
-  (define-key LilyPond-mode-map "\C-c\C-m" 'LilyPond-command-midi)
-  (define-key LilyPond-mode-map "\C-cn" 'lilypond-notes)
-  (define-key LilyPond-mode-map "\C-cs" 'lilypond-score)
+  (define-key LilyPond-mode-map "\C-c\C-m" 'LilyPond-command-next-midi)
+  (define-key LilyPond-mode-map "\C-cn" 'LilyPond-insert-tag-notes)
+  (define-key LilyPond-mode-map "\C-cs" 'LilyPond-insert-tag-score)
   )
 
 ;;; Menu Support
 
-(define-skeleton lilypond-notes
-  "Lilypond notes tag."
+(define-skeleton LilyPond-insert-tag-notes
+  "LilyPond notes tag."
   nil
 ;  (if (bolp) nil ?\n)
   "\\notes"
@@ -489,8 +484,8 @@ command."
       (concat " \\relative " (skeleton-read "Relative: " "" str)))
   " { " _ " }")
 
-(define-skeleton lilypond-score
-  "Lilypond score tag."
+(define-skeleton LilyPond-insert-tag-score
+  "LilyPond score tag."
   nil
   (if (bolp) nil ?\n)
   "\\score {\n"
@@ -537,9 +532,9 @@ command."
               :keys "C-c C-r" :style radio
               :selected (eq LilyPond-command-current 'LilyPond-command-region) ]))
          '(("Insert"
-            [ "\\notes..."  lilypond-notes
+            [ "\\notes..."  LilyPond-insert-tag-notes
               :keys "C-c n" ]
-            [ "\\score..."  lilypond-score
+            [ "\\score..."  LilyPond-insert-tag-score
               :keys "C-c s" ]
             ))
 ;        (let ((file 'LilyPond-command-on-current))
@@ -554,7 +549,7 @@ command."
          '([ "SmartView" (LilyPond-command (LilyPond-command-menu "SmartView") 'LilyPond-master-file) :keys "C-c C-s"])
          '([ "View" (LilyPond-command (LilyPond-command-menu "View") 'LilyPond-master-file) :keys "C-c C-v"])
          '([ "ViewPS" (LilyPond-command (LilyPond-command-menu "ViewPS") 'LilyPond-master-file) :keys "C-c C-p"])
-         '([ "Midi" (LilyPond-command (LilyPond-command-menu "Midi") 'LilyPond-master-file) :keys "C-c C-m"])
+         '([ "Midi" (LilyPond-command-next-midi) :keys "C-c C-m"])
          ))
 
 (defconst LilyPond-imenu-generic-re "^\\([a-zA-Z_][a-zA-Z0-9_]*\\) *="
index 691dcb2aaf29db0287f776c8479b3b5fd225f05c..003d380d3f0a84db1387e5c86ccc227f0168773f 100644 (file)
@@ -324,6 +324,7 @@ ScoreContext = \translator {
        \name Score
        
        \consists "Repeat_acknowledge_engraver"
+       \consists "Staff_collecting_engraver"
        \consists "Timing_engraver"
        \consists "Output_property_engraver"
        \consists "System_start_delimiter_engraver"
index 4b200d509be2087e80c28cdbd35441d82d1d1eb2..3b40500bb52df32d43f14f192783fa5e624c3f70 100644 (file)
@@ -97,7 +97,6 @@ voiceTwo = {
   \slurDown
   \tieDown
   \dotsDown  
-
 }
    
 voiceThree = {
index 28cc1a6459b7c53d6bd0f7de922d3e5052e56557..e9bc7e9f71bcf3f19b90324f51dd47827e1bd73d 100644 (file)
@@ -1,15 +1,15 @@
 Begin3
 Title: LilyPond
-Version: 1.5.25
-Entered-date: 05DEC01
+Version: 1.5.26
+Entered-date: 14DEC01
 Description: @BLURB@
 Keywords: music notation typesetting midi fonts engraving
 Author: hanwen@cs.uu.nl (Han-Wen Nienhuys)
        janneke@gnu.org (Jan Nieuwenhuizen)
 Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
 Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
-       1000k lilypond-1.5.25.tar.gz 
+       1000k lilypond-1.5.26.tar.gz 
 Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
-       1000k lilypond-1.5.25.tar.gz 
+       1000k lilypond-1.5.26.tar.gz 
 Copying-policy: GPL
 End
index 7027054c8ccbafbc1102a463a58bef5af13e8528..0bfd6726321fab6986308ffebb096d24e08410b7 100644 (file)
@@ -1,5 +1,5 @@
 %define name lilypond
-%define version 1.5.25
+%define version 1.5.26
 %define release 1mdk
 
 Name: %{name}
index c31da8a65ba67866b4d1dd3cc03c3e2f29721af5..3f62515f6896b5def912919e3e7aed852062ad77 100644 (file)
@@ -1,11 +1,11 @@
 %define info yes
 
 Name: lilypond
-Version: 1.5.25
+Version: 1.5.26
 Release: 1
 License: GPL
 Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.25.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.26.tar.gz
 Summary: Create and print music notation 
 URL: http://www.lilypond.org/
 BuildRoot: /tmp/lilypond-install
index 3a460b67b363005a804bd999aad9f7ba6c9368df..35b61fe56bd95595193f0b9d5135331922ba16f9 100644 (file)
 
 Distribution: SuSE Linux 7.0 (i386)
 Name: lilypond
-Version: 1.5.25
+Version: 1.5.26
 Release: 2
 Copyright:    GPL
 Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.25.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.26.tar.gz
 # music notation software for.. ?
 Summary: A program for printing sheet music.
 URL: http://www.lilypond.org/
index efd48214a34096cda1404358694c4b12cbfc28a1..2e13e651fd24d6f23878003f3a7e5d27f47e5f12 100644 (file)
@@ -132,6 +132,16 @@ class LatexPaper:
                self.m_geo_x_marginparsep = None
                self.__body = None
        def set_geo_option(self, name, value):
+
+               if type(value) == type(""):
+                       m = re.match ("([0-9.]+)(cm|in|pt|mm|em|ex)",value)
+                       if m:
+                               unit = m.group (2)
+                               num = string.atof(m.group (1))
+                               conv =  dimension_conversion_dict[m.group(2)]
+
+                               value = conv(num)
+
                if name == 'body' or name == 'text':
                        if type(value) == type(""):
                                self.m_geo_textwidth =  value
@@ -307,6 +317,7 @@ def pt2pt(x):
 
 dimension_conversion_dict ={
        'mm': mm2pt,
+       'cm': lambda x: mm2pt(10*x),
        'in': in2pt,
        'em': em2pt,
        'ex': ex2pt,
@@ -614,7 +625,7 @@ def scan_latex_preamble(chunks):
                        idx = idx + 1
                        continue
                m = get_re ('header').match(chunks[idx][1])
-               if m.group (1):
+               if m <> None and m.group (1):
                        options = re.split (',[\n \t]*', m.group(1)[1:-1])
                else:
                        options = []
@@ -628,8 +639,8 @@ def scan_latex_preamble(chunks):
                                m = re.match("(\d\d)pt", o)
                                if m:
                                        paperguru.m_fontsize = int(m.group(1))
-                       
                break
+       
        while chunks[idx][0] != 'preamble-end':
                if chunks[idx] == 'ignore':
                        idx = idx + 1
index 2a93542dd03281aa09adc8b412a66823149829d5..62d6bbf561428beb9ec4ba9c5474bea527399846 100644 (file)
@@ -443,7 +443,7 @@ def analyse_lilypond_output (filename, extra):
 
        # search only the first 10k
        s = s[:10240]
-       for x in ('textheight', 'linewidth', 'papersize', 'orientation'):
+       for x in extra_fields:
                m = re.search (r'\\def\\lilypondpaper%s{([^}]*)}'%x, s)
                if m:
                        set_setting (extra, x, m.group (1))