Share via


IWMEncStatistics.IndexerStats

Windows Media Encoder SDK banner art

The IndexerStats property retrieves an IWMEncIndexerStats object to determine the number of files being indexed, the name of a file in the queue, and the percentage of indexing completed on the current file.

Syntax

object = IWMEncStatistics.IndexerStats;

Parameters

This property takes no parameters.

Property Value

An IWMEncIndexerStats object.

If this property fails, it returns an error number.

Number Description
0xC00D1B7D No statistics are currently available.

Remarks

This property is read-only. The IWMEncIndexerStats object monitors the indexing process for a Windows Media file. A file index enables operations, such as fast forwarding, that must seek to specific time offsets in the file. If you specify an archive file, the indexing process starts automatically on a separate thread in the background of the encoding process immediately after the archiving process stops. The indexing process stops at the end of the file.

Example Code

using WMEncoderLib;

try
{
// Create a WMEncoder object.
  WMEncoder Encoder;
  Encoder = new WMEncoder();

// Configure the encoding session including the sources, output,
// and profile, then start encoding.

// You can create a timer control to retrieve the statistics
// (as follows) after you start the encoding session.

// Declare objects and variables.
  IWMEncStatistics Stats;
  IWMEncIndexerStats IndexStats;
  int lFileCount;
  string sFileName;
  int lPercent;

// Retrieve an IWMEncStatistics object, and use it to
// retrieve an IWMEncIndexerStats object.
  Stats = Encoder.Statistics;
  IndexStats = (IWMEncIndexerStats)Stats.IndexerStats;

// Retrieve the number of files remaining in the queue.
  lFileCount = IndexStats.FileCount;

// Retrieve the name of a specific file in the queue.
  sFileName = IndexStats.get_FileName(0);

// Retrieve the percentage of indexing completed on the
// current file.
  lPercent = IndexStats.PercentComplete;
}

catch (Exception e)
{
     // TODO: Handle exceptions.
}

Requirements

Reference: Windows Media Encoder

Namespace: WMEncoderLib

Assembly: Interop.WMEncoderLib.dll

Library: WMEncoderLib.dll

See Also