private static unsafe int LockForProcessImpl(IntPtr thisObject, int inputLockedParameterCount, LockParameters.__Native *pInputLockedParameters, int outputLockedParameterCount, LockParameters.__Native *pOutputLockedParameters) { try { var shadow = ToShadow <AudioProcessorShadow>(thisObject); var callback = (AudioProcessor)shadow.Callback; var inputLockedParameters = new LockParameters[inputLockedParameterCount]; for (int i = 0; i < inputLockedParameters.Length; i++) { var param = new LockParameters(); param.__MarshalFrom(&pInputLockedParameters[i]); inputLockedParameters[i] = param; } var ouputLockedParameters = new LockParameters[outputLockedParameterCount]; for (int i = 0; i < ouputLockedParameters.Length; i++) { var param = new LockParameters(); param.__MarshalFrom(&pOutputLockedParameters[i]); ouputLockedParameters[i] = param; } callback.LockForProcess(inputLockedParameters, ouputLockedParameters); } catch (Exception exception) { return((int)SharpDX.Result.GetResultFromException(exception)); } return(0); }
private static unsafe int LockForProcessImpl(IntPtr thisObject, int inputLockedParameterCount, LockParameters.__Native* pInputLockedParameters, int outputLockedParameterCount, LockParameters.__Native* pOutputLockedParameters) { try { var shadow = ToShadow<AudioProcessorShadow>(thisObject); var callback = (AudioProcessor)shadow.Callback; var inputLockedParameters = new LockParameters[inputLockedParameterCount]; for (int i = 0; i < inputLockedParameters.Length; i++) { var param = new LockParameters(); param.__MarshalFrom(&pInputLockedParameters[i]); inputLockedParameters[i] = param; } var ouputLockedParameters = new LockParameters[outputLockedParameterCount]; for (int i = 0; i < ouputLockedParameters.Length; i++) { var param = new LockParameters(); param.__MarshalFrom(&pOutputLockedParameters[i]); ouputLockedParameters[i] = param; } callback.LockForProcess(inputLockedParameters, ouputLockedParameters); } catch (Exception exception) { return (int)SharpDX.Result.GetResultFromException(exception); } return 0; }
/// <summary> /// Called by XAudio2 to lock the input and output configurations of an XAPO allowing it to /// do any final initialization before {{Process}} is called on the realtime thread. /// </summary> /// <param name="inputLockedParameters"> Array of input <see cref="SharpDX.XAPO.LockParameters"/> structures.pInputLockedParameters may be NULL if InputLockedParameterCount is 0, otherwise itmust have InputLockedParameterCount elements.</param> /// <param name="outputLockedParameters"> Array of output <see cref="SharpDX.XAPO.LockParameters"/> structures.pOutputLockedParameters may be NULL if OutputLockedParameterCount is 0, otherwise itmust have OutputLockedParameterCount elements.</param> /// <returns>No documentation.</returns> /// <unmanaged>HRESULT IXAPO::LockForProcess([None] UINT32 InputLockedParameterCount,[In, Buffer, Optional] const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pInputLockedParameters,[None] UINT32 OutputLockedParameterCount,[In, Buffer, Optional] const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pOutputLockedParameters)</unmanaged> public void LockForProcess(LockParameters[] inputLockedParameters, LockParameters[] outputLockedParameters) { LockForProcess_(inputLockedParameters.Length, inputLockedParameters, outputLockedParameters.Length, outputLockedParameters); }