]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.22
authorfred <fred>
Sun, 24 Mar 2002 20:00:16 +0000 (20:00 +0000)
committerfred <fred>
Sun, 24 Mar 2002 20:00:16 +0000 (20:00 +0000)
bin/Makefile
bin/clean-diaper.sh [new file with mode: 0644]
bin/make-website.pl [new file with mode: 0644]
flower/include/string.hh
lily/molecule.cc
lily/note-head.cc [new file with mode: 0644]
lily/scoreline.cc
make/Variables.make

index 4b3c40476d46aa075cca1844de2f76fa9bdc4003..7850aabe6542060771c415b106ecbbaf1f2f3ec0 100644 (file)
@@ -4,24 +4,26 @@ depth = ..
 include $(depth)/make/Include.make
 
 # list of distribution files:
-SCRIPTS = clearlily cpgento make-patch lily.efence \
-       make-version release conflily clean-fonts
-PERL_SCRIPTS_IN = $(wildcard *.in)
-PERL_SCRIPTS = $(addprefix $(outdir)/, $(PERL_SCRIPTS_IN:.in=))
+PERL_SCRIPTS_IN = $(wildcard *.pl)
+PERL_SCRIPTS = $(addprefix $(outdir)/, $(PERL_SCRIPTS_IN:.pl=))
+SH_SCRIPTS_IN = $(wildcard *.sh)
+SH_SCRIPTS = $(addprefix $(outdir)/, $(SH_SCRIPTS_IN:.sh=))
 PYTHON_SCRIPTS_IN = $(wildcard *.py)
 PYTHON_SCRIPTS = $(addprefix $(outdir)/, $(PYTHON_SCRIPTS_IN:.py=))
-EXTRA_DISTFILES = $(SCRIPTS) $(PERL_SCRIPTS_IN) $(PYTHON_SCRIPTS_IN) 
-#
+EXTRA_DISTFILES = $(SH_SCRIPTS_IN) $(PERL_SCRIPTS_IN) $(PYTHON_SCRIPTS_IN) 
 
-all: $(PERL_SCRIPTS) $(PYTHON_SCRIPTS)
 
-$(outdir)/%: %.in
-#      cd .. && CONFIG_FILES=bin/$(notdir $@) CONFIG_HEADERS= ./config.status
-#      mv $(< :.in=) $@
-# this nukes make/out/Configure_variables.make.
+all: $(PERL_SCRIPTS) $(PYTHON_SCRIPTS) $(SH_SCRIPTS)
+
+$(outdir)/%: %.pl
        sed 's!@PERL@!$(PERL)!' < $< > $@
        chmod 755 $@
 
+#FIXME.  Check for bash?
+$(outdir)/%: %.sh
+       sed 's!@SH@!$(SH)!' < $< > $@
+       chmod 755 $@
+
 $(outdir)/%: %.py
        sed 's!@PYTHON@!$(PYTHON)!' < $< > $@
        chmod 755 $@
diff --git a/bin/clean-diaper.sh b/bin/clean-diaper.sh
new file mode 100644 (file)
index 0000000..284346d
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# unclobber current dir.
+rm -vf *.aux *.log `grep -li "^% Creator: GNU LilyPond" *.out` *.orig *~
+rm -vf `grep -li "Creator: mi2mu" *.midi.ly`
+rm -vf `grep -li "Creator: GNU LilyPond" *.midi`
+rm -vf `find -name 'core'`
+rm -vf `find -name *.orig`
+rm -vf `find -name *.rej`
+
+# docxx mess
+rm -vf *dvi
+rm -vf *.class  HIER*.html dxxgifs.tex gifs.db icon?.gif logo.gif down.gif \
+    aindex.html index.html
diff --git a/bin/make-website.pl b/bin/make-website.pl
new file mode 100644 (file)
index 0000000..1d690e2
--- /dev/null
@@ -0,0 +1,356 @@
+#!@PERL@ -w 
+# -*-Perl-*- 
+
+
+# stupid script to generate WWW site.  The WWW site is my 
+# test-suite for LilyPond, I usually don't distribute versions that
+# fail to make the website
+
+use FileHandle;
+use Getopt::Long;
+
+my $lily_version;
+my $footstr;
+my $mw_id = "<!make_website!>";
+my $id_str = "make-website 0.4";
+my $TAR="tar";
+my $MAKE="make";
+
+sub get_version
+{
+    my ($vstr)=("");
+    open V, "$depth/VERSION";
+    while (<V>) {
+       s/#.*$//g;
+       next if (/^ *$/);
+       s/^/\$/;
+       s/= *(.*)$/=\"$1\";/;
+       $vstr .= $_;
+    }
+    eval ($vstr);
+    
+    $lily_version= "$TOPLEVEL_MAJOR_VERSION.$TOPLEVEL_MINOR_VERSION.$TOPLEVEL_PATCH_LEVEL$TOPLEVEL_MY_PATCH_LEVEL";
+    
+    # stupid checks.
+    $lily_version= $lily_version;
+    
+    close V;
+}
+
+sub set_html_footer
+{
+    my $MAILADDRESS=$ENV{MAILADDRESS};
+    my @pw=(getpwuid($<));
+    my $username=$pw[6];
+
+    $footstr = 
+       "\n<hr>Please take me <a href=index.html>back to the index</a>\n
+of LilyPond -- The GNU Project Music typesetter
+<hr>
+<font size=-1>
+This page was built using <code>" . $id_str . "</code> from lilypond-"
+    . $lily_version . 
+       " by<p>
+<address><br>$username <a href=mailto:" 
+    . $MAILADDRESS . ">&lt<!bla>" . $MAILADDRESS ."</a>&gt</address>
+<p></font>";
+}
+    
+
+# do something, check return status
+sub my_system
+{
+    my (@cmds) = @_;
+    foreach $cmd (@cmds) {
+       my ($ignoreret)=0;
+       if ( $cmd  =~ /^-/ ) {
+           $ignoreret = 1;
+           $cmd = substr ($cmd, 1);
+       }
+       
+       my $ret =  ( system ($cmd));
+       if ($ret) {
+           if ($ignoreret) {
+               print STDERR "ignoring failed command \`$cmd\' (status $ret)\n";
+           }else {
+               print STDERR "\nmake_website: failed on command \`$cmd\' (status $ret)\n";
+               exit 2;
+           }
+       }
+    }
+}
+
+
+local $base="lilypond/";
+
+local @examples=("twinkle-pop", 
+                "wtk1-fugue2",
+                "standchen-16", 
+                "standchen-20", 
+                "wtk1-prelude1",
+                "toccata-fuga-E", 
+                "scsii-menuetto",
+                "cadenza", 
+                "gallina",
+                "twinkle", 
+                "collisions",
+                "font",
+                #"scales", 
+                "rhythm", 
+                "multi" );
+
+
+sub gen_html
+{
+    print "generating HTML\n";
+    my_system "$MAKE -kC .. html";
+}
+
+sub gen_examples
+{
+    print "generating examples: \n";
+    my @todo=();
+    foreach $a (@examples) {
+       push @todo, "out/$a.ps.gz", "out/$a.gif", "out/$a.ly.txt";
+    }
+    
+    my_system ("$MAKE -C .. " . join(' ', @todo));
+}
+
+my @texstuff = ("mudela-man", "mudela-course");
+
+sub gen_manuals
+{
+    print "generating TeX doco list\n";
+    open HTMLLIST, ">tex_manuals.html";
+    print HTMLLIST "<HTML><TITLE>PostScript Manuals</TITLE>\n" ;
+    print HTMLLIST "<BODY><h1>LilyPond manuals (in PostScript)</h1>";
+    print HTMLLIST "<ul>\n";
+    my @todo=();
+    foreach $a (@texstuff) {
+       push @todo , "out/$a.ps.gz";
+       print HTMLLIST "<li><a href=$a.ps.gz>$a.ps.gz</a>";
+    }
+    print HTMLLIST "</ul>";
+    
+    print HTMLLIST "</BODY></HTML>";
+    close HTMLLIST;
+
+    my_system( "$MAKE -C .. " .  join(' ', @todo));
+}
+
+sub gen_list
+{
+    print "generating HTML list\n";
+    open HTMLLIST, ">example_output.html";
+
+    print HTMLLIST "<html><body><TITLE>Rendered Examples</TITLE>\n
+These example files are taken from the LilyPond distribution.
+LilyPond currently only outputs TeX and MIDI. The pictures and
+PostScript files were generated using TeX, Ghostscript and some
+graphics tools.  The papersize used for these examples is A4.  The GIF
+files have been scaled to eliminate aliasing."; 
+
+
+
+    foreach $a (@examples)
+    {
+       $name=$a; print HTMLLIST "<h1>example file: $name</h1>\n<XMP>\n";
+
+       open IF, "$depth/input/$a.ly";
+       input_record_separator IF "\n}";
+       
+       $desc = <IF>;
+       close IF;
+       
+       print HTMLLIST "$desc\n</XMP>";
+
+       $inputf="$a.ly.txt";
+       $giff="$a.gif";
+       $jpegf="$a.jpeg";
+       $pngf = "$a.png";
+       $psf="$a.ps.gz";
+       $midif="$a.midi";
+       
+       print HTMLLIST "<ul>";
+
+       print HTMLLIST "<li><a href=$inputf> The input file</a>"
+           if ( -f $inputf );
+       
+       print HTMLLIST "<li><a href=$giff>The output (picture)</a>"     
+           if ( -f $giff );
+
+       print HTMLLIST "<li><a href=$psf>The output (PS)</a>\n"
+           if ( -f $psf );
+               
+       print HTMLLIST "<li><a href=$midif>The output (MIDI)</a>\n" 
+           if ( -f $midif );
+       print HTMLLIST "</ul>";
+    }
+    print HTMLLIST "</BODY></HTML>";
+    close HTMLLIST;
+}
+
+sub edit_html
+{
+    print STDERR "adding footer\n";
+
+    OUTER:
+    foreach $a (<*.html>) {
+       open H, "$a";
+       my $sep="</BODY>";
+       input_record_separator H $sep;
+       my $file="";
+       
+       while (<H>) { 
+           if (/$mw_id/) {
+               close H;
+               next OUTER;
+           }
+           $file .= $_; 
+
+       }
+       close H;
+
+       my $subst =  $footstr;
+       $subst .= $back if (! $a =~ /index.html/ );
+       $file =~ s/$sep/$subst$sep/g ;
+       $file =~ s/\.gif/\.$image/g;
+       $file =~ s!<TITLE>(.*)</TITLE>!<TITLE>LilyPond WWW: $1</TITLE>!g;
+       open H, ">$a";
+       print H $mw_id;
+       
+       print H $file;
+       close H;
+    }
+}
+
+sub copy_txt_file
+{
+    my ($f) = @_;
+    my $d = $f;
+    $d =~ s!^.*\/!!;
+    if (! $f =~ /.txt$/) {
+       $d = "$f.txt";
+    }
+    print, $d;
+}
+    
+sub top_of_NEWS
+{
+    open NEWS, "NEWS.txt";
+    input_record_separator NEWS "****";
+    $desc = <NEWS>;
+    chop ($desc);
+    close NEWS;
+
+    return $desc;
+}
+
+sub edit_index
+{
+    $ton = top_of_NEWS();
+    $ton = "\n<XMP>\n$ton\n</XMP>\n";
+    open INDEX, "index.html";
+    input_record_separator NEWS undef;
+    $index = <INDEX>;
+    close INDEX;
+    $index =~ s/top_of_NEWS/$ton/;
+    open INDEX, ">index.html";
+    print INDEX $index;
+    close INDEX;
+}
+
+
+sub copy_files
+{  
+    print "copying files\n";
+    my_system "ln -s $depth/out ./docxx" if ( ! -x "docxx" ) ;
+    my_system "cp $depth/TODO ./TODO.txt",
+    "cp $depth/ANNOUNCE ./ANNOUNCE.txt",
+    "cp $depth/NEWS ./NEWS.txt",
+    "cp $depth/DEDICATION ./DEDICATION.txt";
+    my_system "make -C .. gifs";
+    
+}
+
+sub set_images
+{
+    for $a (<*.gif>) {
+       if ($opt_png) {
+           my_system "gif2png -d $a";
+       }
+       if ($opt_jpeg) {
+           my $b=$a;
+           $b =~ s/.gif/.jpeg/;
+           my_system "cjpeg -o $b $a";
+       }
+    }
+}
+
+sub docxx_update
+{
+    open BANNER, ">/tmp/lilybanner.html";
+    my $ban = $footstr;
+    $ban =~ s!index.html!../index.html!g;
+    print BANNER $ban;
+    close BANNER;
+    my_system "BANNEROPT=\"-B /tmp/lilybanner.html\" $depth/bin/out/make-docxx";
+}
+
+sub do_tar
+{
+     print "tarring.\n";
+     $files = join (' ', < *.html *.$image *.ps.gz *.txt *.midi docxx/*>);
+     my_system
+        "-$TAR zvhcf website.tar.gz $files;",
+#       "gzip -f9 website.tar;";
+}
+
+sub identify
+{
+    print STDERR "This is " . $id_str . "\n";
+    
+}
+sub main
+{
+    identify;
+    GetOptions("jpeg", "gif", "png", "noexamples");
+
+    local $image="gif" ;
+    $image = "png" if ($opt_png);
+    $image = "jpeg" if ($opt_jpeg);
+    
+    $depth = "../";
+    my $cwd;
+    chomp($cwd = `pwd`);
+    die "need to be in directory Documentation\n" if ( ! ($cwd =~ /Documentation$/));
+    get_version;
+    print "lily v. " . $lily_version . "\n";
+    set_html_footer;
+
+
+    $depth = "../../";
+
+    chdir ("out");
+    $ENV{"TEXINPUTS"} .= ":$depth/input/:";
+    $ENV{"LILYINCLUDE"} = "$depth/input/";
+
+
+    gen_html;
+    copy_files;
+
+    if (! $opt_noexamples) {
+       gen_examples;
+       gen_list;
+       gen_manuals;
+    }
+    set_images;
+
+    edit_html;
+    edit_index;
+    docxx_update;
+    do_tar;
+}
+
+main;
index 9e60bf9858ee02be020b9978f62d171cdc54cfe3..69226f075bff167595898f37c9fbe163fb43c214 100644 (file)
@@ -83,10 +83,7 @@ public:
   Byte const* byte_C() const;
   char* ch_l();
   Byte* byte_l();
-#if 0
-  /// deprecated; use ch_C()
-  operator char const*() const { return ch_C(); }
-#endif
+
   String &operator =(String const & source);
 
   /// concatenate s
index 4dfe7d6c1309dd0e130530e04fd7e12f26329ca8..f054a280212b2193d93751c0c6abcabe5cc20bf4 100644 (file)
@@ -40,10 +40,10 @@ Molecule::translate (Offset o)
 }
 
 void
-Molecule::translate (Real x,Axis a)
+Molecule::translate_axis (Real x,Axis a)
 {
   for (iter_top (ats,c); c.ok(); c++)
-    c->translate (x,a);
+    c->translate_axis (x,a);
 }
 
 void
@@ -66,7 +66,7 @@ Molecule::add_at_edge (Axis a, Direction d, Molecule const &m)
     }
   Real offset = extent ()[a][d] - m.extent ()[a][-d];
   Molecule toadd (m);
-  toadd.translate (offset, a);
+  toadd.translate_axis (offset, a);
   add (toadd);
 }
 
diff --git a/lily/note-head.cc b/lily/note-head.cc
new file mode 100644 (file)
index 0000000..529e28d
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+  notehead.cc -- implement Note_head
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "misc.hh"
+#include "dots.hh"
+#include "note-head.hh"
+#include "dimen.hh" 
+#include "debug.hh"
+#include "paper-def.hh"
+#include "lookup.hh"
+#include "molecule.hh"
+#include "musical-request.hh"
+
+
+Note_head::Note_head ()
+{
+  x_dir_ = CENTER;
+  staff_size_i_= 8;            // UGH
+  position_i_ = 0;
+  extremal_i_ = 0;
+}
+
+void
+Note_head::do_pre_processing ()
+{
+  // 8 ball looks the same as 4 ball:
+  if (balltype_i_ > 2)
+    balltype_i_ = 2;
+  if (dots_l_)                 // move into Rhythmic_head?
+    dots_l_->position_i_ = position_i_;
+}
+
+IMPLEMENT_IS_TYPE_B1(Note_head,Rhythmic_head);
+
+
+int
+Note_head::compare (Note_head *const  &a, Note_head * const &b)
+{
+  return a->position_i_ - b->position_i_;
+}
+
+Interval
+Note_head::do_width () const
+{
+  Atom a =  paper ()->lookup_l()->ball (balltype_i_);
+  Interval i = a.dim_[X_AXIS];
+  i+= x_dir_ * i.length ();
+  return i;
+}
+
+Molecule*
+Note_head::brew_molecule_p() const 
+{
+  Molecule*out = 0;
+  Paper_def *p = paper();
+  Real inter_f = p->internote_f ();
+
+  // ugh
+  int streepjes_i = abs(position_i_) < staff_size_i_/2 
+    ? 0
+    : (abs(position_i_) - staff_size_i_/2) /2;
+  
+  Atom  s = p->lookup_l()->ball (balltype_i_);
+  out = new Molecule (Atom (s));
+  out->translate_axis (x_dir_ * s.dim_[X_AXIS].length (), X_AXIS);
+
+  if (streepjes_i) 
+    {
+      int dir = sign (position_i_);
+       
+      Atom streepje = p->lookup_l()->streepjes (balltype_i_, dir* streepjes_i);
+
+      Molecule sm;
+      sm.add (streepje);
+      if (position_i_ % 2)
+       sm.translate_axis (-inter_f* dir, Y_AXIS);
+      out->add (sm);
+    }
+  
+  out->translate_axis (inter_f*position_i_, Y_AXIS);
+  return out;
+}
index 9a6438a5edc39a6bb74be2c6eab0a3b393a62a3d..4a2df191c4bbfd7e27e200aa5c43aa40479803ba 100644 (file)
@@ -73,7 +73,7 @@ Line_of_score::set_breaking (Array<Col_hpositions> const &breaking)
 
       for (int i=0; i < curline.size(); i++)
        {
-         curline[i]->translate(config[i],X_AXIS);
+         curline[i]->translate_axis (config[i],X_AXIS);
          curline[i]->line_l_ = (Line_of_score*)line_l;
        }
     }
index c1a022fa1981a41f4f3399c1ee8644caecb2f74c..abcc2dde581c69beb8d646b664d05c3dbc6ba181 100644 (file)
@@ -200,12 +200,6 @@ STRIPDEBUG=true
 DISTFILES=$(EXTRA_DISTFILES) Makefile $(ALL_SOURCES)
 DOCDIR=$(depth)/$(outdir)
 
-# .hh should be first. Don't know why
-# take some trouble to auto ignore sources and obsolete stuff.
-progdocs=$(shell $(FIND) ./ -name '*.hh' |egrep -v '$(OUTDIR_NAME)') \
-       $(shell $(FIND) ./ -name '*.cc' |egrep -v '$(OUTDIR_NAME)') \
-
-
 pod2html=pod2html
 pod2groff=pod2man --center="LilyPond documentation" --section="0"\
        --release="LilyPond $(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)" $< > $@
@@ -220,6 +214,3 @@ endif
 DO_STRIP=true
 
 
-docxx-opts=-S -k -p
-docxx=doc++
-