Re: kAudioUnitProperty_ClassInfo endianness
Re: kAudioUnitProperty_ClassInfo endianness
- Subject: Re: kAudioUnitProperty_ClassInfo endianness
- From: William Stewart <email@hidden>
- Date: Tue, 13 Dec 2005 12:33:04 -0800
The implementation in AUBase does a couple of things that are worthy
of note. This has been endian aware since the first time we shipped
this. If you are just using this code, any presets you have should
read fine between PPC and Intel machines.
(1) The top level fields (such as the AU's type) all use CFNumbers or
other CF objects that are endian aware (CFString)
For these defined fields, the values are always strings - a .aupreset
file is just a plist file and can be expected to be read in a text
editor.
For instance, here are the contents of a AU Preset file from Apple's
bandpass AU:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://
www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>data</key>
<data>
AAAAAAAAAAAAAAACAAAAAEH7a+kAAAABREDxjA==
</data>
<key>manufacturer</key>
<integer>1634758764</integer>
<key>name</key>
<string>lo</string>
<key>subtype</key>
<integer>1651532147</integer>
<key>type</key>
<integer>1635083896</integer>
<key>version</key>
<integer>0</integer>
</dict>
</plist>
(2) In the element objects where the parameter values are saved, they
are saved as a block of binary data in a CFData object attached to
the "data" key. This data is flipped to big-endian before it is added
to the CFData object.
However, we make no guarantees about the contents of this "data" key
- it is a blob of data that is private to the AU's implementation and
we place no expectations on any other code being able to parse the
contents of that key. Nor have we expected AUs to necessarily use
this scheme for persisting their state (though we have advised AU
developers to use it).
Any other key the AU defines for its own use of course is also
defined for its representation with the priviso that it must be able
to be represented within the broad structure of an xml/plist file of
the format described above.
Bill
On 13/12/2005, at 10:18 AM, Dominic Feira wrote:
Is kAudioUnitProperty_ClassInfo defined to contain a certain
endianness? It would be nice if it is always network byte order.
I'm just concerned about saving an AUs state on PPC and moving it
to Intel, and vice-versa.
Thanks.
Dominic Feira / Code Monkey / Ambrosia Software, Inc.
_______________________________________________
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
--
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
________________________________________________________________________
__
_______________________________________________
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