Subversion Repositories svn.mios

Rev

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

Rev 505 Rev 628
Line 18... Line 18...
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
 */
19
 */
20
package org.midibox.sidedit;
20
package org.midibox.sidedit;
21
21
22
import javax.sound.midi.MidiMessage;
22
import javax.sound.midi.MidiMessage;
23
import javax.sound.midi.Receiver;
-
 
24
import javax.sound.midi.ShortMessage;
-
 
-
 
23
25
import org.midibox.midi.MidiUtils;
24
import org.midibox.midi.MidiUtils;
26
import org.midibox.sidlibr.Patch;
25
import org.midibox.sidlibr.Patch;
27
26
28
public class SIDSysexParameterControl extends SIDSysexParameter {
27
public class SIDSysexParameterControl extends SIDSysexParameter {
29
28
Line 46... Line 45...
46
   
45
47
    protected String tooltip;
46
    protected String tooltip;
48
   
47
49
    protected Object tooltipListener;
48
    protected Object tooltipListener;
50
   
49
51
    public SIDSysexParameterControl(int type, String[] valAlias ,Patch patch, int addres, int start_bit, int reso, String name, String tooltip) {
50
    public SIDSysexParameterControl(int type, String[] valAlias, Patch patch,
-
 
51
            int addres, int start_bit, int reso, String name, String tooltip) {
52
        super(patch, addres, start_bit, reso, name);
52
        super(patch, addres, start_bit, reso, name);
53
        setReceive(true);
53
        setReceive(true);
54
        setSend(true);
54
        setSend(true);
55
        this.tooltip = tooltip;
55
        this.tooltip = tooltip;
56
        this.type = type;
56
        this.type = type;
57
        this.valAlias = valAlias;
57
        this.valAlias = valAlias;
58
        this.spValAlias = sparseValAlias(valAlias);
58
        this.spValAlias = sparseValAlias(valAlias);
59
    }
59
    }
60
   
60
61
    public SIDSysexParameterControl(int type, String[] valAlias ,Patch patch, int addres, int start_bit, int reso, String name) {
61
    public SIDSysexParameterControl(int type, String[] valAlias, Patch patch,
-
 
62
            int addres, int start_bit, int reso, String name) {
62
        super(patch, addres, start_bit, reso, name);
63
        super(patch, addres, start_bit, reso, name);
63
        setReceive(true);
64
        setReceive(true);
64
        setSend(true);
65
        setSend(true);
65
        this.tooltip = name;
66
        this.tooltip = name;
66
        this.type = type;
67
        this.type = type;
Line 168... Line 169...
168
            return out;
169
            return out;
169
        }
170
        }
170
    }
171
    }
171
172
172
    public void send(MidiMessage message, long lTimeStamp) {
173
    public void send(MidiMessage message, long lTimeStamp) {
173
        String m = MidiUtils.getHexString(message.getMessage()).replace(" ", "");      
174
        String m = MidiUtils.getHexString(message.getMessage())
-
 
175
                .replace(" ", "");
174
        if (m.indexOf(SIDSysexInfo.acknowledgedSysex.replace("<device>", "00"))== 0) {
176
        if (m.indexOf(SIDSysexInfo.acknowledgedSysex.replace("<device>", "00")) == 0) {
175
            //System.out.println("MBSID: Acknowdledged!");
177
            // System.out.println("MBSID: Acknowdledged!");
176
        }else if (m.equals(SIDSysexInfo.error1Sysex.replace("<device>", "00"))) {
178
        } else if (m.equals(SIDSysexInfo.error1Sysex.replace("<device>", "00"))) {
177
            System.out.println("MBSID: Received less bytes then expected");
179
            System.out.println("MBSID: Received less bytes then expected");
178
        }else if (m.equals(SIDSysexInfo.error2Sysex.replace("<device>", "00"))) {
180
        } else if (m.equals(SIDSysexInfo.error2Sysex.replace("<device>", "00"))) {
179
            System.out.println("MBSID: Wrong checksum");
181
            System.out.println("MBSID: Wrong checksum");
180
        }else if (m.equals(SIDSysexInfo.error3Sysex.replace("<device>", "00"))) {
182
        } else if (m.equals(SIDSysexInfo.error3Sysex.replace("<device>", "00"))) {
-
 
183
            System.out
181
            System.out.println("MBSID: Bankstick or patch/drumset/ensemble not available");
184
                    .println("MBSID: Bankstick or patch/drumset/ensemble not available");
182
        }else if (m.equals(SIDSysexInfo.error4Sysex.replace("<device>", "00"))) {
185
        } else if (m.equals(SIDSysexInfo.error4Sysex.replace("<device>", "00"))) {
183
            System.out.println("MBSID: Parameter not available");
186
            System.out.println("MBSID: Parameter not available");
184
        }else if (m.equals(SIDSysexInfo.error5Sysex.replace("<device>", "00"))) {
187
        } else if (m.equals(SIDSysexInfo.error5Sysex.replace("<device>", "00"))) {
185
            System.out.println("MBSID: RAM access not supported");
188
            System.out.println("MBSID: RAM access not supported");
186
        }else if (m.equals(SIDSysexInfo.error6Sysex.replace("<device>", "00"))) {
189
        } else if (m.equals(SIDSysexInfo.error6Sysex.replace("<device>", "00"))) {