Package org.jsynthlib.xmldevice

Examples of org.jsynthlib.xmldevice.XmlBankDriverSpecDocument


    }

    void createBankDriver(String infoText, FrameWrapper patchEditor,
            IBankDriver driver) throws IllegalAccessException,
            NoSuchFieldException, IOException {
        XmlBankDriverSpecDocument document =
                XmlBankDriverSpecDocument.Factory.newInstance();
        XmlBankDriverSpec driverSpec = document.addNewXmlBankDriverSpec();

        XmlDriverDefs drivers = deviceSpec.getDrivers();
        XmlDriverDef driverDef = drivers.addNewXmlDriverDef();
        driverDef.setDriverClass(driver.getClass().getName());
        driverDef.setDriverType(XmlDriverDef.DriverType.BANK);

        addGenericFields(driver, driverSpec, infoText);

        if (driver instanceof AbstractBankDriver) {
            AbstractBankDriver bankDriver = (AbstractBankDriver) driver;
            driverSpec.setNumPatches(getField("numPatches", int.class,
                    bankDriver, AbstractBankDriver.class));
            driverSpec.setNumColumns(getField("numColumns", int.class,
                    bankDriver, AbstractBankDriver.class));
            driverSpec.setSingleSysexID(getField("singleSysexID", String.class,
                    bankDriver, AbstractBankDriver.class));
            driverSpec.setSingleSize(getField("singleSize", int.class,
                    bankDriver, AbstractBankDriver.class));
        }

        properties.put(newDriverKey(), driver.getClass().getSimpleName());
        document.save(new File(outDir, driver.getClass().getSimpleName()
                + ".xml"));
    }
View Full Code Here

TOP

Related Classes of org.jsynthlib.xmldevice.XmlBankDriverSpecDocument

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.