]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.18
authorfred <fred>
Sun, 24 Mar 2002 19:58:45 +0000 (19:58 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:58:45 +0000 (19:58 +0000)
bin/mf-to-table.in
lily/clef-grav.cc
lily/include/translator-group.hh
lily/performer.cc
lily/rhythmic-column-grav.cc
lily/translator-group.cc
tex/taupindefs.tex

index 17a7c2f7a8ef678c3a7da7992264907434abebf5..c7e5a25b946fff81a9c6e04508ae4d6899f1a119 100644 (file)
@@ -9,7 +9,7 @@ Ugh . Perl sux. Anybody for Python?
     
 =cut    
 
-$mf_to_table_version = 0.1;
+$mf_to_table_version = 0.2;
 
 use Getopt::Long;
 
@@ -30,43 +30,58 @@ sub usage
     . "Generate mozarella metrics table from preparated metafont log\n\n"
     . "Options:\n"
     . "  -h, --help             print this help\n"
-    . "  -o, --output=FILE      name output file\n"
+    . "  -l, --ly=FILE          name output table\n"
+    . "  -t, --tex=FILE         name output tex chardefs\n"
 }
 
 sub make_table
 {
     my $line;
     my $indent = 0;
+    my $lineno=0;
     while ($line = <IN>) {
+       $lineno++;
        if ($line =~ /^@@/) {
            $line =~ s/^@@(.*)@@/$1/;
            chop ($line);
            my @fields = split (/:/,$line);
            my $label = $fields [0];
            my $name = $fields [1];
-           print OUT "\t" x $indent;
+           print OUTLY "\t" x $indent;
            if ($label eq "font") {
-               print OUT "% $name=\\symboltables {\n";
+               print OUTLY "% $name=\\symboltables {\n";
+               print OUTTEX "% $name\n";
                $indent++;
            } elsif ($label eq "group") {
-               print OUT "\"$name\" = \\table {\n";
+               print OUTLY "\"$name\" = \\table {\n";
+               print OUTTEX "% $name\n";
                $indent++;
            } elsif ($label eq "puorg") {
-               print OUT "}\n";
+               print OUTLY "}\n";
+               print OUTTEX "\n";
                $indent--;
            } elsif ($label eq "tnof") {
-               print OUT "%  } % $name\n";
+               print OUTLY "%  } % $name\n";
                $indent--;
            } elsif ($label eq "char") {
                my $c = $fields [2];
                my $w = $fields [3];
                my $h = $fields [4];
                my $d = $fields [5];
-               my $id = $fields [6];
-               my $texstr = $fields [7];
-               print OUT sprintf( "\"%s\"\t\"\\%s\"\t%.2f\\pt\t%.2f\\pt\t%.2f\\pt\t%.2f\\pt\n", $id, $texstr, 0, $w, $h, $d );
+               my $b = $fields [6];
+               my $id = $fields [7];
+               my $texstr = $fields [8];
+               print OUTLY sprintf( "\"%s\"\t\"\\%s\"\t%.2f\\pt\t%.2f\\pt\t%.2f\\pt\t%.2f\\pt\n", $id, $texstr, -$b, $w, $h, -$d );
+               # remove % from generic chars, and save start charcode
+               my $defstr = "\\fetdef";
+               if ($texstr =~ /{%/) {
+                       $texstr =~ s/{%.*//;
+                       $texstr .= "start";
+                       $defstr = "\\def"
+               }
+               print OUTTEX sprintf( "%s\\%s{%d}\n", $defstr, $texstr, $c);
            } else {
-               print STDERR "mf-to-table: unknown label: \`$label\'\n";
+               print STDERR "mf-to-table: $lineno: unknown label: \`$label\'\n";
            }
        }
     }
@@ -74,16 +89,28 @@ sub make_table
       
 sub  set_files 
 {
-    $infile = "-";
-    $outfile = "-";
-    $outfile = $opt_output if (defined($opt_output));
-
     if ($ARGV [0])  {
        $infile = $ARGV[0];
     } 
-    if (( ! -f $infile) && (! $infile =~ /\\.log$/s ) ){
+    if (!(-f $infile) && !($infile =~ /\.log$/s )) {
        $infile .= ".log";
     }
+
+    if (defined($opt_ly)) {
+       $lyfile = $opt_ly;
+    }
+    else {
+       $lyfile = $infile;
+       $lyfile =~ s/\.log$/.ly/;
+    }
+    if (defined($opt_tex)) {
+       $texfile = $opt_tex;
+    }
+    else {
+       $texfile = $infile;
+       $texfile =~ s/\.log$/.tex/;
+    }
+
     print STDERR "Input ", (($infile eq "-") ?"STDIN" : $infile), " .. \n";
 }
 
@@ -92,14 +119,20 @@ sub do_one_arg
     set_files;
 
     die "can't open \`$infile\'" unless open IN,$infile ;
-    die "can't open \`$outfile\'" unless open OUT, ">$outfile";
-    print OUT "% generated at " . localtime() . " from $infile\n";
-    print OUT "% changes will be lost\n";
+
+    die "can't open \`$lyfile\'" unless open OUTLY, ">$lyfile";
+    print OUTLY "% generated at " . localtime() . " from $infile\n";
+    print OUTLY "% changes will be lost\n\n";
+
+    die "can't open \`$texfile\'" unless open OUTTEX, ">$texfile";
+    print OUTTEX "% generated at " . localtime() . " from $infile\n";
+    print OUTTEX "% changes will be lost\n\n";
     
     make_table;
 
     close IN;
-    close OUT;
+    close OUTLY;
+    close OUTTEX;
 }
 
 ## "main"
@@ -107,7 +140,7 @@ sub do_one_arg
 identify;
 
 #GetOptions ("help", "output=s", "from=i", "to=i", "minor=i", "edit", "show-rules");
-GetOptions ("help", "output=s");
+GetOptions ("help", "ly=s", "tex=s");
 
 if ($opt_help) {
     usage();
@@ -115,7 +148,7 @@ if ($opt_help) {
     exit 0;
 }
 
-local ($infile,$outfile);
+local ($infile,$lyfile,$texfile);
 my $processed_one=0;
 
 while (defined($ARGV[0])) {
index 670e5d9cd0520bb130d57907cfeb408d10bcf1cc..fc70af6a0edc79d0f3bcc1c99590a02c67fcdae2 100644 (file)
@@ -75,7 +75,7 @@ void
 Clef_engraver::do_creation_processing()
 {
   Scalar def = get_property ("defaultclef");
-  if (def)
+  if (def.operator bool ()) // egcs: Scalar to bool is ambiguous
     set_type (def);
   if (clef_type_str_.length_i ())
     create_clef();
index dc2e8365eb98a3e7712b6d594b8c589862cb26c1..1cc3a0b3c3343eb29d650361f2da9d60dd09742d 100644 (file)
@@ -17,7 +17,9 @@
 #include "plist.hh"
 #include "parray.hh"
 
+// egcs
 typedef void (Translator::*Method_pointer)(void);
+typedef void (Translator::*Const_method_pointer)(void) const; 
 
 /** Make some kind of #Element#s from Requests. Elements are made by
   hierarchically grouped #Translator#s
@@ -68,7 +70,8 @@ protected:
   virtual void do_post_move_processing();   
   virtual void do_creation_processing();
   virtual void do_removal_processing();
-  void each (Method_pointer) const;
+  void each (Method_pointer);
+  void each (Const_method_pointer) const;
 };
 
 #endif // TRANSLATOR_GROUP_HH
index 5775f157eb4133230dbe0a73a96cb34e97ccaf48..ed171b5a7066419bb3436f1c6d8e4101ffd43355 100644 (file)
 
 IMPLEMENT_IS_TYPE_B1(Performer, Translator);
 
-Performer::Performer()
-{
-}
-
 void 
 Performer::play (Audio_element* p) 
 { 
index af3238c0f9510ec508d13e19ba66398c3ff51b09..7cba706c24fbe699744ba514477b430d5b45850c 100644 (file)
@@ -76,7 +76,8 @@ Rhythmic_column_engraver::do_pre_move_processing()
   if (ncol_p_) 
     {
       if (! ncol_p_->h_shift_b_)
-       ncol_p_->h_shift_b_  = (bool) get_property ("hshift");
+       // egcs
+       ncol_p_->h_shift_b_  = get_property ("hshift").operator bool ();
       if (! ncol_p_->dir_)
        ncol_p_->dir_ =(Direction) int(get_property ("ydirection"));
 
index 1521ede70d64ae93bb96ff250711c36acdafd8d8..5725a028c3458d48fcc3959d0f196e67a5637c48 100644 (file)
@@ -267,7 +267,14 @@ Translator_group::get_default_interpreter()
 }
 
 void
-Translator_group::each (Method_pointer method) const
+Translator_group::each (Method_pointer method)
+{
+  for (PCursor<Translator*> i (trans_p_list_.top ()); i.ok (); i++)
+    (i.ptr()->*method) ();     
+}
+
+void
+Translator_group::each (Const_method_pointer method) const
 {
   for (PCursor<Translator*> i (trans_p_list_.top ()); i.ok (); i++)
     (i.ptr()->*method) ();     
index 290e711cb904970eec8c78f987600c1526f8b423..12080f171afce197c28212c9630929b4931c5f47 100644 (file)
@@ -1,4 +1,3 @@
-\input fetdefs
 \def\musixtwentyfonts{
         \font\normaltextfont=cmr10 %\textfont is a primitive
         \font\smalltextfont=cmr8
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % provide interface to musixtex fonts 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\musicdef\breveball{'040}
-\musicdef\longaball{'047}
+% \musicdef\breveball{'040}
+% \musicdef\longaball{'047}
+% \musicdef\quartball{'007}
+% \musicdef\halfball{'010}
+% \musicdef\wholeball{'011}
 \musicdef\halfrest{'074}
 \musicdef\wholerest{'075}
 \musicdef\breverest{'072}
 %% hmm
 \musicdef\outsidehalfrest{10}
 \musicdef\outsidewholerest{11}
-\musicdef\quartrest{62}
-\musicdef\eighthrest{63}
-\musicdef\sixteenthrest{64}
-\musicdef\thirtysecondrest{65}
-\musicdef\sixtyfourthrest{66}
-\musicdef\hundredtwentyeighthrest{67}
+\musicdef\quartrest{62}
+\musicdef\eighthrest{63}
+\musicdef\sixteenthrest{64}
+\musicdef\thirtysecondrest{65}
+\musicdef\sixtyfourthrest{66}
+\musicdef\hundredtwentyeighthrest{67}
 \musicdef\sharp{52}
 \musicdef\flat{50}
 \musicdef\natural{54}
 
 \def\tr{{\it tr}}
 
-\def\beamuslope#1#2{{\count0=#2\advance\count0 by#1
-        \advance\count0 by 122
-        \musicfnt\char\count0}}
-\def\beamdslope#1#2{{\count0=#2\advance\count0 by#1
-        \advance\count0 by 186
-        \musicfnt\char\count0}}
+% \def\beamuslope#1#2{{\count0=#2\advance\count0 by#1
+%         \advance\count0 by 122
+%         \musicfnt\char\count0}}
+% \def\beamdslope#1#2{{\count0=#2\advance\count0 by#1
+%         \advance\count0 by 186
+%         \musicfnt\char\count0}}
+
 
+\input fetdefs