Re: How to remember the MIDIEndpoint after reboot
Re: How to remember the MIDIEndpoint after reboot
- Subject: Re: How to remember the MIDIEndpoint after reboot
- From: Philippe Wicker <email@hidden>
- Date: Sun, 15 Jun 2003 11:41:16 +0200
On Sunday, June 15, 2003, at 10:47 AM, Nobuyasu Jinnai/神内伸恭 wrote:
>
Dir sir,
>
>
I have to remember MIDIEndpoint of user selected after reboot
>
in a setting file.
>
Is there any way to determin MIDIEndpoint after reboot from this file?
>
Can MIDIUniqueID use for this perpose?
It depends of the "entity" to which the endpoint was related. If the
"entity" is a non persistent virtual source /destination created by
some MIDI app, then the life time of the endpoint ref is the life time
of the app. You may try this little "command line" program which shows
that the endpoint ref changes at each execution. (NOTE: add CoreMIDI
and CoreFoundation frameworks to the project). I didn't try to print an
endpoint ref asssociated with a physical device, however I think those
refs are persistent. You can find some explanations about this topic in
CoreMIDI/CoreServices.h.
#include <CoreMIDI/CoreMIDI.h>
int main (int argc, char* argv[])
{
MIDIClientRef client_ref ;
MIDIEndpointRef endpoint_ref ;
// Create the Midi Client Object
MIDIClientCreate ( CFSTR("MyClient"), NULL, NULL, &client_ref) ;
// Create the Midi Endpoint Object
MIDISourceCreate ( client_ref, CFSTR("MyEndpoint"), &endpoint_ref) ;
// Print the endpoint ref
printf ("endpoint_ref 0x%x\n", endpoint_ref) ;
// Dispose client and endpoint refs
MIDIClientDispose(client_ref) ;
MIDIEndpointDispose(endpoint_ref) ;
}
>
>
Best regards,
>
>
--Jinnai
>
_______________________________________________
>
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.
>
>
Philippe Wicker
email@hidden
_______________________________________________
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.