]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.49.hwn1: deze dus
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 11 May 2000 20:10:56 +0000 (22:10 +0200)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 11 May 2000 20:10:56 +0000 (22:10 +0200)
1.3.49.hwn1
===========

* Junked Dictionary from Piano_pedal_engraver and
Piano_pedal_performer.  Marked kerning as TODO.

* Introduced boolean element property no-spacing-rods: ignore this
item for hard constraints.

---
Generated by hanwen@cs.uu.nl,
>From = lilypond-1.3.49, To = lilypond-1.3.49.hwn1

usage

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.3.49.hwn1.diff

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

24 files changed:
CHANGES
ROADMAP
VERSION
flower/include/dictionary.hh
flower/include/hash-table.hh
input/bugs/addlyrmus.fly [deleted file]
input/bugs/b.fly [deleted file]
input/bugs/grace-grace.fly [deleted file]
input/bugs/grace.sly [deleted file]
lily/bezier.cc
lily/chord-name.cc
lily/include/ly-smobs.icc
lily/include/score-element-callback.hh [new file with mode: 0644]
lily/include/score-element.hh
lily/include/sustain-pedal.hh [new file with mode: 0644]
lily/piano-pedal-engraver.cc
lily/piano-pedal-performer.cc
lily/property-engraver.cc
lily/score-element-callback.cc [new file with mode: 0644]
lily/single-malt-grouping-item.cc
lily/sustain-pedal.cc [new file with mode: 0644]
lily/text-engraver.cc
lily/translator-ctors.cc
scripts/mudela-book.py

diff --git a/CHANGES b/CHANGES
index 8ecaab17c896abbb2960b0a7c955a6574c5e6305..3335da4946ce469924cead550a64cf72d7b30ad6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,19 @@
-1.3.49.jcn1
+--- ../lilypond-1.3.49/CHANGES Thu May 11 15:31:37 2000
+++ b/CHANGES   Thu May 11 22:01:01 2000
+@@ -1,3 +1,13 @@
+1.3.49.hwn1
+===========
+
+* Junked Dictionary from Piano_pedal_engraver and
+Piano_pedal_performer.  Marked kerning as TODO.
+
+* Introduced boolean element property no-spacing-rods: ignore this
+item for hard constraints.
+
+
+ 1.3.48.uu1
+ ==========
+ 1.3.49.jcn1
 ==========
 
 * Made silly faq.texi fixes (time to get my verbatim patch in :-)
diff --git a/ROADMAP b/ROADMAP
index 3894dd5d9eca15eed05961101322763487782b47..dfe496a678e4f4121b6d046e1215bc752b282b49 100644 (file)
--- a/ROADMAP
+++ b/ROADMAP
@@ -31,9 +31,6 @@ LilyPond's source files.
      F.Schubert/
      Hymns/
      J.S.Bach/
-     L.Mozart/
-     N.W.Gade/
-     W.A.Mozart/
    intl/                       library for gettext
    po/                         translations
    ps/                         postscript library files
diff --git a/VERSION b/VERSION
index ac6ae4db85345b5f928ac228806c163e3acaf720..308d07ced0a9aa763cd0e456f03dc79ce9c29007 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
 PATCH_LEVEL=49
-MY_PATCH_LEVEL=jcn1
+MY_PATCH_LEVEL=hwn1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 3cb1069b39e66c62df2f1ac553ed6bbac093ab6f..9134b80afcb5c1283e847b00a5f89d44f80270fb 100644 (file)
@@ -27,6 +27,9 @@ struct Dict_initialiser
 };
 
 
+/*
+  DEPRECATED. Use either SCM (preferred) or STL 
+ */
 template<class V>
 class Dictionary : public Hash_table<String, V>
 {
index bd437e6e972d7215f9546fcce539d789cbd809b0..f3f5bfe23402768e46f5206593b24abc5fd186d3 100644 (file)
@@ -43,7 +43,9 @@ struct Hash_table_entry
    A hash table of prime size.
 
    We use quadratic probing.  
- */
+
+  DEPRECATED. Use either SCM (preferred) or STL 
+*/
 template<class K, class V>
 class Fixed_size_hash_table
 {
diff --git a/input/bugs/addlyrmus.fly b/input/bugs/addlyrmus.fly
deleted file mode 100644 (file)
index 32b095b..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-\context Voice \addlyrics
-               { s8 s16 s32 s64 }
-               { [c16 c c c] }
diff --git a/input/bugs/b.fly b/input/bugs/b.fly
deleted file mode 100644 (file)
index 0b3c3a3..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-\time 3/2; < a1.
-       { s1 \> s4 \! s4\ppp} >
-                       
diff --git a/input/bugs/grace-grace.fly b/input/bugs/grace-grace.fly
deleted file mode 100644 (file)
index 8b43d9d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-% core
-\grace a8 \grace b8 c4
diff --git a/input/bugs/grace.sly b/input/bugs/grace.sly
deleted file mode 100644 (file)
index a488e30..0000000
+++ /dev/null
@@ -1 +0,0 @@
-c'' \grace c8 c c \grace c8 c 
index 0ced85b84069fbd472c1e933b6e17ae7dede373a..72bd0e0f46aafbb9790437fdab209858fd71544a 100644 (file)
@@ -31,8 +31,6 @@ binomial_coefficient (Real over , int under)
 void
 flip (Array<Offset>* arr_p, Axis a)
 {
-  // huh?
-  //  for (int i = c.size (); i--;)
   for (int i = 0; i < arr_p->size (); i++)
     (*arr_p)[i][a] = - (*arr_p)[i][a];
 }
index bb6fbbc1ea915bfa8620d030fc7d8b6ad4b6e938..3bc56b107e10252c2d8faa0ce169e8582f2a8f21 100644 (file)
    "text"
    ("style" . "text")
  */
+/*
+  UGH. remove Dictionary< >
+ */
 Molecule
 Chord_name::ly_word2molecule (SCM word) const
 {
-  Dictionary<SCM> option_dict;
+  Dictionary<SCM> option_dict; // junkme
   if (gh_pair_p (word))
     {
       SCM options = gh_cdr (word);
index 9b54ddc24e5e23165a83c5a11cad3aa251ed40b3..b652432ca8f3eeb89b928def2e03dd0fee35bfdb 100644 (file)
@@ -31,7 +31,9 @@ return s;\
 }\
 
 
-
+/*
+  should include equal_p ? 
+ */
 #define IMPLEMENT_SMOBS(CL)\
 long CL::smob_tag_;\
 static scm_smobfuns CL ## _funs = {                                    \
diff --git a/lily/include/score-element-callback.hh b/lily/include/score-element-callback.hh
new file mode 100644 (file)
index 0000000..949ceec
--- /dev/null
@@ -0,0 +1,21 @@
+/*   
+  score-element-callback.hh -- declare  Score_element callbacks
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#ifndef SCORE_ELEMENT_CALLBACK_HH
+#define SCORE_ELEMENT_CALLBACK_HH
+
+#include "lily-proto.hh"
+#include "lily-guile.hh"
+
+typedef SCM (* Score_element_callback) (Score_element * ,  SCM extra_params);
+SCM smobify_callback (Score_element_callback cb);
+
+
+#endif /* SCORE_ELEMENT_CALLBACK_HH */
+
index 768152545e7e6fb88dbfc43c7db7fc1a86e1772f..8bc4761cf16c1d9ee3642bdc4371f9373152a0a0 100644 (file)
@@ -140,6 +140,7 @@ public:
    */
   void calculate_dependencies (int final, int busy, Score_element_method_pointer funcptr);
 
+
   static SCM handle_broken_smobs (SCM, SCM criterion);
   void recurse_into_smobs (SCM s, void (Score_element::*meth_ptr)());
 
@@ -199,11 +200,7 @@ public:
   bool used_b_;
   
   char const * name () const;
-  /**
-     Set empty in direction A.
-     JUNKME
-   */
-  void set_empty (Axis a);
+
   bool empty_b (Axis a) const;
   Interval extent (Axis) const;
  
diff --git a/lily/include/sustain-pedal.hh b/lily/include/sustain-pedal.hh
new file mode 100644 (file)
index 0000000..b2ae20e
--- /dev/null
@@ -0,0 +1,43 @@
+/*   
+  sustain-pedal.hh -- declare 
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#ifndef SUSTAIN_PEDAL_HH
+#define SUSTAIN_PEDAL_HH
+
+#include "item.hh" 
+
+
+/*
+  Urg.
+  This is almost text
+  Problem is:
+    * we have no kerning
+    * symbols are at wrong place in font
+
+
+
+  Properties:
+
+  glyph -- text string (TODO:   make one large glyph of the Ped symbol, removes need for do_brew_molecule ())
+
+*/
+
+class Sustain_pedal : public Item
+{
+public:
+  VIRTUAL_COPY_CONS (Score_element);
+
+protected:
+  virtual Molecule do_brew_molecule () const;
+  virtual void after_line_breaking ();
+};
+
+
+#endif /* SUSTAIN_PEDAL_HH */
+
index 61d00a4e9601953bb21a3402d81585c6d8983ebb..3fdbf0352a9b54ba7adc20ffed5428c4ff31b97f 100644 (file)
 #include "stem.hh"
 #include "side-position-interface.hh"
 #include "staff-symbol-referencer.hh"
-#include "dictionary.hh"
-#include "dictionary-iter.hh"
 #include "text-item.hh"
-
-/*
-  Urg.
-  This is almost text
-  Problem is:
-    * we have no kerning
-    * symbols are at wrong place in font
-*/
-
-class Sustain_pedal : public Item
-{
-public:
-  VIRTUAL_COPY_CONS (Score_element);
-
-protected:
-  virtual Molecule do_brew_molecule () const;
-  virtual void after_line_breaking ();
-};
-
-void
-Sustain_pedal::after_line_breaking ()
-{
-  Side_position_interface i (this);
-  Direction d =  i.get_direction ();
-  i.set_direction (d);
-}
-
-Molecule
-Sustain_pedal::do_brew_molecule () const
-{
-  Molecule mol;
-  SCM glyph = get_elt_property ("glyph");
-  if (glyph == SCM_UNDEFINED)
-    return mol;
-  String text = ly_scm2string (glyph);
-
-  for (int i = 0; i < text.length_i (); i++)
-    {
-      // leuke koor dump door tiepo, snapnie helemaal:
-      //String idx = ("pedal-") + text[i];
-      // urg, Byte* ??
-      // braak: waarom vindt String het zo moeilijk om
-      // String + char te doen?
-      //String idx = "pedal-" + String (&text.byte_C ()[i], 1);
-      String idx = String ("pedal-") + String (&text.byte_C ()[i], 1);
-      Molecule m = lookup_l ()->afm_find (idx);
-      if (m.empty_b ())
-       continue;
-      Real kern = 0;
-      if (i)
-       {
-         SCM s = scm_eval (gh_list (ly_symbol2scm ("pedal-kerning"),
-                                    ly_str02scm (String (&text.byte_C ()[i - 1], 1).ch_C ()),
-                                    ly_str02scm (String (&text.byte_C ()[i], 1).ch_C ()),
-                                    SCM_UNDEFINED));
-         if (gh_number_p (s))
-           {
-             Staff_symbol_referencer_interface st (this);
-             Real staff_space = st.staff_space ();
-             kern = gh_scm2double (s) * staff_space;
-           }
-       }
-      mol.add_at_edge (X_AXIS, RIGHT, m, kern);
-    }
-    
-  return mol;
-}
-
-
-
+#include "sustain-pedal.hh"
 /*
    TODO:
-     * it would be real cool if an engraver could be initialised with a
+     * it would be really cool if an engraver could be initialised with a
        string, ie:
 
           Piano_pedal_engraver::"sostenuto"
           Piano_pedal_engraver::"sustain"
           Piano_pedal_engraver::"una-chorda"
+
+
+
  */
 
+/*
+  Would it? The semantics are unclear, and real benefits are muddy
+  too.  --hwn */
+
+
+
 /**
-   engrave Piano pedals
+   engrave Piano pedals symbols.
  */
 class Piano_pedal_engraver : public Engraver
 {
-  struct Pedal_info
-  {
-    Span_req* start_req_l_;
-    Drul_array<Span_req*> req_l_drul_;
-    Item* item_p_;
-  };
-
 public:
   VIRTUAL_COPY_CONS (Translator);
   Piano_pedal_engraver ();
-
+  ~Piano_pedal_engraver ();
 protected:
+  virtual void do_creation_processing ();
   virtual bool do_try_music (Music*);
   virtual void do_process_music ();
   virtual void do_pre_move_processing ();
@@ -123,24 +55,49 @@ protected:
   virtual void acknowledge_element (Score_element_info);
 
 private:
-  Dictionary<Pedal_info> info_dict_;
+  struct Pedal_info
+  {
+    char const * name_;
+    Span_req* start_req_l_;
+    Drul_array<Span_req*> req_l_drul_;
+    Item* item_p_;
+  };
+
+
+  Pedal_info *info_list_;
 };
 
 ADD_THIS_TRANSLATOR (Piano_pedal_engraver);
 
 Piano_pedal_engraver::Piano_pedal_engraver ()
 {
-  (void)info_dict_["Sostenuto"];
-  (void)info_dict_["Sustain"];
-  (void)info_dict_["UnaChorda"];
-  for (Dictionary_iter <Pedal_info> i (info_dict_); i.ok (); i++)
+  info_list_ = 0;
+}
+void
+Piano_pedal_engraver::do_creation_processing()
+{
+  info_list_ = new Pedal_info[4];
+  Pedal_info *p = info_list_;
+
+
+  char * names [] = { "Sostenuto", "Sustain", "UnaChorda", 0  };
+  char **np = names ;
+  do
     {
-      Pedal_info& p = i.val_ref ();
-      p.item_p_ = 0;
-      p.req_l_drul_[START] = 0;
-      p.req_l_drul_[STOP] = 0;
-      p.start_req_l_ = 0;
+      p->name_ = *np;
+      p->item_p_ = 0;
+      p->req_l_drul_[START] = 0;
+      p->req_l_drul_[STOP] = 0;
+      p->start_req_l_ = 0;
+
+      p++;
     }
+  while (*(np ++));
+}
+
+Piano_pedal_engraver::~Piano_pedal_engraver()
+{
+  delete[] info_list_;
 }
 
 /*
@@ -150,22 +107,21 @@ Piano_pedal_engraver::Piano_pedal_engraver ()
 void
 Piano_pedal_engraver::acknowledge_element (Score_element_info info)
 {
-  for (Dictionary_iter <Pedal_info> i (info_dict_); i.ok (); i++)
+  for (Pedal_info*p = info_list_; p->name_; p ++)
     {
-      Pedal_info& p = i.val_ref ();
-      if (p.item_p_)
+      if (p->item_p_)
        {
          if (Note_head* n = dynamic_cast<Note_head*> (info.elem_l_))
            {
-             Side_position_interface st (p.item_p_);
+             Side_position_interface st (p->item_p_);
              st.add_support (n);
              if (st.get_axis( ) == X_AXIS
-                 && !p.item_p_->parent_l (Y_AXIS))
-               p.item_p_->set_parent (n, Y_AXIS);
+                 && !p->item_p_->parent_l (Y_AXIS))
+               p->item_p_->set_parent (n, Y_AXIS);
            }
          if (Stem* s = dynamic_cast<Stem*> (info.elem_l_))
            {
-             Side_position_interface st (p.item_p_);
+             Side_position_interface st (p->item_p_);
              st.add_support (s);
            }
        }
@@ -175,14 +131,13 @@ Piano_pedal_engraver::acknowledge_element (Score_element_info info)
 bool
 Piano_pedal_engraver::do_try_music (Music *m)
 {
-  for (Dictionary_iter <Pedal_info> i (info_dict_); i.ok (); i++)
+  if (Span_req * s = dynamic_cast<Span_req*>(m))
     {
-      Pedal_info& p = i.val_ref ();
-      if (Span_req * s = dynamic_cast<Span_req*>(m))
+      for (Pedal_info*p = info_list_; p->name_; p ++)
        {
-         if (s->span_type_str_ == i.key ())
+         if (s->span_type_str_ == p->name_)
            {
-             p.req_l_drul_[s->span_dir_] = s;
+             p->req_l_drul_[s->span_dir_] = s;
              return true;
            }
        }
@@ -193,70 +148,70 @@ Piano_pedal_engraver::do_try_music (Music *m)
 void
 Piano_pedal_engraver::do_process_music ()
 {
-  for (Dictionary_iter <Pedal_info> i (info_dict_); i.ok (); i++)
+  for (Pedal_info*p = info_list_; p->name_; p ++)
     {
-      Pedal_info& p = i.val_ref ();
       SCM s = SCM_UNDEFINED;
-      if (p.req_l_drul_[STOP] && p.req_l_drul_[START])
+      if (p->req_l_drul_[STOP] && p->req_l_drul_[START])
        {
-         if (!p.start_req_l_)
+         if (!p->start_req_l_)
            {
-             p.req_l_drul_[STOP]->warning (_f ("can't find start of piano pedal: %s", i.key ()));
+             p->req_l_drul_[STOP]->warning (_f ("can't find start of piano pedal: %s",  p->name_ ));
            }
          else
            {
-             s = get_property ("stopStart" + i.key ());
+             s = get_property ("stopStart" + String (p->name_ ));
            }
-         p.start_req_l_ = p.req_l_drul_[START];
+         p->start_req_l_ = p->req_l_drul_[START];
        }
-      else if (p.req_l_drul_[STOP])
+      else if (p->req_l_drul_[STOP])
        {
-         if (!p.start_req_l_)
+         if (!p->start_req_l_)
            {
-             p.req_l_drul_[STOP]->warning (_f ("can't find start of piano pedal: %s", i.key ()));
+             p->req_l_drul_[STOP]->warning (_f ("can't find start of piano pedal: %s", p->name_ ));
            }
          else
            {
-             s = get_property ("stop" + i.key ());
+             s = get_property ("stop" + String (p->name_ ));
            }
-         p.start_req_l_ = 0;
+         p->start_req_l_ = 0;
        }
-      else if (p.req_l_drul_[START])
+      else if (p->req_l_drul_[START])
        {
-         p.start_req_l_ = p.req_l_drul_[START];
-         s = get_property ("start" + i.key ());
+         p->start_req_l_ = p->req_l_drul_[START];
+         s = get_property ("start" + String (p->name_ ));
        }
 
       if (s != SCM_UNDEFINED)
        {
-         if (i.key () == "Sustain")
+         if (p->name_ == String ("Sustain"))
            {
-             p.item_p_ = new Sustain_pedal;
-             p.item_p_->set_elt_property ("glyph", s);
+             p->item_p_ = new Sustain_pedal;
+             p->item_p_->set_elt_property ("text", s);
            }
          else
            {
-             p.item_p_ = new Text_item;
-             p.item_p_->set_elt_property ("text", s);
+             p->item_p_ = new Text_item;
+             p->item_p_->set_elt_property ("text", s);
              // guh
-             p.item_p_->set_elt_property ("style", ly_str02scm ("italic"));
+             p->item_p_->set_elt_property ("style", ly_str02scm ("italic"));
            }
 
-         Side_position_interface si (p.item_p_);
+         Side_position_interface si (p->item_p_);
          si.set_axis (Y_AXIS);
 
          /* Hmm,
             If set to empty, it can't be centred
             Howto centre non-fat text?
-            p.item_p_->set_empty (X_AXIS);
+            p->item_p_->set_empty (X_AXIS);
          */
-         p.item_p_->set_elt_property ("self-alignment-X", gh_int2scm (0));
-         p.item_p_->add_offset_callback (Side_position_interface::aligned_on_self, X_AXIS);
-         p.item_p_->add_offset_callback (Side_position_interface::centered_on_parent, X_AXIS);
-         announce_element (Score_element_info (p.item_p_,
-                                               p.req_l_drul_[START]
-                                               ? p.req_l_drul_[START]
-                                               : p.req_l_drul_[STOP]));
+         p->item_p_->set_elt_property ("no-spacing-rods"  , SCM_BOOL_T);
+         p->item_p_->set_elt_property ("self-alignment-X", gh_int2scm (0));
+         p->item_p_->add_offset_callback (Side_position_interface::aligned_on_self, X_AXIS);
+         p->item_p_->add_offset_callback (Side_position_interface::centered_on_parent, X_AXIS);
+         announce_element (Score_element_info (p->item_p_,
+                                               p->req_l_drul_[START]
+                                               ? p->req_l_drul_[START]
+                                               : p->req_l_drul_[STOP]));
        }
     }
 }
@@ -264,36 +219,41 @@ Piano_pedal_engraver::do_process_music ()
 void
 Piano_pedal_engraver::do_pre_move_processing ()
 {
-  for (Dictionary_iter <Pedal_info> i (info_dict_); i.ok (); i++)
+  Item * sustain = 0;
+  for (Pedal_info*p = info_list_; p->name_; p ++)
+    {
+      if (p->name_ == String ("Sustain"))
+       sustain = p->item_p_;
+    }
+
+  for (Pedal_info*p = info_list_; p->name_; p ++)
     {
-      Pedal_info& p = i.val_ref ();
-      if (p.item_p_)
+      if (p->item_p_)
        {
-         side_position (p.item_p_).add_staff_support ();
+         side_position (p->item_p_).add_staff_support ();
          /*
            Hmm.
          */
-         if (i.key () != "Sustain")
+         if (p->name_ != String ("Sustain"))
            {
-             if (Item* sustain = info_dict_["Sustain"].item_p_)
+             if (sustain)
                {
-                 Side_position_interface st (p.item_p_);
+                 Side_position_interface st (p->item_p_);
                  st.add_support (sustain);
                }
            }
-         typeset_element (p.item_p_);
+         typeset_element (p->item_p_);
        }
-      p.item_p_ = 0;
+      p->item_p_ = 0;
     }
 }
 
 void
 Piano_pedal_engraver::do_post_move_processing ()
 {
-  for (Dictionary_iter <Pedal_info> i (info_dict_); i.ok (); i++)
+  for (Pedal_info*p = info_list_; p->name_; p ++)
     {
-      Pedal_info& p = i.val_ref ();
-      p.req_l_drul_[STOP] = 0;
-      p.req_l_drul_[START] = 0;
+      p->req_l_drul_[STOP] = 0;
+      p->req_l_drul_[START] = 0;
     }
 }
index 01dfab892ff7260916df6196c1002f2f2ef11b74..c3d2a1a0f4eb322a3a7271ff10e0fcfbb5607fb9 100644 (file)
@@ -20,16 +20,18 @@ class Piano_pedal_performer : public Performer
 {
   struct Pedal_info
   {
+    char const *name_;
     Span_req* start_req_l_;
     Drul_array<Span_req*> req_l_drul_;
   };
 
 public:
   VIRTUAL_COPY_CONS (Translator);
-  
   Piano_pedal_performer ();
-
+  ~Piano_pedal_performer ();
+  
 protected:
+  virtual void do_creation_processing ();
   virtual bool do_try_music (Music*);
   virtual void do_process_music ();
   virtual void do_pre_move_processing ();
@@ -37,52 +39,68 @@ protected:
 
 private:
   Link_array<Audio_piano_pedal> audio_p_arr_;
-  Dictionary<Pedal_info> info_dict_;
+  Pedal_info * info_alist_;
 };
 
 ADD_THIS_TRANSLATOR (Piano_pedal_performer);
 
 Piano_pedal_performer::Piano_pedal_performer ()
 {
-  (void)info_dict_["Sostenuto"];
-  (void)info_dict_["Sustain"];
-  (void)info_dict_["UnaChorda"];
-  for (Dictionary_iter <Pedal_info> i (info_dict_); i.ok (); i++)
+  info_alist_ = 0;
+}
+
+Piano_pedal_performer::~Piano_pedal_performer()
+{
+  delete[] info_alist_;
+}
+
+void
+Piano_pedal_performer::do_creation_processing ()
+{
+  info_alist_ = new Pedal_info[4];
+  Pedal_info *p = info_alist_;
+
+  char * names [] = { "Sostenuto", "Sustain", "UnaChorda", 0  };
+  char **np = names ;
+  do
     {
-      Pedal_info& p = i.val_ref ();
-      p.req_l_drul_[START] = 0;
-      p.req_l_drul_[STOP] = 0;
-      p.start_req_l_ = 0;
+      p->name_ = *np;
+      p->req_l_drul_[START] = 0;
+      p->req_l_drul_[STOP] = 0;
+      p->start_req_l_ = 0;
+
+      p++;
     }
+  while (*(np ++));
 }
 
 void
 Piano_pedal_performer::do_process_music ()
 {
-  for (Dictionary_iter <Pedal_info> i (info_dict_); i.ok (); i++)
+  for (Pedal_info*p = info_alist_; p->name_; p ++)
     {
-      Pedal_info& p = i.val_ref ();
-      if (p.req_l_drul_[STOP])
+      if (p->req_l_drul_[STOP])
        {
-         if (!p.start_req_l_)
+         if (!p->start_req_l_)
            {
-             p.req_l_drul_[STOP]->warning (_f ("can't find start of piano pedal: %s", i.key ()));
+             p->req_l_drul_[STOP]->warning (_f ("can't find start of piano pedal: %s", String (p->name_)));
            }
          else
            {
              Audio_piano_pedal* a = new Audio_piano_pedal;
-             a->type_str_ = i.key ();
+             a->type_str_ = String (p->name_);
              a->dir_ = STOP;
              audio_p_arr_.push (a);
            }
-         p.start_req_l_ = 0;
+         p->start_req_l_ = 0;
        }
 
-      if (p.req_l_drul_[START])
+      if (p->req_l_drul_[START])
        {
-         p.start_req_l_ = p.req_l_drul_[START];
+         p->start_req_l_ = p->req_l_drul_[START];
          Audio_piano_pedal* a = new Audio_piano_pedal;
-         a->type_str_ = i.key ();
+         a->type_str_ = String (p->name_);
          a->dir_ = START;
          audio_p_arr_.push (a);
        }
@@ -92,7 +110,7 @@ Piano_pedal_performer::do_process_music ()
 void
 Piano_pedal_performer::do_pre_move_processing ()
 {
-  for (int i=0; i < audio_p_arr_.size (); i++)
+  for (int i=0; i< audio_p_arr_.size (); i++)
     play_element (audio_p_arr_[i]);
   audio_p_arr_.clear ();
 }
@@ -100,25 +118,23 @@ Piano_pedal_performer::do_pre_move_processing ()
 void
 Piano_pedal_performer::do_post_move_processing ()
 {
-  for (Dictionary_iter <Pedal_info> i (info_dict_); i.ok (); i++)
+  for (Pedal_info*p = info_alist_; p->name_; p ++)
     {
-      Pedal_info& p = i.val_ref ();
-      p.req_l_drul_[STOP] = 0;
-      p.req_l_drul_[START] = 0;
+      p->req_l_drul_[STOP] = 0;
+      p->req_l_drul_[START] = 0;
     }
 }
 
 bool
 Piano_pedal_performer::do_try_music (Music* r)
 {
-  for (Dictionary_iter <Pedal_info> i (info_dict_); i.ok (); i++)
+  if (Span_req * s = dynamic_cast<Span_req*>(r))
     {
-      Pedal_info& p = i.val_ref ();
-      if (Span_req * s = dynamic_cast<Span_req*>(r))
+      for (Pedal_info*p = info_alist_; p->name_; p ++)
        {
-         if (s->span_type_str_ == i.key ())
+         if (s->span_type_str_ == String (p->name_))
            {
-             p.req_l_drul_[s->span_dir_] = s;
+             p->req_l_drul_[s->span_dir_] = s;
              return true;
            }
        }
index c0f2887008f22d93a14e5b5652cd9422f048e5be..07eff6b44153545a5f76223702a7eb20f8d34c2c 100644 (file)
 
 class Property_engraver : public Engraver
 {
-  Dictionary<Protected_scm> prop_dict_;
+  /*
+    UGH. Junk Dictionary
+  */
+  Dictionary<Protected_scm> prop_dict_;        // junkme
   void apply_properties (SCM, Score_element*);
 
 protected:
diff --git a/lily/score-element-callback.cc b/lily/score-element-callback.cc
new file mode 100644 (file)
index 0000000..f0cf123
--- /dev/null
@@ -0,0 +1,57 @@
+/*   
+  score-element-callback.cc --  implement Callback smob.
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#include "score-element-callback.hh"
+
+
+static long callback_tag;
+
+static
+SCM mark_smob (SCM)
+{
+  return SCM_EOL;
+}
+
+static int
+print_smob (SCM, SCM port, scm_print_state *)
+{
+  scm_puts ("#<Callback>", port);
+  return 1;
+}
+
+static
+scm_sizet free_smob (SCM)
+{
+  return 0;
+}
+
+static scm_smobfuns callback_funs = {
+  mark_smob, free_smob,
+  print_smob, 0,
+};
+
+static
+void start_callback_smobs()
+{
+  callback_tag = scm_newsmob (&callback_funs);
+}
+
+
+SCM smobify_callback (Score_element_callback cb )
+{
+  SCM z;
+  
+  SCM_NEWCELL(z);
+  SCM_SETCDR(z, cb);
+  SCM_SETCAR(z, callback_tag);
+
+  return z;
+}
+  
+ADD_SCM_INIT_FUNC(callback, start_callback_smobs);
index b03d4c59beb48e0061f8a80cf839bedff701dbdb..b017addc21d4f99f1fb77f77fa007817f65e9ab9 100644 (file)
@@ -55,6 +55,11 @@ Single_malt_grouping_item::my_width () const
          continue;             /*UGH UGH*/ 
        }
 
+      if (to_boolean (il->get_elt_property ("no-spacing-rods")))
+       {
+         continue;
+       }
+
       Interval iv (il->extent (X_AXIS));
       if (!iv.empty_b ())
        {
diff --git a/lily/sustain-pedal.cc b/lily/sustain-pedal.cc
new file mode 100644 (file)
index 0000000..a6388d6
--- /dev/null
@@ -0,0 +1,62 @@
+/*   
+  sustain-pedal.cc --  implement Sustain_pedal
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#include "sustain-pedal.hh"
+#include "side-position-interface.hh"
+#include "molecule.hh"
+#include "lookup.hh"
+#include "staff-symbol-referencer.hh"
+
+void
+Sustain_pedal::after_line_breaking ()
+{
+  /*
+    UGH. Should work automatically via offset callback. 
+   */
+  Side_position_interface i (this);
+  Direction d =  i.get_direction ();
+  i.set_direction (d);
+}
+
+Molecule
+Sustain_pedal::do_brew_molecule () const
+{
+  Molecule mol;
+  SCM glyph = get_elt_property ("text");
+  if (glyph == SCM_UNDEFINED)
+    return mol;
+  String text = ly_scm2string (glyph);
+
+  for (int i = 0; i < text.length_i (); i++)
+    {
+      String idx = String ("pedal-") + String (&text.byte_C ()[i], 1);
+      Molecule m = lookup_l ()->afm_find (idx);
+      if (m.empty_b ())
+       continue;
+      Real kern = 0;
+      if (i)
+       {
+         SCM s = scm_eval (gh_list (ly_symbol2scm ("pedal-kerning"),
+                                    ly_str02scm (String (&text.byte_C ()[i - 1], 1).ch_C ()),
+                                    ly_str02scm (String (&text.byte_C ()[i], 1).ch_C ()),
+                                    SCM_UNDEFINED));
+         if (gh_number_p (s))
+           {
+             Staff_symbol_referencer_interface st (this);
+             Real staff_space = st.staff_space ();
+             kern = gh_scm2double (s) * staff_space;
+           }
+       }
+      mol.add_at_edge (X_AXIS, RIGHT, m, kern);
+    }
+    
+  return mol;
+}
+
+
index 0f222daab1bd2f1d6022c20729ed0fe437647a96..c0ab61393794be4c987a2c08876189004c0146f9 100644 (file)
@@ -104,8 +104,10 @@ Text_engraver::do_process_music ()
       
       SCM empty = get_property ("textNonEmpty");
       if (!to_boolean (empty))
-       text->set_extent_callback (0, X_AXIS);
-
+       {
+         text->set_elt_property ("no-spacing-rods" , SCM_BOOL_T);
+         text->set_extent_callback (0, X_AXIS);
+       }
       announce_element (Score_element_info (text, r));
       texts_.push (text);
     }
index acb9523cc04a75dbe9656057173ba8393808b0e2..8c72758890b4a9be4940736b3e10f799638a91ae 100644 (file)
@@ -15,6 +15,9 @@
   should delete these after exit.
  */
 
+/*
+  UGH. Dictionary is deprecated
+ */
 Dictionary<Translator*> *global_translator_dict_p=0;
 
 void
index a78822588d18363d6fc2d86059fe87c2a109f197..ca4b70f8ad6e79ed95b27099478687a83dec57d9 100644 (file)
@@ -19,6 +19,13 @@ dep_prefix = ''
 
 # BUG: does not handle \verb|\begin{verbatim}\end{verbatim}| correctly.
 # Should make a joint RE for \verb and \begin, \end{verbatim}
+
+# TODO: add an option to read the .ly files from a previous run and dump
+# the .tex file, so you can do
+#
+# * mudela-book file.tex
+# * convert-mudela *.ly
+# * mudela-book --read-lys *.ly
 #
 
 default_music_fontsize = 16