docs: update GESTimelineElement

This commit is contained in:
Henry Wilkes 2020-01-07 17:40:53 +00:00 committed by Thibault Saunier
parent 94db57b9bd
commit 4b3fe5f622
3 changed files with 696 additions and 318 deletions

View file

@ -358,27 +358,74 @@ GType ges_pipeline_flags_get_type (void);
/**
* GESEditMode:
* @GES_EDIT_MODE_NORMAL: The object is edited the normal way (default).
* @GES_EDIT_MODE_RIPPLE: The objects are edited in ripple mode.
* The Ripple mode allows you to modify the beginning/end of a clip
* and move the neighbours accordingly. This will change the overall
* timeline duration. In the case of ripple end, the duration of the
* clip being rippled can't be superior to its max_duration - inpoint
* otherwise the action won't be executed.
* @GES_EDIT_MODE_ROLL: The object is edited in roll mode.
* The Roll mode allows you to modify the position of an editing point
* between two clips without modifying the inpoint of the first clip
* nor the out-point of the second clip. This will not change the
* overall timeline duration.
* @GES_EDIT_MODE_TRIM: The object is edited in trim mode.
* The Trim mode allows you to modify the in-point/duration of a clip
* without modifying its position in the timeline.
* @GES_EDIT_MODE_SLIDE: The object is edited in slide mode.
* The Slide mode allows you to modify the position of a clip in a
* timeline without modifying its duration or its in-point, but will
* modify the duration of the previous clip and in-point of the
* following clip so does not modify the overall timeline duration.
* (not implemented yet)
* @GES_EDIT_MODE_NORMAL: The element is edited the normal way (default).
* This only moves a single element. If acting on the start edge of the
* element, the element's start time is set to the edit position.
* If acting on end edge of the element, the element's duration time
* is set such that its end time matches the edit position.
* @GES_EDIT_MODE_RIPPLE: The element is edited in ripple mode. This
* shifts the element and all later elements (those with equal or later
* start times) in the timeline by the same amount. If acting on the
* element as a whole, the element's start time is shifted to the edit
* position, and later elements are also shifted by the same amount. If
* acting on the end edge of the element, the element's **duration time**
* is shifted so that the element's end time matches the edit position,
* and later elements have their **start time** shifted by the same
* amount.
* @GES_EDIT_MODE_ROLL: The element is edited in roll mode. This trims
* the edge of an element and neighbouring edges (opposite edges of other
* elements in the timeline with the same corresponding time value), such
* that the edges remain in contact. If acting on the start edge of the
* element, the start edge is trimmed to the edit position (see
* #GES_EDIT_MODE_TRIM), and any other elements in the timeline whose end
* time matches the edited element's start time (evaluated before the
* edit) will have their **end** edge trimmed to the same edit position.
* Similarly, if acting on the end edge of the element, the end edge is
* trimmed to the edit position, and any other elements in the timeline
* whose start time matches the edited element's end time will have
* their start edge trimmed to the same edit position.
* @GES_EDIT_MODE_TRIM: The element is edited in trim mode. This shifts
* the edge of a single element while maintaining the timing of
* its internal content in the timeline, so the samples/frames/etc of a
* source would still appear at the same timeline time when it is played.
* If acting on the start edge of the element, the element's start time
* will be shifted to the edit position and the element's in-point time
* will be shifted by the same amount. Additionally, the element's
* duration time will be shifted the other way such that the element's
* end time remains the same. If acting on end edge of the element, the
* element's duration time is set such that its end time matches the edit
* position.
* @GES_EDIT_MODE_SLIDE: The element is edited in slide mode (not yet
* implemented). This shifts the element and will trim the edges of
* neighbouring edges on either side accordingly. If acting on the
* element as a whole, the element's start time is shifted to the edit
* position. Any other elements in the timeline whose end time matches
* the edited element's start time (evaluated before the edit) will have
* their end edge trimmed to the same edit position. Additionally, any
* other elements in the timeline whose start time matches the edited
* element's end time will have their start edge trimmed to match the
* edited element's **new** end time.
*
* When a single timeline element is edited within its timeline, using
* ges_timeline_element_edit(), depending on the edit mode, its
* #GESTimelineElement:start, #GESTimelineElement:duration or
* #GESTimelineElement:in-point will be adjusted accordingly. In addition,
* other elements in the timeline may also have their properties adjusted.
*
* In fact, the edit is actually performed on the toplevel of the edited
* element (usually a #GESClip), which is responsible for moving its
* children along with it. For simplicity, in the descriptions we will
* use "element" to exclusively refer to toplevel elements.
*
* In the edit mode descriptions, the "start edge", "end edge" and the
* "element as a whole" correspond to using #GES_EDGE_START, #GES_EDGE_END
* and #GES_EDGE_NONE as part of the edit, respectively. The "start time",
* "duration time" and "in-point time" correspond to the
* #GESTimelineElement:start, #GESTimelineElement:duration and
* #GESTimelineElement:in-point properties, respectively. Moreover, the
* "end time" refers to the final time of the element:
* #GESTimelineElement:start + #GESTimelineElement:duration. Finally,
* the "edit position" is the timeline time used as part of the edit.
*
* You can also find more explanation about the behaviour of those modes at:
* [trim, ripple and roll](http://pitivi.org/manual/trimming.html)
@ -401,7 +448,7 @@ GType ges_edit_mode_get_type (void);
* GESEdge:
* @GES_EDGE_START: Represents the start of an object.
* @GES_EDGE_END: Represents the end of an object.
* @GES_EDGE_NONE: Represent the fact we are not workin with any edge of an
* @GES_EDGE_NONE: Represent the fact we are not working with any edge of an
* object.
*
* The edges of an object contain in a #GESTimeline or #GESTrack

File diff suppressed because it is too large Load diff

View file

@ -38,56 +38,57 @@ typedef struct _GESTimelineElementPrivate GESTimelineElementPrivate;
/**
* GES_TIMELINE_ELEMENT_START:
* @obj: a #GESTimelineElement
* @obj: A #GESTimelineElement
*
* The start position of the object (in nanoseconds).
* The #GESTimelineElement:start of @obj.
*/
#define GES_TIMELINE_ELEMENT_START(obj) (((GESTimelineElement*)obj)->start)
/**
* GES_TIMELINE_ELEMENT_END:
* @obj: a #GESTimelineElement
* @obj: A #GESTimelineElement
*
* The end position of the object (in nanoseconds).
* The end position of @obj: #GESTimelineElement:start +
* #GESTimelineElement:duration.
*/
#define GES_TIMELINE_ELEMENT_END(obj) ((((GESTimelineElement*)obj)->start) + (((GESTimelineElement*)obj)->duration))
/**
* GES_TIMELINE_ELEMENT_INPOINT:
* @obj: a #GESTimelineElement
* @obj: A #GESTimelineElement
*
* The in-point of the object (in nanoseconds).
* The #GESTimelineElement:in-point of @obj.
*/
#define GES_TIMELINE_ELEMENT_INPOINT(obj) (((GESTimelineElement*)obj)->inpoint)
/**
* GES_TIMELINE_ELEMENT_DURATION:
* @obj: a #GESTimelineElement
* @obj: A #GESTimelineElement
*
* The duration of the object (in nanoseconds).
* The #GESTimelineElement:duration of @obj.
*/
#define GES_TIMELINE_ELEMENT_DURATION(obj) (((GESTimelineElement*)obj)->duration)
/**
* GES_TIMELINE_ELEMENT_MAX_DURATION:
* @obj: a #GESTimelineElement
* @obj: A #GESTimelineElement
*
* The maximun duration of the object (in nanoseconds).
* The #GESTimelineElement:max-duration of @obj.
*/
#define GES_TIMELINE_ELEMENT_MAX_DURATION(obj) (((GESTimelineElement*)obj)->maxduration)
/**
* GES_TIMELINE_ELEMENT_PRIORITY:
* @obj: a #GESTimelineElement
* @obj: A #GESTimelineElement
*
* The priority of the object.
* The #GESTimelineElement:priority of @obj.
*/
#define GES_TIMELINE_ELEMENT_PRIORITY(obj) (((GESTimelineElement*)obj)->priority)
/**
* GES_TIMELINE_ELEMENT_NO_LAYER_PRIORITY:
*
* Layer priority when the element is not in a layer
* Layer priority when a timeline element is not in any layer.
*/
#define GES_TIMELINE_ELEMENT_NO_LAYER_PRIORITY ((guint32) -1)
@ -95,47 +96,49 @@ typedef struct _GESTimelineElementPrivate GESTimelineElementPrivate;
* GES_TIMELINE_ELEMENT_LAYER_PRIORITY:
* @obj: The object to retrieve the layer priority from
*
* See #ges_timeline_element_get_layer_priority
* See #ges_timeline_element_get_layer_priority.
*/
#define GES_TIMELINE_ELEMENT_LAYER_PRIORITY(obj) (ges_timeline_element_get_layer_priority(((GESTimelineElement*)obj)))
/**
* GES_TIMELINE_ELEMENT_PARENT:
* @obj: a #GESTimelineElement
* @obj: A #GESTimelineElement
*
* The parent of the object.
* The #GESTimelineElement:parent of @obj.
*/
#define GES_TIMELINE_ELEMENT_PARENT(obj) (((GESTimelineElement*)obj)->parent)
/**
* GES_TIMELINE_ELEMENT_TIMELINE:
* @obj: a #GESTimelineElement
* @obj: A #GESTimelineElement
*
* The timeline in which the object is.
* The #GESTimelineElement:timeline of @obj.
*/
#define GES_TIMELINE_ELEMENT_TIMELINE(obj) (((GESTimelineElement*)obj)->timeline)
/**
* GES_TIMELINE_ELEMENT_NAME:
* @obj: a #GESTimelineElement
* @obj: A #GESTimelineElement
*
* The name of the object.
* The #GESTimelineElement:name of @obj.
*/
#define GES_TIMELINE_ELEMENT_NAME(obj) (((GESTimelineElement*)obj)->name)
/**
* GESTimelineElement:
* @parent: The #GESTimelineElement that controls the object
* @parent: The #GESTimelineElement:parent of the element
* @asset: The #GESAsset from which the object has been extracted
* @start: position (in time) of the object
* @inpoint: Position in the media from which the object should be used
* @duration: duration of the object to be used
* @maxduration: The maximum duration the object can have
* @priority: priority of the object in the layer (0:top priority)
* @start: The #GESTimelineElement:start of the element
* @inpoint: The #GESTimelineElement:in-point of the element
* @duration: The #GESTimelineElement:duration of the element
* @maxduration: The #GESTimelineElement:max-duration of the element
* @priority: The #GESTimelineElement:priority of the element
* @name: The #GESTimelineElement:name of the element
* @timeline: The #GESTimelineElement:timeline of the element
*
* Those filed can be accessed from outside but in no case should
* be changed from there. Subclasses can write them but should make
* sure to properly call g_object_notify.
* All members can be read freely, but should usually not be written to.
* Subclasses may write to them, but should make sure to properly call
* g_object_notify().
*/
struct _GESTimelineElement
{
@ -162,32 +165,51 @@ struct _GESTimelineElement
/**
* GESTimelineElementClass:
* @set_parent: method to set the parent of a #GESTimelineElement.
* @set_start: method to set the start of a #GESTimelineElement,
* -1 means that the subclass handled emiting the notify signal and
* the base class should return TRUE.
* @set_duration: method to set the duration of a #GESTimelineElement,
* -1 means that the subclass handled emiting the notify signal and
* the base class should return TRUE.
* @set_inpoint: method to set the inpoint of a #GESTimelineElement,
* -1 means that the subclass handled emiting the notify signal and
* the base class should return TRUE.
* @set_max_duration: method to set the maximun duration of a #GESTimelineElement
* @set_priority: method to set the priority of a #GESTimelineElement
* @ripple: method to ripple an object
* @ripple_end: method to ripple an object on its #GES_EDGE_END edge
* @roll_start: method to roll an object on its #GES_EDGE_START edge
* @roll_end: method to roll an object on its #GES_EDGE_END edge
* @trim: method to trim an object
* @deep_copy: Copy the children properties of @self into @copy
* @set_parent: Method called just before the #GESTimelineElement:parent
* is set.
* @set_start: Method called just before the #GESTimelineElement:start is
* set. A return of -1 means that the subclass handled emitting the notify
* signal and the base class should return %TRUE.
* @set_duration: Method called just before the
* #GESTimelineElement:duration is set. A return of -1 means that the
* subclass handled emitting the notify signal and the base class should
* return %TRUE.
* @set_inpoint: Method called just before the
* #GESTimelineElement:in-point is set. A return of -1 means that the
* subclass handled emitting the notify signal and the base class should
* return %TRUE.
* @set_max_duration: Method called just before the
* #GESTimelineElement:max-duration is set.
* @set_priority: Method called just before the
* #GESTimelineElement:in-point is set.
* @ripple_end: Method to ripple an object on its #GES_EDGE_END edge.
* @roll_start: Method to roll an object on its #GES_EDGE_START edge.
* @roll_end: Method to roll an object on its #GES_EDGE_END edge.
* @trim: Method to trim an object.
* @deep_copy: Prepare @copy for pasting as a copy of @self. At least by
* copying the children properties of @self into @copy.
* @paste: Paste @self, which is the @copy prepared by @deep_copy, into
* the timeline at the given @paste_position, with @ref_element as a
* reference, which is the @self that was passed to @deep_copy.
* @lookup-child: Method to find a child with the child property.
* @prop_name. The default vmethod will return the first child that
* matches. Overwrite this with a call to the parent vmethod if you wish
* to redirect property names. Or overwrite to change which child is
* returned if multiple children share the same child property name.
* @get_track_types: Return a the track types for the element.
* @set_child_property: Method for setting the child property given by
* @pspec on @child to @value. Default implementation will use
* g_object_set_property().
* @get_layer_priority: Get the #GESLayer:priority of the layer that this
* element is part of.
*
* The GESTimelineElement base class. Subclasses should override at least
* The #GESTimelineElement base class. Subclasses should override at least
* @set_start @set_inpoint @set_duration @ripple @ripple_end @roll_start
* @roll_end and @trim.
*
* Vmethods in subclasses should apply all the operation they need to but
* the real method implementation is in charge of setting the proper field,
* and emit the notify signal.
* and emitting the notify signal.
*/
struct _GESTimelineElementClass
{