pub struct TimingAdjustCommand {
pub event_indices: Vec<usize>,
pub start_offset_cs: i32,
pub end_offset_cs: i32,
pub description: Option<String>,
}Expand description
Command to adjust event timing (shift start/end times)
Fields§
§event_indices: Vec<usize>§start_offset_cs: i32§end_offset_cs: i32§description: Option<String>Implementations§
Source§impl TimingAdjustCommand
impl TimingAdjustCommand
Sourcepub fn new(
event_indices: Vec<usize>,
start_offset_cs: i32,
end_offset_cs: i32,
) -> Self
pub fn new( event_indices: Vec<usize>, start_offset_cs: i32, end_offset_cs: i32, ) -> Self
Create a new timing adjustment command for specific events
Sourcepub fn all_events(start_offset_cs: i32, end_offset_cs: i32) -> Self
pub fn all_events(start_offset_cs: i32, end_offset_cs: i32) -> Self
Create a timing adjustment command for all events
Sourcepub fn shift_start(event_indices: Vec<usize>, offset_cs: i32) -> Self
pub fn shift_start(event_indices: Vec<usize>, offset_cs: i32) -> Self
Adjust only start times (keep duration constant)
Sourcepub fn shift_end(event_indices: Vec<usize>, offset_cs: i32) -> Self
pub fn shift_end(event_indices: Vec<usize>, offset_cs: i32) -> Self
Adjust only end times (change duration)
Sourcepub fn scale_duration(event_indices: Vec<usize>, factor: f64) -> Self
pub fn scale_duration(event_indices: Vec<usize>, factor: f64) -> Self
Scale duration (multiply by factor)
Sourcepub fn with_description(self, description: String) -> Self
pub fn with_description(self, description: String) -> Self
Set a custom description for this command
Trait Implementations§
Source§impl Clone for TimingAdjustCommand
impl Clone for TimingAdjustCommand
Source§fn clone(&self) -> TimingAdjustCommand
fn clone(&self) -> TimingAdjustCommand
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TimingAdjustCommand
impl Debug for TimingAdjustCommand
Source§impl EditorCommand for TimingAdjustCommand
impl EditorCommand for TimingAdjustCommand
Source§fn execute(&self, document: &mut EditorDocument) -> Result<CommandResult>
fn execute(&self, document: &mut EditorDocument) -> Result<CommandResult>
Execute the command on the given document Read more
Source§fn description(&self) -> &str
fn description(&self) -> &str
Get a human-readable description of the command
Source§fn memory_usage(&self) -> usize
fn memory_usage(&self) -> usize
Get the estimated memory usage of this command Read more
Source§fn modifies_content(&self) -> bool
fn modifies_content(&self) -> bool
Check if this command modifies document content Read more
Auto Trait Implementations§
impl Freeze for TimingAdjustCommand
impl RefUnwindSafe for TimingAdjustCommand
impl Send for TimingAdjustCommand
impl Sync for TimingAdjustCommand
impl Unpin for TimingAdjustCommand
impl UnwindSafe for TimingAdjustCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more