Java Core MIDI - virtual endpoints bugged?
Java Core MIDI - virtual endpoints bugged?
- Subject: Java Core MIDI - virtual endpoints bugged?
- From: Ilya Maykov <email@hidden>
- Date: Wed, 30 Jul 2003 23:58:12 -0700
Hey everyone,
I've ran into some trouble while trying to use virtual endpoints with
the Java Core MIDI API. For some reason, the program throws
NullPointerExceptions every time the virtual endpoint gets MIDI data.
However, given the poor quality of the Java Core MIDI API, I decided to
see if the problem was Java-specific, and surely enough, the same code
works when written in C. Here is a snippet of the malfunctioning Java
code:
...
client = new MIDIClient(new CAFString("Virtual endpoint test client"),
null);
v_endpoint = client.destinationCreate(new CAFString("VDest0"), new
VirtualMIDIReadProc());
...
private class VirtualMIDIReadProc implements MIDIReadProc
{
public void execute(MIDIInputPort inputPort, MIDIEndpoint endPoint,
MIDIPacketList packetList)
{
System.out.println("MIDI Data received.");
}
}
}
...
As you can see, it doesn't do much, just creates a virtual destination
that can receive data, and every time the data is received, it prints a
message to the console. Here is the exception that gets thrown:
java.lang.NullPointerException
at
com.apple.audio.midi.MIDIDispatcher.readProc(MIDIDispatcher.java:93)
So ... what the hell??? Either I'm doing something wrong, or the Java
version of the Core MIDI API is bugged! If anybody has a clue, please
let me know. In the meanwhile, I will try to figure it out on my own,
and thanks for the help in advance.
Ilya Maykov
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.