Microsoft DirectX 8.0

Overview of the Timeline Components

The timeline in Microsoft® DirectShow® Editing Services (DES) is a COM component. The objects inside the timeline are also COM components. This article provides an overview of the interfaces exposed by the various objects.

This article contains the following topics:

For more information about timelines, see The Timeline Model. For a list of components in DES, see DirectShow Editing Services Components.

The Timeline

The timeline exposes the IAMTimeline interface. This interface contains methods for setting properties on the timeline; for adding groups to the timeline; and for creating timeline objects, such as groups, tracks, and sources. To create a new timeline, call the standard CoCreateInstance function as follows:

IAMTimeline *pTL = NULL;
hr = CoCreateInstance(CLSID_AMTimeline, NULL, CLSCTX_INPROC_SERVER, 
        IID_IAMTimeline, (void**)&pTL);

The new timeline is empty. At this point you can either load an existing project file (see Loading and Previewing a Project), or build up the timeline by creating and inserting new objects (see Constructing a Timeline).

Timeline Objects

Each type of object in the timeline—source, track, effect, and so forth—is a distinct COM object. However, an application does not create them using the CoCreateInstance function. Instead, it calls the IAMTimeline::CreateEmptyNode method. This method creates an object of the requested type, initializes it, and returns a pointer to the object. For details, see Constructing a Timeline.

Every timeline object exposes the IAMTimelineObj interface. In addition, the various object types support their own specialized interfaces:

Note that groups are a type of composition, so they support IAMTimelineComp, as well as their own IAMTimelineGroup interface.

In addition to the interfaces listed previously, timeline objects expose other, secondary interfaces. These interfaces determine the relationships between the object types.

InterfaceMeaningExposed By
IAMTimelineVirtualTrack The object is a virtual track. A virtual track is any object that can act like a track. Virtual tracks can reside inside compositions and hold other timeline objects. Composition, Track
IAMTimelineEffectable The object can have effects. Composition, Track, Source
IAMTimelineTransable The object can have transitions. Composition, Track
IAMTimelineSplittable The object can be split, using the IAMTimelineSplittable::SplitAt method. Track, Source, Effect, Transition

Subobjects

Sources, effects, and transitions have internal pointers to other COM objects, called subobjects. The subobject performs the actual work of the object. The subobject of a source is the component that creates the video or audio data. The subobject of an effect or transition is the component that transforms the data; for example, in a video effect, it creates the visual effect in the video stream.

The type of subobject depends on the type of object:

Groups, compositions, and tracks do not have subobjects.

The application does not directly set the subobject pointer. For effects and transitions, the application calls the IAMTimelineObj::SetSubObjectGUID method to specify the GUID of the subobject. For source objects, an application typically calls the IAMTimelineSrc::SetMediaName to specify the name of a source file. However, the SetSubObjectGUID method can also be used for source objects, to specify the class identifier (CLSID) of a filter.

For more information, see Working with Sources and Working with Effects and Transitions.