From 9fee0ec4ca0c5b7a334cc29dbb58e76c7a4c736e Mon Sep 17 00:00:00 2001 From: Michiel Van Der Kolk Date: Mon, 11 Jul 2005 15:42:37 +0000 Subject: Songdb java version, source. only 1.5 compatible git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7101 a1c6a512-1295-4272-9138-f99709370657 --- songdbj/javazoom/jl/converter/jlc.java | 216 +++++++++++++++++++++++++++++++++ 1 file changed, 216 insertions(+) create mode 100644 songdbj/javazoom/jl/converter/jlc.java (limited to 'songdbj/javazoom/jl/converter/jlc.java') diff --git a/songdbj/javazoom/jl/converter/jlc.java b/songdbj/javazoom/jl/converter/jlc.java new file mode 100644 index 0000000000..57c84eba4a --- /dev/null +++ b/songdbj/javazoom/jl/converter/jlc.java @@ -0,0 +1,216 @@ +/* + * 11/19/04 1.0 moved to LGPL. + * + * 29/01/00 Initial version. mdm@techie.com + * + * 12/12/99 JavaLayer 0.0.7 mdm@techie.com + * + * 14/02/99 MPEG_Args Based Class - E.B + * Adapted from javalayer and MPEG_Args. + * Doc'ed and integerated with JL converter. Removed + * Win32 specifics from original Maplay code. + *----------------------------------------------------------------------- + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + *---------------------------------------------------------------------- + */ + +package javazoom.jl.converter; + +import java.io.PrintWriter; + +import javazoom.jl.decoder.Crc16; +import javazoom.jl.decoder.JavaLayerException; +import javazoom.jl.decoder.OutputChannels; + +/** + * The jlc class presents the JavaLayer + * Conversion functionality as a command-line program. + * + * @since 0.0.7 + */ +public class jlc +{ + + static public void main(String args[]) + { + String[] argv; + long start = System.currentTimeMillis(); + int argc = args.length + 1; + argv = new String[argc]; + argv[0] = "jlc"; + for(int i=0;i2) + { + try + { + String level = argv[i].substring(2); + verbose_level = Integer.parseInt(level); + } + catch (NumberFormatException ex) + { + System.err.println("Invalid verbose level. Using default."); + } + } + System.out.println("Verbose Activated (level "+verbose_level+")"); + } + /* else if (argv[i].equals("-s")) + ma.stdout_mode = true; */ + else if (argv[i].equals("-p")) + { + if (++i == argc) + { + System.out.println("Please specify an output filename after the -p option!"); + System.exit (1); + } + //output_mode = O_WAVEFILE; + output_filename = argv[i]; + } + /*else if (argv[i].equals("-f")) + { + if (++i == argc) + { + System.out.println("Please specify a new scalefactor after the -f option!"); + System.exit(1); + } + ma.use_own_scalefactor = true; + // ma.scalefactor = argv[i]; + }*/ + else return Usage(); + } + else + { + filename = argv[i]; + System.out.println("FileName = "+argv[i]); + if (filename == null) return Usage(); + } + i++; + } + if (filename == null) + return Usage(); + + return true; + } + + + /** + * Usage of JavaLayer. + */ + public boolean Usage() + { + System.out.println("JavaLayer Converter :"); + System.out.println(" -v[x] verbose mode. "); + System.out.println(" default = 2"); + /* System.out.println(" -s write u-law samples at 8 kHz rate to stdout"); + System.out.println(" -l decode only the left channel"); + System.out.println(" -r decode only the right channel"); + System.out.println(" -d downmix mode (layer III only)"); + System.out.println(" -s write pcm samples to stdout"); + System.out.println(" -d downmix mode (layer III only)");*/ + System.out.println(" -p name output as a PCM wave file"); + System.out.println(""); + System.out.println(" More info on http://www.javazoom.net"); + /* System.out.println(" -f ushort use this scalefactor instead of the default value 32768");*/ + return false; + } + }; +}; \ No newline at end of file -- cgit v1.2.3