Examples of Patch


Examples of javax.sound.midi.Patch

    AudioSynthesizer synth = new SoftSynthesizer();
    synth.openStream(null, null);
    Soundbank defsbk = synth.getDefaultSoundbank();
    if(defsbk != null)
    {       
      Instrument ins3 = defsbk.getInstrument(new Patch(0,3));
      Instrument ins10 = defsbk.getInstrument(new Patch(0,10));
      assertTrue(synth.remapInstrument(ins3, ins10));
      Instrument[] loaded = synth.getLoadedInstruments();
      for (int i = 0; i < loaded.length; i++) {
        if(loaded[i].getPatch().getBank() == ins3.getPatch().getBank())
        if(loaded[i].getPatch().getProgram() == ins3.getPatch().getProgram())
View Full Code Here

Examples of javax.sound.midi.Patch

        return null;
    }

    // Get General MIDI 2 Alias patch for this instrument.
    public Patch getPatchAlias() {
        Patch patch = getPatch();
        int program = patch.getProgram();
        int bank = patch.getBank();
        if (bank != 0)
            return patch;
        boolean percussion = false;
        if (getPatch() instanceof ModelPatch)
            percussion = ((ModelPatch)getPatch()).isPercussion();
        if (percussion)
            return new Patch(0x78 << 7, program);
        else
            return new Patch(0x79 << 7, program);
    }
View Full Code Here

Examples of name.fraser.neil.plaintext.DiffMatchPatch.Patch

  //  PATCH TEST FUNCTIONS


  public void testPatchObj() {
    // Patch Object.
    final Patch p = new Patch();
    p.start1 = 20;
    p.start2 = 21;
    p.length1 = 18;
    p.length2 = 17;
    p.diffs = diffList(new Diff(EQUAL, "jump"), new Diff(DELETE, "s"), new Diff(INSERT, "ed"), new Diff(EQUAL, " over "), new Diff(DELETE, "the"), new Diff(INSERT, "a"), new Diff(EQUAL, "\nlaz"));
    final String strp = "@@ -21,18 +22,17 @@\n jump\n-s\n+ed\n  over \n-the\n+a\n %0Alaz\n";
    assertEquals("Patch: toString.", strp, p.toString());
  }
View Full Code Here

Examples of name.fraser.neil.plaintext.diff_match_patch.Patch

  //  PATCH TEST FUNCTIONS


  public void testPatchObj() {
    // Patch Object.
    Patch p = new Patch();
    p.start1 = 20;
    p.start2 = 21;
    p.length1 = 18;
    p.length2 = 17;
    p.diffs = diffList(new Diff(EQUAL, "jump"), new Diff(DELETE, "s"), new Diff(INSERT, "ed"), new Diff(EQUAL, " over "), new Diff(DELETE, "the"), new Diff(INSERT, "a"), new Diff(EQUAL, "\nlaz"));
    String strp = "@@ -21,18 +22,17 @@\n jump\n-s\n+ed\n  over \n-the\n+a\n %0Alaz\n";
    assertEquals("Patch: toString.", strp, p.toString());
  }
View Full Code Here

Examples of org.eclipse.jgit.patch.Patch

    if (in == null) {
      fail("No " + patchFile + " test vector");
      return null; // Never happens
    }
    try {
      final Patch p = new Patch();
      p.parse(in);
      return p;
    } finally {
      in.close();
    }
  }
View Full Code Here

Examples of org.eclipse.jgit.patch.Patch

  public ApplyResult call() throws GitAPIException, PatchFormatException,
      PatchApplyException {
    checkCallable();
    ApplyResult r = new ApplyResult();
    try {
      final Patch p = new Patch();
      try {
        p.parse(in);
      } finally {
        in.close();
      }
      if (!p.getErrors().isEmpty())
        throw new PatchFormatException(p.getErrors());
      for (FileHeader fh : p.getFiles()) {
        ChangeType type = fh.getChangeType();
        File f = null;
        switch (type) {
        case ADD:
          f = getFile(fh.getNewPath(), true);
View Full Code Here

Examples of org.eclipse.jgit.patch.Patch

    if (in == null) {
      fail("No " + patchFile + " test vector");
      return null; // Never happens
    }
    try {
      final Patch p = new Patch();
      p.parse(in);
      return p;
    } finally {
      in.close();
    }
  }
View Full Code Here

Examples of org.eclipse.jgit.patch.Patch

  public ApplyResult call() throws GitAPIException, PatchFormatException,
      PatchApplyException {
    checkCallable();
    ApplyResult r = new ApplyResult();
    try {
      final Patch p = new Patch();
      try {
        p.parse(in);
      } finally {
        in.close();
      }
      if (!p.getErrors().isEmpty())
        throw new PatchFormatException(p.getErrors());
      for (FileHeader fh : p.getFiles()) {
        ChangeType type = fh.getChangeType();
        File f = null;
        switch (type) {
        case ADD:
          f = getFile(fh.getNewPath(), true);
View Full Code Here

Examples of org.exist.versioning.Patch

            NodeProxy diffProxy = (NodeProxy) nv;
            DocumentImpl diff = diffProxy.getDocument();
       
            MemTreeBuilder builder = context.getDocumentBuilder();
            DocumentBuilderReceiver receiver = new DocumentBuilderReceiver(builder);
            Patch patch = new Patch(context.getBroker(), diff);
            if (isCalledAs("annotate"))
                patch.annotate(reader, receiver);
            else
                patch.patch(reader, receiver);
            NodeValue result = (NodeValue) builder.getDocument().getDocumentElement();
            return result == null ? Sequence.EMPTY_SEQUENCE : result;
        } catch (IOException e) {
            throw new XPathException(this, e.getMessage(), e);
        } catch (XMLStreamException e) {
View Full Code Here

Examples of org.locationtech.geogig.api.plumbing.diff.DiffMatchPatch.Patch

        if (!(o instanceof LCSGeometryDiffImpl)) {
            return false;
        }
        LCSGeometryDiffImpl d = (LCSGeometryDiffImpl) o;
        for (int i = 0; i < d.patches.size(); i++) {
            Patch patchA = patches.get(i);
            Patch patchB = d.patches.get(i);
            if (!patchA.equals(patchB)) {
                return false;
            }
        }
        return true;
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.