Struct aspasia::TimedMicroDvdSubtitle
source · pub struct TimedMicroDvdSubtitle { /* private fields */ }
Expand description
Timed version of MicroDVD (.sub) subtitle, using user-supplied framerate to calculate timings
When initialised without framerate, the default framerate is 24.
Implementations§
source§impl TimedMicroDvdSubtitle
impl TimedMicroDvdSubtitle
sourcepub fn from_raw(raw: &MicroDvdSubtitle, framerate: Option<f32>) -> Self
pub fn from_raw(raw: &MicroDvdSubtitle, framerate: Option<f32>) -> Self
Convert raw MicroDVD subtitle data to timed MicroDVD data, given the framerate the subtitles were created for. If no framerate is given, the default of 24 is used.
sourcepub fn with_framerate(
path: impl AsRef<Path>,
framerate: f32
) -> Result<Self, Error>
pub fn with_framerate( path: impl AsRef<Path>, framerate: f32 ) -> Result<Self, Error>
Create MicroDVD from path given and calculate its timings using the given framerate.
Errors
Returns Error::FileIoError
if an error occurs while opening the file
sourcepub fn set_framerate(&mut self, framerate: f32)
pub fn set_framerate(&mut self, framerate: f32)
Modify framerate associated with subtitle. Does not modify event timings at all.
sourcepub fn update_framerate(&mut self, framerate: f32)
pub fn update_framerate(&mut self, framerate: f32)
Modify framerate associated with subtitle
This will also recalculate and update all event timings to match the new framerate.
Trait Implementations§
source§impl Debug for TimedMicroDvdSubtitle
impl Debug for TimedMicroDvdSubtitle
source§impl Display for TimedMicroDvdSubtitle
impl Display for TimedMicroDvdSubtitle
source§impl From<&AssSubtitle> for TimedMicroDvdSubtitle
impl From<&AssSubtitle> for TimedMicroDvdSubtitle
source§fn from(value: &AssSubtitle) -> Self
fn from(value: &AssSubtitle) -> Self
Converts to this type from the input type.
source§impl From<&SsaSubtitle> for TimedMicroDvdSubtitle
impl From<&SsaSubtitle> for TimedMicroDvdSubtitle
source§fn from(value: &SsaSubtitle) -> Self
fn from(value: &SsaSubtitle) -> Self
Converts to this type from the input type.
source§impl From<&SubRipSubtitle> for TimedMicroDvdSubtitle
impl From<&SubRipSubtitle> for TimedMicroDvdSubtitle
source§fn from(value: &SubRipSubtitle) -> Self
fn from(value: &SubRipSubtitle) -> Self
Converts to this type from the input type.
source§impl From<&TimedMicroDvdSubtitle> for AssSubtitle
impl From<&TimedMicroDvdSubtitle> for AssSubtitle
source§fn from(value: &TimedMicroDvdSubtitle) -> Self
fn from(value: &TimedMicroDvdSubtitle) -> Self
Converts to this type from the input type.
source§impl From<&TimedMicroDvdSubtitle> for MicroDvdSubtitle
impl From<&TimedMicroDvdSubtitle> for MicroDvdSubtitle
source§fn from(value: &TimedMicroDvdSubtitle) -> Self
fn from(value: &TimedMicroDvdSubtitle) -> Self
Converts to this type from the input type.
source§impl From<&TimedMicroDvdSubtitle> for SsaSubtitle
impl From<&TimedMicroDvdSubtitle> for SsaSubtitle
source§fn from(value: &TimedMicroDvdSubtitle) -> Self
fn from(value: &TimedMicroDvdSubtitle) -> Self
Converts to this type from the input type.
source§impl From<&TimedMicroDvdSubtitle> for SubRipSubtitle
impl From<&TimedMicroDvdSubtitle> for SubRipSubtitle
source§fn from(value: &TimedMicroDvdSubtitle) -> Self
fn from(value: &TimedMicroDvdSubtitle) -> Self
Converts to this type from the input type.
source§impl From<&TimedMicroDvdSubtitle> for WebVttSubtitle
impl From<&TimedMicroDvdSubtitle> for WebVttSubtitle
source§fn from(value: &TimedMicroDvdSubtitle) -> Self
fn from(value: &TimedMicroDvdSubtitle) -> Self
Converts to this type from the input type.
source§impl From<&WebVttSubtitle> for TimedMicroDvdSubtitle
impl From<&WebVttSubtitle> for TimedMicroDvdSubtitle
source§fn from(value: &WebVttSubtitle) -> Self
fn from(value: &WebVttSubtitle) -> Self
Converts to this type from the input type.
source§impl From<TimedMicroDvdSubtitle> for AssSubtitle
impl From<TimedMicroDvdSubtitle> for AssSubtitle
source§fn from(value: TimedMicroDvdSubtitle) -> Self
fn from(value: TimedMicroDvdSubtitle) -> Self
Converts to this type from the input type.
source§impl From<TimedMicroDvdSubtitle> for SsaSubtitle
impl From<TimedMicroDvdSubtitle> for SsaSubtitle
source§fn from(value: TimedMicroDvdSubtitle) -> Self
fn from(value: TimedMicroDvdSubtitle) -> Self
Converts to this type from the input type.
source§impl From<TimedMicroDvdSubtitle> for SubRipSubtitle
impl From<TimedMicroDvdSubtitle> for SubRipSubtitle
source§fn from(value: TimedMicroDvdSubtitle) -> Self
fn from(value: TimedMicroDvdSubtitle) -> Self
Converts to this type from the input type.
source§impl From<TimedMicroDvdSubtitle> for WebVttSubtitle
impl From<TimedMicroDvdSubtitle> for WebVttSubtitle
source§fn from(value: TimedMicroDvdSubtitle) -> Self
fn from(value: TimedMicroDvdSubtitle) -> Self
Converts to this type from the input type.
source§impl FromStr for TimedMicroDvdSubtitle
impl FromStr for TimedMicroDvdSubtitle
source§impl Subtitle for TimedMicroDvdSubtitle
impl Subtitle for TimedMicroDvdSubtitle
§type Event = TimedMicroDvdEvent
type Event = TimedMicroDvdEvent
Event type for the given subtitle format
source§fn from_path_with_encoding(
path: impl AsRef<Path>,
encoding: Option<&'static Encoding>
) -> Result<Self, Error>
fn from_path_with_encoding( path: impl AsRef<Path>, encoding: Option<&'static Encoding> ) -> Result<Self, Error>
Load subtitle format from path using the given encoding Read more
source§fn events_mut(&mut self) -> &mut [Self::Event]
fn events_mut(&mut self) -> &mut [Self::Event]
Get list of events as a mutable slice
source§fn from_path(path: impl AsRef<Path>) -> Result<Self, Error>
fn from_path(path: impl AsRef<Path>) -> Result<Self, Error>
Load subtitle from given path.
Automatically attempts to detect the encoding to use from the file contents. Read more
source§impl TextSubtitle for TimedMicroDvdSubtitle
impl TextSubtitle for TimedMicroDvdSubtitle
source§fn strip_formatting(&mut self)
fn strip_formatting(&mut self)
Remove all styling/formatting information from the text and subtitle metadata
Auto Trait Implementations§
impl RefUnwindSafe for TimedMicroDvdSubtitle
impl Send for TimedMicroDvdSubtitle
impl Sync for TimedMicroDvdSubtitle
impl Unpin for TimedMicroDvdSubtitle
impl UnwindSafe for TimedMicroDvdSubtitle
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