Re: Getting node class data
Re: Getting node class data
- Subject: Re: Getting node class data
- From: Robert Grant <email@hidden>
- Date: Wed, 16 Oct 2002 08:11:09 -0400
Thanks Bill, glad to know I'm not losing it :-)
Thanks to your workarounds and toll-free bridging between Cocoa & CF I
think
I've got the persistence stuff working. (That malloc/free stuff was
making me nervous
anyway ;-))
Robert.
On Tuesday, October 15, 2002, at 09:49 PM, Bill Stewart wrote:
Oh...
There is a workaround though that you can use.
Use the GetNodeInfo call to get the AudioUnit for that node, then just
call
its GetClassInfo property yourself - that will give you the
CFPropertyList
for that unit - (and is what the fixed version does anyway)
Bill
on 15/10/02 6:46 PM, Bill Stewart wrote:
Thus - on further inspection (sigh!) this hasn't been hooked up...
(I've fixed
it now, and we'll try to have this available as soon as we can)
So, how this is *meant* to work...
You can make a node with class data:
AUGraphNewNode (mGraph, NULL, 0, myCFPropList, &myNode)
- this does work:)
In this case you don't need to specify the component description,
because all
of the info for that is contained within the class data.
I've also decided to get stricter about the size stuff (this has a
lot of
history that I'm embarrassed to report here) - originally, this was
going to
be some blob of memory, but we never did it that way, then we did the
CF
version, thought that maybe it should work either way, only now to
find that
it really doesn't.... So, its IS ONLY going to work with CF structs
in the
future (ie. The classDataSize value will be ignored)
So then, if this were working, this is how you'd get the class info:
AUGraphGetNodeInfo (mGraph, myNode, NULL, NULL, &myCFPropList, NULL);
(Of course the first and last NULL can be Not-NULL if you want
either/both the
ComponentDescription or the AudioUnit)
If you want to use myCFPropList you should take a CFRetain on this,
and do a
CFRelease on it when you're done with it.
Sorry about the hassles.
Bill
on 15/10/02 7:54 AM, Robert Grant wrote:
Sorry for all these questions....
I'm trying to save the class data for a node, here's my code:
- (void)encodeWithCoder:(NSCoder*)coder
{
void* bytes;
UInt32 size;
OSStatus status = AUGraphGetNodeInfo(m_graph, m_node, NULL, &size,
NULL, NULL);
NSLog(@"GetNodeInfo status: %d", status);
bytes = malloc(size);
status = AUGraphGetNodeInfo(m_graph, m_node, NULL, &size, &bytes,
NULL);
NSLog(@"GetNodeInfo status: %d", status);
[coder encodeBytes: bytes length: size];
free(bytes);
}
First I'm getting the size of the class data and then malloc'ing a
buffer
of that size.
The problem is that size is coming back 0. This shouldn't be the case
should it?
This is happening with any node I try it on.
Thanks,
Robert.
_______________________________________________
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.
--
mailto:email@hidden
tel: +1 408 974 4056
_______________________________________________________________________
___
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
_______________________________________________________________________
___
_______________________________________________
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.
_______________________________________________
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.