Package com.pcmsolutions.comms

Examples of com.pcmsolutions.comms.MidiSystemFacade$Impl_DeviceHunter


        columnData[4] = new ColumnData("Version", 80, JLabel.LEFT, 0, String.class, null, null);
        sectionData = new SectionData[]{new SectionData(UIColors.getTableFirstSectionBG(), UIColors.getTableFirstSectionFG(), 550, "")};
    }

    protected void doRefresh() {
        final MidiSystemFacade midi = MidiSystemFacade.getInstance();
        if (midi != null) {
            midi.removeMidiSystemListener(this);
            midi.addMidiSystemListener(this);
            MidiDevice.Info[] devices = midi.getAllDevices();
            Arrays.sort(devices, new Comparator() {
                public int compare(Object o1, Object o2) {
                    return o1.toString().compareTo(o2.toString());
                }
            });
            for (int i = 0, n = devices.length; i < n; i++) {
                final MidiDevice.Info di = devices[i];
                tableRowObjects.add(new ColumnValueProvider() {
                    public Object getValueAt(int col) {
                        switch (col) {
                            case 0:
                                return di.getName();
                            case 1:
                                try {
                                    return (midi.isPortPermitted(di) ? "Yes" : "no");
                                } catch (UnknownMidiDeviceException e) {
                                    return "unknown";
                                }
                            case 2:
                                try {
                                    return IntPool.get(midi.getRefCount(di)).toString();
                                } catch (UnknownMidiDeviceException e) {
                                    return "unknown";
                                }
                            case 3:
                                return di.getDescription();
View Full Code Here

TOP

Related Classes of com.pcmsolutions.comms.MidiSystemFacade$Impl_DeviceHunter

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.