CoreMIDI: problem connecting MIDI I/F after app launch
CoreMIDI: problem connecting MIDI I/F after app launch
- Subject: CoreMIDI: problem connecting MIDI I/F after app launch
- From: Hidetomo Katsura <email@hidden>
- Date: Tue, 9 Mar 2004 14:39:30 -0800
my app currently keeps the indexes of the MIDI source and destination
in the prefs. and it checks if the indexes are still within the current
number of sources and destinations at app launch. and if i connect the
MIDI interface after app launch, and select the source and destination
in my app's MIDI setup panel, MIDISendSysex() doesn't send anything
even though it returns noErr and the completion proc gets "complete"
TRUE.
i have extracted the MIDI related code from my app and wrote a tiny
command-line test app, and it works fine if it doesn't call (#if 0)
MIDIGetNumberOfSources/MIDIGetNumberOfDestinations before
MIDIClientCreate/MIDIInputPortCreate/.../MIDISendSysex, but it doesn't
work if it calls (#if 1)
MIDIGetNumberOfSources/MIDIGetNumberOfDestinations. CoreMIDI APIs
return noErr and ports and destination are non-NULL but the MIDI out
indicator of my MIDI interface (midisport 2x2) doesn't blink.
i also noticed that the MIDIInPortThread is already there after calling
MIDIGetNumberOfSources/MIDIGetNumberOfDestinations while probably it
shouldn't be.
does anybody have any suggestions how to workaround this problem
besides connecting the MIDI interface before app launch and not calling
MIDIGetNumberOfSources/MIDIGetNumberOfDestinations before other
CoreMIDI APIs?
--------
// pseudo code
#if 1
MIDIGetNumberOfSources();
MIDIGetNumberOfDestinations();
#endif
// for debug
printf( "HIT RETURN KEY AFTER CONNECTING MIDI I/F\n" );
getchar();
MIDIClientCreate();
MIDIInputPortCreate();
MIDIGetSource();
MIDIPortConnectSource();
MIDIOutputPortCreate();
MIDIGetDestination();
MIDISendSysex();
--------
regards,
katsura
_______________________________________________
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.