void RegisterSampleSaver(struct SaveSampleReg *reg)
RegisterSampleSaver()
has to
tell Hollywood whether it wants to register another sample saver. Hollywood
will pass a pointer to a struct SaveSampleReg
to this function.
This structure looks like this:
struct SaveFormatReg { ULONG CapsMask; [out] ULONG FormatID; [in/out] STRPTR FormatName; [out] }; struct SaveSampleReg { struct SaveFormatReg hdr; }; |
Your implementation has to do the following with the individual structure members:
CapsMask:
HWSAVESMPCAPS_MORE:
RegisterSampleSaver()
again so that
you can register another saver. If you don't want to register another saver,
don't set this flag. (V5.3)
FormatID:
FormatID
you have specified
must not be changed or you will break compatibility with applets or executables
that have been compiled with previous versions. If you are registering more
than one sample saver using HWSAVESMPCAPS_MORE
, you can look at the
FormatID
member to tell how many times Hollywood has already called
RegisterSampleSaver()
because FormatID
will contain the identifier
of the last sample saver you registered. If FormatID
is 0, then this
is the first call to RegisterSampleSaver()
. Note that it is not recommended
to keep your own counter because Hollywood might call RegisterSampleSaver()
multiple times, i.e. it might first loop over RegisterSampleSaver()
to determine
how many sample savers there are in total and then it might loop over
RegisterSampleSaver()
again to actually register their names.
FormatName:
#SMPFMT_
prefix must not be included
in the string you pass. Hollywood will add this automatically, i.e. if you
pass the string "TESTFORMAT" here, Hollywood will make your sample saver
available under the constant #SMPFMT_TESTFORMAT
.
struct SaveSampleReg
to be filled out by your implementation