Enum gstreamer_editing_services::EditMode[][src]

#[non_exhaustive]
pub enum EditMode {
    Normal,
    Ripple,
    Roll,
    Trim,
    Slide,
    // some variants omitted
}

When a single timeline element is edited within its timeline at some position, using crate::prelude::TimelineElementExt::edit(), depending on the edit mode, its [crate::TimelineElement:start], [crate::TimelineElement:duration] or [crate::TimelineElement:in-point] will be adjusted accordingly. In addition, any clips may change [crate::Clip:layer].

Each edit can be broken down into a combination of three basic edits:

In particular, when editing a crate::Clip:

When editing a crate::Group:

When editing a crate::TrackElement, if it has a crate::Clip parent, this will be edited instead. Otherwise it is edited in the same way as a crate::Clip.

The layer priority of a crate::Group is the lowest layer priority of any crate::Clip underneath it. When a group is edited to a new layer priority, it will shift all clips underneath it by the same amount, such that their relative layers stay the same.

If the crate::Timeline has a [crate::Timeline:snapping-distance], then snapping may occur for some of the edges of the main edited element:

These edges may snap with either the start or end edge of any other [crate::Source] in the timeline that is not also being moved by the element, including those in different layers, if they are within the [crate::Timeline:snapping-distance]. During an edit, only up to one snap can occur. This will shift the edit position such that the snapped edges will touch once the edit has completed.

Note that snapping can cause an edit to fail where it would have otherwise succeeded because it may push the edit position such that the edit would result in an unsupported timeline configuration. Similarly, snapping can cause an edit to succeed where it would have otherwise failed.

For example, in Self::Ripple acting on crate::Edge::None, the main element is the MOVED toplevel of the edited element. Any source under the main MOVED toplevel may have its start or end edge snapped. Note, these sources cannot snap with each other. The edit may also push other elements, but any sources under these elements cannot snap, nor can they be snapped with. If a snap does occur, the MOVE of the toplevel and all other elements pushed by the ripple will be shifted by the same amount such that the snapped edges will touch.

You can also find more explanation about the behaviour of those modes at: trim, ripple and roll and clip management.

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Normal

The element is edited the normal way (default). If acting on the element as a whole (crate::Edge::None), this will MOVE the element by MOVING its toplevel. When acting on the start of the element (crate::Edge::Start), this will only MOVE the element, but not its toplevel parent. This can allow you to move a crate::Clip or crate::Group to a new start time or layer within its container group, without effecting other members of the group. When acting on the end of the element (crate::Edge::End), this will END-TRIM the element, leaving its toplevel unchanged.

Ripple

The element is edited in ripple mode: moving itself as well as later elements, keeping their relative times. This edits the element the same as Self::Normal. In addition, if acting on the element as a whole, or the start of the element, any toplevel element in the same timeline (including different layers) whose start time is later than the current start time of the MOVED element will also be MOVED by the same shift as the edited element. If acting on the end of the element, any toplevel element whose start time is later than the current end time of the edited element will also be MOVED by the same shift as the change in the end of the edited element. These additional elements will also be shifted by the same shift in layers as the edited element.

Roll

The element is edited in roll mode: swapping its content for its neighbour’s, or vis versa, in the timeline output. This edits the element the same as Self::Trim. In addition, any neighbours are also TRIMMED at their opposite edge to the same timeline position. When acting on the start of the element, a neighbour is any earlier element in the timeline whose end time matches the current start time of the edited element. When acting on the end of the element, a neighbour is any later element in the timeline whose start time matches the current start time of the edited element. In addition, a neighbour have a [crate::Source] at its end/start edge that shares a track with a [crate::Source] at the start/end edge of the edited element. Basically, a neighbour is an element that can be extended, or cut, to have its content replace, or be replaced by, the content of the edited element. Acting on the element as a whole (crate::Edge::None) is not defined. The element can not shift layers under this mode.

Trim

The element is edited in trim mode. When acting on the start of the element, this will START-TRIM it. When acting on the end of the element, this will END-TRIM it. Acting on the element as a whole (crate::Edge::None) is not defined.

Slide

The element is edited in slide mode (not yet implemented): moving the element replacing or consuming content on each end. When acting on the element as a whole, this will MOVE the element, and TRIM any neighbours on either side. A neighbour is defined in the same way as in Self::Roll, but they may be on either side of the edited elements. Elements at the end with be START-TRIMMED to the new end position of the edited element. Elements at the start will be END-TRIMMED to the new start position of the edited element. Acting on the start or end of the element (crate::Edge::Start and crate::Edge::End) is not defined. The element can not shift layers under this mode.

Implementations

impl EditMode[src]

pub fn name<'a>(self) -> &'a str[src]

This is supported on crate feature v1_18 only.

Trait Implementations

impl Clone for EditMode[src]

fn clone(&self) -> EditMode[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for EditMode[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Display for EditMode[src]

This is supported on crate feature v1_18 only.

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<'a> FromValue<'a> for EditMode[src]

type Checker = GenericValueTypeChecker<Self>

Value type checker.

unsafe fn from_value(value: &'a Value) -> Self[src]

Get the contained value from a Value. Read more

impl Hash for EditMode[src]

fn hash<__H: Hasher>(&self, state: &mut __H)[src]

Feeds this value into the given Hasher. Read more

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given Hasher. Read more

impl Ord for EditMode[src]

fn cmp(&self, other: &EditMode) -> Ordering[src]

This method returns an Ordering between self and other. Read more

#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]

Compares and returns the maximum of two values. Read more

#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]

Compares and returns the minimum of two values. Read more

#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]

Restrict a value to a certain interval. Read more

impl PartialEq<EditMode> for EditMode[src]

fn eq(&self, other: &EditMode) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &EditMode) -> bool[src]

This method tests for !=.

impl PartialOrd<EditMode> for EditMode[src]

fn partial_cmp(&self, other: &EditMode) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl StaticType for EditMode[src]

fn static_type() -> Type[src]

Returns the type identifier of Self.

impl ToValue for EditMode[src]

fn to_value(&self) -> Value[src]

Convert a value to a Value.

fn value_type(&self) -> Type[src]

Returns the type identifer of self. Read more

impl ValueType for EditMode[src]

type Type = Self

Type to get the Type from. Read more

impl Copy for EditMode[src]

impl Eq for EditMode[src]

impl StructuralEq for EditMode[src]

impl StructuralPartialEq for EditMode[src]

Auto Trait Implementations

impl RefUnwindSafe for EditMode

impl Send for EditMode

impl Sync for EditMode

impl Unpin for EditMode

impl UnwindSafe for EditMode

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToSendValue for T where
    T: Send + ToValue + ?Sized
[src]

pub fn to_send_value(&self) -> SendValue[src]

Returns a SendValue clone of self.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.