Subversion Repositories svn.mios

Rev

Rev 709 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
709 adamjking 1
package org.midibox.midi.xml;
2
 
721 adamjking 3
import javax.sound.midi.MidiDevice;
709 adamjking 4
 
721 adamjking 5
import org.midibox.utils.xml.XMLUtils;
6
import org.w3c.dom.Node;
7
 
8
public class MidiDeviceXML extends XMLUtils {
9
 
10
    protected String nameAttr = "name";
11
 
12
    protected String hashCodeAttr = "hashCode";
13
 
14
    protected MidiDevice midiDevice;
15
 
16
    public MidiDeviceXML(MidiDevice midiDevice, String rootElementTag) {
17
 
18
        super(rootElementTag);
19
 
20
        this.midiDevice = midiDevice;
21
    }
22
 
23
    public void saveXML(Node node) {
24
 
25
        super.saveXML(node);
26
 
27
        rootElement
28
                .setAttribute(nameAttr, midiDevice.getDeviceInfo().getName());
29
 
30
        rootElement.setAttribute(hashCodeAttr, ""
31
                + midiDevice.getDeviceInfo().toString().hashCode());
32
    }
709 adamjking 33
}