IAudioClock.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. namespace Vannatech.CoreAudio.Interfaces
  22. {
  23. /// <summary>
  24. /// Enables a client to monitor a stream's data rate and the current position in the stream.
  25. /// </summary>
  26. /// <remarks>
  27. /// MSDN Reference: http://msdn.microsoft.com/en-us/library/dd370881.aspx
  28. /// </remarks>
  29. public partial interface IAudioClock
  30. {
  31. /// <summary>
  32. /// Gets the device frequency.
  33. /// </summary>
  34. /// <param name="frequency">Receives the device frequency.</param>
  35. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  36. [PreserveSig]
  37. int GetFrequency(
  38. [Out] [MarshalAs(UnmanagedType.U8)] out UInt64 frequency);
  39. /// <summary>
  40. /// Gets the current position in the stream.
  41. /// </summary>
  42. /// <param name="devicePosition">Receives the device position.</param>
  43. /// <param name="counterPosition">Receives the value of the performance counter at the time that the device read the position.</param>
  44. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  45. [PreserveSig]
  46. int GetPosition(
  47. [Out] [MarshalAs(UnmanagedType.U8)] out UInt64 devicePosition,
  48. [Out, Optional] [MarshalAs(UnmanagedType.U8)] out UInt64 counterPosition);
  49. /// <summary>
  50. /// Reserved for future use.
  51. /// </summary>
  52. /// <param name="characteristics">Receives a value that indicates the characteristics of the audio clock.</param>
  53. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  54. [PreserveSig]
  55. int GetCharacteristics(
  56. [Out] [MarshalAs(UnmanagedType.U4)] out UInt32 characteristics);
  57. }
  58. }