]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.15
authorfred <fred>
Sun, 24 Mar 2002 19:58:01 +0000 (19:58 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:58:01 +0000 (19:58 +0000)
TODO
lily/atom.cc
lily/crescendo.cc
lily/dynamic-grav.cc
lily/include/atom.hh [new file with mode: 0644]
lily/include/lookup.hh

diff --git a/TODO b/TODO
index 47cd313b8122253b06a3049a31e143f45e4f90a0..15869f6f39236b8e5b7f70a9cede2114da3f5d3a 100644 (file)
--- a/TODO
+++ b/TODO
@@ -6,8 +6,17 @@ done, or is an idea that I want to think about
 Most of the items are marked in the code as well, with full explanation. 
 grep for TODO and ugh/ugr
 
+       - naming Mozarella, Madeira, Muella, Fontaigna?
+
        - bf: abbrevs over whole note
 
+       - scoping for properties
+
+       { \multi 2  < { \stemup .. } { \stemdown .. } >
+               c2 }
+       
+       this modifies \stem for the c2
+
        * use properties for:
        - Text_style
        - default_octave
@@ -21,9 +30,9 @@ grep for TODO and ugh/ugr
        - cadenza mode? 
        - MIDI instrument
        - staff title
-       
+
        * check out egcs
-       
+
        * give Items/Spanners access to unbroken originals      
 
 3RD PARTY BUGS:
@@ -102,8 +111,8 @@ languages:
 
        \score { < 
                \melodic \type Staff { c'4 g'4 }
-               \lyric {   \id "Lyric" ""; hello4 bye4 < a chord > }
-               \lyric {   \id "Lyric" ""; bye4 hello4 }
+               \lyric { \id "Lyric" ""; hello4 bye4 < a chord > }
+               \lyric { \id "Lyric" ""; bye4 hello4 }
                \melodic { \id "Staff" ""; c'4 g'4 }
        > }
 
@@ -120,7 +129,7 @@ languages:
        (which is at Voice_gravs level)
        - make encapsulated spacing problems.
 
-       * On-demand loading of simple-engravers
+       * On-demand loading of simple-engravers?
 
        * accidentals per Voice_group
 
@@ -260,8 +269,6 @@ SMALLISH PROJECTS
 
        * A range for context errors (eg. mark both { and }. )
 
-       * merge Atom and Symbol
-
        * lyric in staff  (sharpsharp in staff, text below)
 
        * write Dynamic_line (to group dynamics horizontally)
index 00660aac555a6751a9918ae6299a23c231794a73..0f1f2052891710a10d25883ab588aa3e53a12580 100644 (file)
@@ -5,7 +5,7 @@
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
-#include "symbol.hh"
+#include "atom.hh"
 #include "tex.hh"
 #include "interval.hh"
 #include "dimen.hh"
@@ -17,28 +17,43 @@ void
 Atom::print() const
 {
 #ifndef NPRINT
-  DOUT << "texstring: " <<sym_.tex<<"\n";    
+  DOUT << "texstring: " <<tex_<<"\n";    
 #endif
 }
 
 Box
 Atom::extent() const
 {
-  Box b (sym_.dim);
+  Box b (dim_);
   b.translate (off_);
   return b;
 }
 
-Atom::Atom (Symbol s)
+
+Atom::Atom()
+  : dim_ (Interval (0,0),Interval (0,0))
+{
+  tex_ = "\\unknown";
+}
+
+Atom::Atom (String s, Box b)
+  :  dim_ (b)
 {
-  sym_=s;
+  tex_ = s;
 }
 
 
+String
+Atom::str() const 
+{
+  return "Atom (\'"+tex_+"\', (" + dim_.x().str () + ", " 
+    + dim_.y ().str () + "))";
+}
+
 String
 Atom::TeX_string() const
 {
-  String tex_str = sym_.tex;
+  String tex_str = tex_;
   Offset off = off_;
 
   /* infinity checks. */
index 3fe1a4114c00c78e77e375ca0195bf2d3c02ba55..1bd91d0f0cde3b4cdf9c856f65041cc9afbb076c 100644 (file)
@@ -24,12 +24,12 @@ Crescendo::Crescendo()
 Interval
 Crescendo::symbol_height() const
 {
-  return get_symbol().dim[Y_AXIS];
+  return get_symbol().dim_[Y_AXIS];
 }
 
 static Real absdyn_dim = 10 PT;        // ugh
 
-Symbol
+Atom
 Crescendo::get_symbol() const
 {    
   Real w_dim = width().length ();
@@ -48,7 +48,7 @@ Crescendo::get_symbol() const
       w_dim = 0;
     }
 
-  return Symbol (paper()->lookup_l ()->hairpin (w_dim, grow_dir_ < 0));
+  return Atom (paper()->lookup_l ()->hairpin (w_dim, grow_dir_ < 0));
 }
 
 Molecule*
@@ -60,7 +60,7 @@ Crescendo::brew_molecule_p() const
     x_off_dim += absdyn_dim;
   
   m_p = new Molecule;
-  Symbol s (get_symbol());
+  Atom s (get_symbol());
   m_p->add (Atom (s));
   m_p->translate (Offset (x_off_dim, pos_i_ * paper()->internote_f ()));
   return m_p;
index 241737cf329b812e22ffc869331321b7592688a7..bd875bd8396beb80b154f21031e571b3c71155fc 100644 (file)
@@ -51,10 +51,8 @@ Dynamic_engraver::do_process_requests()
        {
          Text_def * td_p = new Text_def;
          td_p->align_i_ = 0;
-         String loud =Dynamic_req::loudness_str (
-                                                 dreq_l->absdynamic()->loudness_);
-           
-         td_p->text_str_ = paper()->lookup_l ()->dynamic (loud).tex;
+         String loud = dreq_l->absdynamic()->loudness_str ();      
+         td_p->text_str_ = paper()->lookup_l ()->dynamic (loud).tex_;
          td_p->style_str_ = "dynamic";
 
          assert (!dynamic_p_) ; // TODO
diff --git a/lily/include/atom.hh b/lily/include/atom.hh
new file mode 100644 (file)
index 0000000..d25942c
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+  atom.hh -- declare Atom
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#ifndef ATOM_HH
+#define ATOM_HH
+
+#include "string.hh"
+#include "boxes.hh"
+#include "lily-proto.hh"
+
+
+/// a symbol which can be translated, and freely copied
+struct Atom {
+  String tex_;
+  Box dim_;
+  Offset off_;
+
+  String str() const;          // for printing.
+  Atom (String, Box);
+    Atom ();
+  void translate (Offset o) {
+    off_ += o;
+  }
+  void translate (Real r,Axis a){
+    off_[a] += r;
+  }
+  /// how big is #this#?
+  Box extent() const;
+  void print() const;
+  String TeX_string() const;
+};
+#endif
index 638e8c3bdffce990e67562dee83c55844869a4f3..f4696f9faae94e368fdce95d331c5b3bbd6c3328 100644 (file)
@@ -9,12 +9,13 @@
 #ifndef LOOKUPSYMS_HH
 #define LOOKUPSYMS_HH
 
-#include "symbol.hh"
+#include "atom.hh"
 #include "fproto.hh"
 #include "scalar.hh"
 #include "direction.hh"
 
-/// intuitive interface to symbol table
+/** handy interface to symbol table
+ */
 struct Lookup {
     Paper_def * paper_l_;
     Symtables *symtables_;
@@ -23,40 +24,40 @@ struct Lookup {
     void add (String, Symtable*);
     void print() const;
 
-    Symbol linestaff (int n, Real w) const;
-    Symbol fill (Box b) const;
-    Symbol beam_element (int,int,Real=0) const;
+    Atom linestaff (int n, Real w) const;
+    Atom fill (Box b) const;
+    Atom beam_element (int,int,Real=0) const;
 
     /// round slope to closest TeXslope
-    Symbol beam (Real&,Real) const;
+    Atom beam (Real&,Real) const;
 
     /**
       pos == 3 : 3 lines above staff (extending below note)
 
       pos == -3: below staff
       */
-    Symbol streepjes (int pos) const;
+    Atom streepjes (int pos) const;
 
-    Symbol vbrace (Real &dy) const;
-    Symbol meter (Array<Scalar>) const;
-    Symbol stem (Real y1_pos, Real y2_pos) const;
-    Symbol rule_symbol (Real height, Real width) const;
-    Symbol accidental (int) const;
-    Symbol ball (int) const;
-    Symbol flag (int, Direction) const;
-    Symbol rest (int, bool outside) const;
-    Symbol clef (String) const;
-    Symbol bar (String, Real height) const;
+    Atom vbrace (Real &dy) const;
+    Atom meter (Array<Scalar>) const;
+    Atom stem (Real y1_pos, Real y2_pos) const;
+    Atom rule_symbol (Real height, Real width) const;
+    Atom accidental (int) const;
+    Atom ball (int) const;
+    Atom flag (int, Direction) const;
+    Atom rest (int, bool outside) const;
+    Atom clef (String) const;
+    Atom bar (String, Real height) const;
     
-    Symbol dots (int) const;
-    Symbol slur (int dy, Real &dx, Direction dir) const;
-    Symbol half_slur (int dy, Real &dx, Direction dir, int xpart) const;
-    Symbol half_slur_middlepart (Real &dx, Direction dir) const;
-    Symbol big_slur (int dy, Real &dx, Direction dir) const;
-    Symbol text (String style, String text, int align = 1) const;
-    Symbol script (String idx) const;
-    Symbol hairpin (Real & width, bool decresc) const;
-    Symbol dynamic (String) const;
+    Atom dots (int) const;
+    Atom slur (int dy, Real &dx, Direction dir) const;
+    Atom half_slur (int dy, Real &dx, Direction dir, int xpart) const;
+    Atom half_slur_middlepart (Real &dx, Direction dir) const;
+    Atom big_slur (int dy, Real &dx, Direction dir) const;
+    Atom text (String style, String text, int align = 1) const;
+    Atom script (String idx) const;
+    Atom hairpin (Real & width, bool decresc) const;
+    Atom dynamic (String) const;
     Lookup();
     Lookup (Lookup const &);
     ~Lookup();