Subversion Repositories svn.mios

Rev

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

Rev 628 Rev 721
Line 30... Line 30...
30
import javax.sound.midi.MidiUnavailableException;
30
import javax.sound.midi.MidiUnavailableException;
31
import javax.sound.midi.Receiver;
31
import javax.sound.midi.Receiver;
32
import javax.sound.midi.Transmitter;
32
import javax.sound.midi.Transmitter;
33
33
34
public class VirtualMidiDevice extends Observable implements MidiDevice {
34
public class VirtualMidiDevice extends Observable implements MidiDevice {
-
 
35
-
 
36
    public static Object NAME = new Object();
35
37
   
36
    protected VirtualMidiDevice.Info info;
38
    protected VirtualMidiDevice.Info info;
37
39
38
    protected int maxNoTransmitters;
40
    protected int maxNoTransmitters;
39
41
Line 47... Line 49...
47
49
48
    protected long timeStart = System.currentTimeMillis();
50
    protected long timeStart = System.currentTimeMillis();
49
51
50
    public VirtualMidiDevice(String name, int maxNoTransmitters,
52
    public VirtualMidiDevice(String name, int maxNoTransmitters,
51
            int maxNoReceivers) {
53
            int maxNoReceivers) {
52
        this.info = new VirtualMidiDevice.MyInfo(name, "midibox.org",
-
 
-
 
54
       
53
                "Virtual MIDI Device", "v1.0");
55
        setName(name);
-
 
56
       
54
        this.maxNoTransmitters = maxNoTransmitters;
57
        this.maxNoTransmitters = maxNoTransmitters;
55
        this.maxNoReceivers = maxNoReceivers;
58
        this.maxNoReceivers = maxNoReceivers;
56
        this.transmitters = new LinkedList();
59
        this.transmitters = new LinkedList();
57
        this.receivers = new LinkedList();
60
        this.receivers = new LinkedList();
58
        this.midiOutPort = new MidiOutPort();
61
        this.midiOutPort = new MidiOutPort();
-
 
62
    }
-
 
63
   
-
 
64
    public void setName(String name) {
-
 
65
        this.info = new VirtualMidiDevice.MyInfo(name, "midibox.org",
-
 
66
                "Virtual MIDI Device", "v1.0");
-
 
67
       
-
 
68
        setChanged();
-
 
69
       
-
 
70
        notifyObservers(NAME);
-
 
71
       
-
 
72
        clearChanged();
59
    }
73
    }
60
74
   
61
    public void close() {
75
    public void close() {
62
76
63
    }
77
    }
Line 160... Line 174...
160
            this.receiver = receiver;
174
            this.receiver = receiver;
161
        }
175
        }
162
    }
176
    }
163
177
164
    public class MyInfo extends MidiDevice.Info {
178
    public class MyInfo extends MidiDevice.Info {
-
 
179
       
165
        protected MyInfo(String name, String vendor, String description,
180
        protected MyInfo(String name, String vendor, String description,
166
                String version) {
181
                String version) {
167
            super(name, vendor, description, version);
182
            super(name, vendor, description, version);
168
        }
183
        }
169
    }
184
    }