pub struct TimeSpans(pub Vec<TimeSpan>);
Expand description
TimeSpan
buffer to be used as reference by the synchronization process
May be generated from an AudioSink
that’s been processed for voice-
activity, extracted from a subtitle file whose timing is known to be good,
or populated manually by some other process (e.g. extracing embedded subs
from video file). TimeSpans
also provides functionality for reading and
writing raw timespan data to/from disk which is useful for caching.
Tuple Fields§
§0: Vec<TimeSpan>
Implementations§
Source§impl TimeSpans
impl TimeSpans
Sourcepub fn push(&mut self, span: SubTimeSpan)
pub fn push(&mut self, span: SubTimeSpan)
Appends a timespan
Sourcepub fn save(&self, filename: &str) -> Result<(), TimeSpansSaveError>
pub fn save(&self, filename: &str) -> Result<(), TimeSpansSaveError>
Saves raw timespan data to disk
Sourcepub fn load(filename: &str) -> Result<Self, TimeSpansLoadError>
pub fn load(filename: &str) -> Result<Self, TimeSpansLoadError>
Loads raw timespan data from disk
Sourcepub fn from_sub_file(sub_file: &SubtitleFile) -> Result<Self, SyncError>
pub fn from_sub_file(sub_file: &SubtitleFile) -> Result<Self, SyncError>
Create TimeSpans
instance from subtitle file
Sourcepub fn to_alass_timespans(&self, interval: i64) -> Vec<TimeSpan>
pub fn to_alass_timespans(&self, interval: i64) -> Vec<TimeSpan>
Convert TimeSpan
s from subparse
to alass_core
representation
Trait Implementations§
Source§impl From<&VoiceActivity> for TimeSpans
Analyze vector of voice-activity data and produce TimeSpans
impl From<&VoiceActivity> for TimeSpans
Analyze vector of voice-activity data and produce TimeSpans
Source§fn from(activity: &VoiceActivity) -> TimeSpans
fn from(activity: &VoiceActivity) -> TimeSpans
Converts to this type from the input type.
Source§impl IntoIterator for TimeSpans
Allow for iteration over internal subparse::TimeSpan
elements
impl IntoIterator for TimeSpans
Allow for iteration over internal subparse::TimeSpan
elements
Auto Trait Implementations§
impl Freeze for TimeSpans
impl RefUnwindSafe for TimeSpans
impl Send for TimeSpans
impl Sync for TimeSpans
impl Unpin for TimeSpans
impl UnwindSafe for TimeSpans
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more