Subversion Repositories svn.mios

Rev

Rev 709 | Rev 722 | 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 org.midibox.midi.MidiParameterControl;
4
import org.w3c.dom.Node;
709 adamjking 5
 
721 adamjking 6
public class MidiParameterControlXML extends MidiParameterXML {
7
 
8
    protected MidiParameterControl midiParameterControl;
9
 
10
    protected String receiveAttr = "receive";
11
 
12
    protected String sendAttr = "send";
13
 
14
    protected String globalAttr = "global";
15
 
16
    protected String learnAttr = "learn";
17
 
18
    protected String typeAttr = "type";
19
 
20
    protected String defaultValueAttr = "defaultValue";
21
 
22
    public MidiParameterControlXML(MidiParameterControl midiParameterControl, String rootElementTag) {
23
 
24
        super(midiParameterControl, rootElementTag);
25
 
26
        this.midiParameterControl = midiParameterControl;
27
    }
28
 
29
    public void saveXML(Node node) {
30
 
31
        super.saveXML(node);
32
 
33
        rootElement.setAttribute(typeAttr, "" + midiParameterControl.getType());
34
 
35
        rootElement.setAttribute(defaultValueAttr, "" + midiParameterControl.getMidiDefaultValue());
36
 
37
        rootElement.setAttribute(sendAttr, midiParameterControl.isSend() ? "true" : "false");
38
 
39
        rootElement.setAttribute(receiveAttr, midiParameterControl.isReceive() ? "true" : "false");
40
 
41
        rootElement.setAttribute(globalAttr, midiParameterControl.isGlobal() ? "true" : "false");
42
 
43
        rootElement.setAttribute(learnAttr, midiParameterControl.isLearn() ? "true" : "false");    
44
    }
709 adamjking 45
}