IAudioRenderClient.cs 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // -----------------------------------------
  2. // SoundScribe (TM) and related software.
  3. //
  4. // Copyright (C) 2007-2011 Vannatech
  5. // http://www.vannatech.com
  6. // All rights reserved.
  7. //
  8. // This source code is subject to the MIT License.
  9. // http://www.opensource.org/licenses/mit-license.php
  10. //
  11. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17. // THE SOFTWARE.
  18. // -----------------------------------------
  19. using System;
  20. using System.Runtime.InteropServices;
  21. using Vannatech.CoreAudio.Enumerations;
  22. namespace Vannatech.CoreAudio.Interfaces
  23. {
  24. /// <summary>
  25. /// Enables a client to write output data to a rendering endpoint buffer.
  26. /// </summary>
  27. /// <remarks>
  28. /// MSDN Reference: http://msdn.microsoft.com/en-us/library/dd368242.aspx
  29. /// </remarks>
  30. public partial interface IAudioRenderClient
  31. {
  32. /// <summary>
  33. /// Retrieves a pointer to the next available space in the rendering endpoint buffer.
  34. /// </summary>
  35. /// <param name="frameCount">The number of audio frames in the data packet that the caller plans to write to the requested space in the buffer.</param>
  36. /// <param name="dataPointer">Receives the starting address of the buffer area into which the caller will write the data packet.</param>
  37. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  38. [PreserveSig]
  39. int GetBuffer(
  40. [In] [MarshalAs(UnmanagedType.U4)] UInt32 frameCount,
  41. [Out] [MarshalAs(UnmanagedType.SysInt)] out IntPtr dataPointer);
  42. /// <summary>
  43. /// Releases the buffer space acquired in the previous call to the <see cref="IAudioRenderClient.GetBuffer"/> method.
  44. /// </summary>
  45. /// <param name="frameCount">The number of audio frames written by the client to the data packet.</param>
  46. /// <param name="bufferFlag">The buffer-configuration flags. This should be either zero or <see cref="AUDCLNT_BUFFERFLAGS.AUDCLNT_BUFFERFLAGS_SILENT"/></param>
  47. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  48. [PreserveSig]
  49. int ReleaseBuffer(
  50. [In] [MarshalAs(UnmanagedType.U4)] UInt32 frameCount,
  51. [In] [MarshalAs(UnmanagedType.U4)] UInt32 bufferFlag);
  52. }
  53. }