Package gnu.getopt

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


  {
    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

    // 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

    // 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

    // 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

    /**
     * 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

    // 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

  /**
   * 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

    String argString = "d:i:o:c:r:gu";
    featdim = parseFeatDim(args, argString);
    dist = parseChunkDist(args, argString, featdim);
    parseCommands(args, argString);

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

    int c = -1;
    while ((c = opt.getopt()) != -1)
    {
      switch (c)
      {
      case 'o':
        outFileName = opt.getOptarg();
        break;
      case 'r':
        reverseSort = true;
        break;
      case 'g':
        debug = true;
        break;
      case 'u':
        reuseChunks = true;
        break;
      case 'd': // already handled above
        break;
      case 'i': // already handled above
        break;
      case 'c': // 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();

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

    String argString = "d:i:o:c:r:g";
    // featdim = parseFeatDim(args, argString);
    // dist = parseChunkDist(args, argString, featdim);
    parseCommands(args, argString);

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

    int c = -1;
    while ((c = opt.getopt()) != -1)
    {
      switch (c)
      {
      case 'o':
        outFileName = opt.getOptarg();
        break;
      case 'r':
        reverseSort = true;
        break;
      case 'g':
        debug = true;
        break;
      case 'd': // already handled above
        break;
      case 'i': // already handled above
        break;
      case 'c': // 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();

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

TOP

Related Classes of gnu.getopt.Getopt

Copyright © 2018 www.massapicom. 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.