Creating and registering new media sequence types

To play and record media data stored in a file format that isn't recognized by the time-media frameworks, you can derive a sequence type that can translate between the new data format and one of the supported formats. Before the new class can be used, it must be registered with the Media Registry. Once your classes are registered, they can be used seamlessly by the media frameworks.

The registry also supports the deregistration of classes and default selection of media components and sequences.

To add support for a new type of media sequence, you:

  1. Derive the new sequence type from TMediaSequence or a media-specific sequence type such as TAudioSequence.
  2. Derive a media sequence creator from TMediaSequenceCreator for the new sequence type.
  3. Register the sequence creator with the Media Registry.
The media sequence creator allows the Media Registry to automatically create sequences of the new type given a file in the appropriate format. For example, when a user provides a file system entity for a media data file that gets passed to one of the convenience players, the player instantiates a TMediaRegistryCaller and calls TMediaRegistryCaller::CreateSequence. The registry iterates through its collection of TMediaSequenceCreators until it finds the sequence type that matches the data file.

Once the sequence type is registered, you also can create sequences of that type directly. For example, to create an empty sequence for recording you can call TMediaRegistryCaller::CreateNewSequence and pass in the type of sequence you want to record. To create a sequence for a particular file, you use TMediaRegistryCaller::CreateSequence, passing in the file system entity for the file.

NOTE All media components, not only sequences, are registered with the Media Registry. This allows you to create default media components by passing TMediaRegistryCaller::CreateDefaultComponent the component type you want to create. You use the TMediaComponentType static functions to access the component types.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker