int ok = SaveSample(STRPTR filename, struct SaveSampleCtrl *ctrl);
struct SaveSampleCtrl
to this function. This structure looks like this:
struct SaveSampleCtrl { APTR Data; // [in] int DataSize; // [in] int Samples; // [in] int Channels; // [in] int Bits; // [in] int Frequency; // [in] ULONG Flags; // [in] ULONG FormatID; // [in] -- V5.3 STRPTR Adapter; // [in] -- V10.0 struct hwUserTagList *UserTags; // [in] -- V10.0 }; |
In this structure Hollywood passes the following information to your SaveSample()
function:
Data:
DataSize:
Data
buffer in bytes.
Samples:
Channels:
Bits:
Frequency:
Flags:
HWSNDFLAGS_BIGENDIAN
HWSNDFLAGS_SIGNEDINT
FormatID:
Adapter:
NULL
, Hollywood wants your plugin to
use the file adapter specified in Adapter
to save the sample. This means that you
have to use hw_FOpenExt() instead of hw_FOpen()
to save the sample. Make sure to check for Hollywood 10.0 before trying to access
this member because it isn't there in previous versions. See hw_FOpenExt for details. (V10.0)
UserTags:
UserTags
could
also be intended for another plugin, namely the file adapter plugin passed
in Adapter
. See User tags for details. Make sure to check for Hollywood 10.0
before trying to access this member because it isn't there in previous versions.
(V10.0)
This function has to return True
if the sample has been successfully saved or False
in case of an error.
struct SaveSampleCtrl
containing the sample to be savedTrue
or False
indicating success or failure