Ejemplo n.º 1
0
        internal IntPtr GetProperty(AudioFilePropertyId id, uint size)
        {
            // Callers must release this!
            var unmanagedValue = Marshal.AllocHGlobal((int)size);

            SafeNativeMethods.AudioFileGetProperty(Handle, id, ref size, unmanagedValue);
            return(unmanagedValue);
        }
Ejemplo n.º 2
0
        internal T GetProperty <T>(AudioFilePropertyId id) where T : unmanaged
        {
            var size           = (uint)Marshal.SizeOf(typeof(T));
            var unmanagedValue = Marshal.AllocHGlobal((int)size);

            try
            {
                SafeNativeMethods.AudioFileGetProperty(Handle, id, ref size, unmanagedValue);
                return(Marshal.PtrToStructure <T>(unmanagedValue));
            }
            finally
            {
                Marshal.FreeHGlobal(unmanagedValue);
            }
        }
Ejemplo n.º 3
0
 internal static extern AudioFileStatus AudioFileGetPropertyInfo(
     [NotNull] AudioFileHandle handle,
     AudioFilePropertyId id,
     out uint dataSize,
     out uint isWritable);
Ejemplo n.º 4
0
 internal static extern AudioFileStatus AudioFileGetProperty(
     [NotNull] AudioFileHandle handle,
     AudioFilePropertyId id,
     ref uint size,
     [Out] IntPtr data);
Ejemplo n.º 5
0
 internal void GetPropertyInfo(AudioFilePropertyId id, out uint dataSize, out uint isWritable) =>
 SafeNativeMethods.AudioFileGetPropertyInfo(Handle, id, out dataSize, out isWritable);
Ejemplo n.º 6
0
 internal AudioFileStatus GetPropertyInfo(AudioFilePropertyId id, out uint dataSize, out uint isWritable)
 {
     return(SafeNativeMethods.AudioFileGetPropertyInfo(Handle, id, out dataSize, out isWritable));
 }