]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.0.1
authorfred <fred>
Sun, 24 Mar 2002 20:12:16 +0000 (20:12 +0000)
committerfred <fred>
Sun, 24 Mar 2002 20:12:16 +0000 (20:12 +0000)
19 files changed:
flower/vector.cc
lily/direction.cc
lily/include/afm-reader.hh [new file with mode: 0644]
lily/include/afm.hh [new file with mode: 0644]
lily/include/file-results.hh
lily/include/linear-programming.hh
lily/include/music-wrapper-iterator.hh
lily/include/music-wrapper.hh
lily/include/musical-pitch.hh
lily/include/relative-music-iterator.hh
lily/include/relative-music.hh
lily/include/rod.hh
lily/include/scope.hh
lily/linear-programming.cc
lily/music-wrapper-iterator.cc
lily/music-wrapper.cc
lily/musical-pitch.cc
lily/relative-octave-music.cc
lily/scope.cc

index fafa47a97e7f111cff3778a38be149984da4fcdb..e4eb654d6904d98059153bea38fafa1655d9d580 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the Flower Library
   
-  (c) 1996-98 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
+  (c) 1996-98 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
index 802418fce5ef7371d596ffc953d63e3e606499a8..1c2481953f20e1cca6cde3c4420b191b6f77f660 100644 (file)
@@ -4,7 +4,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
+  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
diff --git a/lily/include/afm-reader.hh b/lily/include/afm-reader.hh
new file mode 100644 (file)
index 0000000..64faa2a
--- /dev/null
@@ -0,0 +1,22 @@
+
+/*   
+  afm-reader.hh -- declare 
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#ifndef AFM_READER_HH
+#define AFM_READER_HH
+
+class Adobe_font_metric_file
+{
+  Adobe_font_metric_file
+  
+};
+
+
+#endif /* AFM_READER_HH */
+
diff --git a/lily/include/afm.hh b/lily/include/afm.hh
new file mode 100644 (file)
index 0000000..8a932d0
--- /dev/null
@@ -0,0 +1,56 @@
+/*   
+  afm.hh -- declare Adobe_font_metric
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#ifndef AFM_HH
+#define AFM_HH
+
+#include "string.hh"
+#include "box.hh"
+#include "array.hh"
+
+struct Adobe_font_char_metric {
+  int C_;
+  Real WX_;
+  String N_;
+  Box B_;
+  Box &bbox();
+  String &name();
+  Real &width();
+  int  &code ();
+  
+  String str () const;
+  Adobe_font_char_metric ();
+};
+
+struct Adobe_font_metric {
+  String  FontName_;
+  String FullName_;
+  String FamilyName_;
+  String Weight_;
+  Real ItalicAngle_;
+  bool IsFixedPitch_;
+  Box FontBBox_;
+  Real UnderlinePosition_;
+  Real UnderlineThickness_;
+  String Version_;
+  String Notice_;
+  String EncodingScheme_;
+  Array<Adobe_font_char_metric> char_metrics_;
+
+  Adobe_font_char_metric find_char (String name) const;
+  String str () const;
+  Adobe_font_metric ();
+};
+
+Adobe_font_metric read_afm (String fn);
+
+
+
+#endif /* AFM_HH */
+
index 3d6df5e9d6884c9d6bc663fd8da8d33a5da76437..f4cf779c174e6124ec2731782b903c0dd79899d8 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
+  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
@@ -12,7 +12,7 @@
 #include "fproto.hh"
 
 void do_one_file (String init_str, String file_str);
-
+extern Header *header_global_p;
 extern Array<String> target_str_global_array;
 extern Array<String> inclusion_global_array;
 extern Link_array<Score> score_global_array;
index 08eefad8230e3f17ac6b387a694bda05e00b83ff..c0648e8b26732320cee2ae416239d3d808af8c37 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
+  (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
index cd5ad0a9866175e7af43baf7ee8258e3ea744d1c..4437d461ed209f3696f3aeef55297db5687ce01a 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
+  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
index 989fb5fd0c4186b5f2ef7d3a9d9e67bd53cc556c..cdecc0b5bafdaad4ddb24354c6da80ef46a0b6fe 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
+  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
index 643cf046784f3762435b29a1d01f3189fda8acfe..ed3e8ed015bf89904c9723a602d5d93efb1c9e12 100644 (file)
@@ -3,27 +3,32 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
+  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
 #ifndef MUSICAL_PITCH_HH
 #define MUSICAL_PITCH_HH
+
 #include "lily-proto.hh"
+#include "input.hh"
 
 /** The pitch as it figures in diatonal western music (12 semitones in
    an octave).
 
    It is not Music because, it has to duration associated
 */
-struct Musical_pitch {
+struct Musical_pitch : public Input
+{
+  Musical_pitch ();
+
   /// 0 is c, 6 is b
   int notename_i_;
   /// 0 is central c
   int octave_i_;
-
-    /// 0 natural, 1 sharp, etc
+  /// 0 natural, 1 sharp, etc
   int accidental_i_;
+
   void init () ;
   Musical_pitch to_relative_octave (Musical_pitch);
   void transpose (Musical_pitch);
@@ -32,7 +37,6 @@ struct Musical_pitch {
   int steps() const;
   /// return pitch from central c (in halfnotes)
   int semitone_pitch() const; 
-  Musical_pitch ();
   void up_to (int);
   void down_to (int);
   String str () const;
index 0971a62d2dc6d6a47daeacfbed7ba0ff3d887273..c792445996a31f568c3dcb815dff479c8fcbabec 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
+  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
index dd1639858aa2811e8f0d4755c61ecd4c62f763fb..6137260d687143883553d253bf495e391e0e6cd0 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
+  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
index c71b6b3484ebc52a8147622ed2b1669fd46df37c..81ea0d97b339a244abd2cf4e3181db971f9c860e 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
+  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
index 799e480ac074a24313157de265af9f72fc1478a2..f9980f2db87c0174c2286d23be252b577efbbf69 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
+  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
index eed55a9b3726cf61fbb205a394972d046ac1a9b3..6ccc0b31e40faf7a7074c583fd7a4c8cceefa0da 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
+  (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
index 1160611e7044f71d2c3b66beb9b13cd2a4d45380..13b2a90c31dacebe3749b245ecba110ff80dbd9b 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
+  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
index 2e241d5800ea08f6b67aac7ed7e306843ca13241..72971abf50c40efc4bece48003a0e46c1ff768b5 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
+  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
index 89da2e12d914cd1d5cdbbe5bc88e0adbced08a83..e7ffbd7014b1beeb45ec034c93da3bf76ae21274 100644 (file)
@@ -3,11 +3,12 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
+  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 #include "musical-pitch.hh"
 #include "debug.hh"
+#include "main.hh"
 
 Musical_pitch::Musical_pitch ()
 {
@@ -26,7 +27,7 @@ void
 Musical_pitch::print () const
 {
 #ifndef NPRINT
-  DOUT << str();
+  DOUT << str ();
 #endif
 }
 
@@ -84,24 +85,32 @@ Musical_pitch::transpose (Musical_pitch delta)
 }
 
 
+#if 0
+// nice test for internationalisation strings
 char const *accname[] = {"double flat", "flat", "natural",
                         "sharp" , "double sharp"};
+#else
+char const *accname[] = {"eses", "es", "", "is" , "isis"};
+#endif
 
 String
 Musical_pitch::str () const
 {
   int n = (notename_i_ + 2) % 7;
-  String s (char(n + 'a'));
+  String s = to_str (char(n + 'a'));
   if (accidental_i_)
-    s +=   " " + String (accname[accidental_i_ + 2]);
+    s += String (accname[accidental_i_ + 2]);
 
   if (octave_i_)
-    s  += String ((octave_i_> 0)? "^": "_") + String(octave_i_);
-  
+    s  += String ((octave_i_> 0)? "^": "_") + to_str (octave_i_);
 
   return s;
 }
 
+/*
+  change me to relative, counting from last pitch p
+  return copy of resulting pitch
+ */
 Musical_pitch
 Musical_pitch::to_relative_octave (Musical_pitch p)
 {
@@ -112,24 +121,37 @@ Musical_pitch::to_relative_octave (Musical_pitch p)
   up_pitch.accidental_i_ = accidental_i_;
   down_pitch.accidental_i_ = accidental_i_;
   
+  Musical_pitch n = *this;
   up_pitch.up_to (notename_i_);
   down_pitch.down_to (notename_i_);
+
   int h = p.steps ();
   if (abs (up_pitch.steps () - h) < abs (down_pitch.steps () - h))
-    {
-      *this =  up_pitch;
-      /* this sux imnsho
-      if (oct_mod > 0)         // ugh
-      oct_mod --;*/
-    }
+    n = up_pitch;
   else
+    n = down_pitch;
+  
+  if (find_quarts_global_b)
     {
-      *this = down_pitch;
-      /*      if (oct_mod < 0)
-             oct_mod ++;*/
+      int d = this->semitone_pitch () - n.semitone_pitch ();
+      if (d)
+       {
+         int i = 1 + (abs (d) - 1) / 12;
+         String quote_str = d < 0 ? to_str (',', i) : to_str ('\'', i);
+         Musical_pitch w = *this;
+         w.octave_i_ = 0;
+         String name_str = w.str ();
+         name_str + quote_str;
+         w.warning (_f ("Interval greater than quart, relative: %s", 
+           name_str + quote_str));
+         // don't actually do any relative stuff
+         n = *this;
+       }
     }
-  
-  octave_i_ += oct_mod;
+  else
+    n.octave_i_ += oct_mod;
+
+  *this = n;
   return *this;
 }
 
@@ -153,86 +175,3 @@ Musical_pitch::down_to (int notename)
   notename_i_ = notename;
 }
 
-#if 0
-
-Musical_pitch
-My_lily_parser::get_melodic_req (Musical_pitch p, int quotes)
-{
-  if (relative_octave_mode_b_)
-    {
-      set_nearest (melodic);
-      int d = melodic->pitch () - last_melodic_->pitch ();
-      int shift = 0;
-      if (quotes && (sign (d) == sign (quotes)))
-       shift -= sign (quotes);
-      if (!quotes && (abs (d) == 6))
-       {
-         String str = _("Octave ambiguity; assuming ");
-         /*
-           [TODO]
-           figure this out.
-
-           If the distance is exactly*) half an octave, there is 
-           no nearest pitch.  In that case, we'll try to guess what 
-           composer/ typist meant.
-           Firstly, we'll do this by comparing the 'notename distance':
-               
-           f b'   % name-distance: f g a b: 3
-
-           is surely a shorter notename distance than
-
-           f 'b  % name-distance: b c d e f: 4
-
-           (should we give a warning at all, or can we safely assume
-           this is a positive interval up?)
-
-           *) It is conceivable that, musically speaking, the interval
-           with the greater pitch-distance is thought to be smaller?
-
-         */
-
-         int name_delta = melodic->notename_i_ - last_melodic_->notename_i_;
-         int name_near = abs (name_delta) % 7;
-         int name_wrap = (7 - abs (name_delta)) % 7;
-         if (name_near != name_wrap)
-           shift = name_near < name_wrap ? sign (name_delta) : -sign (name_delta);
-         else if (sign (last_melodic_->accidental_i_) 
-                  != sign (melodic->accidental_i_))
-           shift = last_melodic_->accidental_i_ - melodic->accidental_i_;
-         else
-           shift = -1;
-         String name_str = notename_str (melodic);
-         str += shift > 0 ? name_str + "'" : "'" + name_str;
-         if (sign (d) == sign (shift))
-           shift = 0;
-         melodic->warning (str);
-       }
-      melodic->octave_i_ += quotes + shift;
-    }
-  else
-    {
-      Melodic_req nearest (*melodic);
-      set_nearest (&nearest);
-      melodic->octave_i_ += quotes;
-
-      if (find_quarts_global_b)
-       {
-         int e = melodic->pitch () - nearest.pitch ();
-         if (e)
-           {
-             int d = melodic->pitch () - last_melodic_->pitch ();
-             String str = _("Interval greater than quart");
-             int n = 1 + (abs (d) - 1) / 12;
-             String quote_str ('\'', n);
-             str += _(", relative: ");
-             String name_str = notename_str (melodic);
-             str += d < 0 ? quote_str + name_str : name_str + quote_str;
-             melodic->warning (str);
-           }
-       }
-    }
-  delete last_melodic_;
-  last_melodic_ = melodic->clone ()->musical ()->melodic ();
-  return melodic;
-}
-#endif
index 0b80d49c12c97f92011b7dbe5cbeae8d69d49559..db24b85fc0d12ca57025970b346d675d8c40db20 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
+  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
index 52a185ee911b90f05a18f72dedd102b94e3b7c90..2e20a1b38d3530f401974f38392354da5d3e91e5 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
+  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
@@ -20,7 +20,7 @@ Scope::print () const
     {
       if (ai.val()->init_b_ == init_b)
        {
-         DOUT << ai.key() << '=';
+         DOUT << ai.key() << "=";
          ai.val()->print ();
        }
     }
@@ -30,8 +30,8 @@ Scope::~Scope ()
 {
   for (Assoc_iter<String,Identifier*>   ai (*this); ai.ok(); ai++)
     {
-      DOUT << "deleting: " << ai.key()<<'\n';
-      delete ai.val();
+      DOUT << "deleting: " << ai.key() << '\n';
+      delete ai.val ();
     }
 }