]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/main.cc (main_prog): print summary of failed files.
authorhanwen <hanwen>
Fri, 9 Jan 2004 00:27:01 +0000 (00:27 +0000)
committerhanwen <hanwen>
Fri, 9 Jan 2004 00:27:01 +0000 (00:27 +0000)
* lily/axis-group-engraver.cc: move all spanner creation to
process_music (). Now staffs can be adjusted with \override too.

* lily/chord-tremolo-engraver.cc (try_music): fix spurious warning.

32 files changed:
ChangeLog
Documentation/topdocs/NEWS.texi
input/regression/staff-tweak.ly
input/screech-boink.ly
lily/axis-group-engraver.cc
lily/bar-line.cc
lily/bar-number-engraver.cc
lily/chord-name-engraver.cc
lily/chord-tremolo-engraver.cc
lily/engraver.cc
lily/include/main.hh
lily/include/output-property.hh [deleted file]
lily/include/translator-change.hh [deleted file]
lily/include/translator-def.hh
lily/include/translator-group.hh
lily/input-file-results.cc
lily/main.cc
lily/music-output-def.cc
lily/parser.yy
lily/piano-pedal-engraver.cc
lily/protected-scm.cc
lily/separating-line-group-engraver.cc
lily/slur-bezier-bow.cc
lily/spacing-engraver.cc
lily/spacing-spanner.cc
lily/staff-symbol-engraver.cc
lily/streams.cc [deleted file]
lily/system-start-delimiter-engraver.cc
lily/translator-def.cc
lily/translator-group.cc
lily/vertical-align-engraver.cc
mf/feta-bolletjes.mf

index 823b1998786d911d11495f89caeb403b29c0525d..d59be95f030cd76065d074026069d75772759b58 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
+2004-01-09  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * lily/main.cc (main_prog): print summary of failed files.
+
+       * lily/axis-group-engraver.cc: move all spanner creation to
+       process_music (). Now staffs can be adjusted with \override too.
+       
+       * lily/chord-tremolo-engraver.cc (try_music): fix spurious warning. 
+
 2004-01-08  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/translator-def.cc (get_translator_names): accept user
+       tweaks too. 
+
+       * mf/feta-bolletjes.mf (overdone_heads): oops, slashes are twice
+       as big as normal heads. 
+
        * input/*ly: run convert-ly
        
        * lily/tuplet-bracket.cc (brew_molecule): call after_line_breaking
index 84d146fca62d858653ef59bcd1a32d4c9b4a37cc..c85cc20c2dc3a45d347d27aff6e4be43f9f73fbd 100644 (file)
 Unreleased:
 
 @itemize
-@item  Features of spanner contexts, like Staff, can now be changed easily:
+
+@item The syntax for changing staffs has changed. The keyword
+@code{\change} should now be used, e.g.
+
+@example
+  \change Staff = up
+@end example 
+
+@item  Features of spanner contexts, like @code{Staff}, can now be changed easily:
 
 @example
   \new Staff \with @{
@@ -30,7 +38,8 @@ Version 2.1.7
 @itemize @bullet
 
 @item Multi measure rests are now truly centered between the
-clefs/barlines of the staff, independent of symbols on the other staffs.
+clefs/barlines of the staff, their position is independent of symbols
+on the other staffs.
 
 @item Collision resolution for dots in chords has been improved greatly. 
 
index f088dc8fda680a63994be68695026685b971c468..fcc21b8f442731f8eee387f3ed1c2721fa8e07d0 100644 (file)
@@ -1,8 +1,10 @@
 \version "2.1.7"
+
 \header {
 texidoc = "The staff is a grob, and may be adjusted as well: this one
  shows a staff with 6 thick line, and a slightly large staffspace.
 Beams remain correctly quantized."    
+
 }
 
 
@@ -10,15 +12,19 @@ mus = \notes \relative c' { c4 g' d'8 d d d }
 
 \score {
   \notes <<
-    \new Staff \mus
-    \new Staff \with { 
-       StaffSymbol \set #'thickness = #2.0
-       StaffSymbol \set #'line-count = #6
-       StaffSymbol \set #'staff-space = #1.1
-    } \mus
+    \new Staff {
+       \property
+       Staff.  StaffSymbol \set #'thickness = #2.0
+       \property
+       Staff.StaffSymbol \set #'line-count = #6
+       \property
+       Staff.StaffSymbol \set #'staff-space = #1.1
+       \mus
+    }
+    \mus
   >>
   \paper  {
     raggedright = ##t
-  } 
+  }
 }
 
index f779df0e9cff3662c14bad6b1a24a3bb0c463c35..6c42914cf2d449733cc72c94fa2cabe19bdac9c2 100644 (file)
@@ -21,7 +21,7 @@
        c'''32  \change Staff = down
         g16]
        \change Staff = up
-\property Voice.Stem \revert #'direction
+     \property Voice.Stem \revert #'direction
        \property Voice.followVoice = ##t
        c'''32([ b''16 a''16 gis''16 g''32)]  } \\
        { s4 \times 2/3 { d'16[ f' g'] } as'32[ b''32 e'' d''] } \\
index b8e57746840f1f61225849ba494af285b8314307..c00c4af282dd42bac508d8adf3e568b1a60aab26 100644 (file)
@@ -21,7 +21,7 @@ class Axis_group_engraver : public Engraver
 protected:
   Spanner *staffline_;
   Link_array<Grob> elts_;
-  virtual void initialize ();
+  virtual void process_music ();
   virtual void finalize ();
   virtual void acknowledge_grob (Grob_info);
   virtual void process_acknowledged_grobs ();
@@ -39,9 +39,11 @@ Axis_group_engraver::Axis_group_engraver ()
 }
 
 void
-Axis_group_engraver::initialize ()
+Axis_group_engraver::process_music ()
 {
-  staffline_ = get_spanner ();
+if (!staffline_)
+  {
+    staffline_ = get_spanner ();
 
   Grob *  it = unsmob_grob (get_property ("currentCommandColumn"));
 
@@ -49,6 +51,7 @@ Axis_group_engraver::initialize ()
 
   announce_grob(staffline_, SCM_EOL);
 }
+} 
 
 Spanner*
 Axis_group_engraver::get_spanner () const
index 82fdf74bdc2ba7568da0728c2f66d1b4378ded8d..e9dd56728bf3ad2309d5875cdf577dc6e96a2063 100644 (file)
@@ -10,7 +10,6 @@
 
 #include "lookup.hh"
 #include "paper-column.hh"
-#include "main.hh"
 #include "grob.hh"
 #include "bar-line.hh"
 #include "string.hh"
index 4ef961ad7495cba91131a96cd20bb1264edec229..e2689a94825bf4e1dbc5c2f9288636d6508e268a 100644 (file)
@@ -54,7 +54,8 @@ Bar_number_engraver::process_music ()
        {
          SCM bn = get_property ("currentBarNumber");
          SCM proc = get_property ("barNumberVisibility");
-         if (gh_number_p (bn) && to_boolean(gh_call1(proc, bn)))
+         if (gh_number_p (bn) && gh_procedure_p (proc)
+             && to_boolean(gh_call1(proc, bn)))
            {
              create_items ();
              // guh.
index 619b51a639323d312a6362d2629fd748e5cd19ae..633e1b3e118906f6f84e07eeb608f5eab1827d6e 100644 (file)
@@ -12,7 +12,6 @@
 #include "paper-def.hh"
 #include "font-interface.hh"
 #include "paper-def.hh"
-#include "main.hh"
 #include "dimensions.hh"
 #include "item.hh"
 #include "pitch.hh"
index 6d4160ea66036dc7df5904197c7b4714e328f126..a67946fe7b236e813ea9e29f7d5349300ad6b7f9 100644 (file)
@@ -95,7 +95,7 @@ Chord_tremolo_engraver::try_music (Music * m)
 
       int elt_count = seq ? scm_ilength (seq-> music_list ()) : 1;
 
-      if (elt_count != 2)
+      if (seq && elt_count != 2)
        {
          rp->origin ()->warning (_f ("Chord tremolo with %d elements. Must have two elements.", elt_count));
        }
index c49e76062ef80b7573f1c151bfdcb8aa8fc40ce2..e4a636721635e482dbc3d3a0f097d9c47e04feb0 100644 (file)
@@ -10,7 +10,6 @@
 #include "engraver.hh"
 #include "engraver-group-engraver.hh"
 #include "grob.hh"
-#include "main.hh"
 #include "score-engraver.hh"
 #include "warn.hh"
 
@@ -31,7 +30,6 @@ Engraver::announce_grob (Grob* e, SCM cause)
     TODO: junk grob-info, and make a cause grob-property to store
     `causes' generically.
   */
-  
   if (unsmob_music (cause) || unsmob_grob (cause))
     e->set_grob_property ("cause", cause);
 
index 9904c7512112d912804f6b1c63ca8505635f5e77..748128eea82fc6a9e450e6908fa880032d57ecb6 100644 (file)
@@ -9,6 +9,7 @@
 #define MAIN_HH
 
 #include "lily-proto.hh"
+#include "array.hh"
 
 void debug_init ();
 void set_debug (bool);
@@ -39,6 +40,7 @@ extern bool internal_type_checking_global_b;
 
 /* misc */
 extern All_font_metrics *all_fonts_global;
+extern Array<String> failed_files;
 extern int exit_status_global;
 extern File_path global_path;
 extern int score_count_global;
diff --git a/lily/include/output-property.hh b/lily/include/output-property.hh
deleted file mode 100644 (file)
index 3c6608a..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*   
-  output-property.hh -- declare Output_property
-  
-  source file of the GNU LilyPond music typesetter
-  
-  (c)  2000--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
-
-#ifndef OUTPUT_PROPERTY_HH
-#define OUTPUT_PROPERTY_HH
-
-#include "music.hh"
-
-
-/*
-  
-props:
-
-  relevant stuff: the predicate, the symbol, the value
-
- */
-class Output_property : public Music
-{
-public:
-  VIRTUAL_COPY_CONS (Music);
-  Output_property (SCM, SCM, SCM);
-};
-
-#endif /* OUTPUT_PROPERTY_HH */
-
-#error
diff --git a/lily/include/translator-change.hh b/lily/include/translator-change.hh
deleted file mode 100644 (file)
index 65296f8..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-
-#error
index bb641d5bf5d3ca2da96a56854ebd1b640f85c1fc..acc70202ca40df56d63df753fd517afcc89a33b1 100644 (file)
@@ -38,11 +38,12 @@ public:
   SCM default_child_context_name ();
   SCM get_context_name () const;
   SCM get_accepted ()  const;
-  SCM get_translator_names () const;
+  SCM get_property_ops ()  const { return property_ops_; }
+  SCM get_translator_names (SCM) const;
   void set_acceptor (SCM accepts, bool add);
 
   Link_array<Translator_def> path_to_acceptable_translator (SCM type_string, Music_output_def* odef) const;
-  Translator_group * instantiate (Music_output_def*);
+  Translator_group * instantiate (Music_output_def*, SCM extra_ops);
 
   SCM to_alist () const;
   bool is_alias (SCM) const;
index b68f4b4ec29a40fae755d21a4e0f53269b7cc8de..566e33a42f3755495cd538f50ff8b9b3db8fb748 100644 (file)
@@ -52,7 +52,7 @@ public:
   VIRTUAL_COPY_CONS (Translator);
   Translator_group (Translator_group const &);
   Translator_group ();
-  void add_fresh_group_translator (Translator *trans, SCM ops);
+  void add_fresh_group_translator (Translator *trans);
   void add_used_group_translator (Translator *trans);
   
   /// Score_register = 0, Staff_registers = 1, etc)
index 90bf8d4e2a717ff0e536da4ded7ca2e37ce4fc19..8565efe074184bd296984f3a38706ea13b7ba464 100644 (file)
@@ -144,6 +144,7 @@ Input_file_results::Input_file_results (String init, String in_file, String out_
   if (parser.error_level_)
     {
       exit_status_global  = 1;
+      failed_files.push (in_file);
     }
 
   
index 58d7553430158f16145b5c44df83acce45ea5fb0..5d88928cc7674dc93e92fd1f6fc2073152252727 100644 (file)
@@ -34,6 +34,8 @@
 #include "global-ctor.hh"
 #include "kpath.hh"
 
+Array<String> failed_files;
+
 static int sane_putenv (char const* key, char const* value, bool overwrite = false);
 
 /*
@@ -371,6 +373,13 @@ main_prog (void *, int, char **)
     } while ((arg  = oparser_p_static->get_next_arg ()));
   delete oparser_p_static;
   oparser_p_static = 0;
+
+  if (exit_status_global)
+    {
+      printf ("Failed files: ");
+      for (int i = 0; i < failed_files.size (); i++)
+       printf ("%s", failed_files[i].to_str0 ());
+    }
   exit (exit_status_global);
 }
 
index d13d5ec76a658c9bda95bf30eec21f4c0ed4de36..56d6bf6ca857d9a58b0a72c6513a831741bce904 100644 (file)
@@ -102,7 +102,7 @@ Music_output_def::get_global_translator ()
   if (!t)
     error (_f ("can't find `%s' context", "Score"));
 
-  Translator_group * tg = t->instantiate (this);
+  Translator_group * tg = t->instantiate (this, SCM_EOL);
   
   tg->initialize ();
   
index 86a4b070e305c9f407a743a6c201be1bcd558a90..e9b33a4e0e942ae5ac4ab9bbb6678f6b0842ea3d 100644 (file)
@@ -316,7 +316,7 @@ yylex (YYSTYPE *s,  void * v)
 %type <i>      exclamations questions dots optional_rest
 %type <i>       bass_mod
 %type <scm>    grace_head
-%type <scm>    property_operation_list
+%type <scm>    context_mod_list
 %type <scm>    lyric_element
 %type <scm>    bass_number br_bass_figure bass_figure figure_list figure_spec
 %token <i>     DIGIT
@@ -327,9 +327,7 @@ yylex (YYSTYPE *s,  void * v)
 %token <scm>    FRACTION
 %token <id>    IDENTIFIER
 %token <scm>   CHORDNAMES
-
-%token <scm> CHORD_MODIFIER
-
+%token <scm>   CHORD_MODIFIER
 %token <scm>   SCORE_IDENTIFIER
 %token <scm>   MUSIC_OUTPUT_DEF_IDENTIFIER
 %token <scm>   NUMBER_IDENTIFIER
@@ -383,7 +381,7 @@ yylex (YYSTYPE *s,  void * v)
 %type <music>  relative_music re_rhythmed_music part_combined_music
 %type <music>  music_property_def context_change 
 %type <scm> Music_list
-%type <scm> property_operation context_mod translator_mod
+%type <scm> property_operation context_mod translator_mod optional_context_mod
 %type <outputdef>  music_output_def_body
 %type <music> shorthand_command_req
 %type <music>  post_event tagged_post_event
@@ -888,15 +886,20 @@ Simple_music:
        ;
 
 
+optional_context_mod:
+       /**/ { $$ = SCM_EOL; }
+       | WITH '{' context_mod_list '}'  { $$ = $3; }
+       ;
+
 grace_head:
        GRACE  { $$ = scm_makfrom0str ("Grace"); } 
        | ACCIACCATURA { $$ = scm_makfrom0str ("Acciaccatura"); }
        | APPOGGIATURA { $$ = scm_makfrom0str ("Appoggiatura"); }
        ;
 
-property_operation_list:
+context_mod_list:
        /* */  { $$ = SCM_EOL; }
-       | property_operation_list property_operation  {
+       | context_mod_list context_mod  {
                 $$ = gh_cons ($2, $1);
        }
        ;
@@ -964,26 +967,18 @@ basic music objects too, since the meaning is different.
                scm_gc_unprotect_object ($2->self_scm ());
 #endif
        }
-       | CONTEXT string '=' string Music {
-               $$ = context_spec_music ($2, $4, $5, SCM_EOL);
+       | CONTEXT string '=' string optional_context_mod Music {
+               $$ = context_spec_music ($2, $4, $6, $5);
 
        }
-       | CONTEXT STRING Music {
-               $$ = context_spec_music ($2, SCM_UNDEFINED, $3, SCM_EOL);
+       | CONTEXT STRING optional_context_mod Music {
+               $$ = context_spec_music ($2, SCM_UNDEFINED, $4, $3);
        }
-       | NEWCONTEXT string Music {
+       | NEWCONTEXT string optional_context_mod Music {
                $$ = context_spec_music ($2, get_next_unique_context (),
-                                        $3, SCM_EOL);
-       }
-       | TRANSLATOR string '{' property_operation_list '}' Music  {
-               $$ = context_spec_music ($2, get_next_unique_context (),
-                                        $6, $4);
-               
-       }
-       | TRANSLATOR string '=' string '{' property_operation_list '}' Music  {
-               $$ = context_spec_music ($2, $4, 
-                                        $8, $6);
+                                        $4, $3);
        }
+
        | TIMES {
                THIS->push_spot ();
        }
index cb993f4bab896f574bf674d556bb4a3328f2fd5e..5204f51f68e4683468252beac344157907eb8726 100644 (file)
@@ -98,7 +98,6 @@ Piano_pedal_engraver::Piano_pedal_engraver ()
 void
 Piano_pedal_engraver::initialize ()
 {
-
   previous_.clear ();
 
   char * names [] = { "Sostenuto", "Sustain", "UnaCorda", 0  };
index 17193eeda5986dde2fc5e1b8fed8dbb6b4986b5e..db784cbac6f1033a465372ff1c64b14aa6c0b72a 100644 (file)
@@ -8,7 +8,6 @@
  */
 #include "protected-scm.hh"
 #include "lily-guile.hh"
-#include "main.hh"
 
 Protected_scm::Protected_scm ()
 {
index 2cb1cf9aa2442569345d232a7b7fa75167e6d7c4..cd6b5ca86843477d996f3f0baa4cc3979caebe92 100644 (file)
@@ -53,7 +53,7 @@ protected:
   Spanner * sep_span_;
   
   virtual void acknowledge_grob (Grob_info);
-  virtual void initialize ();
+  virtual void process_music ();
   virtual void finalize ();
   virtual void stop_translation_timestep ();
   virtual void start_translation_timestep ();  
@@ -69,14 +69,17 @@ Separating_line_group_engraver::Separating_line_group_engraver ()
 }
 
 void
-Separating_line_group_engraver::initialize ()
+Separating_line_group_engraver::process_music ()
 {
-  sep_span_ = new Spanner (get_property ("SeparatingGroupSpanner"));
 
-  announce_grob(sep_span_, SCM_EOL);
-  sep_span_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
-}
+  if (!sep_span_)
+    {
+      sep_span_ = new Spanner (get_property ("SeparatingGroupSpanner"));
 
+      announce_grob(sep_span_, SCM_EOL);
+      sep_span_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
+    }
+}
 void
 Separating_line_group_engraver::finalize ()
 {
index 9a152ddcab7027da1505a82eb97a0902cf6aaa0a..b2bd25ca3e0c0ec02ef7c663319d7540ba186894 100644 (file)
@@ -9,7 +9,6 @@
 #include "warn.hh"
 #include "paper-def.hh"
 #include "slur-bezier-bow.hh"
-#include "main.hh"
 
 Slur_bezier_bow::Slur_bezier_bow (Array<Offset> encompass, Direction dir,
                                  Real h_inf, Real r_0)
index 6e5447df01642bf64b0b49020d6a29cd36944c90..ae331b60d6299caefd7ee9360dbfebd18b8f1b11 100644 (file)
@@ -51,7 +51,7 @@ protected:
   virtual void acknowledge_grob (Grob_info);
   virtual void start_translation_timestep ();
   virtual void stop_translation_timestep ();
-  virtual void initialize ();
+  virtual void process_music ();
   virtual void finalize ();
 };
 
@@ -74,13 +74,15 @@ Spacing_engraver::Spacing_engraver ()
 }
 
 void
-Spacing_engraver::initialize ()
+Spacing_engraver::process_music ()
 {
-  spacing_  =new Spanner (get_property ("SpacingSpanner"));
-  spacing_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));  
-  announce_grob(spacing_, SCM_EOL);
+  if (!spacing_)
+    {
+      spacing_  =new Spanner (get_property ("SpacingSpanner"));
+      spacing_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));  
+      announce_grob(spacing_, SCM_EOL);
+    }
 }
-
 void
 Spacing_engraver::finalize ()
 {
index 17915f5442f9274662d14ca317e1cd6d05ca9ff3..14d7699d7806035d007a352fdd80d3d9b15626dd 100644 (file)
@@ -32,7 +32,7 @@
 /*
   TODO: this file/class is too complex. Should figure out how to chop
   this up even more.
-   
+    
  */
 
 class Spacing_spanner
index ea7300749a7113cd29ba9c77dd12331f85826bc9..71c9c8ca7de7ba5d2679eb4b47b1db1ba2f5989a 100644 (file)
@@ -26,7 +26,7 @@ protected:
   virtual ~Staff_symbol_engraver ();
   virtual void acknowledge_grob (Grob_info);
   virtual void finalize ();
-  virtual void initialize ();
+  virtual void process_music ();
 };
 
 
@@ -41,13 +41,16 @@ Staff_symbol_engraver::Staff_symbol_engraver ()
 }
 
 void
-Staff_symbol_engraver::initialize ()
+Staff_symbol_engraver::process_music ()
 {
-  span_ = new Spanner (get_property ("StaffSymbol"));
+  if (!span_)
+    {
+      span_ = new Spanner (get_property ("StaffSymbol"));
   
-  span_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
+      span_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
 
-  announce_grob(span_, SCM_EOL);
+      announce_grob(span_, SCM_EOL);
+    }
 }
 
 void
diff --git a/lily/streams.cc b/lily/streams.cc
deleted file mode 100644 (file)
index 022b3ab..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#include "config.h"
-
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/types.h>
-#if HAVE_SYS_STAT_H 
-#include <sys/stat.h>
-#endif
-
-#include <iostream>
-#include <fstream>
-
-#include "stream.hh"
-#include "file-path.hh"
-#include "warn.hh"
-#include "main.hh"
-
-#if __GNUC__ > 2
-std::ostream *
-open_file_stream (String filename, std::ios_base::openmode mode)
-#else
-std::ostream *
-open_file_stream (String filename, int mode)
-#endif
-{
-  std::ostream *os;
-  if ((filename == "-"))
-    os = &std::cout;
-  else
-    {
-      Path p = split_path (filename);
-      if (!p.dir.is_empty ())
-        if (mkdir (p.dir.to_str0 (), 0777) == -1 && errno != EEXIST)
-          error (_f ("can't create directory: `%s'", p.dir));
-      os = new std::ofstream (filename.to_str0 (), mode);
-    }
-  if (!*os)
-    error (_f ("can't open file: `%s'", filename));
-  return os;
-}
-
-void
-close_file_stream (std::ostream *os)
-{
-  *os << std::flush;
-  if (!*os)
-    {
-      warning (_ ("Error syncing file (disk full?)"));
-      exit_status_global = 1;
-    }
-  if (os != &std::cout)
-    delete os;
-  os = 0;
-}  
index b2a621a3dda24c07aeb0d4c344b2170352180ecf..d8045610bd2754a531477974e537f1bfae3f211f 100644 (file)
@@ -23,7 +23,7 @@ public:
 protected:
   Spanner * delim_;
   virtual void acknowledge_grob (Grob_info);
-  virtual void initialize ();
+  virtual void process_music ();
   virtual void finalize ();
 };
 
@@ -68,15 +68,17 @@ System_start_delimiter_engraver::System_start_delimiter_engraver ()
 }
 
 void
-System_start_delimiter_engraver::initialize ()
+System_start_delimiter_engraver::process_music ()
 {
-  SCM delim_name =get_property ("systemStartDelimiter");
-  delim_ = new Spanner (internal_get_property (delim_name));
+  if (!delim_)
+    {
+      SCM delim_name =get_property ("systemStartDelimiter");
+      delim_ = new Spanner (internal_get_property (delim_name));
 
-  delim_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
-  announce_grob (delim_, SCM_EOL);
+      delim_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
+      announce_grob (delim_, SCM_EOL);
+    }
 }
-
 void
 System_start_delimiter_engraver::finalize ()
 {
index 1386d0bdd752467f53930d97ea9fbc969e8b54ff..37bc280533f21019b0263ba667b11dca7a76da43 100644 (file)
@@ -72,7 +72,6 @@ Translator_def::Translator_def (Translator_def const & s)
   smobify_self();
   description_ = s.description_;
 
-
   accept_mods_ = s.accept_mods_;
   property_ops_ = s.property_ops_;
   translator_mods_ = s.translator_mods_;
@@ -136,31 +135,7 @@ Translator_def::add_context_mod (SCM mod)
     }
 }
 
-SCM
-Translator_def::get_translator_names () const
-{
-  SCM l1 = SCM_EOL;
-  SCM l2 = SCM_EOL;
-
-  SCM mods = scm_reverse (translator_mods_);
-  for (SCM s = mods; gh_pair_p (s); s = gh_cdr (s))
-    {
-      SCM tag = gh_caar (s);
-      SCM arg = gh_cadar (s);
-
-      if (ly_symbol2scm ("consists") == tag)
-       l1 = gh_cons (arg, l1);
-      else if (ly_symbol2scm ("consists-end") == tag)
-       l2 = gh_cons (arg, l2);
-      else if (ly_symbol2scm ("remove") == tag)
-       {
-         l1 = scm_delete_x (arg, l1);
-         l2 = scm_delete_x (arg, l2);
-       }
-    }
 
-  return scm_append_x (scm_list_2 (l1, l2));
-}
 
 SCM
 Translator_def::get_context_name () const
@@ -263,12 +238,44 @@ names_to_translators (SCM namelist, Translator_group*tg)
          scm_gc_unprotect_object (str);
        }
     }
-  return l; 
+  return l;
+}
+
+
+SCM
+Translator_def::get_translator_names (SCM user_mod) const
+{
+  SCM l1 = SCM_EOL;
+  SCM l2 = SCM_EOL;
+
+  SCM mods = scm_reverse_x (scm_list_copy (translator_mods_),
+                           user_mod);
+  
+  for (SCM s = mods; gh_pair_p (s); s = gh_cdr (s))
+    {
+      SCM tag = gh_caar (s);
+      SCM arg = gh_cadar (s);
+
+      if (gh_string_p (arg))
+       arg = scm_string_to_symbol (arg);
+      
+      if (ly_symbol2scm ("consists") == tag)
+       l1 = gh_cons (arg, l1);
+      else if (ly_symbol2scm ("consists-end") == tag)
+       l2 = gh_cons (arg, l2);
+      else if (ly_symbol2scm ("remove") == tag)
+       {
+         l1 = scm_delete_x (arg, l1);
+         l2 = scm_delete_x (arg, l2);
+       }
+    }
+
+  return scm_append_x (scm_list_2 (l1, l2));
 }
 
 
 Translator_group *
-Translator_def::instantiate (Music_output_def* md)
+Translator_def::instantiate (Music_output_def* md, SCM ops)
 {
   Translator * g = get_translator (translator_group_type_);
   g = g->clone (); 
@@ -277,19 +284,12 @@ Translator_def::instantiate (Music_output_def* md)
   tg->output_def_ = md;
   tg->definition_ = self_scm ();
 
-  SCM trans_names = get_translator_names (); 
+  SCM trans_names = get_translator_names (ops); 
   tg->simple_trans_list_ = names_to_translators (trans_names, tg);
-  
-  return tg;
-}
 
-void
-Translator_def::apply_default_property_operations (Translator_group*tg)
-{
-  apply_property_operations (tg, property_ops_);
+  return tg;
 }
 
-
 SCM
 Translator_def::clone_scm () const
 {
@@ -317,13 +317,19 @@ Translator_def::default_child_context_name ()
   SCM d = get_accepted ();
   return gh_pair_p (d) ? ly_car (scm_last_pair (d)) : SCM_EOL;
 }
+void
+Translator_def::apply_default_property_operations (Translator_group *tg)
+{
+  apply_property_operations (tg , property_ops_);
+}
 
 SCM
 Translator_def::to_alist () const
 {
   SCM l = SCM_EOL;
 
-  l = gh_cons (gh_cons (ly_symbol2scm ("consists"),  get_translator_names ()), l);
+  l = gh_cons (gh_cons (ly_symbol2scm ("consists"),
+                       get_translator_names (SCM_EOL)), l);
   l = gh_cons (gh_cons (ly_symbol2scm ("description"),  description_), l);
   l = gh_cons (gh_cons (ly_symbol2scm ("aliases"),  context_aliases_), l);
   l = gh_cons (gh_cons (ly_symbol2scm ("accepts"),  get_accepted ()), l);
index 1ce7b11e318fec73ea47606b1daff340852c320d..c83baf9f9590bdc068b1f6badd96dca2e43b3cfb 100644 (file)
@@ -86,14 +86,15 @@ Translator_group::add_used_group_translator (Translator *t)
 
 
 void
-Translator_group::add_fresh_group_translator (Translator*t, SCM pre_init_ops)
+Translator_group::add_fresh_group_translator (Translator*t)
 {
   Translator_group*tg = dynamic_cast<Translator_group*> (t);
-  assert (tg);
 
   trans_group_list_ = add_translator (trans_group_list_,t); 
-  unsmob_translator_def (tg->definition_)->apply_default_property_operations (tg);
-  apply_property_operations (tg, pre_init_ops);
+  
+  Translator_def * td = unsmob_translator_def (tg->definition_);
+  td->apply_default_property_operations (tg);
+
   t->initialize ();
 }
 
@@ -139,16 +140,19 @@ Translator_group::find_create_translator (SCM n, String id, SCM operations)
       // start at 1.  The first one (index 0) will be us.
       for (int i=0; i < path.size (); i++)
        {
-         Translator_group * new_group = path[i]->instantiate (output_def_);
+         SCM ops = (i == path.size () -1) ? operations : SCM_EOL;
+
+         Translator_group * new_group
+           = path[i]->instantiate (output_def_, ops);
 
-         SCM ops = SCM_EOL; 
          if (i == path.size () -1)
            {
              new_group->id_string_ = id;
-             ops = operations;
            }
 
-         current->add_fresh_group_translator (new_group, ops);
+         current->add_fresh_group_translator (new_group);
+         apply_property_operations (new_group, ops);
+         
          current = new_group;
        }
 
@@ -236,8 +240,8 @@ Translator_group::get_default_interpreter ()
          warning (_f ("can't find or create: `%s'", ly_symbol2string (nm).to_str0 ()));
          t = unsmob_translator_def (this->definition_);
        }
-      Translator_group *tg = t->instantiate (output_def_);
-      add_fresh_group_translator (tg, SCM_EOL);
+      Translator_group *tg = t->instantiate (output_def_, SCM_EOL);
+      add_fresh_group_translator (tg);
 
       if (!tg->is_bottom_translator_b ())
        return tg->get_default_interpreter ();
@@ -473,6 +477,9 @@ Translator_group::context_name () const
   return ly_symbol2string (td->get_context_name ());
 }
 
+/*
+  PRE_INIT_OPS is in the order specified, and hence must be reversed.
+ */
 void
 apply_property_operations (Translator_group*tg, SCM pre_init_ops)
 {
index e38d46686b255d0c9f794b6cdb4ec9bfde0f562d..9248973f0bf8c7d4aa356bbe088005be25ec3571 100644 (file)
@@ -21,7 +21,7 @@ public:
   TRANSLATOR_DECLARATIONS(Vertical_align_engraver);
 protected:
   virtual void acknowledge_grob (Grob_info);
-  virtual void initialize ();
+  virtual void process_music ();
   virtual void finalize ();
 };
 
@@ -31,11 +31,14 @@ Vertical_align_engraver::Vertical_align_engraver ()
 }
 
 void
-Vertical_align_engraver::initialize ()
+Vertical_align_engraver::process_music ()
 {
-  valign_ =new Spanner (get_property ("VerticalAlignment"));
-  valign_->set_bound (LEFT,unsmob_grob (get_property ("currentCommandColumn")));
-  announce_grob(valign_ , SCM_EOL);
+  if (!valign_)
+    {
+      valign_ =new Spanner (get_property ("VerticalAlignment"));
+      valign_->set_bound (LEFT,unsmob_grob (get_property ("currentCommandColumn")));
+      announce_grob(valign_ , SCM_EOL);
+    }
 }
 
 void
index d173b4bf170f0b1b464db2bcc93448636df687dd..fd4a7e9299698ff6890778dd7db221bb1f08f440 100644 (file)
@@ -285,13 +285,18 @@ fet_beginchar("Quart trianglehead", "2triangle", "trianglehead")
 fet_endchar;
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
+%
+% slash heads are for indicating improvisation. They are  
+% twice as high as normal heads.
+%
 def draw_slash(expr hwid_hash) =
+       save exact_height;
+       save ne_dir;
+       pair ne_dir;
+       exact_height =  staff_space# + stafflinethickness#/2;
 
-
-       set_char_box (0, staff_space# / slash_slope + hwid_hash,
-                       staff_space#/2 + stafflinethickness#/2,
-                       staff_space#/2 + stafflinethickness#/2);
+       set_char_box (0, 2 exact_height / slash_slope + hwid_hash,
+                       exact_height, exact_height);
 
        charwx := charwd;
        charwy := charht;
@@ -302,13 +307,14 @@ def draw_slash(expr hwid_hash) =
        bot y1 = - d;
        top y2 = h;
        lft x1 = 0;
-       lft x2 = staff_space / slash_slope;
+       lft x2 = 2 h / slash_slope;
        
        rt x3 = w;
        y3 = y2;
        y4 = y1;
        x3- x2 = x4 - x1;
 
+       ne_dir := unitvector( z3  - z4);
        filldraw z1 --- z2 --- z3 --- z4 --- cycle;
 
        if hwid_hash > 2 slash_thick#:
@@ -319,11 +325,11 @@ def draw_slash(expr hwid_hash) =
                y5 = y8;
                y3 - y7 = th;
                y5 - y1 = th;
-               z6 - z5 = whatever * (1,  slash_slope);
-               z8 - z7 = whatever * (1,  slash_slope);
+               z6 - z5 = whatever * ne_dir;
+               z8 - z7 = whatever * ne_dir;
 
-               z5  = z1 + whatever * (1,  slash_slope) + (th, 0);
-               z8  = z4 + whatever * (1,  slash_slope) + (-th, 0);
+               z5  = z1 + whatever * ne_dir + th * (ne_dir rotated -90);
+               z8  = z4 + whatever * ne_dir + th * (ne_dir rotated 90);
 
                unfill
                        z5 -- z6 -- z7 -- z8 -- cycle;
@@ -332,19 +338,18 @@ def draw_slash(expr hwid_hash) =
 enddef;
 
 fet_beginchar("Whole slashhead","0slash","wholeslashhead")
-       draw_slash(2 slash_thick# + 0.5 staff_space#);
+       draw_slash(4 slash_thick# + 0.5 staff_space#);
 fet_endchar;
 
 fet_beginchar("Half slashhead","1slash","halfslashhead")
-       draw_slash(2 slash_thick# + 0.15 staff_space#);
+       draw_slash(3.0 slash_thick# + 0.15 staff_space#);
 fet_endchar;
 
 fet_beginchar("Quart slashhead","2slash","quartslashhead")
-       draw_slash(slash_thick#);
+       draw_slash(1.5 slash_thick#);
 fet_endchar;
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
 % thick is the distance between the NE/SW parallel lines in the cross
 % (distance between centres of lines)
 % in stafflinethickness def