]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.1.8.hwn2
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 25 Nov 1998 13:00:43 +0000 (14:00 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 25 Nov 1998 13:00:43 +0000 (14:00 +0100)
pl 8.hwn2
- more output revamping.

---
Generated by hanwen@cs.uu.nl using package-diff 0.62,
From = lilypond-1.1.8.hwn1, To = lilypond-1.1.8.hwn2

usage

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.1.8.hwn2.diff

Patches do not contain automatically generated files
or (urg) empty directories,
i.e., you should rerun autoconf, configure
and possibly make outdirs.

--state
1.1.8.hwn1
1.1.8.hwn2
++state

14 files changed:
NEWS
VERSION
init/lily.scm
init/table16.ly
init/table20.ly
lily/dynamic-engraver.cc
lily/include/lily-guile.hh
lily/include/paper-outputter.hh
lily/lily-guile.cc
lily/lookup.cc
lily/p-score.cc
lily/paper-def.cc
lily/paper-outputter.cc
lily/stem.cc

diff --git a/NEWS b/NEWS
index 4c5561f8266131274bf126032bc8d78ae667f7cd..3abc2f98e6285818890d03d748fa8480154550c7 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,14 @@
---- ../lilypond-1.1.8/NEWS     Sat Nov 21 12:21:29 1998
+--- ../lilypond-1.1.8.hwn1/NEWS        Sun Nov 22 20:43:39 1998
+++ b/NEWS      Wed Nov 25 14:00:43 1998
+@@ -1,4 +1,8 @@
+pl 8.hwn2
+       - more output revamping.
+
+ pl 8.hwn1
+       - Scheme output stuff
+       - tutorial fixes.
+ pl 8--- ../lilypond-1.1.8/NEWS        Sat Nov 21 12:21:29 1998
 ++ b/NEWS      Mon Nov 23 21:47:36 1998
 @@ -1,3 +1,8 @@
 pl 8.jcn1
diff --git a/VERSION b/VERSION
index 216dcd2ab154e114fe92391d34ae4b6e99f68a8c..3982b9e2512692ec988c42f0c3f5c8f7ea385c5f 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=1
 PATCH_LEVEL=8
-MY_PATCH_LEVEL=jcn1
+MY_PATCH_LEVEL=hwn2
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 4b741da3d1243d2a54117998aad06cb125d16616..be28d088f943702d7338ac1c740067ea8aaec221 100644 (file)
 
 ;;;;;;;; TeX
 
-
-
 (define (tex-scm action-name)
 
   (define (unknown) 
     "%\n\\unknown%\n")
 
-
   (define (beam width slope thick)
     (embedded-ps ((ps-scm 'beam) width slope thick)))
 
      "\\placebox{"
      (number->dim y) "}{" (number->dim x) "}{" s "}"))
 
+  (define (pianobrace y)
+    (define step 1.0)
+    (define minht mudelapaperstaffheight)
+    (define maxht (* 6 minht))
+    (string-append
+     "{\\bracefont " (char  (/  (- (max y (- maxht step)) minht)   step)) "}"))
+  
   (define (rulesym h w) 
     (string-append 
      "\\vrule height " (number->dim (/ h 2))
           (define experimental-on  ,experimental-on)
           (define char  ,char)
           (define maatstreep ,maatstreep)
+          (define pianobrace ,pianobrace)
           ))
 
        ((eq? action-name 'experimental-on) experimental-on)
 )
 
 
-(define 
-  (unknown-ps) 
-  "\n unknown\n")
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; output definitions
 
index 56a746aad87384689888438e108d48d10e49b92e..5c311e61c8500154fa35e357f95577f312b71184 100644 (file)
@@ -68,9 +68,5 @@ table_sixteen=
      }
 
 
-     "beamslopes" = \table {
-       "slope"         "beamslope"     2  2.0\pt 64.0\pt 0.0\pt 0.0\pt
-       "horizontal"    "rulesym"       2       
-     }
 }
 
index 718dd5bbec285b5364aa296400f3384e35803d03..4ad52927916b7edfbc2b3c279a4834eff87cc35e 100644 (file)
@@ -70,11 +70,6 @@ table_twenty =
         "stem" "stem"  2
         "fill" "hbox{}"        0
      }
-
-     "beamslopes" = \table {
-       "slope"         "beamslope"     2  2.0\pt 64.0\pt 0.0\pt 0.0\pt 
-       "horizontal"    "rulesym"       2       
-     }
      
 }
 
index becdf9b76ba29b34e3742d808141ef4688917e02..fbfd95459d5ee0a3f6e137e910f73c41e168c6a2 100644 (file)
@@ -64,7 +64,7 @@ Dynamic_engraver::do_process_requests()
          Text_def * td_p = new Text_def;
          td_p->align_dir_ = CENTER;
          String loud = absd->loudness_str ();
-         td_p->text_str_ = paper ()->lookup_l (0)->dynamic (loud).str_; // ugh
+         td_p->text_str_ =  paper ()->lookup_l (0)->dynamic (loud).str_; // ugh
          td_p->style_str_ = "dynamic";
 
          
index ea7344b84186ce710a71ccdb01e2cc5e96df1053..e2f945b1c08a568129976bd174a586e5835ff5a2 100644 (file)
@@ -20,19 +20,12 @@ SCM ly_symbol (String name);
 SCM ly_append (SCM a, SCM b);
 SCM ly_eval (SCM a);
 SCM ly_func_o (char const* name);
-SCM ly_lambda_o ();
-SCM ly_list1 (SCM a);
-SCM ly_quote ();
 SCM ly_quote_scm (SCM s);
 
 
 #include "array.hh"
 #include "scalar.hh"
 
-SCM lambda_scm (String str, Array<int> args_arr);
-SCM lambda_scm (String str, Array<Real> args_arr);
-SCM lambda_scm (String str, Array<Scalar> args_arr);
-
 
 void read_lily_scm_file (String);
 
index e88e6fa5c6556c89f36a6b42efa3196b4c2e9830..42c580768e9a5d24a8c2c22c998fd9667702844a 100644 (file)
@@ -24,13 +24,17 @@ public:
   Paper_outputter (Paper_stream *);
   ~Paper_outputter ();
 
+  void output_int_def (String k, int v);
+  void output_Real_def (String k, Real v);
+  void output_String_def (String k, String v);
+  void output_scope (Scope*, String prefix);
+  void output_version ();
   void output_font_def (int i, String str);
   void output_font_switch (int i);
   void output_header ();
   void output_molecule (Molecule const *, Offset, char const *);
   void output_comment (String s);
   void output_scheme (SCM scm);
-  void output_string (String s);
   void start_line ();
   void stop_line ();
   void switch_to_font (String fontname);
index 0205684901198f8340faeaf7cf2b5403826a1f51..1652449551d0055d3b256ce5c8e55aa8a70ac2fd 100644 (file)
 #include "simple-file-storage.hh"
 #include "file-path.hh"
 
-SCM
-ly_list1 (SCM a)
-{
-  return gh_list (a, SCM_UNDEFINED);
-}
-
 
 /*
   scm_m_quote doesn't use any env, but needs one for a good signature in GUILE.
@@ -36,26 +30,6 @@ ly_quote_scm (SCM s)
   
 }
 
-SCM
-ly_eval (SCM a)
-{
-  return gh_call1 (gh_eval_str ("eval"), a);
-}
-
-SCM
-ly_lambda_o ()
-{
-  return gh_eval_str ("'(lambda (o))");
-}
-
-SCM
-ly_func_o (char const* name)
-{
-  char buf[200];               // ugh.
-  snprintf (buf, 200, "'(%s o)", name);
-  return gh_eval_str (buf);
-}
-
 /*
   See: libguile/symbols.c
 
@@ -69,53 +43,6 @@ ly_symbol (String name)
   return gh_car (scm_intern (name.ch_C(), name.length_i()));
 }
 
-SCM
-lambda_scm (String str, Array<int> args_arr)
-{
-  if (str.empty_b ())
-    {
-      str = "empty";
-      args_arr.clear ();
-    }
-  SCM args_scm = SCM_EOL;
-  for (int i = args_arr.size () - 1; i >= 0; i--)
-    args_scm = gh_cons (gh_int2scm (args_arr[i]), args_scm);
-  args_scm = gh_cons (ly_symbol (str.ch_l ()), args_scm);
-  return args_scm;
-}
-
-// scm_top_level_env(SCM_CDR(scm_top_level_lookup_closure_var)))
-SCM
-lambda_scm (String str, Array<Scalar> args_arr)
-{
-  if (str.empty_b ())
-    {
-      str = "empty";
-      args_arr.clear ();
-    }
-  SCM args_scm = SCM_EOL;
-  for (int i = args_arr.size (); i--; )
-    args_scm = gh_cons (gh_str02scm (args_arr[i].ch_l ()), args_scm);
-  args_scm = gh_cons (ly_symbol (str.ch_l ()), args_scm);
-  return args_scm;
-}
-
-SCM
-lambda_scm (String str, Array<Real> args_arr)
-{
-  if (str.empty_b ())
-    {
-      str = "empty";
-      args_arr.clear ();
-    }
-  SCM args_scm = SCM_EOL;
-  for (int i = args_arr.size (); i--; )
-    args_scm = gh_cons (gh_double2scm (args_arr[i]), args_scm);
-  
-  args_scm = gh_cons (ly_symbol (str.ch_l ()), args_scm);
-  return args_scm;
-}
-
 /**
 
    Read a file, and shove it down GUILE.  GUILE also has file read
index fcaf8fc60f0bea5cde6d2fc46c5797c889d2eb1a..43afcd75a229ca0d662aa37e0fd93a86b68d9496 100644 (file)
 #include "main.hh"
 #include "lily-guile.hh"
 
+SCM
+array_to_list (SCM *a , int l)
+{
+  SCM list = SCM_EOL;
+  for (int i= l; i--;  )
+    {
+      list =  gh_cons (a[i], list);
+    }
+  return list;
+}
+
 
 Lookup::Lookup ()
 {
@@ -97,8 +108,6 @@ Lookup::afm_find (String s, bool warn) const
   a.dim_ = m.B_;
   a.dim_[X_AXIS] *= 1 / 1000.0;
   a.dim_[Y_AXIS] *= 1 / 1000.0;
-  Array<Real> arr;
-  arr.push (m.code ());
 
   
   a.lambda_ = gh_list (ly_symbol ("char"),
@@ -121,8 +130,7 @@ Lookup::ball (int j) const
 Atom
 Lookup::bar (String str, Real h) const
 {
-  Array<Real> arr;
-  arr.push (h);
+
   Atom a = (*symtables_p_) ("bars")->lookup (str);
   
   
@@ -143,14 +151,13 @@ Lookup::beam (Real slope, Real width, Real thick) const
   Real min_y = (0 <? height) - thick/2;
   Real max_y = (0 >? height) + thick/2;
 
-  Array<Real> arr;
-  arr.push (width);
-  arr.push (slope);
-  arr.push (thick);
-
   Atom a;
-  a.lambda_ =  (lambda_scm ("beam", arr));
-  a.str_ = "beam";
+  a.lambda_ =   gh_list (ly_symbol ("beam"),
+          gh_double2scm (width),
+          gh_double2scm (slope),
+          gh_double2scm (thick),
+          SCM_UNDEFINED);
+
   a.dim_[X_AXIS] = Interval (0, width);
   a.dim_[Y_AXIS] = Interval (min_y, max_y);
   return a;
@@ -189,12 +196,11 @@ Lookup::dashed_slur (Array<Offset> controls, Real thick, Real dash) const
       sc[i] =  offset2scm (controls[i]);
     }
 
-  // (lambda (o) (dashed-slur o thick dash '(stuff))
   a.lambda_ = 
     gh_list (ly_symbol ("dashed-slur"),
             gh_double2scm (thick), 
             gh_double2scm (dash),
-            gh_list (sc[1], sc[2], sc[3], sc[0], SCM_UNDEFINED),
+            ly_quote_scm (array_to_list (sc, 4)),
             SCM_UNDEFINED);
 
   a.str_ = "dashed_slur";
@@ -217,9 +223,9 @@ Atom
 Lookup::extender (Real width) const
 {
   Atom a = (*symtables_p_) ("param")->lookup ("extender");
-  Array<Real> arr;
-  arr.push (width);
-  a.lambda_ = (lambda_scm (a.str_, arr));
+  a.lambda_ = gh_list (ly_symbol (a.str_),
+                      gh_double2scm (width),
+                      SCM_UNDEFINED);
   a.str_ = "extender";
   a.font_ = font_;
   return a;
@@ -311,16 +317,14 @@ Lookup::stem (Real y1, Real y2) const
   a.dim_.x () = Interval (0,0);
   a.dim_.y () = Interval (y1,y2);
 
-  Array<Real> arr;
-
   Real stem_width = paper_l_->get_var ("stemthickness");
 
-  gh_list (ly_symbol ("stem"),
-          gh_double2scm(-stem_width /2),
-          gh_double2scm(stem_width),
-          gh_double2scm(y2),
-          gh_double2scm(-y1),
-          SCM_UNDEFINED);
+  a.lambda_ = gh_list (ly_symbol ("stem"),
+                      gh_double2scm(-stem_width /2),
+                      gh_double2scm(stem_width),
+                      gh_double2scm(y2),
+                      gh_double2scm(-y1),
+                      SCM_UNDEFINED);
 
   a.font_ = font_;
   return a;
@@ -341,16 +345,15 @@ Dictionary<Adobe_font_metric*> afm_p_dict;
 Atom
 Lookup::text (String style, String text) const
 {
-  Array<Scalar> arr;
-
-  arr.push (text);
   Atom a =  (*symtables_p_) ("style")->lookup (style);
-  a.lambda_ = lambda_scm (a.str_, arr);
+
+  a.lambda_ = gh_list(ly_symbol (a.str_),
+                     gh_str02scm (text.ch_C()),
+                     SCM_UNDEFINED);
+  
   Real font_w = a.dim_.x ().length ();
   Real font_h = a.dim_.y ().length ();
 
-// urg
-//  if (!cmr_dict.length_i ())
   if (!cmr_dict.elem_b ("roman"))
     {
       //brrrr
@@ -403,7 +406,6 @@ Lookup::text (String style, String text) const
     }
   DOUT << "\n" << to_str (w) << "\n";
   a.dim_.x () = Interval (0, w);
-  a.str_ = "text";
   a.font_ = font_;
   return a;
 }
@@ -413,43 +415,21 @@ Atom
 Lookup::time_signature (Array<int> a) const
 {
   Atom s ((*symtables_p_) ("param")->lookup ("time_signature"));
-  s.lambda_ =  (lambda_scm (s.str_, a));
-
+  s.lambda_ = gh_list (ly_symbol (s.str_),
+                      gh_int2scm (a[0]),
+                      gh_int2scm (a[1]),
+                      SCM_UNDEFINED);
   return s;
 }
 
-/*
-  should be handled via Tex_ code and Lookup::bar ()
- */
 Atom
 Lookup::vbrace (Real &y) const
 {
-  Atom a = (*symtables_p_) ("param")->lookup ( "brace");
-  Interval ydims = a.dim_[Y_AXIS];
-  Real min_y = ydims[LEFT];
-  Real max_y = ydims[RIGHT];
-  Real step = 1.0 PT;
-  if (y < min_y)
-    {
-      warning (_ ("piano brace") 
-              + " " + _ ("too small") +  " (" + print_dimen (y) + ")");
-      y = min_y;
-    }
-  if (y > max_y)
-    {
-      warning (_ ("piano brace")
-              + " " + _ ("too big") + " (" + print_dimen (y) + ")");
-      y = max_y;
-    }
-
-  
-  int idx = int (rint ( (y- min_y)/step)) + 1;
-  
-  Array<Real> arr;
-  arr.push (idx);
-  a.lambda_ = (lambda_scm (a.str_, arr));
-  a.str_ = "brace";
+  Atom a;
+  a.lambda_ = gh_list (ly_symbol ("pianobrace"),
+                      gh_double2scm (y),
+                      SCM_UNDEFINED
+                      );
   a.dim_[Y_AXIS] = Interval (-y/2,y/2);
   a.font_ = font_;
   return a;
@@ -460,13 +440,13 @@ Lookup::hairpin (Real width, bool decresc, bool continued) const
 {
   Atom a;  
   Real height = paper_l_->staffheight_f () / 6;
-  Array<Real> arr;
-  arr.push (width);
-  arr.push (height);
-  arr.push (continued ? height/2 : 0);
+
   String hairpin = String (decresc ? "de" : "") + "crescendo\n";
-  a.lambda_ = lambda_scm (hairpin, arr);
-  a.str_ = "hairpin";
+  a.lambda_ = gh_list (ly_symbol (hairpin),
+                      gh_double2scm (width),
+                      gh_double2scm (height),
+                      gh_double2scm (continued ? height/2 : 0.0),
+                      SCM_UNDEFINED);
   a.dim_.x () = Interval (0, width);
   a.dim_.y () = Interval (-2*height, 2*height);
   a.font_ = font_;
@@ -476,26 +456,14 @@ Lookup::hairpin (Real width, bool decresc, bool continued) const
 Atom
 Lookup::plet (Real dy , Real dx, Direction dir) const
 {
-  Array<Real> arr;
-  arr.push (dx);
-  arr.push (dy);
-  arr.push (dir);
   Atom a;
-  a.lambda_ = (lambda_scm ("tuplet", arr));
-  a.str_ = "plet";
+  a.lambda_ = gh_list(ly_symbol ("tuplet"),
+                     gh_double2scm (dx),
+                     gh_double2scm (dy),
+                     gh_int2scm (dir));
   return a;
 }
 
-SCM
-array_to_list (SCM *a , int l)
-{
-  SCM list = SCM_EOL;
-  for (int i= l; i--;  )
-    {
-      list =  gh_cons (a[i], list);
-    }
-  return list;
-}
 
 Atom
 Lookup::slur (Array<Offset> controls) const
@@ -513,7 +481,7 @@ Lookup::slur (Array<Offset> controls) const
 
 
   a.lambda_ =gh_list (ly_symbol ("slur"),
-                     array_to_list (scontrols, 8),
+                     ly_quote_scm (array_to_list (scontrols, 8)),
                      SCM_UNDEFINED);
 
   a.dim_[X_AXIS] = Interval (0, dx);
@@ -533,9 +501,10 @@ Lookup::vbracket (Real &y) const
               + " " + _ ("too small") +  " (" + print_dimen (y) + ")");
       //      y = min_y;
     }
-  Array<Real> arr;
-  arr.push (y);
-  a.lambda_ =  (lambda_scm ("bracket", arr));
+
+  a.lambda_ =  gh_list (ly_symbol ("bracket"),
+                       gh_double2scm (y),
+                       SCM_UNDEFINED);
   a.str_ = "vbracket";
   a.dim_[Y_AXIS] = Interval (-y/2,y/2);
   a.dim_[X_AXIS] = Interval (0,4 PT);
@@ -545,11 +514,11 @@ Lookup::vbracket (Real &y) const
 Atom
 Lookup::volta (Real w, bool last_b) const
 {
-  Array<Real> arr;
-  arr.push (w);
-  arr.push (last_b);
   Atom a;
-  a.lambda_ = (lambda_scm ("volta", arr));
+  a.lambda_ = gh_list (ly_symbol ("volta"),
+                      gh_double2scm (w),
+                      gh_int2scm (last_b),
+                      SCM_UNDEFINED);
   a.str_ = "volta";
   return a;
 }
index 94982bb10066f288b367e2710ea4211429532d07..2afdbc129c206728fe5a470b23f9ece2a75ef769 100644 (file)
@@ -45,18 +45,6 @@ Paper_score::Paper_score ()
 
 Paper_score::~Paper_score ()
 {
-#if 0
-  for (int i=0; i< line_l_arr_.size (); i++)
-    line_l_arr_[i]->unlink_all ();
-
-  for (PCursor<Score_element*> i(elem_p_list_.top()); i.ok(); i++)
-    {
-
-      if (i->linked_b())
-       i->unlink ();
-      assert (! i->linked_b ());
-    }
-#endif
 }
 
 void
index 9d6fc3dd8fed39df8e2425c2d89cceee6f124766..a98af9d3896d1fcacd3a69fc4618db32b528ece9 100644 (file)
@@ -224,64 +224,30 @@ Paper_def::reset_default_count()
   default_count_i_ = 0;
 }
 
-//urg
 extern char const* lily_version_number_sz ();
 
-void
-output_def (Paper_outputter* p, String key, String val)
-{
-  SCM args_scm = gh_list (ly_symbol ("lily-def"),
-            gh_str02scm (key.ch_l ()),
-            gh_str02scm (val.ch_l ()), SCM_UNDEFINED);
-  p->output_scheme (args_scm);
-}
-
-void
-output_header (Paper_outputter* p, Scope *head)
-{
-  if (!head)
-    return;
-
-  String id_str = "Lily was here";
-  if (no_timestamps_global_b)
-    id_str += ".";
-  else
-    id_str += String (", ") + lily_version_number_sz ();
-  output_def (p, "LilyIdString", id_str);
-  
-  for (Dictionary_iter<Identifier*> i (*head); i.ok (); i++)
-    {
-      if (!i.val ()->access_content_String (false))
-       continue;
-      
-      String val = *i.val()->access_content_String (false);
-      output_def (p, "mudela" + i.key (), val);
-    }
-}
-
-void
-Paper_def::output_settings (Paper_outputter* p) const
-{
-  for (Dictionary_iter<Identifier*> i (*scope_p_); i.ok (); i++)
-    output_def (p, String ("mudelapaper") + i.key (), i.val ()->str ());
-  p->output_string (*scope_p_->elem (String (output_global_ch) + "setting")->access_content_String (false));
-}
-
 Paper_outputter*
 Paper_def::paper_outputter_p (Paper_stream* os_p, Header* header_l, String origin_str) const
 {
   Paper_outputter* p = new Paper_outputter (os_p);
 
-  output_header (p, header_global_p);
-#if 0
   // for now; breaks -fscm output
   p->output_comment (_ ("outputting Score, defined at: "));
   p->output_comment (origin_str);
-#endif
 
-  output_header (p, header_l);
-
-  output_settings (p);
+  p->output_version();
+  if (header_global_p)
+    p->output_scope (header_global_p, "mudela");
+  if (header_l)
+    p->output_scope (header_l, "mudela");
+  if (scope_p_)
+    p->output_scope (scope_p_, "mudelapaper");
+  
+  if (output_global_ch == String("tex"))
+    {
+      *p->outstream_l_ << *scope_p_->elem ("texsetting")->access_content_String (false);
+    }
+  
 
   SCM scm = gh_list (ly_symbol ("experimental-on"), SCM_UNDEFINED);
   p->output_scheme (scm);
@@ -299,7 +265,8 @@ Paper_def::paper_stream_p () const
   if (outname != "-")
     outname += String (".") + output_global_ch;
   *mlog << _f ("Paper output to %s...", 
-              outname == "-" ? String ("<stdout>") : outname ) << endl;
+              outname == "-" ? String ("<stdout>") : outname) << endl;
+
   target_str_global_array.push (outname);
   return new Paper_stream (outname);
 }
index c0c183ec4e4ab5fe5de8a142eaf9b74a08d5df7e..bfab233f072e0d716a5acc8619855a9d9bab23a8 100644 (file)
@@ -10,6 +10,7 @@
 #include <time.h>
 #include <fstream.h>
 
+#include "dictionary-iter.hh"
 #include "virtual-methods.hh"
 #include "paper-outputter.hh"
 #include "paper-stream.hh"
@@ -20,6 +21,8 @@
 #include "debug.hh"
 #include "lookup.hh"
 #include "main.hh"
+#include "scope.hh"
+#include "identifier.hh"
 
 Paper_outputter::Paper_outputter (Paper_stream *s)
 {
@@ -38,7 +41,6 @@ Paper_outputter::output_header ()
 {
   String s = String ("(eval (") + output_global_ch + "-scm 'all-definitions))";
   gh_eval_str (s.ch_C());
-
   
   String creator;
   if (no_timestamps_global_b)
@@ -155,11 +157,42 @@ Paper_outputter::output_scheme (SCM scm)
       free (c);
     }
 }
+
+void
+Paper_outputter::output_scope (Scope *scope, String prefix)
+{
+  for (Dictionary_iter<Identifier*> i (*scope); i.ok (); i++)
+    {
+      if (dynamic_cast<String_identifier*> (i.val ()))
+       {
+         String val = *i.val()->access_content_String (false);
+
+         output_String_def (prefix + i.key (), val);
+       }
+      else if(dynamic_cast<Real_identifier*> (i.val ()))
+       {
+         Real val  = *i.val ()->access_content_Real (false);
+
+         output_Real_def (prefix + i.key (), val);       
+       }
+      else if (dynamic_cast<int_identifier*> (i.val ()))
+       {
+         int val  = *i.val ()->access_content_int (false);       
+         
+         output_int_def (prefix + i.key (), val);        
+       }
+    }
+}
+
 void
-Paper_outputter::output_string (String str)
+Paper_outputter::output_version ()
 {
-  // urg
-  *outstream_l_ << str;
+  String id_str = "Lily was here";
+  if (no_timestamps_global_b)
+    id_str += ".";
+  else
+    id_str += String (", ") + get_version_str ();
+  output_String_def ( "LilyIdString", id_str);
 }
 
 void
@@ -194,12 +227,50 @@ Paper_outputter::start_line ()
 void
 Paper_outputter::output_font_def (int i, String str)
 {
-  SCM scm =gh_list (ly_symbol ("font-def"),
-                   gh_int2scm (i),
-                   gh_str02scm (str.ch_l ()),
-                   SCM_UNDEFINED);
-                                
+  SCM scm = gh_list (ly_symbol ("font-def"),
+                    gh_int2scm (i),
+                    gh_str02scm (str.ch_l ()),
+                    SCM_UNDEFINED);
+
+  output_scheme (scm);
+}
+
+void
+Paper_outputter::output_Real_def (String k, Real v)
+{
+  
+  SCM scm = gh_list (ly_symbol ("lily-def"),
+                    gh_str02scm (k.ch_l ()),
+                    gh_str02scm (to_str(v).ch_l ()),
+                    SCM_UNDEFINED);
+  output_scheme (scm);
+
+  gh_define (k.ch_l (), gh_double2scm (v));
+}
+
+void
+Paper_outputter::output_String_def (String k, String v)
+{
+  
+  SCM scm = gh_list (ly_symbol ("lily-def"),
+                    gh_str02scm (k.ch_l ()),
+                    gh_str02scm (v.ch_l ()),
+                    SCM_UNDEFINED);
   output_scheme (scm);
+
+  gh_define (k.ch_l (), gh_str02scm (v.ch_l ()));
+}
+
+void
+Paper_outputter::output_int_def (String k, int v)
+{
+  SCM scm = gh_list (ly_symbol ("lily-def"),
+                    gh_str02scm (k.ch_l ()),
+                    gh_str02scm (to_str (v).ch_l ()),
+                    SCM_UNDEFINED);
+  output_scheme (scm);
+
+  gh_define (k.ch_l (), gh_int2scm (v));
 }
 
 void
index 91277cf1b3009229965c04e2e5f22e3a9b00f4ea..f23ca3b67ab339bdfe2f82c7351f5689ac575fe3 100644 (file)
@@ -285,7 +285,6 @@ Stem::brew_molecule_p () const
   Molecule *mol_p =new Molecule;
   Drul_array<Real> stem_y = yextent_drul_;
   Real dy = paper ()->internote_f ();
-  
 
   Real head_wid = 0;
   if (head_l_arr_.size ())