Ejemplo n.º 1
0
 public AcmDriverDetailsForm(AcmDriver driver)
 {
     InitializeComponent();
     AddLine("Long Name: {0}", driver.LongName);
     AddLine("Short Name: {0}", driver.ShortName);
     AddLine("Driver ID: {0}", driver.DriverId);
     driver.Open();
     AddLine("FormatTags:", driver.FormatTags);
     foreach (AcmFormatTag formatTag in driver.FormatTags)
     {
         AddLine("{0}: {1}", formatTag.FormatTagIndex, formatTag.FormatDescription);
         AddLine("   Standard Format Count: {0}", formatTag.StandardFormatsCount);
         AddLine("   Support Flags: {0}", formatTag.SupportFlags);
         AddLine("   Format Tag: {0}, Format Size: {1}", formatTag.FormatTag, formatTag.FormatSize);
         AddLine("   Formats:");
         foreach (AcmFormat format in driver.GetFormats(formatTag))
         {
             AddLine("   {0}: {1}", format.FormatIndex, format.FormatDescription);
             AddLine("      FormatTag: {0}, Support Flags: {1}", format.FormatTag, format.SupportFlags);
             AddLine("      WaveFormat: {0} {1}Hz {2} Channels {3} bits, Block Align: {4}, AverageBytesPerSecond: {5}, Extra Size: {6}",
                 format.WaveFormat.Encoding, format.WaveFormat.SampleRate, format.WaveFormat.Channels,
                 format.WaveFormat.BitsPerSample, format.WaveFormat.BlockAlign, format.WaveFormat.AverageBytesPerSecond,
                 format.WaveFormat.ExtraSize);
         }
     }
     driver.Close();
 }
Ejemplo n.º 2
0
 private string DescribeCodec(AcmDriver driver)
 {
     try
     {
         driver.Open();
         var builder = new StringBuilder();
         DescribeAcmDriver(driver, builder);
         foreach (var formatTag in driver.FormatTags)
         {
             DescribeAcmFormatTag(builder, formatTag);
             foreach (var format in driver.GetFormats(formatTag))
             {
                 DescribeAcmFormat(builder, format);
             }
         }
         driver.Close();
         return builder.ToString();
     }
     catch (Exception e)
     {
         return e.ToString();
     }
 }
Ejemplo n.º 3
0
 private string DescribeCodec(AcmDriver driver)
 {
     try
     {
         StringBuilder builder = new StringBuilder();
         builder.AppendFormat("Long Name: {0}\r\n", driver.LongName);
         builder.AppendFormat("Short Name: {0}\r\n", driver.ShortName);
         builder.AppendFormat("Driver ID: {0}\r\n", driver.DriverId);
         driver.Open();
         builder.AppendFormat("FormatTags:\r\n");
         foreach (AcmFormatTag formatTag in driver.FormatTags)
         {
             builder.AppendFormat("===========================================\r\n");
             builder.AppendFormat("Format Tag {0}: {1}\r\n", formatTag.FormatTagIndex, formatTag.FormatDescription);
             builder.AppendFormat("   Standard Format Count: {0}\r\n", formatTag.StandardFormatsCount);
             builder.AppendFormat("   Support Flags: {0}\r\n", formatTag.SupportFlags);
             builder.AppendFormat("   Format Tag: {0}, Format Size: {1}\r\n", formatTag.FormatTag, formatTag.FormatSize);
             builder.AppendFormat("   Formats:\r\n");
             foreach (AcmFormat format in driver.GetFormats(formatTag))
             {
                 builder.AppendFormat("   ===========================================\r\n");
                 builder.AppendFormat("   Format {0}: {1}\r\n", format.FormatIndex, format.FormatDescription);
                 builder.AppendFormat("      FormatTag: {0}, Support Flags: {1}\r\n", format.FormatTag, format.SupportFlags);
                 builder.AppendFormat("      WaveFormat: {0} {1}Hz Channels: {2} Bits: {3} Block Align: {4}, AverageBytesPerSecond: {5} ({6:0.0} kbps), Extra Size: {7}\r\n",
                     format.WaveFormat.Encoding, format.WaveFormat.SampleRate, format.WaveFormat.Channels,
                     format.WaveFormat.BitsPerSample, format.WaveFormat.BlockAlign, format.WaveFormat.AverageBytesPerSecond,
                     (format.WaveFormat.AverageBytesPerSecond * 8) / 1000.0,
                     format.WaveFormat.ExtraSize);
                 if (format.WaveFormat is WaveFormatExtraData && format.WaveFormat.ExtraSize > 0)
                 {
                     WaveFormatExtraData wfed = (WaveFormatExtraData)format.WaveFormat;
                     builder.Append("      Extra Bytes:\r\n      ");
                     for (int n = 0; n < format.WaveFormat.ExtraSize; n++)
                     {
                         builder.AppendFormat("{0:X2} ", wfed.ExtraData[n]);
                     }
                     builder.Append("\r\n");
                 }
             }
         }
         driver.Close();
         return builder.ToString();
     }
     catch (Exception e)
     {
         return e.ToString();
     }
 }