Пример #1
0
        public IEnumerable <AcmFormat> GetFormats(AcmFormatTag formatTag)
        {
            if (this.driverHandle == IntPtr.Zero)
            {
                throw new InvalidOperationException("Driver must be opened first");
            }
            this.tempFormatsList = new List <AcmFormat>();
            AcmFormatDetails acmFormatDetails = default(AcmFormatDetails);

            acmFormatDetails.structSize         = Marshal.SizeOf(acmFormatDetails);
            acmFormatDetails.waveFormatByteSize = 1024;
            acmFormatDetails.waveFormatPointer  = Marshal.AllocHGlobal(acmFormatDetails.waveFormatByteSize);
            acmFormatDetails.formatTag          = (int)formatTag.FormatTag;
            MmResult arg_9C_0 = AcmInterop.acmFormatEnum(this.driverHandle, ref acmFormatDetails, new AcmInterop.AcmFormatEnumCallback(this.AcmFormatEnumCallback), IntPtr.Zero, AcmFormatEnumFlags.None);

            Marshal.FreeHGlobal(acmFormatDetails.waveFormatPointer);
            MmException.Try(arg_9C_0, "acmFormatEnum");
            return(this.tempFormatsList);
        }
Пример #2
0
 private bool AcmFormatEnumCallback(IntPtr hAcmDriverId, ref AcmFormatDetails formatDetails, IntPtr dwInstance, AcmDriverDetailsSupportFlags flags)
 {
     this.tempFormatsList.Add(new AcmFormat(formatDetails));
     return(true);
 }
Пример #3
0
 public static extern MmResult acmFormatEnum(IntPtr hAcmDriver, ref AcmFormatDetails formatDetails, AcmInterop.AcmFormatEnumCallback callback, IntPtr instance, AcmFormatEnumFlags flags);
Пример #4
0
 internal AcmFormat(AcmFormatDetails formatDetails)
 {
     this.formatDetails = formatDetails;
     this.waveFormat    = WaveFormat.MarshalFromPtr(formatDetails.waveFormatPointer);
 }