MIDIThruConnection Confusion
MIDIThruConnection Confusion
- Subject: MIDIThruConnection Confusion
- From: Michael Fielitz <email@hidden>
- Date: Fri, 12 Apr 2013 10:26:01 +0200
Hi,
does anybody has some experiences with these functions? The documentation for MIDIThruConnectionCreate says:
inPersistentOwnerID - If null, then the connection is marked as owned by the client and will be automatically disposed with the client.
However, when my program has been terminating abnormally, the thru daemon is still hanging around and doing its job whenever a coremidi process is running.
The only way to kill this beast seems to be to delete the file:
~/Preferences/ByHost/com.apple.MIDI.XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.plist
I also tried the other option with PersistentOwnerID and looking for dangling refs on program start. The problem is, I have no idea how to properly deserialize outConnectionList:
- (void)disposeAllThruConnections;
{
CFDataRef outConnectionList;
OSStatus status = MIDIThruConnectionFind(CFSTR("de.12decode.MW2E"), &outConnectionList);
if (status == noErr && CFDataGetLength(outConnectionList) != 0) {
#if 0
NSArray *array = [NSKeyedUnarchiver unarchiveObjectWithData:(NSData *)outConnectionList];
for (int i = 0; i < [array count]; i++) {
MIDIThruConnectionRef ref = (MIDIThruConnectionRef)[array objectAtIndex:i];
MIDIThruConnectionDispose(ref);
}
#endif
}
}
The code above crashes on unarchiveObjectWithData. Are there any other possibilities?
Michael
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden