Microsoft DirectX 8.0

AMTimeline Object

Provides methods for manipulating the timeline, the central object in Microsoft® DirectShow® Editing Services (DES). A timeline is a collection of time-ordered elements, such as video clips, audio clips, effects, and transitions between clips. The render engine uses the timeline to create a filter graph, from which the application can generate the rendered output.

The AMTimeline object performs three basic services:

Methods

AddGroupAdds a group to the timeline.
ClearAllGroupsRemoves all groups from the timeline, along with all objects contained in those groups.
CreateEmptyNodeCreates a new timeline object.
EffectsEnabledDetermines whether effects are enabled.
EnableEffectsEnables or disables all effects in the timeline.
EnableTransitionsEnables or disables all transitions in the timeline.
GetCountOfTypeRetrieves the number of objects of the specified type that are contained in a specified group and all of its children.
GetDefaultEffectNot supported for Visual Basic.
GetDefaultEffectBRetrieves the default effect.
GetDefaultFPSRetrieves the default output frame rate, in frames per second.
GetDefaultTransitionNot supported for Visual Basic.
GetDefaultTransitionBRetrieves the default transition.
GetDirtyRangeNot supported for Visual Basic.
GetDurationNot supported for Visual Basic.
GetDuration2Retrieves the duration of the timeline.
GetGroupRetrieves a specified group.
GetGroupCountRetrieves the number of groups that are contained in the timeline.
GetInsertModeNot supported for Visual Basic.
IsDirtyNot supported for Visual Basic.
RemGroupFromListNot supported for Visual Basic.
SetDefaultEffectNot supported for Visual Basic.
SetDefaultEffectBSets the default effect.
SetDefaultFPSSets the default output frame rate, in frames per second.
SetDefaultTransitionNot supported for Visual Basic.
SetDefaultTransitionBSets the default transition.
SetInsertModeNot supported for Visual Basic.
SetInterestRangeNot supported for Visual Basic.
TransitionsEnabledDetermines whether transitions are enabled.
ValidateSourceNamesValidates source names in the timeline.

AddGroup Method (AMTimeline Object)

AMTimeline Object

Adds a group to the timeline.

Syntax

object.AddGroup(
    pGroup As IAMTimelineObj
)

Parts

object
Object expression that evaluates to an AMTimeline object.
pGroup
AMTimelineObj object that specifies the group.

Error Codes

If the method fails, an error is raised, and Err.Number can be set to one of the following values:

E_INVALIDARGMaximum number of groups exceeded.
E_NOINTERFACEThe object is not a group.

Remarks

Currently, timelines support a maximum of 32 groups.

ClearAllGroups Method (AMTimeline Object)

AMTimeline Object

Removes all groups from the timeline, along with all objects contained in those groups.

Syntax

object.ClearAllGroups()

Parts

object
Object expression that evaluates to an AMTimeline object.

Error Codes

If the method fails, an error is raised.

CreateEmptyNode Method (AMTimeline Object)

AMTimeline Object

Creates a new timeline object.

Use this method to create timeline objects, rather than the New keyword, because this method performs important initialization routines.

Syntax

object.CreateEmptyNode(
    ppObj As AMTimelineObj,
    Type As TIMELINE_MAJOR_TYPE
)

Parts

object
Object expression that evaluates to an AMTimeline object.
ppObj
AMTimelineObj object that receives the new object.
Type
Member of the TIMELINE_MAJOR_TYPE enumerated type that specifies the type of object to create.

Error Codes

If the method fails, an error is raised, and Err.Number can be set to one of the following values:

E_INVALIDARGObject type is not valid.
E_OUTOFMEMORYInsufficient memory.

EffectsEnabled Method (AMTimeline Object)

AMTimeline Object

Determines whether effects are enabled. If effects are disabled, they remain in the timeline but are not rendered.

Syntax

object.EffectsEnabled(
    pfEnabled As Long
)

Parts

object
Object expression that evaluates to an AMTimeline object.
pfEnabled
Variable that receives a value indicating whether effects are enabled. If the value is zero, effects are disabled. If the value is non-zero, effects are enabled.

Error Codes

If the method fails, an error is raised.

EnableEffects Method (AMTimeline Object)

AMTimeline Object

Enables or disables all effects in the timeline. If effects are disabled, they remain in the timeline but are not rendered.

Syntax

object.EnableEffects(
    fEnabled As Long
)

Parts

object
Object expression that evaluates to an AMTimeline object.
fEnabled
Value that specifies whether to enable or disable effects. If zero, effects are disabled. If non-zero, effects are enabled.

Error Codes

If the method fails, an error is raised.

EnableTransitions Method (AMTimeline Object)

AMTimeline Object

Enables or disables all transitions in the timeline. If transitions are disabled, the render engine treats them as cuts; that is, the rendered output jumps instantly from one track to the next. The default cut point is halfway through the duration of the transition. You can change the cut point by calling the IAMTimelineTrans.SetCutPoint method on the transition. Disabled transitions remain in the timeline.

Syntax

object.EnableTransitions(
    fEnabled As Long
)

Parts

object
Object expression that evaluates to an AMTimeline object.
fEnabled
Value that specifies whether to enable or disable transitions. If zero, transitions are disabled. If non-zero, transitions are enabled.

Error Codes

If the method fails, an error is raised.

GetCountOfType Method (AMTimeline Object)

AMTimeline Object

Retrieves the number of objects of the specified type that are contained in a specified group and all of its children.

Syntax

object.GetCountOfType(
    Group As Long,
    pVal As Long,
    pValWithComps As Long,
    MajorType As TIMELINE_MAJOR_TYPE
)

Parts

object
Object expression that evaluates to an AMTimeline object.
Group
Index number of the group for which to retrieve the count.
pVal
Variable that receives the number of objects of the specified type contained in the group and all of its virtual tracks, recursively.
pValWithComps
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.

Error Codes

If the method fails, an error is raised, and Err.Number can be set to the following value:

E_INVALIDARGInvalid group number.

Remarks

Calling this method is equivalent to calling AMTimelineComp.GetCountOfType on the specified group. See the Remarks section of that method for more information.

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

GetDefaultEffect Method (AMTimeline Object)

AMTimeline Object

Not supported for Visual Basic.

Syntax

object.GetDefaultEffect(
    pGuid As GUID
)

GetDefaultEffectB Method (AMTimeline Object)

AMTimeline Object

Retrieves the default effect. If the render engine cannot render an effect, it substitutes the default effect.

Syntax

object.GetDefaultEffectB() As String

Parts

object
Object expression that evaluates to an AMTimeline object.

Return Value

Returns a string that contains the GUID of the default effect.

Error Codes

If the method fails, an error is raised, and Err.Number can be set to the following value:

E_OUTOFMEMORYInsufficient memory.

GetDefaultFPS Method (AMTimeline Object)

AMTimeline Object

Retrieves the default output frame rate, in frames per second (FPS). Groups use this value as their default frame rate. To set a group's frame rate, call the AMTimelineGroup.SetOutputFPS method on the group.

Syntax

object.GetDefaultFPS(
    pFPS As Double
)

Parts

object
Object expression that evaluates to an AMTimeline object.
pFPS
Variable that receives the default frame rate, in frames per second.

Error Codes

If the method fails, an error is raised.

GetDefaultTransition Method (AMTimeline Object)

AMTimeline Object

Not supported for Visual Basic.

Syntax

object.GetDefaultTransition(
    pGuid As GUID
)

GetDefaultTransitionB Method (AMTimeline Object)

AMTimeline Object

Retrieves the default transition. If the render engine cannot render a transition, it substitutes the default transition.

Syntax

object.GetDefaultTransitionB() As *pGuid

Parts

object
Object expression that evaluates to an AMTimeline object.

Return Value

Returns a string that contains the GUID of the default transition.

Error Codes

If the method fails, an error is raised, and Err.Number can be set to the following value:

E_OUTOFMEMORYInsufficient memory.

GetDirtyRange Method (AMTimeline Object)

AMTimeline Object

Not supported for Visual Basic.

Syntax

object.GetDirtyRange(
    pStart As <Unsupported variant type>,
    pStop As <Unsupported variant type>
)

GetDuration Method (AMTimeline Object)

AMTimeline Object

Not supported for Visual Basic.

Syntax

object.GetDuration(
    pDuration As <Unsupported variant type>
)

GetDuration2 Method (AMTimeline Object)

AMTimeline Object

Retrieves the duration of the timeline.

Syntax

object.GetDuration2(
    pDuration As Double
)

Parts

object
Object expression that evaluates to an AMTimeline object.
pDuration
Variable that receives the duration of the timeline, in seconds.

Error Codes

If the method fails, an error is raised.

GetGroup Method (AMTimeline Object)

AMTimeline Object

Retrieves a specified group.

Syntax

object.GetGroup(
    ppGroup As AMTimelineObj,
    WhichGroup As Long
)

Parts

object
Object expression that evaluates to an AMTimeline object.
ppGroup
AMTimelineObj object that receives the specified group.
WhichGroup
Index of the group to retrieve, based on the order in which the groups were added to the timeline. The first group added to the timeline has an index of 0.

Error Codes

If the method fails, an error is raised, and Err.Number can be set to the following value:

E_INVALIDARGInvalid argument.

GetGroupCount Method (AMTimeline Object)

AMTimeline Object

Retrieves the number of groups that are contained in the timeline.

Syntax

object.GetGroupCount(
    pCount As Long
)

Parts

object
Object expression that evaluates to an AMTimeline object.
pCount
Variable that receives the number of groups in the timeline.

Error Codes

If the method fails, an error is raised.

GetInsertMode Method (AMTimeline Object)

AMTimeline Object

Not supported for Visual Basic.

Syntax

object.GetInsertMode(
    pMode As Long
)

IsDirty Method (AMTimeline Object)

AMTimeline Object

Not supported for Visual Basic.

Syntax

object.IsDirty(
    pDirty As Long
);

RemGroupFromList Method (AMTimeline Object)

AMTimeline Object

Not supported for Visual Basic.

Syntax

object.RemGroupFromList(
    pGroup As AMTimelineObj
);

SetDefaultEffect Method (AMTimeline Object)

AMTimeline Object

Not supported for Visual Basic.

Syntax

object.SetDefaultEffect(
    pGuid As GUID
)

SetDefaultEffectB Method (AMTimeline Object)

AMTimeline Object

Sets the default effect. If the render engine cannot render an effect, it substitutes the default effect.

Syntax

object.SetDefaultEffectB(
    pGuid As String
)

Parts

object
Object expression that evaluates to an AMTimeline object.
pGuid
String that contains the GUID of the default effect.

Error Codes

If the method fails, an error is raised, and Err.Number can be set to the following value:

E_OUTOFMEMORYInsufficient memory.

Remarks

If you do not set a default effect, or if the effect that you specify as a default causes an error, DES uses its own default effect.

SetDefaultFPS Method (AMTimeline Object)

AMTimeline Object

Sets the default output frame rate, in frames per second. Groups use this value as their default frame rate. To set a group's frame rate, call the AMTimelineGroup.SetOutputFPS method on the group.

Syntax

object.SetDefaultFPS(
    FPS As Double
)

Parts

object
Object expression that evaluates to an AMTimeline object.
FPS
Default frame rate, in frames per second.

Error Codes

If the method fails, an error is raised.

SetDefaultTransition Method (AMTimeline Object)

AMTimeline Object

Not supported for Visual Basic.

Syntax

object.SetDefaultTransition(
    pGuid As GUID
)

SetDefaultTransitionB Method (AMTimeline Object)

AMTimeline Object

Sets the default transition. If the render engine cannot render a transition, it substitutes the default transition.

Syntax

object.SetDefaultTransitionB(
    pGuid As String
)

Parts

object
Object expression that evaluates to an AMTimeline object.
pGuid
String that contains the GUID of the default transition.

Error Codes

If the method fails, an error is raised, and Err.Number can be set to the following value:

E_OUTOFMEMORYInsufficient memory.

Remarks

If you do not set a default transition, or if the transition that you specify as a default causes an error, DES uses its own default transition.

SetInsertMode Method (AMTimeline Object)

AMTimeline Object

Not supported for Visual Basic.

Syntax

object.SetInsertMode(
    Mode As Long
)

SetInterestRange Method (AMTimeline Object)

AMTimeline Object

Not supported for Visual Basic.

Syntax

object.SetInterestRange(
    Start As <Unsupported variant type>,
    Stop As <Unsupported variant type>
)

TransitionsEnabled Method (AMTimeline Object)

AMTimeline Object

Determines whether transitions are enabled.

Syntax

object.TransitionsEnabled(
    pfEnabled As Long
)

Parts

object
Object expression that evaluates to an AMTimeline object.
pfEnabled
Value that specifies whether transitions are enabled. If zero, transitions are disabled. If non-zero, transitions are enabled.

Error Codes

If the method fails, an error is raised.

See Also

EnableTransitions

ValidateSourceNames Method (AMTimeline Object)

AMTimeline Object

Validates source names in the timeline, using the media locator. Optionally, this method also updates any source object for which it locates a file.

Syntax

object.ValidateSourceNames(
    ValidateFlags As Long,
    pOverride As MediaLocator,
    NotifyEventHandle As LONG_PTR
)

Parts

object
Object expression that evaluates to an AMTimeline object.
ValidateFlags
Bitwise combination of validation flags, specifying the behavior of the media locator. The SFN_VALIDATEF_REPLACE and SFN_VALIDATEF_CHECK flags must be present, or the method returns E_INVALIDARG.
pOverride
Optional MediaLocator object to use in place of the default. To use the default media locator, set the value of this parameter to Nothing.
NotifyEventHandle
Variable of type LONG_PTR. This parameter is ignored and can be zero.

Error Codes

If the method fails, an error is raised, and Err.Number can be set to the following value:

E_INVALIDARGInvalid argument.