Microsoft DirectX 8.0 |
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
AddGroup Adds a group to the timeline. ClearAllGroups Removes all groups from the timeline, along with all objects contained in those groups. CreateEmptyNode Creates a new timeline object. EffectsEnabled Determines whether effects are enabled. EnableEffects Enables or disables all effects in the timeline. EnableTransitions Enables or disables all transitions in the timeline. GetCountOfType Retrieves the number of objects of the specified type that are contained in a specified group and all of its children. GetDefaultEffect Not supported for Visual Basic. GetDefaultEffectB Retrieves the default effect. GetDefaultFPS Retrieves the default output frame rate, in frames per second. GetDefaultTransition Not supported for Visual Basic. GetDefaultTransitionB Retrieves the default transition. GetDirtyRange Not supported for Visual Basic. GetDuration Not supported for Visual Basic. GetDuration2 Retrieves the duration of the timeline. GetGroup Retrieves a specified group. GetGroupCount Retrieves the number of groups that are contained in the timeline. GetInsertMode Not supported for Visual Basic. IsDirty Not supported for Visual Basic. RemGroupFromList Not supported for Visual Basic. SetDefaultEffect Not supported for Visual Basic. SetDefaultEffectB Sets the default effect. SetDefaultFPS Sets the default output frame rate, in frames per second. SetDefaultTransition Not supported for Visual Basic. SetDefaultTransitionB Sets the default transition. SetInsertMode Not supported for Visual Basic. SetInterestRange Not supported for Visual Basic. TransitionsEnabled Determines whether transitions are enabled. ValidateSourceNames Validates source names in the timeline.
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_INVALIDARG Maximum number of groups exceeded. E_NOINTERFACE The object is not a group.
Remarks
Currently, timelines support a maximum of 32 groups.
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.
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_INVALIDARG Object type is not valid. E_OUTOFMEMORY Insufficient memory.
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.
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.
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.
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_INVALIDARG Invalid 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.
Not supported for Visual Basic.
Syntax
object.GetDefaultEffect( pGuid As GUID )
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_OUTOFMEMORY Insufficient memory.
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.
Not supported for Visual Basic.
Syntax
object.GetDefaultTransition( pGuid As GUID )
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_OUTOFMEMORY Insufficient memory.
Not supported for Visual Basic.
Syntax
object.GetDirtyRange( pStart As <Unsupported variant type>, pStop As <Unsupported variant type> )
Not supported for Visual Basic.
Syntax
object.GetDuration( pDuration As <Unsupported variant type> )
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.
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_INVALIDARG Invalid argument.
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.
Not supported for Visual Basic.
Syntax
object.GetInsertMode( pMode As Long )
Not supported for Visual Basic.
Syntax
object.IsDirty( pDirty As Long );
Not supported for Visual Basic.
Syntax
object.RemGroupFromList( pGroup As AMTimelineObj );
Not supported for Visual Basic.
Syntax
object.SetDefaultEffect( pGuid As GUID )
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_OUTOFMEMORY Insufficient 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.
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.
Not supported for Visual Basic.
Syntax
object.SetDefaultTransition( pGuid As GUID )
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_OUTOFMEMORY Insufficient 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.
Not supported for Visual Basic.
Syntax
object.SetInsertMode( Mode As Long )
Not supported for Visual Basic.
Syntax
object.SetInterestRange( Start As <Unsupported variant type>, Stop As <Unsupported variant type> )
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
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_INVALIDARG Invalid argument.