]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.0.1
authorfred <fred>
Sun, 24 Mar 2002 20:12:13 +0000 (20:12 +0000)
committerfred <fred>
Sun, 24 Mar 2002 20:12:13 +0000 (20:12 +0000)
Documentation/BLURB.in [new file with mode: 0644]
flower/file-path.cc
flower/include/text-db.hh
flower/include/text-stream.hh
flower/text-db.cc
flower/text-stream.cc
input/example-2.fly [new file with mode: 0644]
input/example-3.ly [new file with mode: 0644]

diff --git a/Documentation/BLURB.in b/Documentation/BLURB.in
new file mode 100644 (file)
index 0000000..68ca4dc
--- /dev/null
@@ -0,0 +1,6 @@
+LilyPond is the GNU Project music typesetter.  This program can print
+beautiful sheet music from a music definition file.  It can also play
+mechanical performances to a MIDI file.  Features include multiple
+staffs, meters, clefs, keys, lyrics, versatile input language, cadenzas,
+beams, slurs, triplets, formatting scores, part extraction.  It includes
+a nice font of musical symbols.
index e6f9c4cff7b565a722f94b20d350c6e535ef8599..3b76d4b1dd927aa5fa2aba58a87664249fad2b7e 100644 (file)
@@ -74,20 +74,23 @@ File_path::parse_path (String p)
 /** find a file.
   It will search in the current dir, in the construction-arg, and
   in any other added path, in this order.
+
+  @return
+  The full path if found, or empty string if not found
   */
 String
 File_path::find (String nm) const
 {
-  fdebug << _("looking for ") << nm << ": ";
+  fdebug << "looking for" << nm << ": ";
   if (!nm.length_i() || (nm == "-") )
     return nm;
   for (int i=0; i < size(); i++)
     {
       String path  = elem(i);
-      String sep (DIRSEP);
+      String sep = to_str (DIRSEP);
       String right(path.right_str (1));
       if (path.length_i () && right != sep)
-       path += DIRSEP;
+       path += to_str (DIRSEP);
 
       path += nm;
 
@@ -95,12 +98,12 @@ File_path::find (String nm) const
       FILE *f = fopen (path.ch_C(), "r"); // ugh!
       if (f)
        {
-         fdebug << _("found\n");
+         fdebug << "found\n";
          fclose (f);
          return path;
        }
     }
-  fdebug << "\n";
+  fdebug << '\n';
   return "";
 }
 
index ab3e9c82b515ef24250ce250a73c2278fb83dd87..6e90e38c47ff3b3fb5186a96ef45a406ad3886bb 100644 (file)
@@ -40,7 +40,7 @@ public:
 
     Text_db (String fn):Data_file (fn) { }
     Data_file::error;
-    bool eof();
+    bool eof_b ();
 
     /// get next line.
     Text_record operator++(int) {
@@ -48,7 +48,7 @@ public:
     }
     /// are we done yet?
     operator bool() {
-       return !eof();
+       return !eof_b ();
     }
 };
 
index 4d369fdbbb8d2c81a0a2ea50cb610207313f7e2f..3bebb08505d844b04acb0f1ed8575cfece910fa1 100644 (file)
@@ -5,7 +5,7 @@
 #include <stdio.h>
 #include <ctype.h>
 #include "string.hh"
-#include "varray.hh"
+#include "array.hh"
 
 /**
   line counting input stream. 
@@ -28,10 +28,8 @@ class Text_stream
 public:
   Text_stream (String fn);
   String get_name() { return name; }
-  bool eof() {
-    return feof (f);
-  }
-  char    get() {
+  bool eof_b();
+  char get() {
     char c;
        
     if (pushback.empty())
@@ -49,6 +47,8 @@ public:
     pushback.push (c);
   }
   char peek() {
+    if (eof_b ())
+      return -1;
     char c = get();
     unget (c);
     return c;
@@ -61,7 +61,7 @@ public:
   }
 
   ~Text_stream(){
-    if (!eof()) 
+    if (!eof_b()) 
       cerr <<__FUNCTION__<< ": closing unended file";
     
     fclose (f);
index fef860eb31cb77de92c87d64b973130d60d0fab9..e59748f665629698ff945a7ee210ed980650e5d2 100644 (file)
@@ -1,9 +1,9 @@
 #include "text-db.hh"
 bool
-Text_db::eof()
+Text_db::eof_b ()
 {
   Data_file::gobble_leading_white();
-  return  Data_file::eof();
+  return  Data_file::eof_b();
 }
 
 void
@@ -11,41 +11,41 @@ Text_db::gobble_leading_white()
 {
   while (1) 
     {
-       Data_file::gobble_leading_white();
-       if (eof())
-           return ;
-       char c;
-       if  ((c = data_get()) !='\n')
-         {
-           data_unget (c);
-           return ;
+      Data_file::gobble_leading_white();
+      if (eof_b ())
+       return ;
+      char c;
+      if  ((c = data_get()) !='\n')
+       {
+         data_unget (c);
+         return ;
        }       
-  }    
+    }  
 }
 
 
 Text_record
 Text_db::get_record() 
 {
-   while (1) 
-   {
-       String s;
-       Array<String> fields;
-       assert (!eof());
+  while (1) 
+    {
+      String s;
+      Array<String> fields;
+      assert (!eof_b ());
        
-       while ((s = get_word()) != "")
-           {
-           fields.push (s);    
-           gobble_white();
-             }
+      while ((s = get_word()) != "")
+       {
+         fields.push (s);      
+         gobble_white();
+       }
             
 
-       if (get_line() != "")
-           assert (false);
+      if (get_line() != "")
+       assert (false);
     
-       assert (fields.size());
-       return Text_record (fields, get_name(), line ());
-   }
+      assert (fields.size());
+      return Text_record (fields, get_name(), line ());
+    }
 }
 
 
index 01d2e8ef5cc24dba9b930ec3ea2aeb9b8042d9f7..9c87211c252e02ff06cf9f9c60733936cff49731 100644 (file)
@@ -4,28 +4,38 @@ Text_stream::Text_stream (String fn)
 {
   ios::sync_with_stdio();
   if (fn == "")
-           {
-           name = _("<STDIN>");
-           f = stdin;
-             }
-
-       else
-           {
-           name = fn;
-           f = fopen (fn.ch_C (), "r");
-             }
+    {
+      name = _ ("<stdin>");
+      f = stdin;
+    }
 
-       if (!f)
-         {
-           cerr <<__FUNCTION__<< _(": can't open `") << fn << "'\n";
-           exit (1);
-         }
+  else
+    {
+      name = fn;
+      f = fopen (fn.ch_C (), "r");
+    }
 
-       line_no = 1;
+  if (!f)
+    {
+      cerr << __FUNCTION__ 
+          << ": " << _f ("can't open file: `%s'", fn) << '\n';
+      exit (1);
     }
 
+  line_no = 1;
+}
+
 void
 Text_stream::message (String s)
 {
-  cerr << "\n"<<get_name() << ": " << line ()<<": "<<s<<endl;
+  cerr << '\n'<<get_name() << ": " << line ()<<": "<<s<<endl;
+}
+
+bool
+Text_stream::eof_b ()
+{
+  /* UGH UGH ugh*/
+    return
+      // !pushback.size () && 
+      feof (f);
 }
diff --git a/input/example-2.fly b/input/example-2.fly
new file mode 100644 (file)
index 0000000..813fed7
--- /dev/null
@@ -0,0 +1,13 @@
+a''2 ~ c4( [e8 )e] [a,16 a a a]
+
+% Some beamed and slurred notes of different taste in Mudela.
+%
+% Type:
+%
+%     ly2dvi example-2
+%     xdvi example-2     # or your dvi viewer here
+%
+% For more elaborate examples see twinkle.ly, kortjakje.ly and mutopia/*.
+%
+% A docmument on Mudela is under construction: Documentation/tex/mudela.doc
+% (available as .ps from the website too).
diff --git a/input/example-3.ly b/input/example-3.ly
new file mode 100644 (file)
index 0000000..ebd4ba1
--- /dev/null
@@ -0,0 +1,29 @@
+one = \melodic\relative c{
+       c'' d e f
+}
+
+two = \melodic\relative c{
+       \clef "bass";
+       c'2 g2
+}
+
+\score{
+       <
+               \one
+               \two
+       >
+       \paper{}
+       \midi{}
+}
+
+% A full-mudala example with two staffs
+%
+% Type:
+%
+%     ly2dvi example-3
+%     xdvi example-3     # or your dvi viewer here
+%
+% For more elaborate examples see twinkle.ly, kortjakje.ly and mutopia/*.
+%
+% A docmument on Mudela is under construction: Documentation/tex/mudela.doc
+% (available as .ps from the website too).