• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Endpoint refcons are NULL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Endpoint refcons are NULL


  • Subject: Endpoint refcons are NULL
  • From: Andy <email@hidden>
  • Date: Thu, 5 Sep 2002 18:31:22 +0100

Here's a code extract ...

elsewhere in the code endpoints are created and refcons are set using MIDIEndpointSetRefCons()
also elsewhere I extract the endpoint refcons and use them successfully, but when I receive this notification ...

void ClientNotifyProc(const MIDINotification * message, void *refCon)
{
switch ( message->messageID ) {

...

case kMIDIMsgObjectRemoved :
{
MIDIObjectAddRemoveNotification * marn = (MIDIObjectAddRemoveNotification *) message;
if ( marn->childType == kMIDIObjectType_Source ) {
// child = source endpoint
// parent = port that owns endpoint
printf("MIDI SOURCE REMOVED FROM SETUP parent = X, child = X\n", (int)marn->parent, (int)marn->child);

void * ref1 = 0;
void * ref2 = 0;
USBDevice * usbDevice;
OSStatus err = MIDIEndpointGetRefCons((MIDIEndpointRef)marn->child, &ref1, &ref2);

printf("endpoint rc's 1 = X, 2 = X, err = %d\n", (int)ref1, (int)ref2, (int)err);
}
}
break;
}
}

console output is this ...


MIDI SOURCE REMOVED FROM SETUP parent = 09810012, child = 09810013
endpoint rc's 1 = 00000000, 2 = 00000000, err = -50


Parent and Child values correspond to port and endpoint that were created earlier on.
Why the -50 error, (param error ?)
Is it because the endpoints have already been destroyed and the MIDIEndpointRef (marn->child) is no longer valid ?
_______________________________________________
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.
  • Prev by Date: Automatically stop MusicPlayer
  • Next by Date: Re: MIDI Channel 10 on the DLSMusicDevice?
  • Previous by thread: Re: Automatically stop MusicPlayer
  • Next by thread: mic or line input selection?
  • Index(es):
    • Date
    • Thread