Re: CoreMIDI Questions
Re: CoreMIDI Questions
- Subject: Re: CoreMIDI Questions
- From: Kurt Revis <email@hidden>
- Date: Sat, 24 Nov 2001 23:54:51 -0800
I created a MIDIClient through MIDIClientCreate() and implemented the
notification callback function, in hopes that it would get called when
new MIDI devices are added to the system. However, it never gets
called when I unplug or plug in my USB MidiSport 2x2. Is this
something I'm doing wrong or a driver issue or an OS issue or what?
It seems that the current MIDISport driver, or Apple's underlying code
(I'm not sure which), just doesn't support hot-plugging very well. (I
know the folks at MIDIMAN are aware of this.) If you have the device
plugged in, and then start your app, things should work.
(Also: Do you have Classic running? If you do, it may grab the USB
device and not let the X side see it.)
In addition, MIDIRestart() doesn't seem to work at all.
It does work, but not in the circumstance you're trying. For example, I
just started my app with the device plugged in, and it showed up. Then I
unplugged it, and did a MIDIRestart(), and the device was no longer
present in the list. What is not working is getting the device to show
up in the app after it's been plugged in.
Also note that, if you do have devices and endpoints showing up in your
list, after a MIDIRestart(), the values of the MIDIEndpointRef or
MIDIDeviceRef will have changed. So something is actually going on down
there.
So I don't think there's anything you can do about your problem from the
app level; it's a bug in driver-level code. I don't imagine that
blithely calling MIDIRestart() all the time is a recommended practice,
so I wouldn't rely on that.
If you want to do some testing of endpoints appearing or disappearing,
try creating some virtual sources or destinations. These do seem to work
as expected.
--
Kurt Revis
email@hidden