Trait gstreamer_editing_services::prelude::TimelineElementExt [−][src]
pub trait TimelineElementExt: 'static {
Show methods
fn copy(&self, deep: bool) -> Result<TimelineElement, BoolError>;
fn edit(
&self,
layers: &[Layer],
new_layer_priority: i64,
mode: EditMode,
edge: Edge,
position: u64
) -> bool;
fn edit_full(
&self,
new_layer_priority: i64,
mode: EditMode,
edge: Edge,
position: u64
) -> Result<(), Error>;
fn duration(&self) -> ClockTime;
fn inpoint(&self) -> ClockTime;
fn layer_priority(&self) -> u32;
fn max_duration(&self) -> ClockTime;
fn name(&self) -> Option<GString>;
fn natural_framerate(&self) -> Option<(i32, i32)>;
fn parent(&self) -> Option<TimelineElement>;
fn priority(&self) -> u32;
fn start(&self) -> ClockTime;
fn timeline(&self) -> Option<Timeline>;
fn toplevel_parent(&self) -> Option<TimelineElement>;
fn track_types(&self) -> TrackType;
fn paste(
&self,
paste_position: ClockTime
) -> Result<TimelineElement, BoolError>;
fn ripple(&self, start: ClockTime) -> Result<(), BoolError>;
fn ripple_end(&self, end: ClockTime) -> Result<(), BoolError>;
fn roll_end(&self, end: ClockTime) -> Result<(), BoolError>;
fn roll_start(&self, start: ClockTime) -> Result<(), BoolError>;
fn set_duration(&self, duration: ClockTime) -> bool;
fn set_inpoint(&self, inpoint: ClockTime) -> bool;
fn set_max_duration(&self, maxduration: ClockTime) -> bool;
fn set_name(&self, name: Option<&str>) -> Result<(), BoolError>;
fn set_parent<P: IsA<TimelineElement>>(
&self,
parent: &P
) -> Result<(), BoolError>;
fn set_priority(&self, priority: u32) -> bool;
fn set_start(&self, start: ClockTime) -> bool;
fn set_timeline<P: IsA<Timeline>>(
&self,
timeline: &P
) -> Result<(), BoolError>;
fn trim(&self, start: ClockTime) -> Result<(), BoolError>;
fn in_point(&self) -> u64;
fn set_in_point(&self, in_point: u64);
fn is_serialize(&self) -> bool;
fn set_serialize(&self, serialize: bool);
fn connect_duration_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_in_point_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_max_duration_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_name_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_parent_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_priority_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_serialize_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_start_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_timeline_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
}Trait containing all TimelineElement methods.
Implementors
crate::Container, crate::TimelineElement, crate::TrackElement
Required methods
fn copy(&self, deep: bool) -> Result<TimelineElement, BoolError>[src]
Create a copy of self. All the properties of self are copied into
a new element, with the exception of [crate::TimelineElement:parent],
[crate::TimelineElement:timeline] and [crate::TimelineElement:name]. Other data,
such the list of a crate::Container’s children, is not copied.
If deep is true, then the new element is prepared so that it can be
used in Self::paste() or crate::prelude::TimelineExt::paste_element().
In the case of copying a crate::Container, this ensures that the children
of self will also be pasted. The new element should not be used for
anything else and can only be used once in a pasting operation. In
particular, the new element itself is not an actual ‘deep’ copy of
self, but should be thought of as an intermediate object used for a
single paste operation.
deep
Whether the copy is needed for pasting
Returns
The newly create element,
copied from self.
fn edit(
&self,
layers: &[Layer],
new_layer_priority: i64,
mode: EditMode,
edge: Edge,
position: u64
) -> bool[src]
&self,
layers: &[Layer],
new_layer_priority: i64,
mode: EditMode,
edge: Edge,
position: u64
) -> bool
v1_18 only.See Self::edit_full(), which also gives an error.
Note that the layers argument is currently ignored, so you should
just pass None.
layers
A whitelist of layers
where the edit can be performed, None allows all layers in the
timeline.
new_layer_priority
The priority/index of the layer self should be
moved to. -1 means no move
mode
The edit mode
edge
The edge of self where the edit should occur
position
The edit position: a new location for the edge of self
(in nanoseconds) in the timeline coordinates
Returns
fn edit_full(
&self,
new_layer_priority: i64,
mode: EditMode,
edge: Edge,
position: u64
) -> Result<(), Error>[src]
&self,
new_layer_priority: i64,
mode: EditMode,
edge: Edge,
position: u64
) -> Result<(), Error>
v1_18 only.Edits the element within its timeline by adjusting its
[crate::TimelineElement:start], [crate::TimelineElement:duration] or
[crate::TimelineElement:in-point], and potentially doing the same for
other elements in the timeline. See crate::EditMode for details about each
edit mode. An edit may fail if it would place one of these properties
out of bounds, or if it would place the timeline in an unsupported
configuration.
Note that if you act on a crate::TrackElement, this will edit its parent
crate::Clip instead. Moreover, for any crate::TimelineElement, if you select
crate::Edge::None for crate::EditMode::Normal or crate::EditMode::Ripple, this
will edit the toplevel instead, but still in such a way as to make the
[crate::TimelineElement:start] of self reach the edit position.
Note that if the element’s timeline has a
[crate::Timeline:snapping-distance] set, then the edit position may be
snapped to the edge of some element under the edited element.
new_layer_priority can be used to switch self, and other elements
moved by the edit, to a new layer. New layers may be be created if the
the corresponding layer priority/index does not yet exist for the
timeline.
new_layer_priority
The priority/index of the layer self should be
moved to. -1 means no move
mode
The edit mode
edge
The edge of self where the edit should occur
position
The edit position: a new location for the edge of self
(in nanoseconds) in the timeline coordinates
Returns
fn duration(&self) -> ClockTime[src]
Gets the [crate::TimelineElement:duration] for the element.
Returns
The duration of self (in nanoseconds).
fn inpoint(&self) -> ClockTime[src]
Gets the [crate::TimelineElement:in-point] for the element.
Returns
The in-point of self (in nanoseconds).
fn layer_priority(&self) -> u32[src]
v1_16 only.Gets the priority of the layer the element is in. A crate::Group may span
several layers, so this would return the highest priority (numerically,
the smallest) amongst them.
Returns
The priority of the layer self is in, or
GES_TIMELINE_ELEMENT_NO_LAYER_PRIORITY if self does not exist in a
layer.
fn max_duration(&self) -> ClockTime[src]
Gets the [crate::TimelineElement:max-duration] for the element.
Returns
The max-duration of self (in nanoseconds).
fn name(&self) -> Option<GString>[src]
fn natural_framerate(&self) -> Option<(i32, i32)>[src]
v1_18 only.Get the “natural” framerate of self. This is to say, for example
for a [crate::VideoUriSource] the framerate of the source.
Note that a [crate::AudioSource] may also have a natural framerate if it derives
from the same [crate::SourceClip] asset as a [crate::VideoSource], and its value will
be that of the video source. For example, if the uri of a crate::UriClip points
to a file that contains both a video and audio stream, then the corresponding
[crate::AudioUriSource] will share the natural framerate of the corresponding
[crate::VideoUriSource].
framerate_n
The framerate numerator
framerate_d
The framerate denominator
Returns
Whether self has a natural framerate or not, framerate_n
and framerate_d will be set to, respectively, 0 and -1 if it is
not the case.
fn parent(&self) -> Option<TimelineElement>[src]
Gets the [crate::TimelineElement:parent] for the element.
Returns
The parent of self, or None if
self has no parent.
fn priority(&self) -> u32[src]
fn start(&self) -> ClockTime[src]
Gets the [crate::TimelineElement:start] for the element.
Returns
The start of self (in nanoseconds).
fn timeline(&self) -> Option<Timeline>[src]
Gets the [crate::TimelineElement:timeline] for the element.
Returns
The timeline of self, or None
if self has no timeline.
fn toplevel_parent(&self) -> Option<TimelineElement>[src]
Gets the toplevel [crate::TimelineElement:parent] of the element.
Returns
The toplevel parent of self.
fn track_types(&self) -> TrackType[src]
Gets the track types that the element can interact with, i.e. the type
of crate::Track it can exist in, or will create crate::TrackElement-s for.
Returns
The track types that self supports.
fn paste(&self, paste_position: ClockTime) -> Result<TimelineElement, BoolError>[src]
Paste an element inside the same timeline and layer as self. self
must be the return of Self::copy() with deep=TRUE,
and it should not be changed before pasting.
self is not placed in the timeline, instead a new element is created,
alike to the originally copied element. Note that the originally
copied element must stay within the same timeline and layer, at both
the point of copying and pasting.
Pasting may fail if it would place the timeline in an unsupported configuration.
After calling this function element should not be used. In particular,
element can not be pasted again. Instead, you can copy the
returned element and paste that copy (although, this is only possible
if the paste was successful).
See also crate::prelude::TimelineExt::paste_element().
paste_position
The position in the timeline element should be pasted
to, i.e. the [crate::TimelineElement:start] value for the pasted element.
Returns
The newly created element, or
None if pasting fails.
fn ripple(&self, start: ClockTime) -> Result<(), BoolError>[src]
Edits the start time of an element within its timeline in ripple mode.
See Self::edit() with crate::EditMode::Ripple and
crate::Edge::None.
start
The new start time of self in ripple mode
Returns
true if the ripple edit of self completed, false on
failure.
fn ripple_end(&self, end: ClockTime) -> Result<(), BoolError>[src]
Edits the end time of an element within its timeline in ripple mode.
See Self::edit() with crate::EditMode::Ripple and
crate::Edge::End.
end
The new end time of self in ripple mode
Returns
true if the ripple edit of self completed, false on
failure.
fn roll_end(&self, end: ClockTime) -> Result<(), BoolError>[src]
Edits the end time of an element within its timeline in roll mode.
See Self::edit() with crate::EditMode::Roll and
crate::Edge::End.
end
The new end time of self in roll mode
Returns
fn roll_start(&self, start: ClockTime) -> Result<(), BoolError>[src]
Edits the start time of an element within its timeline in roll mode.
See Self::edit() with crate::EditMode::Roll and
crate::Edge::Start.
start
The new start time of self in roll mode
Returns
fn set_duration(&self, duration: ClockTime) -> bool[src]
Sets [crate::TimelineElement:duration] for the element.
Whilst the element is part of a crate::Timeline, this is the same as
editing the element with Self::edit() under
crate::EditMode::Trim with crate::Edge::End. In particular, the
[crate::TimelineElement:duration] of the element may be snapped to a
different timeline time difference from the one given. In addition,
setting may fail if it would place the timeline in an unsupported
configuration, or the element does not have enough internal content to
last the desired duration.
duration
The desired duration in its timeline
Returns
true if duration could be set for self.
fn set_inpoint(&self, inpoint: ClockTime) -> bool[src]
Sets [crate::TimelineElement:in-point] for the element. If the new in-point
is above the current [crate::TimelineElement:max-duration] of the element,
this method will fail.
inpoint
The in-point, in internal time coordinates
Returns
true if inpoint could be set for self.
fn set_max_duration(&self, maxduration: ClockTime) -> bool[src]
Sets [crate::TimelineElement:max-duration] for the element. If the new
maximum duration is below the current [crate::TimelineElement:in-point] of
the element, this method will fail.
maxduration
The maximum duration, in internal time coordinates
Returns
true if maxduration could be set for self.
fn set_name(&self, name: Option<&str>) -> Result<(), BoolError>[src]
Sets the [crate::TimelineElement:name] for the element. If None is given
for name, then the library will instead generate a new name based on
the type name of the element, such as the name “uriclip3” for a
crate::UriClip, and will set that name instead.
If self already has a [crate::TimelineElement:timeline], you should not
call this function with name set to None.
You should ensure that, within each crate::Timeline, every element has a
unique name. If you call this function with name as None, then
the library should ensure that the set generated name is unique from
previously generated names. However, if you choose a name that
interferes with the naming conventions of the library, the library will
attempt to ensure that the generated names will not conflict with the
chosen name, which may lead to a different name being set instead, but
the uniqueness between generated and user-chosen names is not
guaranteed.
name
The name self should take
Returns
true if name or a generated name for self could be set.
fn set_parent<P: IsA<TimelineElement>>(
&self,
parent: &P
) -> Result<(), BoolError>[src]
&self,
parent: &P
) -> Result<(), BoolError>
Sets the [crate::TimelineElement:parent] for the element.
This is used internally and you should normally not call this. A
crate::Container will set the [crate::TimelineElement:parent] of its children
in crate::prelude::GESContainerExt::add() and crate::prelude::GESContainerExt::remove().
Note, if parent is not None, self must not already have a parent
set. Therefore, if you wish to switch parents, you will need to call
this function twice: first to set the parent to None, and then to the
new parent.
If parent is not None, you must ensure it already has a
(non-floating) reference to self before calling this.
Returns
true if parent could be set for self.
fn set_priority(&self, priority: u32) -> bool[src]
Since 1.10
Sets the priority of the element within the containing layer.
Deprecated since 1.10
All priority management is done by GES itself now.
To set crate::Effect priorities crate::prelude::ClipExt::set_top_effect_index should
be used.
priority
The priority
Returns
true if priority could be set for self.
fn set_start(&self, start: ClockTime) -> bool[src]
Sets [crate::TimelineElement:start] for the element. If the element has a
parent, this will also move its siblings with the same shift.
Whilst the element is part of a crate::Timeline, this is the same as
editing the element with Self::edit() under
crate::EditMode::Normal with crate::Edge::None. In particular, the
[crate::TimelineElement:start] of the element may be snapped to a different
timeline time from the one given. In addition, setting may fail if it
would place the timeline in an unsupported configuration.
start
The desired start position of the element in its timeline
Returns
true if start could be set for self.
fn set_timeline<P: IsA<Timeline>>(&self, timeline: &P) -> Result<(), BoolError>[src]
Sets the [crate::TimelineElement:timeline] of the element.
This is used internally and you should normally not call this. A
crate::Clip will have its [crate::TimelineElement:timeline] set through its
crate::Layer. A crate::Track will similarly take care of setting the
[crate::TimelineElement:timeline] of its crate::TrackElement-s. A crate::Group
will adopt the same [crate::TimelineElement:timeline] as its children.
If timeline is None, this will stop its current
[crate::TimelineElement:timeline] from tracking it, otherwise timeline will
start tracking self. Note, in the latter case, self must not already
have a timeline set. Therefore, if you wish to switch timelines, you
will need to call this function twice: first to set the timeline to
None, and then to the new timeline.
Returns
true if timeline could be set for self.
fn trim(&self, start: ClockTime) -> Result<(), BoolError>[src]
Edits the start time of an element within its timeline in trim mode.
See Self::edit() with crate::EditMode::Trim and
crate::Edge::Start.
start
The new start time of self in trim mode
Returns
fn in_point(&self) -> u64[src]
fn set_in_point(&self, in_point: u64)[src]
fn is_serialize(&self) -> bool[src]
fn set_serialize(&self, serialize: bool)[src]
fn connect_duration_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
&self,
f: F
) -> SignalHandlerId
fn connect_in_point_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
&self,
f: F
) -> SignalHandlerId
fn connect_max_duration_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
&self,
f: F
) -> SignalHandlerId
fn connect_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId[src]
fn connect_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId[src]
fn connect_priority_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
&self,
f: F
) -> SignalHandlerId
Since 1.10
fn connect_serialize_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
&self,
f: F
) -> SignalHandlerId
fn connect_start_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId[src]
fn connect_timeline_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
&self,
f: F
) -> SignalHandlerId
Implementors
impl<O: IsA<TimelineElement>> TimelineElementExt for O[src]
impl<O: IsA<TimelineElement>> TimelineElementExt for O[src]fn copy(&self, deep: bool) -> Result<TimelineElement, BoolError>[src]
fn edit(
&self,
layers: &[Layer],
new_layer_priority: i64,
mode: EditMode,
edge: Edge,
position: u64
) -> bool[src]
fn edit(
&self,
layers: &[Layer],
new_layer_priority: i64,
mode: EditMode,
edge: Edge,
position: u64
) -> bool[src]v1_18 only.fn edit_full(
&self,
new_layer_priority: i64,
mode: EditMode,
edge: Edge,
position: u64
) -> Result<(), Error>[src]
fn edit_full(
&self,
new_layer_priority: i64,
mode: EditMode,
edge: Edge,
position: u64
) -> Result<(), Error>[src]v1_18 only.fn duration(&self) -> ClockTime[src]
fn inpoint(&self) -> ClockTime[src]
fn layer_priority(&self) -> u32[src]
fn layer_priority(&self) -> u32[src]v1_16 only.fn max_duration(&self) -> ClockTime[src]
fn name(&self) -> Option<GString>[src]
fn natural_framerate(&self) -> Option<(i32, i32)>[src]
fn natural_framerate(&self) -> Option<(i32, i32)>[src]v1_18 only.fn parent(&self) -> Option<TimelineElement>[src]
fn priority(&self) -> u32[src]
fn start(&self) -> ClockTime[src]
fn timeline(&self) -> Option<Timeline>[src]
fn toplevel_parent(&self) -> Option<TimelineElement>[src]
fn track_types(&self) -> TrackType[src]
fn paste(&self, paste_position: ClockTime) -> Result<TimelineElement, BoolError>[src]
fn ripple(&self, start: ClockTime) -> Result<(), BoolError>[src]
fn ripple_end(&self, end: ClockTime) -> Result<(), BoolError>[src]
fn roll_end(&self, end: ClockTime) -> Result<(), BoolError>[src]
fn roll_start(&self, start: ClockTime) -> Result<(), BoolError>[src]
fn set_duration(&self, duration: ClockTime) -> bool[src]
fn set_inpoint(&self, inpoint: ClockTime) -> bool[src]
fn set_max_duration(&self, maxduration: ClockTime) -> bool[src]
fn set_name(&self, name: Option<&str>) -> Result<(), BoolError>[src]
fn set_parent<P: IsA<TimelineElement>>(
&self,
parent: &P
) -> Result<(), BoolError>[src]
&self,
parent: &P
) -> Result<(), BoolError>
fn set_priority(&self, priority: u32) -> bool[src]
fn set_priority(&self, priority: u32) -> bool[src]Since 1.10
fn set_start(&self, start: ClockTime) -> bool[src]
fn set_timeline<P: IsA<Timeline>>(&self, timeline: &P) -> Result<(), BoolError>[src]
fn trim(&self, start: ClockTime) -> Result<(), BoolError>[src]
fn in_point(&self) -> u64[src]
fn set_in_point(&self, in_point: u64)[src]
fn is_serialize(&self) -> bool[src]
fn set_serialize(&self, serialize: bool)[src]
fn connect_duration_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
&self,
f: F
) -> SignalHandlerId
fn connect_in_point_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
&self,
f: F
) -> SignalHandlerId
fn connect_max_duration_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
&self,
f: F
) -> SignalHandlerId
fn connect_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId[src]
fn connect_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId[src]
fn connect_priority_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
fn connect_priority_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]Since 1.10
fn connect_serialize_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
&self,
f: F
) -> SignalHandlerId
fn connect_start_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId[src]
fn connect_timeline_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
&self,
f: F
) -> SignalHandlerId