Version

    Other Documentation

menu_open
Wwise SDK 2021.1.14

◆ BatchWrite()

virtual AKRESULT AK::StreamMgr::IAkIOHookDeferredBatch::BatchWrite ( AkUInt32  in_uNumTransfers,
BatchIoTransferItem in_pTransferItems,
AkBatchIOCallback  in_pBatchIoCallback,
AKRESULT io_pDispatchResults 
)
pure virtual

Write multiple data to multiple files (asynchronous).

Remarks
  • Queue up multiple write requests at once, using the provided array of in_pTransferItems. There will be in_uNumTransfers number of items in the array.
  • io_pDispatchResults will contain an in_uNumTransfers number of items in the array. Each item in io_pDispatchResults should be set to AK_Success if the corresponding write was successfully dispatched, and set to AK_Failure otherwise. As well, the return value should be a cumulative result of the dispatches, where AK_Success indicates all requests were dispatched successfully, and io_pDispatchResults will not be investigated, whereas AK_Fail indicates at least one failure.
  • When a given write, or some set of writes has completed - whether it was successful, cancelled, or failed - call in_pBatchIoCallback for the corresponding transfer. Pass in the list of AkAsyncIOTransferInfo objects to receive the callback, as well as a list of results for each transfer, e.g. AK_Success or some other AKRESULT. Do not call in_pBatchIoCallback for transfers that were not dispatched (as indicated by the corresponding value in io_pDispatchResults).
  • The pointer to each BatchIoTransferItem::pTransferInfo will be valid until the high-level device is notified through the callback. The array of in_pTransferItems will not be valid, though.
  • File position passed in each BatchIoTransferItem::pTransferInfo takes the offset of this file relative to AkFileDesc::hFile (described with AkFileDesc::uSector). It is computed by the high-level device as "pFileDesc->uSector * Block_Size + Stream_Position", where Block_Size is obtained via AK::StreamMgr::IAkLowLevelIOHook::GetBlockSize().
Returns
  • AK_Success: All I/O requests were successfully dispatched. in_pBatchIoCallback must be called for each write that completes.
  • AK_Fail: At least one failure occurred when dispatching writes. The values of io_pDispatchResults should indicate which operation failed to be dispatched.
Parameters
in_uNumTransfers Number of transfers to process
in_pTransferItems List of transfer items to process
in_pBatchIoCallback Callback to execute to handle completion of multiple items simultaneously
io_pDispatchResults Output result codes to indicate if a transfer was successfully dispatched

Implemented in AK::StreamMgr::IAkIOHookDeferred.


Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise