Subversion Repositories svn.mios

Rev

Rev 709 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 709 Rev 721
Line 1... Line 1...
1
package org.midibox.midi.xml;
1
package org.midibox.midi.xml;
2
2
3
public class MidiDeviceXML {
3
import javax.sound.midi.MidiDevice;
4
4
-
 
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
    }
5
}
33
}