String patchString = patarray[i].getPatchHeader(); for (int jdrv = 0; jdrv < dev.driverCount(); jdrv++) { IPatchDriver drv = (IPatchDriver) dev.getDriver(jdrv); if (drv.supportsPatch(patchString, patarray[i].getByteArray())) { patarray[i].setDriver(drv); break; } }
byte[] d = patarray[i].sysex; patarray[i].setDriver((IPatchDriver) DriverUtil.chooseDriver(d, dev));
    public IPatch[] createPatch(byte[] sysex) {        Patch patch = new Patch(sysex, this);        Patch[] patarray = extractPatch(patch);        if (patarray == null)            return new Patch[] {patch};        // Conversion was sucessfull, we have at least one        // converted patch. Assign a proper driver to each patch of patarray        Device dev = getDevice();        for (int i = 0; i < patarray.length; i++) {            String patchString = patarray[i].getPatchHeader();            for (int jdrv = 0; jdrv < dev.driverCount(); jdrv++) {                IPatchDriver drv = (IPatchDriver) dev.getDriver(jdrv);                if (drv.supportsPatch(patchString, patarray[i].getByteArray())) {                    patarray[i].setDriver(drv);                    break;                }            }        }        return patarray;    }