Microsoft DirectX 8.1 (C++)

Implementing a Guide Store Loader Using the TIF (C++)

This topic applies to Windows XP Home Edition and Windows XP Professional only.

This topic describes a typical implementation of a Guide Store Loader that obtains its data from the BDA MPEG-2 Transport Information Filter (TIF).

The loader object implements the following interfaces:

The loader also creates a GuideStore object for writing data to the repository.

An application can use the loader with the TIF by taking the following steps:

  1. Load the video control.
  2. Create the loader object and pass it a pointer to the IMSVidCtl interface. If your application is written in Visual Basic, the loader will require an automation-compatible interface to receive the MSVidCtl object.
  3. The loader uses the IMSVidCtl interface to obtain IMSVidGraphSegmentContainer using QueryInterface and calls the get_Graph method to obtain a pointer to the filter graph. Enumerate the filters in the usual way (see Enumerating Devices and Filters) and call QueryInterface using each returned IBaseFilter pointer until you find the one that supports IGuideData.
  4. Obtain the IGuideDataLoader interface.
  5. Initialize the loader by calling IGuideDataLoader::Init, passing in a pointer to the IGuideData interface.

The TIF now sends events to the loader when data changes occur, and the loader responds in its implementation of the IGuideDataEvent interface by updating the Guide Store database. To obtain current data, the loader uses the methods of the IGuideData interface it obtained during initialization.

For example, when new schedule entries are reported by the TIF, the loader's IGuideDataEvent::ScheduleEntryChanged method is called. The loader might then take the following steps:

  1. Call IGuideData::GetScheduleEntryIDs to retrieve a collection of all schedule entry identifiers. This collection supports the COM IEnumVARIANT interface for enumeration.
  2. For each schedule entry in the collection, call IGuideData::GetScheduleEntryProperties to retrieve the IEnumGuideDataProperties interface of a collection of metaproperties for that entry.
  3. Iterate through the collection of metaproperties to find the value of the "Description.ID" metaproperty.
  4. Call IScheduleEntries::get_ItemWithKey to find an object in the Guide Store repository that has a matching "Description.ID" metaproperty value. (This method is called on an ordered ScheduleEntries collection previously obtained by using IScheduleEntries::get_ItemsByKey, where the key was the "Description.ID" metaproperty type.)
  5. If a matching ScheduleEntry object exists, update its properties; if it does not, create it.