PageRenderTime 22ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/NAudio/MediaFoundation/IMFMediaEvent.cs

#
C# | 208 lines | 51 code | 34 blank | 123 comment | 0 complexity | d25c9f6ba8e36619065bf8e85d08aff9 MD5 | raw file
Possible License(s): CC-BY-SA-3.0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Runtime.InteropServices;
  4. using System.Text;
  5. using NAudio.CoreAudioApi.Interfaces;
  6. namespace NAudio.MediaFoundation
  7. {
  8. /// <summary>
  9. /// IMFMediaEvent - Represents an event generated by a Media Foundation object. Use this interface to get information about the event.
  10. /// http://msdn.microsoft.com/en-us/library/windows/desktop/ms702249%28v=vs.85%29.aspx
  11. /// Mfobjects.h
  12. /// </summary>
  13. [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("DF598932-F10C-4E39-BBA2-C308F101DAA3")]
  14. public interface IMFMediaEvent : IMFAttributes
  15. {
  16. /// <summary>
  17. /// Retrieves the value associated with a key.
  18. /// </summary>
  19. new void GetItem([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [In, Out] ref PropVariant pValue);
  20. /// <summary>
  21. /// Retrieves the data type of the value associated with a key.
  22. /// </summary>
  23. new void GetItemType([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, out int pType);
  24. /// <summary>
  25. /// Queries whether a stored attribute value equals a specified PROPVARIANT.
  26. /// </summary>
  27. new void CompareItem([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, IntPtr Value, [MarshalAs(UnmanagedType.Bool)] out bool pbResult);
  28. /// <summary>
  29. /// Compares the attributes on this object with the attributes on another object.
  30. /// </summary>
  31. new void Compare([MarshalAs(UnmanagedType.Interface)] IMFAttributes pTheirs, int MatchType, [MarshalAs(UnmanagedType.Bool)] out bool pbResult);
  32. /// <summary>
  33. /// Retrieves a UINT32 value associated with a key.
  34. /// </summary>
  35. new void GetUINT32([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, out int punValue);
  36. /// <summary>
  37. /// Retrieves a UINT64 value associated with a key.
  38. /// </summary>
  39. new void GetUINT64([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, out long punValue);
  40. /// <summary>
  41. /// Retrieves a double value associated with a key.
  42. /// </summary>
  43. new void GetDouble([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, out double pfValue);
  44. /// <summary>
  45. /// Retrieves a GUID value associated with a key.
  46. /// </summary>
  47. new void GetGUID([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, out Guid pguidValue);
  48. /// <summary>
  49. /// Retrieves the length of a string value associated with a key.
  50. /// </summary>
  51. new void GetStringLength([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, out int pcchLength);
  52. /// <summary>
  53. /// Retrieves a wide-character string associated with a key.
  54. /// </summary>
  55. new void GetString([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pwszValue, int cchBufSize,
  56. out int pcchLength);
  57. /// <summary>
  58. /// Retrieves a wide-character string associated with a key. This method allocates the memory for the string.
  59. /// </summary>
  60. new void GetAllocatedString([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [MarshalAs(UnmanagedType.LPWStr)] out string ppwszValue,
  61. out int pcchLength);
  62. /// <summary>
  63. /// Retrieves the length of a byte array associated with a key.
  64. /// </summary>
  65. new void GetBlobSize([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, out int pcbBlobSize);
  66. /// <summary>
  67. /// Retrieves a byte array associated with a key.
  68. /// </summary>
  69. new void GetBlob([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pBuf, int cbBufSize,
  70. out int pcbBlobSize);
  71. /// <summary>
  72. /// Retrieves a byte array associated with a key. This method allocates the memory for the array.
  73. /// </summary>
  74. new void GetAllocatedBlob([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, out IntPtr ip, out int pcbSize);
  75. /// <summary>
  76. /// Retrieves an interface pointer associated with a key.
  77. /// </summary>
  78. new void GetUnknown([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid,
  79. [MarshalAs(UnmanagedType.IUnknown)] out object ppv);
  80. /// <summary>
  81. /// Associates an attribute value with a key.
  82. /// </summary>
  83. new void SetItem([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, IntPtr Value);
  84. /// <summary>
  85. /// Removes a key/value pair from the object's attribute list.
  86. /// </summary>
  87. new void DeleteItem([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey);
  88. /// <summary>
  89. /// Removes all key/value pairs from the object's attribute list.
  90. /// </summary>
  91. new void DeleteAllItems();
  92. /// <summary>
  93. /// Associates a UINT32 value with a key.
  94. /// </summary>
  95. new void SetUINT32([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, int unValue);
  96. /// <summary>
  97. /// Associates a UINT64 value with a key.
  98. /// </summary>
  99. new void SetUINT64([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, long unValue);
  100. /// <summary>
  101. /// Associates a double value with a key.
  102. /// </summary>
  103. new void SetDouble([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, double fValue);
  104. /// <summary>
  105. /// Associates a GUID value with a key.
  106. /// </summary>
  107. new void SetGUID([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [In, MarshalAs(UnmanagedType.LPStruct)] Guid guidValue);
  108. /// <summary>
  109. /// Associates a wide-character string with a key.
  110. /// </summary>
  111. new void SetString([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [In, MarshalAs(UnmanagedType.LPWStr)] string wszValue);
  112. /// <summary>
  113. /// Associates a byte array with a key.
  114. /// </summary>
  115. new void SetBlob([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] byte[] pBuf,
  116. int cbBufSize);
  117. /// <summary>
  118. /// Associates an IUnknown pointer with a key.
  119. /// </summary>
  120. new void SetUnknown([MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [In, MarshalAs(UnmanagedType.IUnknown)] object pUnknown);
  121. /// <summary>
  122. /// Locks the attribute store so that no other thread can access it.
  123. /// </summary>
  124. new void LockStore();
  125. /// <summary>
  126. /// Unlocks the attribute store.
  127. /// </summary>
  128. new void UnlockStore();
  129. /// <summary>
  130. /// Retrieves the number of attributes that are set on this object.
  131. /// </summary>
  132. new void GetCount(out int pcItems);
  133. /// <summary>
  134. /// Retrieves an attribute at the specified index.
  135. /// </summary>
  136. new void GetItemByIndex(int unIndex, out Guid pGuidKey, [In, Out] ref PropVariant pValue);
  137. /// <summary>
  138. /// Copies all of the attributes from this object into another attribute store.
  139. /// </summary>
  140. new void CopyAllItems([In, MarshalAs(UnmanagedType.Interface)] IMFAttributes pDest);
  141. /// <summary>
  142. /// Retrieves the event type.
  143. /// </summary>
  144. /// <remarks>
  145. /// virtual HRESULT STDMETHODCALLTYPE GetType(
  146. /// /* [out] */ __RPC__out MediaEventType *pmet) = 0;
  147. /// </remarks>
  148. void GetType([Out] out MediaEventType pmet);
  149. /// <summary>
  150. /// Retrieves the extended type of the event.
  151. /// </summary>
  152. /// <remarks>
  153. /// virtual HRESULT STDMETHODCALLTYPE GetExtendedType(
  154. /// /* [out] */ __RPC__out GUID *pguidExtendedType) = 0;
  155. /// </remarks>
  156. void GetExtendedType([Out] out Guid pguidExtendedType);
  157. /// <summary>
  158. /// Retrieves an HRESULT that specifies the event status.
  159. /// </summary>
  160. /// <remarks>
  161. /// virtual HRESULT STDMETHODCALLTYPE GetStatus(
  162. /// /* [out] */ __RPC__out HRESULT *phrStatus) = 0;
  163. /// </remarks>
  164. void GetStatus([MarshalAs(UnmanagedType.Error)] out int phrStatus);
  165. /// <summary>
  166. /// Retrieves the value associated with the event, if any.
  167. /// </summary>
  168. /// <remarks>
  169. /// virtual HRESULT STDMETHODCALLTYPE GetValue(
  170. /// /* [out] */ __RPC__out PROPVARIANT *pvValue) = 0;
  171. /// </remarks>
  172. void GetValue(out PropVariant pvValue);
  173. }
  174. }