/// <summary> /// Map the <see cref="MemoryPoolState"/> on the <see cref="Dsp.AudioProcessor"/>. /// </summary> /// <param name="memoryPool">The <see cref="MemoryPoolState"/> to map.</param> /// <returns>Returns the DSP address mapped.</returns> public DspAddress Map(ref MemoryPoolState memoryPool) { DspAddress result = AudioProcessorMemoryManager.Map(GetProcessHandle(ref memoryPool), memoryPool.CpuAddress, memoryPool.Size); if (result != 0) { memoryPool.DspAddress = result; } return(result); }
/// <summary> /// Map the <see cref="AddressInfo"/> to the <see cref="Dsp.AudioProcessor"/>. /// </summary> /// <param name="addressInfo">The <see cref="AddressInfo"/> to map.</param> /// <returns>Returns true if mapping was performed.</returns> private bool AssignDspAddress(ref AddressInfo addressInfo) { if (addressInfo.CpuAddress == 0) { return(false); } if (_memoryPools.Length > 0) { Span <MemoryPoolState> memoryPool = FindMemoryPool(addressInfo.CpuAddress, addressInfo.Size); if (!memoryPool.IsEmpty) { addressInfo.SetupMemoryPool(memoryPool); return(true); } } if (_isForceMapEnabled) { DspAddress dspAddress = AudioProcessorMemoryManager.Map(_processHandle, addressInfo.CpuAddress, addressInfo.Size); addressInfo.ForceMappedDspAddress = dspAddress; AudioProcessorMemoryManager.Map(_processHandle, addressInfo.CpuAddress, addressInfo.Size); } else { unsafe { addressInfo.SetupMemoryPool(MemoryPoolState.Null); } } return(false); }