Examples of Getopt


Examples of gnu.getopt.Getopt

  public static ChunkDist parseChunkDist(String[] args, String argString,
      int[] featdim)
  {
    ChunkDist dist = null;

    Getopt opt = new Getopt("MEAPUtil", args, argString);
    opt.setOpterr(false);

    int c = -1;
    while ((c = opt.getopt()) != -1)
    {
      if (c == 'd')
      {
        String className = opt.getOptarg();

        // Try to load the class named className that extends
        // ChunkDist. (This is ugly as hell)
        Class cl = null;
        try
View Full Code Here

Examples of gnu.getopt.Getopt

   */
  public static Vector parseFeatureExtractor(String[] args, String argString)
  {
    Vector featExts = new Vector();

    Getopt opt = new Getopt("MEAPUtil", args, argString);
    opt.setOpterr(false);

    int c = -1;
    while ((c = opt.getopt()) != -1)
    {
      if (c == 'f')
      {
        String featName = opt.getOptarg();

        // Try to load the class named featName that extends
        // featextractors.FeatureExtractor.
        Class cl = null;
        try
View Full Code Here

Examples of gnu.getopt.Getopt

  {
    if (args.length == 0)
      printUsageAndExit();

    // Parse arguments
    Getopt opt = new Getopt("Segmenter", args, "t:do:s:0");
    opt.setOpterr(false);

    int c = -1;
    while ((c = opt.getopt()) != -1)
    {
      switch (c)
      {
      case 't':
        threshMult = Double.parseDouble(opt.getOptarg());
        tempoMult = threshMult;
        break;
      case 's':
        smtime = Double.parseDouble(opt.getOptarg());
        break;
      case 'd':
        useBeatOD = false;
        break;
      case 'o':
        outFileName = opt.getOptarg();
        break;
      case '0':
        onsetAtFirstFrame = true;
        break;
      case '?':
        printUsageAndExit();
        break;
      default:
        System.out.print("getopt() returned " + c + "\n");
      }
    }

    // parse arguments
    int ind = opt.getOptind();
    if (ind > args.length)
      printUsageAndExit();

    audioFiles = new String[args.length - ind];
    for (int i = ind; i < args.length; i++)
View Full Code Here

Examples of gnu.getopt.Getopt

  {
    if (args.length == 0)
      printUsageAndExit();

    // Parse arguments
    Getopt opt = new Getopt("Synthesizer", args, "o:");
    opt.setOpterr(false);

    int c = -1;
    while ((c = opt.getopt()) != -1)
    {
      switch (c)
      {
      case 'o':
        outFile = opt.getOptarg();
        break;
      case '?':
        printUsageAndExit();
        break;
      default:
        System.out.print("getopt() returned " + c + "\n");
      }
    }

    // parse arguments
    int ind = opt.getOptind();
    if (ind > args.length)
      printUsageAndExit();

    edlFile = new EDLFile(args[ind]);
View Full Code Here

Examples of gnu.getopt.Getopt

    // Parse arguments
    String argString = "f:o:w:h:";
    featExts = parseFeatureExtractor(args, argString);

    Getopt opt = new Getopt("FeatExtracter", args, argString);
    opt.setOpterr(false);

    int c = -1;
    while ((c = opt.getopt()) != -1)
    {
      switch (c)
      {
      case 'o':
        outFile = new FeatFile(opt.getOptarg());
        break;
      case 'h':
        setHopSize(Double.parseDouble(opt.getOptarg()));
        break;
      case 'w':
        setWindowSize(Double.parseDouble(opt.getOptarg()));
        break;
      case 'f': // already handled above
        break;
      case '?':
        printUsageAndExit();
        break;
      default:
        System.out.print("getopt() returned " + c + "\n");
      }
    }

    // parse arguments
    int ind = opt.getOptind();
    if (ind > args.length)
      printUsageAndExit();

    featFiles = new FeatFile[args.length - ind];
    for (int i = ind; i < args.length; i++)
View Full Code Here

Examples of gnu.getopt.Getopt

    // Vector features = new Vector();

    // Parse arguments
    String argString = "o:g";

    Getopt opt = new Getopt("MeapaeMComposer", args, argString);
    opt.setOpterr(false);

    int c = -1;
    while ((c = opt.getopt()) != -1)
    {
      switch (c)
      {
      case 'o':
        outFileName = opt.getOptarg();
        break;
      case 'g':
        debug = true;
        break;
      case '?':
        printUsageAndExit();
        break;
      default:
        System.out.print("getopt() returned " + c + "\n");
      }
    }

    // parse arguments
    int ind = opt.getOptind();
    if (ind > args.length)
      printUsageAndExit();

    featFile = new FeatFile(args[args.length - 1]);
    outFile = new EDLFile(outFileName);
View Full Code Here

Examples of gnu.getopt.Getopt

    // Parse arguments
    String argString = "o:x:g";
    parseCommands(args, argString);

    Getopt opt = new Getopt("ChromaTopComposer", args, argString);
    opt.setOpterr(false);

    int c = -1;
    while ((c = opt.getopt()) != -1)
    {
      switch (c)
      {
      case 'o':
        outFileName = opt.getOptarg();
        break;
      case 'g':
        debug = true;
        break;
      case 'x':
        cmixFileName = opt.getOptarg();
        break;
      case '?':
        printUsageAndExit();
        break;
      default:
        System.out.print("getopt() returned " + c + "\n");
      }
    }

    // parse arguments
    int ind = opt.getOptind();
    if (ind > args.length)
      printUsageAndExit();

    featFile = new FeatFile(args[args.length - 1]);
    outFile = new EDLFile(outFileName);
View Full Code Here

Examples of gnu.getopt.Getopt

    /**
     * Parse command strings from the command line arguments
     */
    public void parseCommands(String[] args, String argString)
    {
        Getopt opt = new Getopt("Composer", args, argString);
        opt.setOpterr(false);
       
        int c = -1;
        while ((c = opt.getopt()) != -1)
        {
            if(c == 'c')
            {
                if(commands == null)
                    commands = new Vector();
               
                commands.add(opt.getOptarg());
            }
        }
    }
View Full Code Here

Examples of gnu.getopt.Getopt

    // Parse arguments
    String argString = "o:c:f:g";
    parseCommands(args, argString);

    Getopt opt = new Getopt("BlipComposer", args, argString);
    opt.setOpterr(false);

    int c = -1;
    while ((c = opt.getopt()) != -1)
    {
      switch (c)
      {
      case 'o':
        outFileName = opt.getOptarg();
        break;
      case 'g':
        debug = true;
        break;
      case 'f':
        blipWav = opt.getOptarg();
        break;
      case 'c': // already handled above
        break;
      case 's':
        silentMode = true;
      case '?':
        printUsageAndExit();
        break;
      default:
        System.out.print("getopt() returned " + c + "\n");
      }
    }

    // parse arguments
    int ind = opt.getOptind();
    if (ind > args.length)
      printUsageAndExit();

    featFile = new FeatFile(args[args.length - 1]);
    outFile = new EDLFile(outFileName);
View Full Code Here

Examples of gnu.getopt.Getopt

  /**
   * Parse command strings from the command line arguments
   */
  public void parseCommands(String[] args, String argString)
  {
    Getopt opt = new Getopt("Composer", args, argString);
    opt.setOpterr(false);

    int c = -1;
    while ((c = opt.getopt()) != -1)
    {
      if (c == 'c')
      {
        if (commands == null)
          commands = new Vector();

        commands.add(opt.getOptarg());
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.