Microsoft DirectX 8.0

IAMTimelineComp Interface

Inserts or retrieves virtual tracks on a composition in Microsoft® DirectShow® Editing Services (DES).

A composition is a collection of layers that acts as a single, composited track. For example, a composition that contains two tracks with a transition between them acts as a single track with the transition precomposited. A composition should contain media of only one type (such as audio or video), but this limitation is not enforced. A virtual track is any object that can reside in a composition, including tracks and other compositions.

The topmost nodes in the timeline are groups. Groups implement both the IAMTimelineComp interface and the IAMTimelineGroup interface.

For more information, see The Timeline Model and Groups, Compositions, and Tracks.

Requirements

Requires Qedit.h.

Methods in Vtable Order

IUnknown methodsDescription
QueryInterfaceRetrieves pointers to supported interfaces.
AddRefIncrements the reference count.
ReleaseDecrements the reference count.
IAMTimelineComp MethodsDescription
VTrackInsBeforeInserts a virtual track into the composition at the specified priority.
VTrackSwapPrioritiesSwitches the priority levels of two tracks.
VTrackGetCountRetrieves the number of virtual tracks contained in the composition.
GetVTrackRetrieves the virtual track at the specified priority.
GetCountOfTypeRetrieves the number of objects of a given type contained in this composition and all of its virtual tracks, recursively.
GetRecursiveLayerOfTypePerforms a depth-first ordering of the virtual tracks contained in this composition, and retrieves the nth virtual track from that ordering.
GetRecursiveLayerOfTypeINot supported.
GetNextVTrackRetrieves the next virtual track after a specified virtual track.

IAMTimelineComp::GetCountOfType

IAMTimelineComp Interface

Retrieves the number of objects of a given type contained in this composition and all its virtual tracks, recursively.

Syntax

HRESULT GetCountOfType(
    long *pVal,
    long *pValWithComps,
    TIMELINE_MAJOR_TYPE MajorType
);

Parameters

pVal
Pointer to a variable that receives the number of objects of the specified type contained in this composition and all its virtual tracks, recursively.
pValWithComps
Pointer to a variable that receives the count returned in pVal plus the number of compositions searched, including this one.
MajorType
Member of the TIMELINE_MAJOR_TYPE enumerated type, specifying the type of object to count.

Return Value

Returns S_OK if successful, or E_POINTER otherwise.

Remarks

Typically, an application will not call this method. It is called by the render engine.

If you count compositions, the value returned in pVal is zero and the value returned in pValWithComps is the number of compositions. The value of *pValWithComps includes the composition on which you call the method. For example, if you call this method on an empty composition, *pValWithComps equals 1.

Groups cannot reside inside compositions, so you cannot use this method to count groups. (The returned count will always be zero.) To count groups, call the IAMTimeline::GetGroupCount method.

IAMTimelineComp::GetNextVTrack

IAMTimelineComp Interface

Retrieves the next virtual track after a specified virtual track.

Syntax

HRESULT GetNextVTrack(
    IAMTimelineObj *pVirtualTrack, 
    IAMTimelineObj **ppNextVirtualTrack
);

Parameters

pVirtualTrack
Pointer to the previous virtual track, or NULL to retrieve the first virtual track in the composition.
ppNextVirtualTrack
[out] Address of a pointer that receives the IAMTimelineObj interface of the next virtual track, in order of priority.

Return Value

Returns S_OK if the method retrieves a virtual track, or S_FALSE otherwise.

Remarks

If the method succeeds, the IAMTimelineObj interface that it returns has an outstanding reference count. Be sure to release the interface when you are finished using it.

IAMTimelineComp::GetRecursiveLayerOfType

IAMTimelineComp Interface

Performs a depth-first ordering of the virtual tracks contained in this composition, and retrieves the nth virtual track from that ordering.

Syntax

HRESULT GetRecursiveLayerOfType(
    IAMTimelineObj **ppVirtualTrack,
    long WhichLayer,
    TIMELINE_MAJOR_TYPE Type
);

Parameters

ppVirtualTrack
[out] Address of a pointer that receives the virtual track's IAMTimelineObj interface.
WhichLayer
Value that specifies which virtual track to retrieve, indexed from zero.
Type
Member of the TIMELINE_MAJOR_TYPE enumerated type that specifies whether to include tracks in the search.

Return Value

Returns one of the following HRESULT values:

S_OKSuccess.
E_INVALIDARGNo object of the specified type.
E_POINTERNULL pointer argument.

Remarks

Typically, an application will not need to call this method.

If the Type parameter is TIMELINE_MAJOR_TYPE_TRACK, the depth-first ordering includes tracks. If not, it includes only compositions and groups. The object itself is included in the ordering.

For example, in the following arrangement, starting from Composition A, the ordering would be B, C, F, D, E, A.

GetRecursiveLayerOfType

If the method succeeds, the IAMTimelineObj interface that it returns has an outstanding reference count. Be sure to release the interface when you are finished using it.

IAMTimelineComp::GetRecursiveLayerOfTypeI

IAMTimelineComp Interface

Not supported. Call the GetRecursiveLayerOfType method instead.

Syntax

HRESULT GetRecursiveLayerOfTypeI(
    IAMTimelineObj **ppVirtualTrack,
    long *pWhichLayer,
    TIMELINE_MAJOR_TYPE Type
);

IAMTimelineComp::GetVTrack

IAMTimelineComp Interface

Retrieves the virtual track at the specified priority.

Syntax

HRESULT GetVTrack(
    IAMTimelineObj **ppVirtualTrack,
    long Which
);

Parameters

ppVirtualTrack
[out] Address of a pointer that receives the virtual track's IAMTimelineObj interface.
Which
Priority of the virtual track to retrieve.

Return Value

Returns one of the following HRESULT values:

S_OKSuccess.
E_INVALIDARGNo virtual track with the specified priority.
E_POINTERNULL pointer argument.

Remarks

If the method succeeds, the IAMTimelineObj interface that it returns has an outstanding reference count. Be sure to release the interface when you are finished using it.

IAMTimelineComp::VTrackGetCount

IAMTimelineComp Interface

Retrieves the number of virtual tracks contained in the composition.

Syntax

HRESULT VTrackGetCount(
    long *pVal
);

Parameters

pVal
Pointer to a variable that receives the number of virtual tracks.

Return Value

Returns S_OK if successful, or E_POINTER otherwise.

IAMTimelineComp::VTrackInsBefore

IAMTimelineComp Interface

Inserts a virtual track into the composition at the specified priority.

Syntax

HRESULT VTrackInsBefore(
    IAMTimelineObj *pVirtualTrack,
    long Priority
);

Parameters

pVirtualTrack
Pointer to the IAMTimelineObj interface of the virtual track.
Priority
Priority at which to insert the virtual track, or –1 to insert the virtual track at the end of the priority list.

Return Value

Returns one of the following HRESULT values:

S_OKSuccess.
E_INVALIDARGInvalid argument.
E_NOINTERFACEObject is not a virtual track.

Remarks

Priority levels start at zero. If the timeline already contains a virtual track at the specified priority level, everything from that point on moves down the priority list to make room for the inserted track. This method fails if the specified priority is greater than the current number of tracks.

IAMTimelineComp::VTrackSwapPriorities

IAMTimelineComp Interface

Switches the priority levels of two tracks.

Given two priority levels, this method switches the virtual tracks at those priorities. When the method returns, the track that was at the first priority level is now at the second priority level, and vice versa.

Syntax

HRESULT VTrackSwapPriorities(
    long VirtualTrackA,
    long VirtualTrackB
);

Parameters

VirtualTrackA
First priority level at which to swap virtual tracks.
VirtualTrackB
Second priority level at which to swap virtual tracks.

Return Value

Returns S_OK if successful, or E_INVALIDARG otherwise.