Subversion Repositories svn.mios

Rev

Rev 753 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 753 Rev 808
Line 4... Line 4...
4
import org.midibox.midi.xml.MidiDeviceRoutingXML;
4
import org.midibox.midi.xml.MidiDeviceRoutingXML;
5
import org.midibox.midi.xml.MidiKeyboardControllerDeviceXML;
5
import org.midibox.midi.xml.MidiKeyboardControllerXML;
6
import org.midibox.utils.xml.XMLUtils;
6
import org.midibox.utils.xml.XMLUtils;
7
import org.w3c.dom.Element;
7
import org.w3c.dom.Element;
8
import org.w3c.dom.Node;
8
import org.w3c.dom.Node;
9
9
10
public class VirtualKeyboardXML extends XMLUtils {
10
public class VirtualKeyboardXML extends XMLUtils {
Line 19... Line 19...
19
        super(rootElementTag);
19
        super(rootElementTag);
20
20
21
        this.virtualKeyboard = virtualKeyboard;
21
        this.virtualKeyboard = virtualKeyboard;
22
22
23
        addTag(MidiDeviceRoutingXML.TAG_ROOT_ELEMENT);
23
        addTag(MidiDeviceRoutingXML.TAG_ROOT_ELEMENT);
24
        addTag(MidiKeyboardControllerDeviceXML.TAG_ROOT_ELEMENT);
24
        addTag(MidiKeyboardControllerXML.TAG_ROOT_ELEMENT);
25
    }
25
    }
26
26
27
    protected void parseElement(Element element) {
27
    protected void parseElement(Element element) {
28
28
29
        super.parseElement(element);
29
        super.parseElement(element);
Line 38... Line 38...
38
                    virtualKeyboard.getMidiDeviceRouting(),
38
                    virtualKeyboard.getMidiDeviceRouting(),
39
                    MidiDeviceRoutingXML.TAG_ROOT_ELEMENT);
39
                    MidiDeviceRoutingXML.TAG_ROOT_ELEMENT);
40
40
41
            midiDeviceRoutingXML.loadXML(element);
41
            midiDeviceRoutingXML.loadXML(element);
42
42
43
        } else if (name == MidiKeyboardControllerDeviceXML.TAG_ROOT_ELEMENT) {
43
        } else if (name == MidiKeyboardControllerXML.TAG_ROOT_ELEMENT) {
44
44
45
            MidiKeyboardControllerDeviceXML midiKeyboardControllerDeviceXML = new MidiKeyboardControllerDeviceXML(
45
            MidiKeyboardControllerXML midiKeyboardControllerXML = new MidiKeyboardControllerXML(
46
                    virtualKeyboard.getMidiKeyboardControllerDevice(),
46
                    virtualKeyboard.getMidiKeyboardController(),
47
                    MidiKeyboardControllerDeviceXML.TAG_ROOT_ELEMENT);
47
                    MidiKeyboardControllerXML.TAG_ROOT_ELEMENT);
48
48
49
            midiKeyboardControllerDeviceXML.loadXML(element);
49
            midiKeyboardControllerXML.loadXML(element);
50
        }
50
        }
51
    }
51
    }
52
52
53
    public void saveXML(Node node) {
53
    public void saveXML(Node node) {
54
54
Line 58... Line 58...
58
                virtualKeyboard.getMidiDeviceRouting(),
58
                virtualKeyboard.getMidiDeviceRouting(),
59
                MidiDeviceRoutingXML.TAG_ROOT_ELEMENT);
59
                MidiDeviceRoutingXML.TAG_ROOT_ELEMENT);
60
60
61
        midiDeviceRoutingXML.saveXML(rootElement);
61
        midiDeviceRoutingXML.saveXML(rootElement);
62
62
63
        MidiKeyboardControllerDeviceXML midiKeyboardControllerDeviceXML = new MidiKeyboardControllerDeviceXML(
63
        MidiKeyboardControllerXML midiKeyboardControllerDeviceXML = new MidiKeyboardControllerXML(
64
                virtualKeyboard.getMidiKeyboardControllerDevice(),
64
                virtualKeyboard.getMidiKeyboardController(),
65
                MidiKeyboardControllerDeviceXML.TAG_ROOT_ELEMENT);
65
                MidiKeyboardControllerXML.TAG_ROOT_ELEMENT);
66
66
67
        midiKeyboardControllerDeviceXML.saveXML(rootElement);
67
        midiKeyboardControllerDeviceXML.saveXML(rootElement);
68
    }
68
    }
69
}
69
}