]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.1.37.script1
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 3 Apr 1999 22:42:55 +0000 (00:42 +0200)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 3 Apr 1999 22:42:55 +0000 (00:42 +0200)
pl 37.script1
- major Script rehack.
- junked Text_def, changed \property textstyle -> \property textStyle
(todo -> convert-mudela)
- Line_of_score is an Axis_group_element, no more overlapping
lines, hopefully.
- mf: whole diamond head tweak
---
Generated by hanwen@cs.uu.nl using package-diff 0.62,
From = lilypond-1.1.37, To = lilypond-1.1.37.script1

usage

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.1.37.script1.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.37
1.1.37.script1
++state

73 files changed:
NEWS
TODO
VERSION
input/test/hara-kiri.ly
lily/axis-align-item.cc
lily/axis-group-spanner.cc
lily/command-request.cc
lily/direction.cc
lily/extender-engraver.cc
lily/g-script-engraver.cc [new file with mode: 0644]
lily/g-script.cc [new file with mode: 0644]
lily/g-staff-side.cc
lily/g-stem-staff-side.cc [new file with mode: 0644]
lily/general-script-def.cc
lily/identifier.cc
lily/include/axis-align-item.hh
lily/include/axis-group-spanner.hh
lily/include/clef-item.hh
lily/include/command-request.hh
lily/include/g-script-engraver.hh [new file with mode: 0644]
lily/include/g-script.hh [new file with mode: 0644]
lily/include/g-staff-side.hh
lily/include/g-stem-staff-side.hh [new file with mode: 0644]
lily/include/g-text-item.hh
lily/include/general-script-def.hh
lily/include/identifier.hh
lily/include/lily-proto.hh
lily/include/line-of-score.hh
lily/include/lookup.hh
lily/include/lookup.hh.orig [new file with mode: 0644]
lily/include/ly-symbols.hh
lily/include/musical-request.hh
lily/include/paper-outputter.hh
lily/include/request.hh
lily/include/script-def.hh
lily/include/script-engraver.hh [deleted file]
lily/include/super-element.hh
lily/include/text-def.hh [deleted file]
lily/include/text-spanner.hh [deleted file]
lily/include/tuplet-spanner.hh
lily/include/volta-spanner.hh
lily/line-of-score.cc
lily/lookup.cc
lily/lyric-performer.cc
lily/multi-measure-rest.cc
lily/music-output-def.cc
lily/musical-request.cc
lily/p-score.cc
lily/paper-outputter.cc
lily/parser.yy
lily/repeat-engraver.cc
lily/rhythmic-column-engraver.cc
lily/score-element.cc
lily/score-engraver.cc
lily/script-column.cc
lily/script-def.cc [deleted file]
lily/script-engraver.cc [deleted file]
lily/script.cc
lily/slur-engraver.cc
lily/spanner.cc
lily/super-element.cc
lily/text-def.cc [deleted file]
lily/text-engraver.cc
lily/text-spanner.cc [deleted file]
lily/time-signature-performer.cc
lily/tuplet-engraver.cc
lily/tuplet-spanner.cc
lily/volta-spanner.cc
ly/engraver.ly
ly/script.ly
mf/feta-bolletjes.mf
scm/lily.scm
scm/script.scm [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index f56f8067e851fcf4ac31261aefbc4ec2fe292169..c22ee296aaafb73af899796d955454077cb60b4c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,19 @@
-pl 37.mb1
+--- ../lilypond-1.1.37/NEWS    Wed Mar 31 21:50:35 1999
+++ b/NEWS      Sun Apr  4 00:42:55 1999
+@@ -1,4 +1,13 @@
+pl 37.script1
+       - major Script rehack.
+       - junked Text_def, changed \property textstyle -> \property textStyle
+(todo -> convert-mudela)
+       - Line_of_score is an Axis_group_element, no more overlapping
+lines, hopefully.
+       - mf: whole diamond head tweak 
+*****
+pl 37 (march 30, 1999)
+       - diamond heads (probably really ugly).
+       - cross head.
+       - tweaked harmonic head a bit.pl 37.mb1
        - Added property restStyle. 
        - mensural 4th, 8th and 16th rests.
 
diff --git a/TODO b/TODO
index 328e9d3615feff8c39a95794e13e268300e65957..d87dbf09f7d2aa78068fbf0411eef7b7830296fd 100644 (file)
--- a/TODO
+++ b/TODO
@@ -16,7 +16,6 @@ Grep for TODO and ugh/ugr/urg.
 > lines from the staff to the note will have a blob too.  For example,
 > with the note "a4" there will be a black note at the ledger line where
 > "c" would be too.  However, only the "a4" will have the extra blob.
-
 . * ps/lily.ps
 . * AFM for BlueSky AFM files.
 . * devise standard for functioning of Vertical_align_element.
@@ -24,6 +23,7 @@ Grep for TODO and ugh/ugr/urg.
 . * staff size for post/prebreaks
 . * .ly files
 .  * input/star-spangled-banner
+.  * input/scripts.ly
 .  * mutopia/J.S.Bach/wtk1-fugue2.ly
 .  * input/test/grace
 .  * fix: text on rests: ridiculous dims
@@ -84,6 +84,7 @@ specify the third.  Should there be?
 
 .* TODO before 1.2
 . * \selectmusic to cut pieces from music. 
+. * TODO: merge atom & molecule; make  tree from molecule.
 . * break priority setting from SCM.
 . * Gade score
 .  * remove [] in favour of auto-beamer
@@ -128,11 +129,10 @@ compilation.
 . * fix Repeated_music design
 . * one big ly2dvi input that includes *all* tests.
 . * store req -> element, element -> element causes for warnings
-. * junk Text_def, use G_text_item in stead.
+. * use G_text_item in stead.
 . * junk Script_def
 . * include examples in RPM.
 . * fix partial measures in meaningful way.
-
 . * add scripts to bars eg.  |^"bla" 
 . * relative mode for mi2mu
 . * uniformise recent feta contributions.
@@ -167,10 +167,10 @@ length?
 . * fix convert-mudela manpage
 . * decimal point in \paper {}
 . * {  \voiceone <a'4.*2/3  d''4.*2/3 fis''4.*2/3>  [g''8 fis'' e''] d''4 |}
-        and=20
+        and
         { \voicetwo  d'4 d'2.*2/3 } spacing
 . * tied notes for MIDI
-. * sharp /flat on trills (in MIDI ??)
+. * sharp / flat on trills (in MIDI ??)
 . * scm-ify \property values.
 . * move class Lookup {} into scm
 . * msgfmt -o check?
diff --git a/VERSION b/VERSION
index 5be3db6e5e7e5e09671124835f71169f2fa27259..a412d4435729da35e0e5672b8c1e12e79ee9975c 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=1
 PATCH_LEVEL=37
-MY_PATCH_LEVEL=mb1
+MY_PATCH_LEVEL=script1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 3acad5cad57c7bbd297e5a205b8a7711e4c2fe31..bdfbe78404b187d9f79d7082b52cd261651ffee7 100644 (file)
@@ -29,7 +29,7 @@ toeters = \type Staff = toeters <
        \toeter_ii
 >
  
-zager = \type Staff = zager \notes \relative c {
+zager = \type Staff = zager \notes \relative c'' {
        \clef bass;
        \property Staff.instrument = "Zager"
        \property Staff.instr = "Zag."
@@ -45,7 +45,7 @@ zager = \type Staff = zager \notes \relative c {
        f e d c
 }
 
-zoger = \type Staff = zoger \notes \relative c {
+zoger = \type Staff = zoger \notes \relative c'' {
        \clef bass;
        \property Staff.instrument = "Zoger"
        \property Staff.instr = "Zog."
@@ -76,7 +76,7 @@ zagers = \type GrandStaff <
        >
        \paper{
                linewidth = 40.0\mm;
-               \translator { \HaraKiriStaffContext }
+%              \translator { \HaraKiriStaffContext }
 %uh?
 %              \translator { \OrchestralScoreContext }
 %              \translator { \OrchestralPartStaffContext }
index a8859ba5886546f120671762bc427b9a823f7191..8990872b212ad9c655ee723770917d00b4cb5ac4 100644 (file)
@@ -1,5 +1,5 @@
 /*   
-  axis-align-item.cc --  implement 
+  axis-align-item.cc --  implement Axis_align_item
   
   source file of the GNU LilyPond music typesetter
   
@@ -12,3 +12,9 @@
 Axis_align_item::Axis_align_item ()
 {
 }
+
+void
+Axis_align_item::do_print () const
+{
+  Axis_group_item::do_print ();
+}
index 58214f51378b51387793665c6706196400957fbb..b625c6c6b3dcba2916213f0fbafba461e64d697e 100644 (file)
@@ -34,15 +34,24 @@ Axis_group_spanner::do_break_processing_if_unbroken()
                item_l->find_prebroken_piece (my_line);
              add_element (broken_item_l);
            }
-         remove_element (elems[i]);  
+
+         Spanner *spanner_l = dynamic_cast<Spanner*> (elems[i]);
+         if (spanner_l)
+           {
+             Spanner *broken_spanner_l =
+               spanner_l->find_broken_piece (my_line);
+             add_element (broken_spanner_l);
+           }
+         remove_element (elems[i]);
        }
+      
     }
 }
 
 void
 Axis_group_spanner::do_break_processing()
 {
-  DOUT << "do_break_processing ()\n";
+
   bool breaking_self_b = ! Spanner::line_l();
   if (!breaking_self_b)  
     {
index 904c74da9a315bc6ccdbc170e6ed7cad4f3ac8ec..84ff56f9f7f86c33a9859eb14d2a22986610c04b 100644 (file)
 #include "debug.hh"
 #include "musical-request.hh"
 
-void
-Command_script_req::do_print() const
-{}
-Command_script_req::Command_script_req(){}
-Command_script_req::~Command_script_req(){}
-
-
-
-
-
-
 void
 Cadenza_req::do_print() const
 {
@@ -58,14 +47,11 @@ Bar_req::do_equal_b (Request*r) const
 void
 Bar_req::do_print() const
 {
+#ifndef NPRINT
   DOUT << type_str_;
+#endif
 }
 
-void
-Bracket_req::do_print () const
-{
-  Span_req::do_print ();
-}
 
 Bar_req::Bar_req (String s)
 {
@@ -87,21 +73,6 @@ Partial_measure_req::do_equal_b (Request* r) const
 
 
 
-
-void
-Timing_req::do_print() const{}
-
-
-
-
-void
-Command_req::do_print() const{}
-
-
-
-void
-Barcheck_req::do_print() const{}
-
 bool
 Barcheck_req::do_equal_b (Request*r) const
 {
@@ -109,9 +80,6 @@ Barcheck_req::do_equal_b (Request*r) const
   return b;
 }
 
-
-
-
 void
 Clef_change_req::do_print() const
 {
@@ -125,11 +93,6 @@ Clef_change_req::Clef_change_req (String s)
   clef_str_ = s;
 }
 
-
-
-
-
-
 void
 Partial_measure_req::do_print() const
 {
@@ -184,11 +147,6 @@ Tempo_req::do_equal_b (Request *r) const
   return t&& t->dur_.length_mom ()== dur_.length_mom () && metronome_i_ == t->metronome_i_;
 }
 
-
-
-
-
-
 void
 Measure_grouping_req::do_print() const
 {
@@ -333,13 +291,6 @@ Break_req::Break_req ()
   penalty_i_ = 0;
 }
 
-void
-Break_req::do_print () const
-{
-}
-
-
-
 Mark_req::Mark_req (String s)
 {
   str_ = s;
index a0ac3e6bbf8ffe785ea9e4badc1eef1ab14db8e1..f4b46b1f5eae3b83b3f45b65664526a0fd32e299 100644 (file)
@@ -9,8 +9,8 @@
 
 #include "direction.hh"
 
-#if 0 
-String direction_str (Direction d, Axis a)
+String
+direction_str (Direction d, Axis a)
 {
   String s("center");
   if (a == Y_AXIS)
@@ -23,4 +23,3 @@ String direction_str (Direction d, Axis a)
     }
   return s;
 }
-#endif
index f0478bebe2a7678b079543dddd1e07a83e85af63..1f616ec7951d674babd835f43069020e40c55085 100644 (file)
@@ -8,7 +8,6 @@
 #include "musical-request.hh"
 #include "extender-engraver.hh"
 #include "extender-spanner.hh"
-#include "text-def.hh"
 #include "score-column.hh"
 #include "g-text-item.hh"
 
diff --git a/lily/g-script-engraver.cc b/lily/g-script-engraver.cc
new file mode 100644 (file)
index 0000000..7ddb4f7
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+  script-engraver.cc -- implement G_script_engraver
+
+  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "g-script-engraver.hh"
+#include "g-script.hh"
+#include "g-stem-staff-side.hh"
+#include "musical-request.hh"
+#include "stem.hh"
+#include "staff-symbol.hh"
+#include "rhythmic-head.hh"
+
+G_script_engraver::G_script_engraver()
+{
+  do_post_move_processing();
+}
+
+bool
+G_script_engraver::do_try_music (Music *r_l)
+{
+  if (Articulation_req *mr = dynamic_cast <Articulation_req *> (r_l))
+    {
+      for (int i=0; i < script_req_l_arr_.size(); i++) 
+       {
+         if (script_req_l_arr_[i]->equal_b (mr))
+           return true;
+       }
+      script_req_l_arr_.push (mr);
+      return true;
+    }
+  return false;
+}
+
+void
+G_script_engraver::do_process_requests()
+{
+  for (int i=0; i < script_req_l_arr_.size(); i++)
+    {
+      Articulation_req* l=script_req_l_arr_[i];
+
+
+      SCM list = gh_eval_str (("(articulation-to-scriptdef \"" + l->articulation_str_ + "\")").ch_C());
+      
+      if (list == SCM_BOOL_F)
+       {
+         l->warning(_f("don't know how to interpret articulation `%s'\n",
+                       l->articulation_str_.ch_C()));
+         continue;
+       }
+      G_script *p =new G_script;
+      G_stem_staff_side_item * ss =new G_stem_staff_side_item;
+      list = SCM_CDR (list);
+         
+      p->indices_drul_[LEFT] = ly_scm2string(SCM_CAAR (list));
+      p->indices_drul_[RIGHT] = ly_scm2string(SCM_CDAR (list));
+      list = SCM_CDR(list);
+      bool follow_staff = gh_scm2bool (SCM_CAR(list));
+      list = SCM_CDR(list);
+      int relative_stem_dir = gh_scm2int (SCM_CAR(list));
+      list = SCM_CDR(list);
+      int force_dir =gh_scm2int (SCM_CAR(list));
+      list = SCM_CDR(list);
+      SCM priority = SCM_CAR(list);
+
+      if (relative_stem_dir)
+         ss->relative_dir_ = relative_stem_dir;
+      else
+         ss->dir_ = force_dir;
+
+      if (l->dir_)
+       ss->dir_ = l->dir_;
+
+      ss->staff_support_b_ = !follow_staff;
+      p->set_staff_side (ss);
+      ss->set_elt_property (script_priority_scm_sym, priority);
+      ss->set_elt_property (padding_scm_sym, gh_double2scm(1.0));
+      script_p_arr_.push (p);
+      staff_side_p_arr_.push (ss);
+      
+      announce_element (Score_element_info (p, l));
+      announce_element (Score_element_info (ss, l));
+    }
+}
+
+void
+G_script_engraver::acknowledge_element (Score_element_info inf)
+{
+  if (Stem *s = dynamic_cast<Stem*>(inf.elem_l_))
+    {
+      for (int i=0; i < staff_side_p_arr_.size(); i++)
+       if (G_stem_staff_side_item * ss = dynamic_cast<G_stem_staff_side_item*>(staff_side_p_arr_[i]))
+         {
+           ss->set_stem (s);
+           ss->add_support (s);
+         }
+    }
+  else if (Rhythmic_head * rh = dynamic_cast<Rhythmic_head*>(inf.elem_l_))
+    {
+      for (int i=0; i < staff_side_p_arr_.size(); i++)
+       {
+         G_staff_side_item * ss = dynamic_cast<G_staff_side_item*>(staff_side_p_arr_[i]);
+         
+         if (!ss->dim_cache_[X_AXIS].parent_l_)
+           {
+             ss->dim_cache_[X_AXIS].parent_l_ = &inf.elem_l_->dim_cache_[X_AXIS];
+           }
+         ss->add_support (rh);
+       }
+    }  
+}
+
+void
+G_script_engraver::do_pre_move_processing()
+{
+  for (int i=0; i < script_p_arr_.size(); i++) 
+    {
+      typeset_element (script_p_arr_[i]);
+      typeset_element (staff_side_p_arr_[i]);
+    }
+  script_p_arr_.clear();
+  staff_side_p_arr_.clear ();
+}
+
+void
+G_script_engraver::do_post_move_processing()
+{
+  script_req_l_arr_.clear();
+}
+
+
+
+ADD_THIS_TRANSLATOR(G_script_engraver);
+
diff --git a/lily/g-script.cc b/lily/g-script.cc
new file mode 100644 (file)
index 0000000..9ad7c9a
--- /dev/null
@@ -0,0 +1,69 @@
+/*   
+  g-script.cc --  implement G_script
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+/*
+
+  TODO: Quantisation support (staccato dots between stafflines)
+
+*/
+
+#include "g-script.hh"
+#include "lookup.hh"
+#include "g-staff-side.hh"
+
+G_script::G_script ()
+{
+  staff_side_l_ =0;
+}
+
+void
+G_script::do_substitute_element_pointer (Score_element*o, Score_element*n)
+{
+  if (o == staff_side_l_)
+    staff_side_l_ = dynamic_cast<G_staff_side_item*>(n);
+}
+
+
+
+Molecule
+G_script::get_molecule(Direction d) const
+{
+  return lookup_l ()->afm_find ("scripts-" + indices_drul_[d]);
+}
+
+
+void
+G_script::do_pre_processing ()
+{
+  Graphical_element * e
+    = staff_side_l_->dim_cache_[X_AXIS].parent_l_->element_l();
+  translate_axis (e->extent (X_AXIS).center (), X_AXIS);
+}
+
+void
+G_script::do_post_processing ()
+{
+  Direction d =  staff_side_l_->dir_;
+  Molecule m (get_molecule(d));
+  translate_axis (- m.dim_[Y_AXIS][Direction (-d)], Y_AXIS);
+}
+
+void
+G_script::set_staff_side (G_staff_side_item*g)
+{
+  staff_side_l_ = g;
+  add_dependency (g);
+  dim_cache_[Y_AXIS].parent_l_ = & g->dim_cache_[Y_AXIS];
+}
+
+Molecule*
+G_script::do_brew_molecule_p () const
+{
+  return new Molecule (get_molecule (staff_side_l_->dir_));
+}
index 20812e55ad33b661c37cd42cd5f563cca3758050..db1b29cd69dee8a84838c3529d17aa3bdbe6d711 100644 (file)
@@ -15,25 +15,26 @@ G_staff_side_item::G_staff_side_item ()
   dir_ = CENTER;
   to_position_l_ = 0;
   set_elt_property (transparent_scm_sym, SCM_BOOL_T);
-
+  staff_support_b_ = true;
   axis_ = Y_AXIS;
 }
 
 
+
 void
 G_staff_side_item::do_pre_processing ()
 {
   if (!dir_)
-    set_default_direction ();
+    dir_ = get_default_direction ();
 
   if (axis_ == X_AXIS)
     position_self ();
 }
 
-void
-G_staff_side_item::set_default_direction ()
+Direction
+G_staff_side_item::get_default_direction () const
 {
-  dir_ = DOWN;
+  return DOWN;
 }
 
 
@@ -66,6 +67,7 @@ G_staff_side_item::do_substitute_element_pointer (Score_element*o, Score_element
 void
 G_staff_side_item::position_self ()
 {
+
   Interval dim;
   Dimension_cache *common = 0;
   if (support_l_arr_.size ())
@@ -85,15 +87,21 @@ G_staff_side_item::position_self ()
       dim = Interval(0,0);
       common = dim_cache_[axis_].parent_l_;
     }
-  Interval sym_dim = to_position_l_->extent (axis_);
+
+  
+  Interval sym_dim
+    = to_position_l_
+    ? to_position_l_->extent (axis_)
+    : Interval(0,0);
+
   Real off = dim_cache_[axis_].relative_coordinate (common);
 
-  SCM pad =   remove_elt_property (padding_scm_sym);
+  SCM pad = remove_elt_property (padding_scm_sym);
   if (pad != SCM_BOOL_F)
     {
-      off -= gh_scm2double (SCM_CDR(pad)) * dir_;
+      off += gh_scm2double (SCM_CDR(pad)) * dir_;
     }
-  dim_cache_[axis_].set_offset (dim[dir_] - sym_dim[-dir_] - off);
+  dim_cache_[axis_].set_offset (dim[dir_] - sym_dim[-dir_] + off);
 }
 
 void
@@ -107,7 +115,8 @@ G_staff_side_item::do_post_processing ()
 void
 G_staff_side_item::do_add_processing ()
 {
-  if (axis_ == Y_AXIS && staff_symbol_l ())
+  if (staff_support_b_
+      && axis_ == Y_AXIS && staff_symbol_l ())
     {
       add_support (staff_symbol_l ());
     }
diff --git a/lily/g-stem-staff-side.cc b/lily/g-stem-staff-side.cc
new file mode 100644 (file)
index 0000000..446e064
--- /dev/null
@@ -0,0 +1,55 @@
+/*   
+  g-stem-staff-side.cc --  implement G_stem_staff_side
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#include "g-stem-staff-side.hh"
+#include "stem.hh"
+
+G_stem_staff_side_item::G_stem_staff_side_item ()
+{
+  stem_l_ =0;
+  relative_dir_ = CENTER;
+}
+
+void
+G_stem_staff_side_item::do_substitute_element_pointer (Score_element*o,
+                                                      Score_element*n)
+{
+  if (o == stem_l_)
+    {
+      stem_l_ = dynamic_cast<Stem*> (n);
+    }
+}
+
+void
+G_stem_staff_side_item::set_stem (Stem*s)
+{
+  stem_l_ =s;
+  add_dependency (s);
+}
+
+
+Direction
+G_stem_staff_side_item::get_default_direction () const
+{
+  return relative_dir_ * stem_l_->dir_;
+}
+
+void
+G_stem_staff_side_item::do_pre_processing ()
+{
+  SCM p = remove_elt_property (padding_scm_sym);
+  if (p != SCM_BOOL_F && stem_l_)
+    {
+      p = SCM_CDR (p);
+      set_elt_property (padding_scm_sym,
+                       gh_double2scm(stem_l_->staff_line_leading_f ()
+                                     * gh_scm2double (p)));
+    }
+  G_staff_side_item :: do_pre_processing ();
+}
index c69988242fd87f9bb4091b54fb205d7bf407802e..a425c9f3873f6c773cc6b25761d9d6e8c59dd965 100644 (file)
@@ -1,3 +1,4 @@
+
 /*
   general-script-def.cc -- implement General_script_def
 
@@ -70,3 +71,4 @@ General_script_def::get_molecule (Paper_def*, Direction) const
 
 
 
+
index bf9205579f4a742c7be2029ec37a7ab557e3d9dc..8419dd36073386b9d0bc300d31c7f11bf32a0ab0 100644 (file)
@@ -13,7 +13,6 @@
 #include "identifier.hh"
 #include "my-lily-lexer.hh"
 #include "debug.hh"
-#include "script-def.hh"
 #include "request.hh"
 #include "translator.hh"
 #include "notename-table.hh"
@@ -82,7 +81,6 @@ Class ## _identifier::do_print () const { \
 
 
 
-DEFAULT_PRINT(General_script_def);
 DEFAULT_PRINT(Translator);
 DEFAULT_PRINT(Music);
 DEFAULT_PRINT(Request);
@@ -99,7 +97,6 @@ Class ## _identifier::do_str () const { \
 
 
 DUMMY_STR(Notename_table);
-DUMMY_STR(General_script_def);
 DUMMY_STR(Translator);
 DUMMY_STR(Music);
 DUMMY_STR(Request);
@@ -171,7 +168,6 @@ IMPLEMENT_ID_CLASS(Translator);
 IMPLEMENT_ID_CLASS(int);
 IMPLEMENT_ID_CLASS(Real);
 IMPLEMENT_ID_CLASS(String);
-IMPLEMENT_ID_CLASS(General_script_def);
 IMPLEMENT_ID_CLASS(Music);
 IMPLEMENT_ID_CLASS(Score);
 IMPLEMENT_ID_CLASS(Request);
@@ -181,7 +177,6 @@ IMPLEMENT_ID_CLASS(Notename_table);
 VIRTUAL_ACCESSOR(Music);
 VIRTUAL_ACCESSOR(Request);
 VIRTUAL_ACCESSOR(Translator);
-VIRTUAL_ACCESSOR(General_script_def);
 DEFAULT_ACCESSOR(Notename_table);
 DEFAULT_ACCESSOR(Duration);
 DEFAULT_ACCESSOR(int);
index 659919425b2743894092c9c478d88c3c81ccf95c..b6a0ab5231572f4d8c6211b06be70628c45c3e5c 100644 (file)
@@ -19,7 +19,8 @@ class Axis_align_item : public virtual Align_element,
 public:
   Axis_align_item ();
 protected:
-  virtual  void do_print () const {}
+  virtual void do_print ()const;
+
 };
 #endif /* AXIS_ALIGN_ITEM_HH */
 
index 40753a8a9a2267a68d8bcd27b24ac1a8682dd78a..0de8cc51efb3a6a2eaed60863454b14d2e21eadd 100644 (file)
@@ -7,8 +7,8 @@
 */
 
 
-#ifndef SPAN_AXIS_GROUP_HH
-#define SPAN_AXIS_GROUP_HH
+#ifndef AXIS_GROUP_SPANNER_HH
+#define AXIS_GROUP_SPANNER_HH
 
 #include "spanner.hh"
 #include "axis-group-element.hh"
index effd9886b556ef6ccfb22c6d21268cb78664101b..c37277e312768ce32cd607c423f029dd54b9f47f 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef CLEFITEM_HH
 #define CLEFITEM_HH
 #include "item.hh"
-#include "text-def.hh"
+
 #include "direction.hh"
 #include "pointer.hh"
 #include "staff-symbol-referencer.hh"
index 75004fb803cff9cca15150cf2089e2ab23506cad..63f8c11135f940ef63dbbc3d761e367c92ce847f 100644 (file)
 #include "duration.hh"
 #include "musical-pitch.hh"
 
-/** Request which are  assumed to be "happening" before the
-  musical requests.  Not coupled to a note or rest. */
-class Command_req  : public virtual Request  {
-public:
-  REQUESTMETHODS(Command_req);
-
-};
-
-
-class Break_req : public Command_req {
+class Break_req : public Request {
 public:
   enum { DISALLOW = -10000, FORCE = 10000 };
   int penalty_i_;
   Break_req ();
-  REQUESTMETHODS (Break_req);
+protected:
+  VIRTUAL_COPY_CONS(Music);
 };
 
-class Mark_req : public Command_req {
+class Mark_req : public Request {
 public:
   Mark_req (String);
   String str_;
-  REQUESTMETHODS (Mark_req);
-};
-
-class Command_script_req : public Command_req,  public Script_req {
-public:
-  // huh? 
-  Command_script_req();
-  ~Command_script_req();
-  REQUESTMETHODS(Command_script_req);
+protected:
+  virtual void do_print () const;  
+  VIRTUAL_COPY_CONS(Music);
 };
 
 
 /** Baseclass for time_signature/partial req. It has to be handled by
   Staff_{walker,column} baseclass.  */
-class Timing_req  : public Command_req  {
+class Timing_req  : public Request  {
 public:
-  REQUESTMETHODS(Timing_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 
@@ -63,7 +49,9 @@ public:
   int metronome_i_;
 
   Tempo_req();
-  REQUESTMETHODS(Tempo_req);
+protected:
+    virtual void do_print () const;
+  VIRTUAL_COPY_CONS(Music);
   bool do_equal_b (Request *) const;
 };
 
@@ -72,7 +60,9 @@ public:
   Moment length_mom_;
 
   Partial_measure_req (Moment);
-  REQUESTMETHODS(Partial_measure_req);
+protected:
+  VIRTUAL_COPY_CONS(Music);
+  virtual void do_print () const;
   bool do_equal_b (Request*) const;
 };
 
@@ -81,11 +71,14 @@ public:
  */
 class Time_signature_change_req  : public Timing_req  {
 public:
-  int beats_i_, one_beat_i_;
+  int beats_i_;
+  int one_beat_i_;
 
   Time_signature_change_req();
+protected:
+  virtual void do_print () const;
   bool do_equal_b (Request*) const;
-  REQUESTMETHODS(Time_signature_change_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 /// toggle Cadenza mode
@@ -93,35 +86,42 @@ class Cadenza_req  : public Timing_req  {
 public:
   /// turn on?
   bool on_b_;
-  bool do_equal_b (Request*) const;
   Cadenza_req (bool);
-  REQUESTMETHODS(Cadenza_req);
+protected:
+  virtual void do_print () const;
+  
+  bool do_equal_b (Request*) const;
+  VIRTUAL_COPY_CONS(Music);
 };
 
 /// check if we're at start of a  measure.
 class Barcheck_req  : public Timing_req  {
 public:
   bool do_equal_b (Request *) const;
-  REQUESTMETHODS(Barcheck_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 class Measure_grouping_req : public Timing_req  {
 public:
   Array<int> beat_i_arr_;
   Array<Moment> elt_length_arr_;
+protected:
+  virtual void do_print () const;
   bool do_equal_b (Request *) const;
-  REQUESTMETHODS(Measure_grouping_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 /** draw a (repeat)-bar. This something different than #Barcheck_req#,
   the latter should only happen at the start of a measure.  */
-class Bar_req  : public Command_req  {
+class Bar_req  : public Request  {
 public:
   String type_str_;
   Bar_req (String);
+protected:
+  virtual void do_print () const;
   bool do_equal_b (Request*) const;
 
-  REQUESTMETHODS(Bar_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 
@@ -130,14 +130,13 @@ public:
     Routines for sharps and flats are separated, 
     so that caller may identify non-conventional keys.
 */
-class Key_change_req  : public Command_req  {
+class Key_change_req  : public Request  {
 public:
   Array<Musical_pitch> pitch_arr_;
   int modality_i_;
   bool ordinary_key_b_;
 
   Key_change_req();
-  REQUESTMETHODS(Key_change_req);
 
   /// squash the octaves to 1
   void squash_octaves();
@@ -146,22 +145,27 @@ public:
 
   /// return number of sharps in key
   int sharps_i();
+  bool minor_b() const;
 
+protected:
+  VIRTUAL_COPY_CONS(Music);
   void transpose (Musical_pitch  d);
-  bool minor_b() const;
+  virtual void do_print () const;
 };
 
-class Clef_change_req  : public Command_req  {
+class Clef_change_req  : public Request  {
 public:
   String clef_str_;
   Clef_change_req (String);
-  REQUESTMETHODS(Clef_change_req);
+protected:
+  virtual void do_print () const;
+  VIRTUAL_COPY_CONS(Music);
 };
 
-class Bracket_req :  public Span_req, public Command_req {
+class Bracket_req :  public Span_req {
 
 public:
-  REQUESTMETHODS(Bracket_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 
diff --git a/lily/include/g-script-engraver.hh b/lily/include/g-script-engraver.hh
new file mode 100644 (file)
index 0000000..7f1774c
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+  script-engraver.hh -- part of GNU LilyPond
+
+  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#ifndef G_SCRIPT_GRAV
+#define G_SCRIPT_GRAV
+
+#include "engraver.hh"
+
+
+class G_script_engraver : public Engraver {
+  Link_array<G_script> script_p_arr_;
+  Link_array<G_staff_side_item> staff_side_p_arr_;
+  Link_array<Articulation_req> script_req_l_arr_;
+
+public:
+  VIRTUAL_COPY_CONS(Translator);
+  
+  G_script_engraver();
+protected:
+  virtual bool do_try_music (Music*);
+  virtual void do_process_requests ();
+  virtual void do_pre_move_processing ();
+  virtual void do_post_move_processing ();
+  virtual void acknowledge_element (Score_element_info);
+};
+
+#endif // G_SCRIPT_GRAV
diff --git a/lily/include/g-script.hh b/lily/include/g-script.hh
new file mode 100644 (file)
index 0000000..f130963
--- /dev/null
@@ -0,0 +1,39 @@
+/*   
+  g-script.hh -- declare G_script
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#ifndef G_STEM_SCRIPT_HH
+#define G_STEM_SCRIPT_HH
+
+#include "item.hh"
+#include "drul-array.hh"
+
+/**
+   articulation marks (and the like) that are attached to notes/stems.
+   Needs support from G_staff_side for proper operation.
+ */
+class G_script : public Item
+{
+  G_staff_side_item * staff_side_l_;
+
+  Molecule get_molecule (Direction d) const;
+public:
+  Drul_array<String> indices_drul_;
+  G_script ();
+  void set_staff_side (G_staff_side_item*);
+
+protected:
+  virtual void do_substitute_element_pointer (Score_element*o,
+                                             Score_element*n);
+  virtual void do_pre_processing ();
+  virtual void do_post_processing ();
+  Molecule* do_brew_molecule_p () const;
+};
+
+#endif /* G_STEM_SCRIPT_HH */
+
index c463360e273d1a80124d46e3a4c4162264a5b0f9..5f527141e0855cf095c06354a413452de3aa9454 100644 (file)
 #include "item.hh"
 #include "staff-symbol-referencer.hh"
 
+/**
+   Position myself next to a set of elements.  Configurable in axis
+   and direction.
+
+  Properties:
+
+    padding :: Real
+
+    Amount of extra space to add.
+*/
 class G_staff_side_item : public Item, public Staff_symbol_referencer
 {
   void position_self ();
 public:
+
   Score_element * to_position_l_;
   Direction dir_;
   Link_array<Score_element> support_l_arr_;
   Axis axis_;
+
+  bool staff_support_b_;
   
   G_staff_side_item ();
   void set_victim (Score_element*);
   void add_support (Score_element*);
 
-  virtual void set_default_direction ();
   VIRTUAL_COPY_CONS(Score_element);
+  virtual Direction get_default_direction () const;
 protected:
   virtual void do_add_processing ();
   virtual void do_substitute_element_pointer (Score_element*,Score_element*);
diff --git a/lily/include/g-stem-staff-side.hh b/lily/include/g-stem-staff-side.hh
new file mode 100644 (file)
index 0000000..59e51ce
--- /dev/null
@@ -0,0 +1,40 @@
+/*   
+  g-stem-staff-side.hh -- declare G_stem_staff_side
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#ifndef G_STEM_STAFF_SIDE_HH
+#define G_STEM_STAFF_SIDE_HH
+
+#include "g-staff-side.hh"
+/**
+   Position self, analogous to G_staff_side_item, but use Stem direction
+   for determining direction.
+
+   Properties:
+
+   padding :: Real
+
+   Padding in staffline leading
+   
+ */
+class G_stem_staff_side_item : public G_staff_side_item
+{
+  Stem *stem_l_;
+public:
+  Direction relative_dir_;
+
+  void set_stem (Stem*);
+  G_stem_staff_side_item ();
+protected:
+  virtual Direction get_default_direction ()const;
+  virtual void do_pre_processing ();
+  virtual void do_substitute_element_pointer (Score_element*o,Score_element*e);
+};
+
+#endif /* G_STEM_STAFF_SIDE_HH */
+
index 2362a5d9bef412e64831d21e1fb982cd48295ee5..c27ad99a691c22ab458240b765fc770d793aefaf 100644 (file)
@@ -12,6 +12,9 @@
 
 #include "item.hh"
 
+/**
+   Print a text in specified style.
+ */
 class G_text_item : public Item
 {
 public:
index fe76de9e74d43ca2fffe9e8eeb89c82e1b860a24..74b2075ae71434b37a544df692f4b38b1eddc645 100644 (file)
@@ -10,6 +10,8 @@
 #ifndef GENERAL_SCRIPT_DEF_HH
 #define GENERAL_SCRIPT_DEF_HH
 
+
+
 #include "lily-proto.hh"
 #include "input.hh"
 #include "virtual-methods.hh"
index 0ebfc65bcdafde793008be1a2ee38a01802aefd7..4d705020fbcbdc24490dc799057d485f6329cad3 100644 (file)
@@ -18,7 +18,7 @@
 class Notename_table_identifier;
 class Translator_identifier;
 class Music_identifier;
-class General_script_def_identifier;
+class Articulation_req_identifier;
 class Symtables_identifier;
 class Midi_def_identifier;
 class Paper_def_identifier;
@@ -54,7 +54,6 @@ struct Identifier : public Input {
   IDACCESSOR(Translator)
   IDACCESSOR(Notename_table)
   IDACCESSOR(Music)
-  IDACCESSOR(General_script_def)
   IDACCESSOR(Symtables)
   IDACCESSOR(Midi_def)
   IDACCESSOR(Paper_def)
index 367ff2febd78a04b8c990210aecf118c8630af5c..68667ae067013bd21ab7a40f4268633c17f351c2 100644 (file)
@@ -19,6 +19,7 @@ struct Abbreviation_req;
 struct Adobe_font_metric;
 struct Adobe_font_char_metric;
 struct All_font_metrics;
+struct Articulation_req;
 struct Atom;
 struct Audio_element;
 struct Audio_column;
@@ -81,6 +82,8 @@ struct Engraver;
 struct Engraver_group_engraver;
 struct Extender;
 struct Extender_req;
+struct G_script;
+struct G_script_req;
 struct G_staff_side_item;
 struct G_text_item;
 struct General_script_def;
index 187947afec79931870a1b8dd9486f7abb061bb16..2410acc2855a4f945d53930f40b06b4149d8a570 100644 (file)
@@ -8,27 +8,30 @@
 #define SCORELINE_HH
 
 #include "colhpos.hh"
-#include "spanner.hh"
+#include "axis-group-spanner.hh"
 #include "super-element.hh"
 
 /// the columns of a score that form one line.
-class Line_of_score : public Spanner, public Super_element
+class Line_of_score : public Axis_group_spanner, public Super_element
 {
-public:
   Link_array<Paper_column> cols_;
+public:
+
   Line_of_score();
     
-  void add_element (Score_element *);
-
   /// is #c# contained in #*this#?
   bool contains_b (Paper_column const *c) const;
     
   Link_array<Line_of_score> get_lines() const;
   Line_of_score * set_breaking (Array<Column_x_positions> const&, int j) const;
 
+
+  void output_all ();
+  void add_column (Paper_column*);
+  
 protected:
+  virtual void do_substitute_element_pointer (Score_element*, Score_element*);
   virtual Link_array<Score_element> get_extra_dependencies () const;
-  virtual Interval do_width() const;
   virtual void do_print() const;
   VIRTUAL_COPY_CONS(Score_element);
 };
index abf3434a8b29da250dc41b9000f9013d1f5da07f..827e094f03da2b0252671e1dc74fd46023474ada 100644 (file)
@@ -41,7 +41,7 @@ public:
   Molecule plet (Real dy, Real dx, Direction dir) const;
   Molecule rest (int, bool outside, String) const;
   Molecule rule_symbol (Real height, Real width) const;
-  Molecule script (String idx) const;
+
   Molecule stem (Real y1_pos, Real y2_pos) const;
   Molecule slur (Array<Offset> controls) const;
   Molecule streepje (int type) const;
diff --git a/lily/include/lookup.hh.orig b/lily/include/lookup.hh.orig
new file mode 100644 (file)
index 0000000..abf3434
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+  lookup.hh -- declare Lookup
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#ifndef LOOKUP_HH
+#define LOOKUP_HH
+
+#include "molecule.hh"
+#include "fproto.hh"
+#include "direction.hh"
+#include "box.hh"
+
+/** handy interface to symbol table
+ */
+class Lookup
+{
+public:
+  Lookup ();
+  Lookup (Lookup const&);
+
+  Molecule simple_bar (String s, Real w) const;
+  Molecule accidental (int, bool cautionary) const;
+  Molecule afm_find (String, bool warn=true) const;
+  Molecule notehead  (int, String) const;
+
+  Molecule bar (String, Real height) const;
+  Molecule beam (Real, Real, Real) const;
+  Molecule clef (String) const;
+  Molecule dashed_slur (Array<Offset> controls, Real thick, Real dash) const;
+  Molecule dots () const;
+  Molecule ledger_line (Interval) const;
+  Molecule fill (Box b) const;
+  Molecule filledbox (Box b) const;  
+  Molecule flag (int, Direction) const;
+  Molecule hairpin (Real width, bool decresc, bool continued) const;
+  Molecule plet (Real dy, Real dx, Direction dir) const;
+  Molecule rest (int, bool outside, String) const;
+  Molecule rule_symbol (Real height, Real width) const;
+  Molecule script (String idx) const;
+  Molecule stem (Real y1_pos, Real y2_pos) const;
+  Molecule slur (Array<Offset> controls) const;
+  Molecule streepje (int type) const;
+  Molecule text (String style, String text) const;
+  Molecule staff_brace (Real dy) const;
+  Molecule staff_bracket (Real dy) const;
+  Molecule volta (Real w, bool last_b) const;
+  Molecule special_time_signature (String, int,int) const;
+  Molecule time_signature (int n,int d) const;
+
+  Paper_def * paper_l_;
+
+  String font_name_;
+  Adobe_font_metric * afm_l_;
+};
+
+#endif // LOOKUP_HH
index 1e2c85eecb6e05b0f1ebf961da3b92215d65722f..322d4ab8cbcfcc6478dec96cf89ba46b61501fcf 100644 (file)
@@ -47,6 +47,7 @@ DECLARE_LY_SYMBOL(pianobrace);
 DECLARE_LY_SYMBOL(placebox);
 DECLARE_LY_SYMBOL(rulesym);
 DECLARE_LY_SYMBOL(rulethickness);
+DECLARE_LY_SYMBOL(script_priority);
 DECLARE_LY_SYMBOL(staffheight);
 DECLARE_LY_SYMBOL(style);
 DECLARE_LY_SYMBOL(text);
index 28d949b497cd56d9a739ba3423961986695af1da..1fd514cde2e9cff882db2e43c1cce035be4eb717 100644 (file)
 #include "duration.hh"
 #include "musical-pitch.hh"
 
-/**
-  A request which is coupled to a note (that has duration).
-  Base class only
- */
-class Musical_req  : public virtual Request  {
-public:
-
-
-  REQUESTMETHODS(Musical_req);
-};
-
-
 
 /** a request with a duration.
   This request is used only used as a base class.
  */
-class Rhythmic_req  : public virtual Musical_req  {
+class Rhythmic_req  : public virtual Request  {
 public:
   Duration duration_;
-    
+  virtual void do_print () const;
+
+
   bool do_equal_b (Request*) const;
   void compress (Moment);
   virtual Moment length_mom () const;
   static int compare (Rhythmic_req const&,Rhythmic_req const&);
-  REQUESTMETHODS(Rhythmic_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 class Skip_req  : public Rhythmic_req  {
 public:
-  REQUESTMETHODS(Skip_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
-struct Spacing_req :virtual Request {
-  Moment next;
-  Real distance;
-  Real strength;
-  Spacing_req();
-  REQUESTMETHODS(Spacing_req);
-};
 
-struct Abbreviation_req : public Musical_req {
-  REQUESTMETHODS (Abbreviation_req);
+struct Abbreviation_req : public Request {
+  VIRTUAL_COPY_CONS (Abbreviation_req);
   Abbreviation_req ();
   int type_i_;
+  virtual void do_print () const;
 };
 
-class Blank_req  : public Spacing_req, Rhythmic_req  {
-public:
-  REQUESTMETHODS(Spacing_req);
-};
 
 /** a syllable  or lyric is a string with rhythm.
   */
 class Lyric_req  : public  Rhythmic_req  {
 public:
+  virtual void do_print () const;
   String text_str_;
-  REQUESTMETHODS(Lyric_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 
+class Articulation_req : public G_script_req
+{
+public:
+  String articulation_str_;
+protected:
+  virtual void do_print () const;
+  VIRTUAL_COPY_CONS(Music);
+};
+
+class Text_script_req : public G_script_req {
+public:
+  String text_str_;
+
+  // should be generic property of some kind.. 
+  String style_str_;
+protected:
+  VIRTUAL_COPY_CONS(Music);
+  virtual void do_print () const;
+};
+
 
 /// request which has some kind of pitch
-struct Melodic_req :virtual Musical_req
+struct Melodic_req :virtual Request
 {
   Musical_pitch pitch_;
+
+  static int compare (Melodic_req const&,Melodic_req const&);
+  
+protected:
   /// transpose. #delta# is relative to central c.
   virtual void transpose (Musical_pitch delta);
-  Melodic_req();
-  bool do_equal_b (Request*) const;
-  static int compare (Melodic_req const&,Melodic_req const&);
-  REQUESTMETHODS(Melodic_req);
+  virtual bool do_equal_b (Request*) const;
+  virtual void do_print () const;
+  VIRTUAL_COPY_CONS(Music);
 };
 
 /// specify tonic of a chord
 struct Tonic_req : public Melodic_req
 {
-  Tonic_req ();
-  REQUESTMETHODS(Tonic_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 /// Put a note of specified type, height, and with accidental on the staff.
@@ -104,8 +107,10 @@ public:
   /// Cautionary, i.e. parenthesized accidental.
   bool cautionary_b_;
   Note_req();
+protected:
+  virtual void do_print () const;
   bool do_equal_b (Request*) const;
-  REQUESTMETHODS(Note_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 /**
@@ -113,7 +118,7 @@ Put a rest on the staff. Why a request? It might be a good idea to not typeset t
 */
 class Rest_req : public Rhythmic_req {
 public:
-  REQUESTMETHODS(Rest_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 /**
@@ -122,24 +127,17 @@ public:
  */
 class Multi_measure_rest_req : public Rhythmic_req  {
 public:
-  REQUESTMETHODS(Multi_measure_rest_req);
+  VIRTUAL_COPY_CONS(Music);
 
 };
 
-class Musical_span_req : public Span_req, public virtual Musical_req
-{
-public:
-  REQUESTMETHODS(Musical_span_req);
-  
-};
-
 
 /** 
  Start / stop an abbreviation beam at this note. 
  */
-class Abbreviation_beam_req : public Musical_span_req  {
+class Abbreviation_beam_req : public Span_req  {
 public:
-  REQUESTMETHODS (Abbreviation_beam_req);
+  VIRTUAL_COPY_CONS(Abbreviation_beam_req);
 
   Abbreviation_beam_req ();
 
@@ -149,46 +147,48 @@ public:
 
 
 /// a slur
-class Slur_req  : public Musical_span_req  {
+class Slur_req  : public Span_req  {
 public:
-  REQUESTMETHODS(Slur_req);
+  VIRTUAL_COPY_CONS(Music);
 
 };
 
 /// an extender line
 class Extender_req : public Request  {
 public:
-  REQUESTMETHODS(Extender_req);
-  Extender_req ();
-};
+  VIRTUAL_COPY_CONS(Music);
 
-class Musical_script_req : public Musical_req,  public Script_req {
-public:
-  REQUESTMETHODS(Musical_script_req);
 };
 
 
-class Dynamic_req  : public virtual Musical_req  {
+class Dynamic_req  : public virtual Request  {
 public:
-  REQUESTMETHODS(Dynamic_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 class Absolute_dynamic_req  : public Dynamic_req  {
 public:
   String loudness_str_;
-  virtual bool do_equal_b (Request*) const;
   String loudness_str () const;
   Absolute_dynamic_req();
-  REQUESTMETHODS(Absolute_dynamic_req);
+
+protected:
+  virtual void do_print () const;
+  virtual bool do_equal_b (Request*) const;
+  VIRTUAL_COPY_CONS(Music);
 };
 
-class Span_dynamic_req  : public Dynamic_req, public Musical_span_req  {
+class Span_dynamic_req  : public Dynamic_req, public Span_req  {
 public:
-  virtual bool do_equal_b (Request*) const;
+
   /// Grow or shrink the volume: 1=cresc, -1 = decresc 
   Direction dynamic_dir_;
+
   Span_dynamic_req();
-  REQUESTMETHODS(Span_dynamic_req);
+protected:
+  virtual bool do_equal_b (Request*) const;
+  virtual void do_print () const;
+  VIRTUAL_COPY_CONS(Music);
 };
 
 #endif // MUSICALREQUESTS_HH
index ef4d41a2c2624319b70f4f703bd15ab113121913..1b62555d0379d9838e84a308b3667976f0416940 100644 (file)
@@ -35,7 +35,7 @@ public:
   void output_molecule (Molecule const *, Offset, char const *);
   void output_comment (String s);
   void output_scheme (SCM scm);
-  void start_line ();
+  void start_line (Real height);
   void stop_line ();
   void switch_to_font (String fontname);
 
index 8cd5e4abdd87b0acc7cf729999d3ce514a474d2a..72134e8c334916475f80cb8083e2d3afb082cd2e 100644 (file)
 
  */
 class Request : public Music {
-
 public:
-    
   virtual ~Request(){}
-
-  
   VIRTUAL_COPY_CONS(Music);
-    
   bool equal_b (Request*) const;
 protected:
   virtual bool do_equal_b (Request*) const;
@@ -40,26 +35,27 @@ protected:
 };
 
 
-#define REQUESTMETHODS(T)      \
-\
-VIRTUAL_COPY_CONS(Request);\
-virtual void do_print() const
-
 
+class G_script_req : public virtual Request
+{
+public:
+  Direction dir_;
+  VIRTUAL_COPY_CONS(Music);
+};
 
 /** Put a script above or below this ``note'' or bar. eg upbow, downbow. Why
   a request? These symbols may conflict with slurs and brackets, so
   this also a request */
 
-class Script_req  : public virtual Request { 
+class Script_req  : public virtual G_script_req { 
 public:
-  Direction dir_;
   General_script_def *scriptdef_p_;
   
   bool do_equal_b (Request*) const;
 
   Script_req();
-  REQUESTMETHODS(Script_req);
+  VIRTUAL_COPY_CONS(Music);
+  virtual void do_print () const;
   ~Script_req();
   Script_req (Script_req const&);
 };
@@ -73,10 +69,12 @@ class Span_req  : public virtual Request  {
 public:
   /// should the spanner start or stop, or is it unwanted?
   Direction spantype_;
-  bool do_equal_b (Request*) const;
-  REQUESTMETHODS(Span_req);
 
   Span_req();
+protected:
+  virtual bool do_equal_b (Request*) const;
+  virtual void do_print() const;
+  VIRTUAL_COPY_CONS(Music);
 };
 
 /**
@@ -84,13 +82,13 @@ public:
  */
 class Tie_req : public Request {
 public:
-  REQUESTMETHODS(Tie_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 /** Start / stop a beam at this note */
 class Beam_req  : public Span_req  {
 public:
-  REQUESTMETHODS(Beam_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 #endif
index c0c92d40741cc72cdefa80fd07d022f41f2118df..f3d17d75b4abb40ee7d8349dbbf30de30974d751 100644 (file)
@@ -9,6 +9,7 @@
 #include "string.hh"
 #include "general-script-def.hh"
 
+#error 
 /** The characteristics of a certain kind of accent. It is not the
   accent itself.  */
 class Script_def : public General_script_def {
diff --git a/lily/include/script-engraver.hh b/lily/include/script-engraver.hh
deleted file mode 100644 (file)
index efa5aa6..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-  script-engraver.hh -- part of GNU LilyPond
-
-  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef SCRIPTGRAV_HH
-#define SCRIPTGRAV_HH
-
-#include "engraver.hh"
-
-
-class Script_engraver : public Engraver {
-  Link_array<Script> script_p_arr_;
-  Link_array<Script_req> script_req_l_arr_;
-
-public:
-  VIRTUAL_COPY_CONS(Translator);
-  
-  Script_engraver();
-protected:
-  virtual bool do_try_music (Music*);
-  virtual void do_process_requests();
-  virtual void do_pre_move_processing();
-  virtual void do_post_move_processing();
-
-};
-
-#endif // SCRIPTGRAV_HH
index 8c3342a4e6a7f03aabb3db97a6e7c1f75c425fb2..6e541e0a8ab8af5d8d54f8f298d04d225305724b 100644 (file)
 #include "score-element.hh"
 /** The toplevel element. The Paper_score contains this element, and any
   element shoud be a dependency for the super element.
+
+  It is the entry point for the "constraint solver"/ dependency
+  tracker.  Every XXXX_processing () call traverses the entire
+  dependency graph, and calls the appropriate
+  Score_element::do_XXX_processing function on each Score_element it encounters.
+  
+  
   */
 class Super_element : public virtual Score_element {
 public:
-  Super_element();
-
   void space_processing ();
   void pre_processing();
   void breakable_col_processing();
   void break_processing();
   void post_processing();
   void output_all ();
-
-protected:
-  
 };
 
 #endif // Super_element_HH
diff --git a/lily/include/text-def.hh b/lily/include/text-def.hh
deleted file mode 100644 (file)
index 0465a90..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-  text-def.hh -- part of GNU LilyPond
-
-  (c) 1996--1999 Han-Wen Nienhuys
-*/
-
-#ifndef TEXT_DEF_HH
-#define TEXT_DEF_HH
-
-#include "general-script-def.hh"
-#include "string.hh"
-#include "lily-proto.hh"
-#include "input.hh"
-
-class Text_def : public General_script_def 
-{
-public:
-  VIRTUAL_COPY_CONS(General_script_def);
-
-  /**
-     Alignment of typeset text wrt center.
-
-     LEFT = raggedright, CENTER = centered, RIGHT = raggedleft
-  */
-  Direction align_dir_;
-
-  String text_str_;
-  String style_str_;
-    
-  virtual void do_print() const;
-  virtual Direction staff_dir() const;
-  virtual Molecule get_molecule (Paper_def* p, Direction dir_) const;
-  virtual ~Text_def() {};
-  virtual bool do_equal_b (const General_script_def*) const;
-  Text_def();
-  virtual void print() const;
-};
-
-#endif // TEXT_DEF_HH
-
diff --git a/lily/include/text-spanner.hh b/lily/include/text-spanner.hh
deleted file mode 100644 (file)
index 0cc7b4f..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-  textspanner.hh -- part of GNU LilyPond
-
-  (c) 1996--1999 Han-Wen Nienhuys
-*/
-
-#ifndef TEXTSPANNER_HH
-#define TEXTSPANNER_HH
-
-#include "string.hh"
-#include "directional-spanner.hh"
-#include "text-def.hh"
-
-/** a spanner which puts texts on top of other spanners.  Use for
-  triplets, volta, ottava, etc.
-
-  (does anyone use  this? Junkme?)
-*/
-class Text_spanner : public Spanner {
-public:
-  Directional_spanner * support_span_l_;
-  General_script_def * spec_p_;
-  Offset text_off_;
-  
-
-  void set_support (Directional_spanner*);
-  Text_spanner();
-  Text_spanner (Text_spanner const&);
-protected:
-  VIRTUAL_COPY_CONS(Score_element);
-  ~Text_spanner();
-  virtual void do_add_processing ();
-  virtual void do_substitute_element_pointer (Score_element*,Score_element*);
-  virtual void do_pre_processing();
-  virtual void do_post_processing();
-  virtual Interval height() const ;
-  virtual Molecule* do_brew_molecule_p() const;
-  virtual void do_print() const;
-};
-#endif // TEXTSPANNER_HH
-
index 224d88b17cd67253994d26e11f7cd8c989cf68c1..afb2d2262730150991ad3e8e2d36cb5481c1def6 100644 (file)
@@ -6,7 +6,7 @@
 
 #ifndef Tuplet_spanner_HH
 #define Tuplet_spanner_HH
-#include "text-def.hh"
+
 #include "pointer.hh"
 #include "directional-spanner.hh"
 
@@ -19,7 +19,12 @@ public:
  
   void add_column (Note_column*);
   void set_beam (Beam*);
-  P<Text_def>  tdef_p_;
+  
+
+  String  number_str_;
+  /*
+    junk us.
+   */
   bool bracket_visibility_b_;
   bool num_visibility_b_;
   
index 2195ac7f4f080795b74eca8e6db4dbcd8f93a084..a1debb439b20fe51c1414eb7231d794e6604f892 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef VOLTA_SPANNER_HH
 #define VOLTA_SPANNER_HH
 
-#include "text-def.hh"
+
 #include "pointer.hh"
 #include "spanner.hh"
 
@@ -21,11 +21,11 @@ public:
   void add_column (Note_column*);
   void add_column (Bar*);
  
-  P<Text_def>  number_p_;
+  String number_str_;
   Link_array<Bar> column_arr_;
   Link_array<Note_column> note_column_arr_;
   bool last_b_;
-  bool visible_b_;
+
  
 protected:
   virtual Molecule* do_brew_molecule_p () const;
index d7fdfed7b6abb377e98759f694d7088f39c80f30..084ee6013e10f7726b26969a56dddefc250821da 100644 (file)
@@ -7,22 +7,15 @@
 */
 
 #include "line-of-score.hh"
-#include "spanner.hh"
-
 #include "paper-def.hh"
+#include "paper-outputter.hh"
 #include "p-col.hh"
 #include "p-score.hh"
+#include "warn.hh"
 
 Line_of_score::Line_of_score()
 {
-}
-
-void
-Line_of_score::add_element (Score_element*e)
-{
-  // avoid excess dependencies.
-  if (! (e->parent_l (X_AXIS) || e->parent_l (Y_AXIS)) )
-    add_dependency (e);
+  set_axes (Y_AXIS,Y_AXIS);
 }
 
 bool
@@ -35,23 +28,13 @@ Line_of_score*
 Line_of_score::set_breaking (Array<Column_x_positions> const &breaking, int j) const
 {
   const Link_array<Paper_column> &curline (breaking[j].cols);
-
   const Array<Real> &config (breaking[j].config);
-       
   Line_of_score *line_l=0;
-       
-  if (breaking.size() >1) 
-    {
-      line_l = dynamic_cast <Line_of_score*> (clone());
-    }
-  else 
-    line_l = (Line_of_score*)( this);
+
+  line_l = dynamic_cast <Line_of_score*> (clone());
 
   line_l->cols_ = curline;
-  /*  Array<Paper_column*> &
-      ((Array<Paper_column*> &)) = */
   line_l->set_bounds(LEFT,curline[0]);
-      
   line_l->set_bounds(RIGHT,curline.top());
        
   for (int i=0; i < curline.size(); i++)
@@ -60,32 +43,55 @@ Line_of_score::set_breaking (Array<Column_x_positions> const &breaking, int j) c
       curline[i]->line_l_ = dynamic_cast<Line_of_score*>(line_l);
     }
 
+  Breaking_information b;
+  b.bounds_ = line_l->spanned_drul_;
+  b.broken_spanner_l_ = line_l;
+  b.line_l_ = line_l;
+  
+  broken_info_.push (b);
+
   return line_l;
 }
 
-
-
+void
+Line_of_score::add_column (Paper_column*p)
+{
+  cols_.push (p);
+}
 
 void
 Line_of_score::do_print() const
 {
   Spanner::do_print();
-}
-
-Interval
-Line_of_score::do_width() const
-{ 
-  return Spanner::do_width();
+  Axis_group_spanner::do_print ();
 }
 
 Link_array<Score_element>
 Line_of_score::get_extra_dependencies () const
 {
-  Link_array<Score_element> r;
+  Link_array<Score_element> r (Axis_group_spanner::get_extra_dependencies ());
   for (int i=0; i < cols_.size (); i++)
     r.push (cols_[i]);
   return r;
 }
 
+void
+Line_of_score::do_substitute_element_pointer (Score_element*o, Score_element*n)
+{
+  if (Paper_column *p = dynamic_cast<Paper_column*>(o))
+    cols_.substitute (p, dynamic_cast<Paper_column*>(n));
+}
 
-
+void
+Line_of_score::output_all ()
+{
+  Interval i(extent(Y_AXIS));
+  if (i.empty_b())
+    warning ("Huh? Empty Line_of_score?");
+  else
+    translate_axis (- i[MAX], Y_AXIS);
+  
+  pscore_l_->outputter_l_->start_line (i.length ());
+  Super_element::output_all ();
+  pscore_l_->outputter_l_->stop_line ();
+}
index 9458b672d19f840847a0ef8a5794e097796084b5..d588febb0553eec610dca9e28ec10a3774e5c6b4 100644 (file)
@@ -327,12 +327,6 @@ Lookup::rule_symbol (Real height, Real width) const
   return m;
 }
 
-Molecule
-Lookup::script (String str) const
-{
-  return afm_find (String ("scripts-") + str);
-}
-
 Molecule
 Lookup::special_time_signature (String s, int n, int d) const
 {
@@ -396,6 +390,8 @@ Molecule
 Lookup::text (String style, String text) const
 {
   Molecule m;
+  if (style.empty_b ())
+    style = "roman";
   
   int font_mag = 1;
   Real font_h = paper_l_->get_var ("font_normal");
@@ -409,6 +405,9 @@ Lookup::text (String style, String text) const
       font_mag = (int)paper_l_->get_var ("magnification_" + style);
     }
 
+  /*
+    UGH.
+   */
   SCM l = gh_eval_str (("(style-to-cmr \"" + style + "\")").ch_C());
   if (l != SCM_BOOL_F)
     {
index 32f3ebc0e0d93c1caf412fe2b12bb397fe1c682f..7ae048437948789e907f8a1865bd9b74a666ee6a 100644 (file)
@@ -7,7 +7,6 @@
 */
 
 #include "lyric-performer.hh"
-#include "text-def.hh"
 #include "musical-request.hh"
 #include "audio-item.hh"
 
index 00b647e6a164656f762d674187f43b7f7d64cb3f..6750347e9d518775ba679002735b8ecf3d9c675f 100644 (file)
@@ -15,7 +15,7 @@
 #include "lookup.hh"
 #include "rest.hh"
 #include "script.hh"
-#include "text-def.hh"
+
 #include "molecule.hh"
 #include "misc.hh"
 
@@ -63,11 +63,8 @@ Multi_measure_rest::do_brew_molecule_p () const
 
   if (measures_i_ > 1)
     {
-      Text_def text;
-      text.text_str_ = to_str (measures_i_);
-      text.style_str_ = "number";
-      text.align_dir_ = CENTER;
-      Molecule s = text.get_molecule (paper_l (), UP);
+      Molecule s ( lookup_l ()->text ("number", to_str (measures_i_)));
+
       s.translate_axis (3.0 * interline_f, Y_AXIS);
       mol_p->add_molecule (s);
     }
index 394ca287b375e26bc3865580b761b2f755cf8fca..86050545ba3fbbf888ba87af6f2711d4d621715f 100644 (file)
@@ -92,7 +92,9 @@ void
 Music_output_def::print () const
 {
 #ifndef NPRINT
+  DOUT << "Translators: \n";
   translator_p_dict_p_->print ();
+  DOUT << "Other definitions.\n";
   scope_p_->print( );
 #endif
 }
index adb284cce09461d3a5c321903dc08af0e342c689..f546bab22cc14050cbc106d3ea00c922c393be77 100644 (file)
@@ -9,30 +9,8 @@
 #include "musical-request.hh"
 #include "misc.hh"
 #include "debug.hh"
-#include "script-def.hh"
-#include "text-def.hh"
-#include "music-list.hh"
-
-
-
-
-void
-Musical_req::do_print () const{}
-void
-Tie_req::do_print () const{}
-
 
-
-
-
-
-
-void
-Musical_span_req::do_print () const
-{
-  Span_req::do_print ();
-}
-            
+#include "music-list.hh"
 
 void
 Span_req::do_print () const
@@ -42,25 +20,6 @@ Span_req::do_print () const
 #endif
 }
 
-
-
-Spacing_req::Spacing_req ()
-{
-  next = 0;
-  distance = 0;
-  strength = 0;
-}
-
-void
-Spacing_req::do_print () const
-{
-#ifndef NPRINT
-  DOUT << "next " << next << "dist " << distance << "strength\n";
-#endif
-}
-
-
-
 Abbreviation_req::Abbreviation_req ()
 {
   type_i_ = 0;
@@ -77,16 +36,6 @@ Abbreviation_req::do_print () const
 
 
 
-void
-Blank_req::do_print () const
-{
-  Spacing_req::do_print ();
-}
-
-Melodic_req::Melodic_req ()
-{
-}
-
 void
 Melodic_req::transpose (Musical_pitch delta)
 {
@@ -117,21 +66,11 @@ Melodic_req::compare (Melodic_req const &m1 , Melodic_req const&m2)
 void
 Melodic_req::do_print () const
 {
-pitch_.print ();
+  pitch_.print ();
 }
 
 
-Tonic_req::Tonic_req ()
-{
-}
 
-void
-Tonic_req::do_print () const
-{
-#ifndef NPRINT
-  Melodic_req::do_print ();
-#endif
-}
 
 int
 Rhythmic_req::compare (Rhythmic_req const &r1, Rhythmic_req const &r2)
@@ -147,9 +86,6 @@ Rhythmic_req::do_equal_b (Request*r) const
   return rh && !compare (*this, *rh);
 }
 
-
-
-
 void
 Rhythmic_req::do_print () const
 {
@@ -211,54 +147,12 @@ Note_req::do_print () const
 #endif
 }
 
-void
-Rest_req::do_print () const
-{
-      Rhythmic_req::do_print ();
-}
-
-void
-Multi_measure_rest_req::do_print () const
-{
-      Rhythmic_req::do_print ();
-}
-
-
-void
-Beam_req::do_print () const
-{
-}
 
 Abbreviation_beam_req::Abbreviation_beam_req ()
 {
   type_i_ = 0;
 }
 
-void
-Abbreviation_beam_req::do_print () const
-{
-}
-
-
-void
-Slur_req::do_print () const
-{
-}
-
-
-
-
-
-Extender_req::Extender_req ()
-{
-}
-
-void
-Extender_req::do_print () const
-{
-}
-
-
 bool
 Span_req::do_equal_b (Request*r) const
 {
@@ -271,66 +165,6 @@ Span_req::Span_req ()
   spantype_ = CENTER;
 }
 
-Script_req::Script_req (Script_req const&s)
-{
-  dir_ = s.dir_;
-  scriptdef_p_ = s.scriptdef_p_ ? s.scriptdef_p_->clone () : 0;
-}
-
-/*
-  don't check dirs?
-
-  (d1.dir_ == d2.dir_)
- */
-bool
-Script_req::do_equal_b (Request*r) const
-{
-  Script_req * s = dynamic_cast <Script_req *> (r);
-  return s &&  scriptdef_p_->equal_b (*s->scriptdef_p_);
-}
-
-Script_req::Script_req ()
-{
-  dir_ = CENTER;
-  scriptdef_p_ = 0;
-}
-
-
-
-
-void
-Script_req::do_print () const
-{
-#ifndef NPRINT
-  DOUT << " dir " << dir_;
-  scriptdef_p_->print ();
-#endif
-}
-
-void
-Musical_script_req::do_print () const
-{
-  Script_req::do_print ();
-}
-
-Script_req::~Script_req ()
-{
-  delete scriptdef_p_;
-}
-
-void
-Skip_req::do_print () const
-{
-#ifndef NPRINT
-  DOUT << "duration: " << length_mom ();
-#endif
-}
-
-void
-Dynamic_req::do_print () const
-{
-  Musical_req::do_print ();
-}
 
 void
 Absolute_dynamic_req::do_print () const
@@ -376,5 +210,15 @@ Span_dynamic_req::do_print () const
 #endif
 }
 
+void
+Text_script_req::do_print () const
+{
+  DOUT << "text" << text_str_
+       << ", style = " << style_str_;
+}
 
-
+void
+Articulation_req::do_print () const
+{
+  DOUT << articulation_str_;
+}
index 8a075e7a249535a76876c7ea35a94614f9fce4df..3cb525d7d1b03875da4ee7513d88beb3935a91e5 100644 (file)
@@ -210,12 +210,13 @@ Paper_score::process ()
     *mlog << elem_p_arr_.size ()  + span_p_arr_.size () << " elements. ";
 
   *mlog << "\nLine ... ";
+  line_l_->break_processing ();
   for (int i=0; i < lines.size (); i++)
     {
       *mlog << '[' << flush;
       
       Line_of_score *line_l = lines[i];
-      line_l->break_processing ();
+
       line_l->post_processing ();
        *mlog << i << flush;
       line_l->output_all ();
index 29ae5715cd845e5de1d712f1f54da7135f4f971a..308c07734d1b784cf41961abbb4df748c5d59c0c 100644 (file)
@@ -227,9 +227,11 @@ Paper_outputter::output_version ()
 }
 
 void
-Paper_outputter::start_line ()
+Paper_outputter::start_line (Real height)
 {
-  SCM scm = gh_list (ly_symbol ("start-line"), SCM_UNDEFINED);
+  SCM scm = gh_list (ly_symbol ("start-line"),
+                    gh_double2scm (height),
+                    SCM_UNDEFINED);
   output_scheme (scm);
 }
 
index 7e53b2ac00ee91b1604d74d4ceab9bfa54cf07d1..2cac7c1fabca13cac7e080a1b3285f618fc63b9d 100644 (file)
@@ -14,7 +14,6 @@
 #include "notename-table.hh"
 #include "scalar.hh"
 #include "translation-property.hh"
-#include "script-def.hh"
 #include "lookup.hh"
 #include "misc.hh"
 #include "my-lily-lexer.hh"
@@ -30,7 +29,7 @@
 #include "command-request.hh"
 #include "musical-request.hh"
 #include "my-lily-parser.hh"
-#include "text-def.hh"
+
 #include "translator-group.hh"
 #include "score.hh"
 #include "music-list.hh"
@@ -96,7 +95,6 @@ Paper_def* current_paper = 0;
     Array<int> *intvec;
     Notename_table *chordmodifiertab;
     Duration *duration;
-    General_script_def * script;
     Identifier *id;
     Music *music;
     Music_list *music_list;
@@ -117,7 +115,6 @@ Paper_def* current_paper = 0;
     Simultaneous_music *chord;
     String *string;
     Tempo_req *tempo;
-    Text_def * textdef;
     Translator* trans;
     char c;
     const char *consstr;
@@ -205,9 +202,7 @@ yylex (YYSTYPE *s,  void * v_l)
 %token <id>    IDENTIFIER
 %token <id>    NOTENAME_TABLE_IDENTIFIER
 %token <id>    MUSIC_IDENTIFIER
-%token <id>    POST_REQUEST_IDENTIFIER
-%token <id>    SCRIPT_IDENTIFIER
-%token <id>    COMMAND_IDENTIFIER
+%token <id>    REQUEST_IDENTIFIER
 %token <id>    REAL_IDENTIFIER
 %token <id>    STRING_IDENTIFIER
 %token <id>    TRANS_IDENTIFIER
@@ -224,6 +219,7 @@ yylex (YYSTYPE *s,  void * v_l)
 %type <outputdef> output_def
 %type <scope>  mudela_header mudela_header_body
 %type <request>        open_request_parens close_request_parens open_request close_request
+%type <request> request_with_dir request_that_take_dir verbose_request
 %type <i>      sub_quotes sup_quotes
 %type <music>  simple_element  request_chord command_element Simple_music  Composite_music 
 %type <music>  Alternative_music Repeated_music
@@ -236,7 +232,7 @@ yylex (YYSTYPE *s,  void * v_l)
 %type <duration> entered_notemode_duration explicit_duration
 %type <intvec> intastint_list int_list
 %type <reqvec>  pre_requests post_requests
-
+%type <request> gen_text_def
 %type <pitch>   explicit_musical_pitch steno_musical_pitch musical_pitch absolute_musical_pitch
 %type <pitch>   steno_tonic_pitch
 %type <notereq>        steno_notepitch
@@ -254,20 +250,19 @@ yylex (YYSTYPE *s,  void * v_l)
 %type <paper>  paper_block paper_def_body
 %type <real>   real_expression real real_with_dimension
 %type <request> abbrev_command_req
-%type <request>        post_request structured_post_request
+%type <request>        post_request 
 %type <request> command_req verbose_command_req
-%type <request>        script_req  dynamic_req extender_req
+%type <request>        extender_req
 %type <string> string
 %type <score>  score_block score_body
 %type <intarr> shape_array
-%type <script> script_definition script_body mudela_script gen_script_def
-%type <textdef> text_def finger
+
 %type <string> script_abbreviation
 %type <trans>  translator_spec_block translator_spec_body
 %type <tempo>  tempo_request
 %type <notenametab> notenames_body notenames_block chordmodifiers_block
 
-%expect 7
+
 
 
 %left '-' '+'
@@ -422,7 +417,7 @@ identifier_init:
        }
 
        | post_request {
-               $$ = new Request_identifier ($1, POST_REQUEST_IDENTIFIER);
+               $$ = new Request_identifier ($1, REQUEST_IDENTIFIER);
        }
        | explicit_duration {
                $$ = new Duration_identifier ($1, DURATION_IDENTIFIER);
@@ -436,10 +431,6 @@ identifier_init:
        | int   {
                $$ = new int_identifier (new int ($1), INT_IDENTIFIER);
        }
-       | script_definition {
-               $$ = new General_script_def_identifier ($1, SCRIPT_IDENTIFIER);
-
-       }
        ;
 
 translator_spec_block:
@@ -569,6 +560,7 @@ paper_block:
        }
        ;
 
+
 optional_dot:
        /* empty */
        | '.'
@@ -716,11 +708,8 @@ Music:
        | Composite_music
        ;
 
-Alternative_music: {
-               Music_list* m = new Music_list;
-               $$ = new Sequential_music (m);
-       }
-       | ALTERNATIVE Simultaneous_music {
+Alternative_music:
+       ALTERNATIVE Simultaneous_music {
                $$ = $2;
        }
        | ALTERNATIVE Sequential_music {
@@ -891,9 +880,6 @@ abbrev_command_req:
        | '|'                           {
                $$ = new Barcheck_req;
        }
-       | COMMAND_IDENTIFIER    {
-               $$ = $1->access_content_Request (true);
-       }
        | '~'   {
                $$ = new Tie_req;
        }
@@ -987,33 +973,73 @@ post_requests:
        {
                $$ = new Link_array<Request>;
        }
-       | post_requests structured_post_request {
+       | post_requests post_request {
                $2->set_spot (THIS->here_input ());
                $$->push ($2);
        }
-       | post_requests close_request   {
-               $$->push ($2);
-       }
        ;
 
-structured_post_request:
-       script_req
-       | post_request
+post_request:
+       verbose_request
+       | request_with_dir
+       | close_request
        ;
 
-post_request:
-       POST_REQUEST_IDENTIFIER {
+
+request_that_take_dir:
+       gen_text_def
+       | verbose_request
+       | script_abbreviation {
+               Identifier*i = THIS->lexer_p_->lookup_identifier ("dash-" + *$1);
+               Articulation_req *a = new Articulation_req;
+               a->articulation_str_ = *i->access_content_String (false);
+               delete $1;
+               $$ = a;
+       }
+       ;
+
+request_with_dir:
+       script_dir request_that_take_dir        {
+               if (G_script_req * gs = dynamic_cast<G_script_req*> ($2))
+                       gs->dir_ = $1;
+               else if ($1)
+                       $2->warning ("Can't specify direction for this request");
+               $$ = $2;
+       }
+       ;
+       
+verbose_request:
+       REQUEST_IDENTIFIER      {
                $$ = (Request*)$1->access_content_Request (true);
+               $$->set_spot (THIS->here_input ());
        }
-       | dynamic_req {
-               $$ = $1;
+       | ABSDYNAMIC '{' STRING '}'     {
+               Absolute_dynamic_req *ad_p = new Absolute_dynamic_req;
+               ad_p ->loudness_str_ = *$3;
+               ad_p->set_spot (THIS->here_input ());
+               delete $3;
+               $$ =ad_p;
+       }
+       | SPANDYNAMIC '{' int int '}' {
+               Span_dynamic_req * sp_p = new Span_dynamic_req;
+               sp_p-> dynamic_dir_  = Direction($3);
+               sp_p->spantype_ = Direction($4);
+               sp_p->set_spot (THIS->here_input ());
+               $$ = sp_p;
        }
        | abbrev_type   {
                Abbreviation_req* a = new Abbreviation_req;
+               a->set_spot (THIS->here_input ());
                a->type_i_ = $1;
                $$ = a;
        }
-
+       | SCRIPT STRING         { 
+               Articulation_req * a = new Articulation_req;
+               a->articulation_str_ = *$2;
+               a->set_spot (THIS->here_input ());
+               $$ = a;
+               delete $2;
+       }
        ;
 
 optional_modality:
@@ -1126,22 +1152,6 @@ extender_req:
        }
        ;
 
-dynamic_req:
-       ABSDYNAMIC '{' STRING '}'       {
-               Absolute_dynamic_req *ad_p = new Absolute_dynamic_req;
-               ad_p ->loudness_str_ = *$3;
-               delete $3;
-               $$ =ad_p;
-       }
-       | SPANDYNAMIC '{' int int '}' {
-               Span_dynamic_req * sp_p = new Span_dynamic_req;
-               sp_p-> dynamic_dir_  = Direction($3);
-               sp_p->spantype_ = Direction($4);
-               $$ = sp_p;
-       }
-       ;
-
-
 close_request:
        close_request_parens {
                $$ = $1;
@@ -1184,60 +1194,16 @@ open_request_parens:
        }
        ;
 
-
-
-script_definition:
-       SCRIPT '{' script_body '}'      { $$ = $3; }
-       ;
-
-script_body:
-       STRING int int int int int              {
-               Script_def *s = new Script_def;
-               s->set_from_input (*$1,$2, $3,$4,$5, $6);
-               $$  = s;
-               delete $1;
-       }
-       ;
-
-script_req:
-       script_dir gen_script_def       {
-               Musical_script_req *m = new Musical_script_req;
-               $$ = m;
-               m->scriptdef_p_ = $2;
-               m->set_spot (THIS->here_input ());
-               if (!m->dir_)
-                 m->dir_  = (Direction)$1;
-       }
-       ;
-
-gen_script_def:
-       text_def        { 
-               $$ = $1;
-               ((Text_def*) $$)->align_dir_ = LEFT; /* UGH */
-       }
-       | mudela_script { 
-               $$ = $1;
-               $$-> set_spot (THIS->here_input ());
-       }
-       | finger {
-               $$ = $1;
-               ((Text_def*)$$)->align_dir_ = RIGHT; /* UGH */
-       }
-       ;
-
-text_def:
+gen_text_def:
        string {
-               Text_def *t  = new Text_def;
+               Text_script_req *t  = new Text_script_req;
                $$ = t;
                t->text_str_ = *$1;
                delete $1;
                $$->set_spot (THIS->here_input ());
        }
-       ;
-
-finger:
-        DIGIT {
-               Text_def* t  = new Text_def;
+       | DIGIT {
+               Text_script_req* t  = new Text_script_req;
                $$ = t;
                t->text_str_ = to_str ($1);
                t->style_str_ = "finger";
@@ -1247,40 +1213,25 @@ finger:
 
 script_abbreviation:
        '^'             {
-               $$ = THIS->lexer_p_
-               ->lookup_identifier ("dash-hat")->access_content_String (true)
-
+               $$ = new String ("hat");
        }
        | '+'           {
-               $$ = THIS->lexer_p_
-               ->lookup_identifier ("dash-plus")->access_content_String (true)
- }
-       | '-'           {
-               $$ = THIS->lexer_p_
-               ->lookup_identifier ("dash-dash")->access_content_String (true)
- }
+               $$ = new String ("plus");
+       }
+       | '-'           {
+               $$ = new String ("dash");
+       }
        | '|'           {
-               $$ = THIS->lexer_p_
-               ->lookup_identifier ("dash-bar")->access_content_String (true)
- }
+               $$ = new String ("bar");
+       }
        | '>'           {
-               $$ = THIS->lexer_p_
-               ->lookup_identifier ("dash-larger")->access_content_String (true)
- }
+               $$ = new String ("larger");
+       }
        | '.'           {
-               $$ = THIS->lexer_p_
-               ->lookup_identifier ("dash-dot")->access_content_String (true);
+               $$ = new String ("dot");
        }
        ;
 
-mudela_script:
-       SCRIPT_IDENTIFIER               { $$ = $1->access_content_General_script_def (true); }
-       | script_definition             { $$ = $1; }
-       | script_abbreviation           {
-               $$ = THIS->lexer_p_->lookup_identifier (*$1)->access_content_General_script_def (true);
-               delete $1;
-       }
-       ;
 
 script_dir:
        '_'     { $$ = DOWN; }
@@ -1421,6 +1372,7 @@ notemode_chord:
                 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
         };
 
+
 chord_additions: 
        {
                $$ = new Array<Musical_pitch>;
@@ -1440,6 +1392,21 @@ chord_notes:
        }
        ;
 
+chord_subtractions: 
+       {
+               $$ = new Array<Musical_pitch>;
+       } 
+       | '^' chord_notes {
+               $$ = $2;
+       }
+       ;
+
+
+/*
+       forevery : X : optional_X sucks. Devise  a solution.
+*/
+
+
 chord_addsub:
        chord_note optional_dot
        | CHORDMODIFIER_PITCH optional_dot
@@ -1484,15 +1451,6 @@ chord_note:
        }
         ;
 
-chord_subtractions: 
-       {
-               $$ = new Array<Musical_pitch>;
-       } 
-       | '^' chord_notes {
-               $$ = $2;
-       }
-       ;
-
 /*
        UTILITIES
  */
index 174737d34fe3f67ecfa6d9af77646a84703eb616..8a3cbdf59724680c5564c48e0c1a5f466a797983 100644 (file)
@@ -144,13 +144,13 @@ Repeat_engraver::do_process_requests ()
     {
       Volta_spanner* v = new Volta_spanner;
       Scalar prop = get_property ("voltaVisibility", 0);
-      v->visible_b_ = prop.to_bool ();
+      if (!prop.to_bool ())
+       v->set_elt_property (transparent_scm_sym, SCM_BOOL_T);
       prop = get_property ("voltaSpannerDuration", 0);
       if ((i == alternative_music_arr_.size () - 1) || prop.length_i ())
         v->last_b_ = true;
-      Text_def* t = new Text_def;
-      t->text_str_ = alternative_str_arr_[i];
-      v->number_p_.set_p (t);
+
+      v->number_str_ = alternative_str_arr_[i];
       volta_p_arr_.push (v);
       announce_element (Score_element_info (v, alternative_music_arr_[i]));
     }
index ec90bcfdb41463571e42675227991db733793e95..152352ac82ae6b9d93a45caf95c12714dc6516a4 100644 (file)
@@ -72,7 +72,7 @@ Rhythmic_column_engraver::acknowledge_element (Score_element_info i)
     return;
   if (Script *s=dynamic_cast<Script *> (item))
     {
-      if (i.req_l_ && dynamic_cast <Musical_req *> (i.req_l_)) 
+      if (i.req_l_)
        {
          script_l_arr_.push (s);
        }
index 986ede9eabc51c64d15b878fc729add948e7d183..992d2eee1d770802fd7a836a9e90a0d759176675 100644 (file)
@@ -134,17 +134,14 @@ Score_element::do_height() const
   return r;
 }
 
-
-/*
-  STANDARD METHS
- */
 void
 Score_element::print() const
 {
 #ifndef NPRINT
   DOUT << classname(this) << "{\n";
   DOUT << "dependencies: " << dependency_size();
+  if (original_l_)
+    DOUT << "Copy ";
   Graphical_element::do_print ();
   do_print();
   
index 12f762e36a86eff1d7bc17b6e4f89916b6bfaf99..5aef40446743e993f5d00fa0ec500c131a7123bb 100644 (file)
@@ -157,7 +157,8 @@ Score_engraver::typeset_all()
                musical_column_l_->add_element(item_p);
            }
        }
-      scoreline_l_->add_element (elem_p);
+      if (!elem_p->dim_cache_[Y_AXIS].parent_l_)
+       scoreline_l_->add_element (elem_p);
     }
   elem_p_arr_.clear();
 }
@@ -185,7 +186,7 @@ Score_engraver::set_columns (Score_column *new_command_l,
   if (command_column_l_ && command_column_l_->linked_b()) 
     {
       pscore_p_->add_column (command_column_l_);
-      scoreline_l_->add_element (command_column_l_);
+      scoreline_l_->add_column (command_column_l_);
     }
   else 
     {
@@ -200,7 +201,7 @@ Score_engraver::set_columns (Score_column *new_command_l,
   if (musical_column_l_ && musical_column_l_->linked_b()) 
     {
       pscore_p_->add_column (musical_column_l_);
-      scoreline_l_->add_element (musical_column_l_);
+      scoreline_l_->add_column (musical_column_l_);      
     }
   else 
     {
index 16eccc8a41acea70a62d33ce9af7de1877b18856..bfbe2f7be5863b2429c14a822bb18b35d8e97afc 100644 (file)
@@ -13,9 +13,6 @@
 #include "stem.hh"
 #include "general-script-def.hh"
 
-
-
-
 void
 Script_column::add_script (Script*s_l)
 {
@@ -119,3 +116,4 @@ Script_column::do_substitute_element_pointer (Score_element*o,Score_element*n)
                                 dynamic_cast <Item *> (n));
     }
 }
+
diff --git a/lily/script-def.cc b/lily/script-def.cc
deleted file mode 100644 (file)
index b2ea20d..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-  script-def.cc -- implement 
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "debug.hh"
-#include "script-def.hh"
-
-#include "paper-def.hh"
-#include "lookup.hh"
-
-Script_def::Script_def()
-{
-  inside_staff_b_ = false;
-  symidx_str_ = "unknown" ;
-  rel_stem_dir_ =CENTER;
-  staff_dir_ = DOWN;
-  invertsym_b_ = 0;
-  priority_i_ =0;
-}
-
-void
-Script_def::set_from_input (String idx,  bool follow, int stem, int staff ,bool invert, int priority_i)
-{
-  inside_staff_b_ = follow;
-  symidx_str_ = idx ;
-  rel_stem_dir_ =Direction(stem);
-  staff_dir_ = Direction(staff);
-  invertsym_b_ = invert;
-  priority_i_ =priority_i;
-}
-
-
-void
-Script_def::do_print() const
-{
-#ifndef NPRINT
-  DOUT << "Script_def{ idx: " << symidx_str_ 
-       << " direction, stem: " << rel_stem_dir_ << " staff : " << staff_dir_ << "}\n";
-#endif
-}
-
-bool
-Script_def::do_equal_b (General_script_def const *g) const 
-{
-  Script_def const * c = dynamic_cast<Script_def const*> (g);
-  return c&& (symidx_str_ == c->symidx_str_ &&
-         rel_stem_dir_ == c->rel_stem_dir_&&
-         staff_dir_ == c->staff_dir_&&
-         invertsym_b_ == c->invertsym_b_);
-}
-
-Direction
-Script_def::staff_dir() const
-{
-  return staff_dir_; 
-}
-
-Direction
-Script_def::rel_stem_dir() const
-{
-  return rel_stem_dir_; 
-}
-
-bool
-Script_def::inside_b() const
-{
-  return inside_staff_b_; 
-}
-
-Molecule
-Script_def::get_molecule (Paper_def *p , Direction d) const
-{
-  String preidx_str ="";
-  if (invertsym_b_)
-    preidx_str = (d < 0)? "d" : "u";
-
-  return p->lookup_l(0)->script (preidx_str + symidx_str_);
-}
-
-
-
-
-int
-Script_def::priority_i() const
-{
-  return priority_i_;
-}
-       
-  
-  
diff --git a/lily/script-engraver.cc b/lily/script-engraver.cc
deleted file mode 100644 (file)
index 247eea7..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
-  script-engraver.cc -- implement Script_engraver
-
-  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "script-engraver.hh"
-#include "script.hh"
-#include "musical-request.hh"
-#include "stem.hh"
-#include "staff-symbol.hh"
-#include "general-script-def.hh"
-#include "text-def.hh"
-
-
-Script_engraver::Script_engraver()
-{
-  do_post_move_processing();
-}
-
-bool
-Script_engraver::do_try_music (Music *r_l)
-{
-  if (Musical_script_req *mr = dynamic_cast <Musical_script_req *> (r_l))
-    {
-      for (int i=0; i < script_req_l_arr_.size(); i++) 
-       {
-         if (script_req_l_arr_[i]->equal_b (mr))
-           return true;
-       }
-      script_req_l_arr_.push (mr);
-      return true;
-    }
-  return false;
-}
-
-void
-Script_engraver::do_process_requests()
-{
-  if (script_p_arr_.size ())
-    return ;
-  
-  for (int i=0; i < script_req_l_arr_.size(); i++)
-    {
-      Script_req* l=script_req_l_arr_[i];
-      Script *p =new Script;
-      p->dir_ = l->dir_;
-      p->specs_p_ = l->scriptdef_p_->clone ();
-      script_p_arr_.push (p);
-      announce_element (Score_element_info (p, l));
-    }
-}
-
-void
-Script_engraver::do_pre_move_processing()
-{
-  for (int i=0; i < script_p_arr_.size(); i++) 
-    {
-      Script*script_p = script_p_arr_[i];
-
-      /*
-       UGH. inside_b () for scripts broken for now.
-       
-      if (!script_p->specs_p_->inside_b())
-       script_p->add_support (s_l);
-      */
-      
-      if (Text_def*td_l = dynamic_cast<Text_def *> (script_p->specs_p_)) // UGH
-       {
-         if (!td_l->style_str_.length_i ())
-           {
-             Scalar style = get_property ("textstyle", 0);
-             if (style.to_bool ())
-               td_l->style_str_= style;
-           }
-
-         // urg, what if this is already set? in-band signaling...
-         Scalar alignment = get_property ("textalignment", 0);
-         if (alignment.isnum_b())
-           {
-             td_l->align_dir_= (Direction)(int)alignment;
-           }
-       }
-      typeset_element (script_p);
-    }
-  script_p_arr_.clear();
-}
-
-void
-Script_engraver::do_post_move_processing()
-{
-  script_req_l_arr_.clear();
-}
-
-
-
-ADD_THIS_TRANSLATOR(Script_engraver);
index 576a9fdb9b90af120233af7b074b818fcad6dc9e..85f3c28e058f26ecbf2800ef7a0357b63596e35e 100644 (file)
@@ -5,7 +5,7 @@
 
   (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
-#include "script-def.hh"
+#include "general-script-def.hh"
 #include "musical-request.hh"
 #include "paper-def.hh"
 #include "script.hh"
index 4d4fb48d0a50696eaa255b42538a6bb9f6a56d79..f81a08a45d9094482597c5cef5d7d5d8aecad9fe 100644 (file)
 bool
 Slur_engraver::do_try_music (Music *req_l)
 {
-  Musical_req *mus_l = dynamic_cast <Musical_req *> (req_l);
-  if (Slur_req *sl = dynamic_cast <Slur_req *> (mus_l))
+  if (Slur_req *sl = dynamic_cast <Slur_req *> (req_l))
     {
-      new_slur_req_l_arr_.push (dynamic_cast <Slur_req *> (mus_l));
+      new_slur_req_l_arr_.push (sl);
       return true;
     }
   return false;
index 6428a80667b7971a48044b9fc297525b3fe12701..d5ac3fff5f4f21456fa788fc4ba45d8191e943ce 100644 (file)
@@ -21,12 +21,9 @@ Spanner::do_print() const
 #ifndef NPRINT
   DOUT << "Between " << classname (spanned_drul_[LEFT])
        << " and " << classname (spanned_drul_[RIGHT]) << '\n';
-  /*  if (broken_into_l_arr_.size())
-    {
-      DOUT << "with broken pieces:\n";
-      for (int i=0; i < broken_into_l_arr_.size (); i++)
-       broken_into_l_arr_[i]->print ();
-       }*/  
+
+  if (broken_b ())
+    DOUT << "Broken in " << to_str (broken_info_.size ()) << " pieces";
 #endif
 }
 
@@ -178,12 +175,6 @@ Spanner::find_broken_piece (Line_of_score*l) const
 
              
              info.broken_spanner_l_ = span_p;
-             /*              if (Axis_group_spanner *ags
-                 = dynamic_cast<Axis_group_spanner*> (span_p))
-               {
-               do something
-               }
-             */
              span_p->handle_broken_dependencies();
 
            }
index c5ee89e9fbe2388ca94618fddb409aa301121bf4..c088a936d6b883c376ad1a12c653974ad23ff322 100644 (file)
 #include "paper-outputter.hh"
 
 
-Super_element::Super_element()
-{
-}
-
-
 /**
     for administration of what was done already
     */
@@ -74,9 +69,7 @@ Super_element::post_processing ()
 void
 Super_element::output_all () 
 {
-  pscore_l_->outputter_l_->start_line ();
   calculate_dependencies (BREWING, BREWED, &Score_element::output_processing);
-  pscore_l_->outputter_l_->stop_line ();
 }
 
 
diff --git a/lily/text-def.cc b/lily/text-def.cc
deleted file mode 100644 (file)
index b259372..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-  text-def.cc -- implement Text_def
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include <ctype.h>
-#include "debug.hh"
-#include "lookup.hh"
-#include "paper-def.hh"
-#include "molecule.hh"
-#include "text-def.hh"
-
-Direction
-Text_def::staff_dir () const
-{
-  if (style_str_ == "finger")
-    return UP;
-  return DOWN;
-}
-
-
-void
-Text_def::do_print() const
-{
-#ifndef NPRINT
-  DOUT << "align " << align_dir_ << " `" << text_str_ << "'";
-#endif
-}
-
-Text_def::Text_def()
-{   
-  align_dir_ = RIGHT;
-  style_str_ = "roman";
-}
-
-bool
-Text_def::do_equal_b (General_script_def const *gdef) const
-{
-  Text_def const *def= dynamic_cast<Text_def const*>(gdef);
-  return def&& align_dir_ == def->align_dir_ && text_str_ == def->text_str_
-       && style_str_ == def->style_str_;
-}
-
-Molecule
-Text_def::get_molecule (Paper_def *p, Direction) const
-{
-  Molecule a= p->lookup_l(0)->text (style_str_, text_str_);
-
-  a.translate_axis (-(align_dir_ + 1)* a.dim_[X_AXIS].center (), X_AXIS);
-  
-  return a;
-}
-
-void
-Text_def::print() const
-{
-  DOUT << "Text `" << text_str_ << "\', style " <<
-       style_str_ << "align " << align_dir_ << '\n';
-}
-
-
-
index 16d5b76027993ba44cca120a517f74c77ade2ed5..e22cb06dea2a976b8407938609949aeb9efb83b5 100644 (file)
 #include "engraver.hh"
 #include "g-staff-side.hh"
 #include "g-text-item.hh"
-#include "text-def.hh"
+#include "musical-request.hh"
 #include "note-head.hh"
 #include "stem.hh"
 #include "staff-symbol.hh"
 
 class Text_engraver : public Engraver
 {
-  Link_array<Script_req> reqs_;
+  Link_array<Text_script_req> reqs_;
   Link_array<G_staff_side_item> positionings_;
   Link_array<G_text_item> texts_;
 public:
@@ -39,11 +39,8 @@ Text_engraver::Text_engraver ()
 bool
 Text_engraver::do_try_music (Music *m)
 {
-  if (Script_req *r = dynamic_cast<Script_req*> (m))
+  if (Text_script_req *r = dynamic_cast<Text_script_req*> (m))
     {
-      Text_def * t = dynamic_cast<Text_def*> (r->scriptdef_p_);
-      if (!t)
-       return false;
       reqs_.push (r);
       return true;
     }
@@ -75,19 +72,25 @@ Text_engraver::do_process_requests ()
 {
   for (int i=0; i < reqs_.size (); i++)
     {
-      Script_req * r = reqs_[i];
-      Text_def * t= dynamic_cast<Text_def*> (r->scriptdef_p_);
+      Text_script_req * r = reqs_[i];
 
       G_text_item *text = new G_text_item;
       G_staff_side_item *ss = new G_staff_side_item;
 
       ss->set_victim (text);
       ss->dir_ = r->dir_;
-      Scalar p (get_property ("textstyle", 0)); // textStyle?
-      if (p.length_i ())
-       text->style_str_ = p;
-      text->text_str_ = t->text_str_;
 
+      text->text_str_ = r->text_str_;
+      
+      if (r->style_str_.empty_b ())
+       {
+         Scalar p (get_property ("textStyle", 0));
+         if (p.length_i ())
+           text->style_str_ = p;
+       }
+      else
+       text->style_str_ = r->style_str_;
+      
       Scalar padding = get_property ("textScriptPadding", 0);
       if (padding.length_i() && padding.isnum_b ())
        {
diff --git a/lily/text-spanner.cc b/lily/text-spanner.cc
deleted file mode 100644 (file)
index 18e9105..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-  text-spanner.cc -- implement Text_spanner
-
-  source file of the GNU LilyPond music typesetter
-
-  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "molecule.hh"
-#include "box.hh"
-#include "text-spanner.hh"
-#include "text-def.hh"
-#include "debug.hh"
-#include "paper-def.hh"
-
-
-
-void
-Text_spanner::set_support (Directional_spanner*d)
-{
-  if (support_span_l_)
-    remove_dependency (support_span_l_);
-  
-  support_span_l_ =d;
-  add_dependency (d);
-}
-
-void
-Text_spanner::do_add_processing ()
-{
-  set_bounds (LEFT, support_span_l_->spanned_drul_[LEFT]);
-  set_bounds (RIGHT, support_span_l_->spanned_drul_[RIGHT]);
-}
-
-Text_spanner::Text_spanner()
-{
-  spec_p_ = 0;
-  support_span_l_ = 0;
-}
-
-void
-Text_spanner::do_print() const
-{
-  spec_p_->print();
-}
-
-void
-Text_spanner::do_post_processing()
-{
-  text_off_ = support_span_l_->center() +
-       Offset (0,support_span_l_->dir_ * paper_l ()->get_realvar(interline_scm_sym)*2.0); // todo
-}
-
-Molecule*
-Text_spanner::do_brew_molecule_p() const
-{
-  Molecule tsym (spec_p_->get_molecule (paper_l (),CENTER));
-  tsym.translate (text_off_);
-
-  Molecule*output = new Molecule;
-  output->add_molecule (tsym);
-  return output;
-}
-
-void
-Text_spanner::do_pre_processing()
-{
-  spanned_drul_ = support_span_l_->spanned_drul_;
-}
-
-Interval
-Text_spanner::height() const
-{
-  return do_brew_molecule_p()->extent ().y ();
-}
-
-void
-Text_spanner::do_substitute_element_pointer (Score_element* o, Score_element*n)
-{
-  if (support_span_l_ == o) 
-       support_span_l_ = (Directional_spanner*) (n?dynamic_cast <Spanner *> (n):0);
-}
-
-
-Text_spanner::~Text_spanner()
-{
-  delete spec_p_;
-}
-
-Text_spanner::Text_spanner (Text_spanner const&s)
-  : Spanner (s)
-{
-  support_span_l_ = s.support_span_l_;
-  spec_p_ = s.spec_p_? s.spec_p_->clone() : 0;
-  text_off_ = s.text_off_;
-}
index 00a6fa28a74ad2f61cdbe37021d6f300099af4b7..fdd75bea770e8d499caf8702d2e2f8678d54a3a4 100644 (file)
@@ -45,11 +45,12 @@ Time_signature_performer::do_try_music (Music* req_l)
   if (time_signature_req_l_)
     return false;
 
-  if (dynamic_cast <Command_req *> (req_l))
-    time_signature_req_l_ = dynamic_cast <Time_signature_change_req *> (req_l);
-
-  if (time_signature_req_l_)
-    return true;
+  if (Time_signature_change_req *t =
+      dynamic_cast <Time_signature_change_req *> (req_l))
+    {
+      time_signature_req_l_ = t;
+      return true;
+    }
 
   return false;
 }
index 73d36eec20d831d7a8c7fcee5d671f8caf701507..ebbbad4a3a64ed79fd32bc288a4cebf4c3269468 100644 (file)
@@ -12,7 +12,7 @@
 #include "tuplet-spanner.hh"
 #include "note-column.hh"
 #include "compressed-music.hh"
-#include "text-def.hh"
+
 #include "beam.hh"
 #include "music-list.hh"
 
@@ -40,10 +40,7 @@ Tuplet_engraver::do_process_requests ()
     {
       Tuplet_spanner* glep = new Tuplet_spanner;
       started_span_p_arr_.push (glep);
-
-      Text_def *t = new Text_def;
-      t->text_str_ = to_str (compressed_music_arr_[i]->den_i_);
-      glep->tdef_p_.set_p  (t);
+      glep->number_str_ = to_str (compressed_music_arr_[i]->den_i_);
       announce_element (Score_element_info (glep, compressed_music_arr_ [i]));
     }
 }
index f9fe68011259633ca7c98c8c62590f2abd58f9e5..14301411077b0d6442382c75481a4723a6cdc9b2 100644 (file)
@@ -18,7 +18,7 @@
 #include "paper-def.hh"
 #include "tuplet-spanner.hh"
 #include "stem.hh"
-#include "text-def.hh"
+
 #include "note-column.hh"
 
 Tuplet_spanner::Tuplet_spanner ()
@@ -26,10 +26,6 @@ Tuplet_spanner::Tuplet_spanner ()
   beam_l_ =0;
   bracket_visibility_b_ = true;
   num_visibility_b_ = true;
-  
-  tdef_p_.set_p(new Text_def);
-  tdef_p_->align_dir_ = CENTER;
-  tdef_p_->style_str_ = "italic";
 }
 
 Molecule*
@@ -39,7 +35,8 @@ Tuplet_spanner::do_brew_molecule_p () const
 
   if (column_arr_.size ()){
     Real ncw = column_arr_.top ()->extent (X_AXIS).length ();
-    Molecule num (tdef_p_->get_molecule (paper_l (), CENTER));
+    Molecule num (lookup_l ()->text ("italic",
+                                    number_str_));
 
     if (beam_l_ && !bracket_visibility_b_)
       {
index 77afc20378567b34349606855f65861e549f790b..431d2aed374546f2bd74ca68db59e3327e7a87d1 100644 (file)
 #include "paper-def.hh"
 #include "volta-spanner.hh"
 #include "stem.hh"
-#include "text-def.hh"
-#include "pointer.tcc"
 
-template class P<Text_def>;            // UGH
+#include "pointer.tcc"
 
 Volta_spanner::Volta_spanner ()
 {
   last_b_ = false;
-  visible_b_ = true;
-  number_p_.set_p (new Text_def);
-  number_p_->align_dir_ = LEFT;
 }
 
 Molecule*
@@ -38,8 +33,6 @@ Volta_spanner::do_brew_molecule_p () const
   if (!column_arr_.size ())
     return mol_p;
 
-  if (!visible_b_)
-    return mol_p;
 
   Real internote_f = paper_l ()->get_realvar (interline_scm_sym)/2.0;
 
@@ -47,7 +40,9 @@ Volta_spanner::do_brew_molecule_p () const
   Real w = extent (X_AXIS).length () - dx;
   Molecule volta (lookup_l ()->volta (w, last_b_));
   Real h = volta.dim_.y ().length ();
-  Molecule num (number_p_->get_molecule (paper_l (), LEFT));
+
+  
+  Molecule num (lookup_l ()->text ("volta", number_str_));
   Real dy = column_arr_.top ()->extent (Y_AXIS) [UP] > 
      column_arr_[0]->extent (Y_AXIS) [UP];
   dy += 2 * h;
@@ -59,10 +54,7 @@ Volta_spanner::do_brew_molecule_p () const
     dy = dy >? note_column_arr_[i]->extent (Y_AXIS).max ();
   dy -= h;
 
-  Text_def two_text;
-  two_text.text_str_ = "2";
-  two_text.style_str_ = number_p_->style_str_;
-  Molecule two (two_text.get_molecule (paper_l (), LEFT));
+  Molecule two (lookup_l ()->text ("number", "2"));
   Real gap = two.dim_.x ().length () / 2;
   Offset off (num.dim_.x ().length () + gap, 
              h / internote_f - gap);
@@ -81,9 +73,6 @@ Volta_spanner::do_add_processing ()
       set_bounds (LEFT, column_arr_[0]);
       set_bounds (RIGHT, column_arr_.top ());  
     }
-
-  // number_p_->style_str_ = "number-1";
-  number_p_->style_str_ = "volta";
 }
   
 Interval
index 8f11a285f697477f0bc1445c813b548a1c355b63..bd34b4587ddd9503b1e9e96db8557fd0c0d92040 100644 (file)
@@ -109,7 +109,8 @@ VoiceContext = \translator {
 
        % ugh.  Order matters here.
        \consists "Text_engraver";
-       \consists "Script_engraver";
+%      \consists "Script_engraver";
+       \consists "G_script_engraver";
        \consists "Rhythmic_column_engraver";
        \consists "Font_size_engraver";
        \consists "Slur_engraver";
index 5a80b52e9ea9b5fc6522599145519bd1386be250..3ff6986bd862680992714cd9706c9ee3d47f7f5c 100644 (file)
@@ -1,68 +1,5 @@
 
-% name = \script {
-% indexstring follow_into_staff same_dir_as_stem above_below_staff symbol_can_beinverted priority }
-%
-
-thumb = \script { "thumb" 0 0 1 0 0 }
-accent = \script { "sforzato"  0 -1 0 0 0 }
-marcato = \script { "marcato" 0 -1 0 1  0 }
-staccatissimo = \script { "staccatissimo" 0  -1 0 1 0 }
-portato= \script { "portato" 0 -1 0 1 0 }
-fermata = \script { "fermata" 0 1 0 1 0 }
-stopped = \script { "stopped" 0 0 1 0 0 }
-staccato = \script { "staccato" 1 -1 0 0 0 }
-tenuto = \script {"tenuto" 1 -1 0 0 0 }
-upbow = \script { "upbow" 0 0 1 0 0 }
-downbow = \script { "downbow" 0 0 1 0 0 }
-lheel = \script { "upedalheel" 0 0 -1  0 0 }
-rheel = \script { "dpedalheel" 0 0 1 0 0 }
-ltoe = \script { "upedaltoe" 0 0 -1 0 0 }
-rtoe = \script { "dpedaltoe" 0 0 1 0 0 }
-turn = \script { "turn" 0 0 1 0 0 }
-open = \script { "open" 0 0 1 0 0 }
-flageolet = \script { "flageolet"  0 0 1 0 0 }
-reverseturn = \script { "reverseturn"   0 0 1 0 0 }
-
-
-% could  we do without this bloat?
-%
-lbheel = \script { "bheel" 0 0 -1  0 0 }
-rbheel = \script { "bheel" 0 0 1 0 0 }
-lbtoe = \script { "btoe" 0 0 -1 0 0 }
-rbtoe = \script { "btoe" 0 0 1 0 0 }
-lfheel = \script { "fheel" 0 0 -1  0 0 }
-rfheel = \script { "fheel" 0 0 1 0 0 }
-lftoe = \script { "ftoe" 0 0 -1 0 0 }
-rftoe = \script { "ftoe" 0 0 1 0 0 }
-
-%
-% left toe:      right heel:
-%
-%                    u     -
-%                    -     u
-%  ---|-----|--   --|x----|x--
-%  ---|-----|--   --|-----|---
-%  --x|----x|--   --|-----|---
-%    ^     -                   
-%    -     ^                   
-%  back  front     back  front
-%
-% 
-% heu, me thought for a moment that order in table_xxx.ly was
-% being translated into priority...
-back = \script { "back" 0 -1 -1  0 0 }
-front = \script { "front" 0 -1 1 0 0 }
-
-trill =\script { "trill" 0 0 1 0 
-       2000   % be above text. 
-}
-
-prall =\script { "prall" 0 0 1 0 0 }
-mordent =\script { "mordent" 0 0 1 0 0 }
-prallprall =\script { "prallprall" 0 0 1 0 0 }
-prallmordent =\script { "prallmordent" 0 0 1 0 0 }
-upprall =\script { "upprall" 0 0 1 0 0 }
-downprall =\script { "downprall" 0 0 1 0 0 }
+\scmfile "script.scm";
 
 "dash-hat" = "marcato"
 "dash-plus" = "stopped"
@@ -70,3 +7,31 @@ downprall =\script { "downprall" 0 0 1 0 0 }
 "dash-bar" = "staccatissimo"
 "dash-larger" = "accent"
 "dash-dot" = "staccato"
+
+
+thumb = \script "thumb"
+accent = \script "accent"
+marcato = \script "marcato"
+staccatissimo = \script "staccatissimo"
+portato = \script "portato"
+fermata = \script "fermata"
+stopped = \script "stopped"
+staccato = \script "staccato"
+tenuto = \script "tenuto"
+upbow = \script "upbow"
+downbow = \script "downbow"
+lheel = \script "lheel"
+rheel = \script "rheel"
+ltoe = \script "ltoe"
+rtoe = \script "rtoe"
+turn = \script "turn"
+open = \script "open"
+flageolet = \script "flageolet"
+reverseturn = \script "reverseturn"
+trill = \script "trill"
+prall = \script "prall"
+mordent = \script "mordent"
+prallprall = \script "prallprall"
+prallmordent = \script "prallmordent"
+upprall = \script "upprall"
+downprall = \script "downprall"
index 922e0fa03ae02ee035a68bd699e7ea07375a7661..018069ed0c6b0ad3881d43b380856cd334415f0e 100644 (file)
@@ -244,7 +244,7 @@ fet_beginchar("Whole diamondhead", "0diamond", "wholediamondhead")
        err_y_a:=0; % no slant
        tilt:=0;
        superness:=0.495;
-       ai_a:=0.400;
+       ai_a:=0.350;
        % ai_bi:=1.23;
        ai_bi:=1.30; % jcn
        % err_y_ai:=0.0938;
index a07a1fcd7e22ac573e6fd52da99467c7d84c77de..9c45773df07d055bc180b908ecade4a3e45a7b2b 100644 (file)
     ("volta" . "feta-nummer"))
 )
 
+(define script-alist '())
+(define (articulation-to-scriptdef a)
+  (assoc a script-alist)
+  )
 
 ;; Map style names to TeX font names.  Return false if 
 ;; no font name found. 
                  (set! font-cmd (cached-fontname font-count))
                  (set! font-alist (acons font-name font-cmd font-alist))
                  (set! font-count (+ 1 font-count))
+                 (if (equal? font-name "")
+                     (error "Empty fontname -- SELECT-FONT"))
                  (string-append "\\font" font-cmd "=" font-name font-cmd))
                (cdr font-cmd)))
          ""                            ;no switch needed
     (embedded-ps ((ps-scm 'bezier-sandwich) l)))
 
 
-  (define (start-line)
+  (define (start-line ht)
     (begin
       (clear-fontcache)
-      "\\hbox{%\n")
+      (string-append"\\vbox to " (number->dim ht) "{\\hbox{%\n"))
     )
+  (define (stop-line) 
+    "}\\vss}\\interscoreline")
 
   (define (filledbox breapth width depth height) 
     (string-append 
      "depth " (number->dim depth)
      "height " (number->dim height) " "))
 
-  (define (stop-line) 
-    "}\\interscoreline")
 
 
   (define (text s)
        (else (error "unknown tag -- PS-SCM " action-name))
        )
   )
-  
 
-;
+                                       ;
 ; Russ McManus, <mcmanus@IDT.NET>  
 ; 
 ; I use the following, which should definitely be provided somewhere
diff --git a/scm/script.scm b/scm/script.scm
new file mode 100644 (file)
index 0000000..17483b9
--- /dev/null
@@ -0,0 +1,38 @@
+;; (name . '((downindexstring upindexstring)
+;;           follow-into-staff :: bool
+;;           dir-relative-to-stem :: int
+;;           force-dir :: int
+;;           priority :: int
+
+;;TODO?      extra padding :: Real (given in staff spaces)
+
+(set! script-alist
+      (append 
+      '(("thumb" . (("thumb"  . "thumb") #f 0 1 0))
+       ("accent" . (("sforzato" .  "sforzato") #f -1 0 0))
+       ("marcato" . (("dmarcato" . "umarcato") #f -1 0  0))
+       ("staccatissimo" . (("dstaccatissimo" . "ustaccatissimo") #f  -1 0 0 0))
+       ("portato" . (("dportato" . "uportato") #f -1 0 0))
+       ("fermata" . (("dfermata" . "ufermata") #f 1 0 0))
+       ("stopped" . (("stopped" . "stopped") #f 0 1 0))
+       ("staccato" . (("staccato" . "staccato") #t -1 0 0))
+       ("tenuto" . (("tenuto" "tenuto") 1 -1 0 0))
+       ("upbow" . (("upbow" . "upbow") #f 0 1 0))
+       ("downbow" . (("downbow" . "downbow") #f 0 1 0))
+       ("lheel" . (("upedalheel" . "upedalheel") #f 0 -1  0))
+       ("rheel" . (("dpedalheel" . "dpedalheel") #f 0 1 0))
+       ("ltoe" . (("upedaltoe" . "upedaltoe") #f 0 -1 0))
+       ("rtoe" . (("dpedaltoe" . "dpedaltoe") #f 0 1 0))
+       ("turn" . (("turn" . "turn") #f 0 1 0))
+       ("open" . (("open" . "open") #f 0 1 0))
+       ("flageolet" . (("flageolet" . "flageolet")  0 0 1 0))
+       ("reverseturn" . (("reverseturn" . "reverseturn")   0 0 1 0))
+       ("trill" . (("trill" . "trill") #f 0 1 2000))
+       ("prall" . (("prall" . "prall") #f 0 1 0))
+       ("mordent" . (("mordent" . "mordent") #f 0 1 0))
+       ("prallprall" . (("prallprall" . "prallprall") #f 0 1 0))
+       ("prallmordent" . (("prallmordent" . "prallmordent") #f 0 1 0))
+       ("upprall" . (("upprall" . "upprall") #f 0 1 0))
+       ("downprall" . (("downprall" . "downprall") #f 0 1 0)))
+      script-alist)
+      )