Struct aspasia::SsaSubtitle
source · pub struct SsaSubtitle { /* private fields */ }
Expand description
SubStation Alpha v4 (.ssa) subtitle
Implementations§
source§impl SsaSubtitle
impl SsaSubtitle
sourcepub fn builder(
) -> __SsaSubtitleBuilder<(__Required<SsaScriptInfo>, __Optional<Vec<SsaEvent>>, __Optional<Vec<SsaEvent>>, __Optional<Vec<SsaEvent>>, __Optional<Vec<SsaEvent>>, __Optional<Vec<SsaEvent>>, __Optional<Vec<SsaStyle>>, __Optional<Vec<SubStationFont>>, __Optional<Vec<SubStationGraphic>>)>
pub fn builder( ) -> __SsaSubtitleBuilder<(__Required<SsaScriptInfo>, __Optional<Vec<SsaEvent>>, __Optional<Vec<SsaEvent>>, __Optional<Vec<SsaEvent>>, __Optional<Vec<SsaEvent>>, __Optional<Vec<SsaEvent>>, __Optional<Vec<SsaStyle>>, __Optional<Vec<SubStationFont>>, __Optional<Vec<SubStationGraphic>>)>
Create a new SsaSubtitle
Arguments
script_info
: Script infodialogue
: Dialogue eventspictures
: Picture eventssounds
: Sound eventsmovies
: Movie eventscommands
: Command eventsstyles
: Stylesfonts
: Embedded font datagraphics
: Embedded graphics data
source§impl SsaSubtitle
impl SsaSubtitle
sourcepub fn pictures_mut(&mut self) -> &mut [SsaEvent]
pub fn pictures_mut(&mut self) -> &mut [SsaEvent]
Get list of picture events as a mutable slice
sourcepub fn picture_mut(&mut self, index: usize) -> Option<&mut SsaEvent>
pub fn picture_mut(&mut self, index: usize) -> Option<&mut SsaEvent>
Get mutable picture event at given index
sourcepub fn sounds_mut(&mut self) -> &mut [SsaEvent]
pub fn sounds_mut(&mut self) -> &mut [SsaEvent]
Get list of sound events as a mutable slice
sourcepub fn sound_mut(&mut self, index: usize) -> Option<&mut SsaEvent>
pub fn sound_mut(&mut self, index: usize) -> Option<&mut SsaEvent>
Get mutable sound event at specified index
sourcepub fn movies_mut(&mut self) -> &mut [SsaEvent]
pub fn movies_mut(&mut self) -> &mut [SsaEvent]
Get list of movie events as a mutable slice
sourcepub fn movie_mut(&mut self, index: usize) -> Option<&mut SsaEvent>
pub fn movie_mut(&mut self, index: usize) -> Option<&mut SsaEvent>
Get mutable movie event at specified index
sourcepub fn commands_mut(&mut self) -> &mut [SsaEvent]
pub fn commands_mut(&mut self) -> &mut [SsaEvent]
Get list of command events as a mutable slice
sourcepub fn command_mut(&mut self, index: usize) -> Option<&mut SsaEvent>
pub fn command_mut(&mut self, index: usize) -> Option<&mut SsaEvent>
Get mutable command event at given index
sourcepub fn script_info(&self) -> &SsaScriptInfo
pub fn script_info(&self) -> &SsaScriptInfo
Get script info struct
sourcepub fn script_info_mut(&mut self) -> &mut SsaScriptInfo
pub fn script_info_mut(&mut self) -> &mut SsaScriptInfo
Get mutable script info struct
sourcepub fn styles_mut(&mut self) -> &mut [SsaStyle]
pub fn styles_mut(&mut self) -> &mut [SsaStyle]
Get list of styles as a mutable slice
sourcepub fn fonts(&self) -> &[SubStationFont]
pub fn fonts(&self) -> &[SubStationFont]
Get list of fonts as a slice
sourcepub fn fonts_mut(&mut self) -> &mut [SubStationFont]
pub fn fonts_mut(&mut self) -> &mut [SubStationFont]
Get list of fonts as a mutable slice
sourcepub fn graphics(&self) -> &[SubStationGraphic]
pub fn graphics(&self) -> &[SubStationGraphic]
Get list of graphics as a slice
sourcepub fn graphics_mut(&mut self) -> &mut [SubStationGraphic]
pub fn graphics_mut(&mut self) -> &mut [SubStationGraphic]
Get list of graphics as a mutable slice
Trait Implementations§
source§impl Debug for SsaSubtitle
impl Debug for SsaSubtitle
source§impl Default for SsaSubtitle
impl Default for SsaSubtitle
source§impl Display for SsaSubtitle
impl Display for SsaSubtitle
source§impl From<&AssSubtitle> for SsaSubtitle
impl From<&AssSubtitle> for SsaSubtitle
source§fn from(value: &AssSubtitle) -> Self
fn from(value: &AssSubtitle) -> Self
source§impl From<&SsaSubtitle> for AssSubtitle
impl From<&SsaSubtitle> for AssSubtitle
source§fn from(value: &SsaSubtitle) -> Self
fn from(value: &SsaSubtitle) -> Self
source§impl From<&SsaSubtitle> for SubRipSubtitle
impl From<&SsaSubtitle> for SubRipSubtitle
source§fn from(value: &SsaSubtitle) -> Self
fn from(value: &SsaSubtitle) -> Self
Convert SubStation Alpha (.ssa) subtitles to .srt format
Replaces SubStation newline indicators (\N) with actual newlines. Additionally, converts .ssa style formatting tags to .srt formatting tags. Currently, bolded, italicised, or coloured text will be converted to their .srt counterparts. All other tags will be discarded.
source§impl From<&SsaSubtitle> for TimedMicroDvdSubtitle
impl From<&SsaSubtitle> for TimedMicroDvdSubtitle
source§fn from(value: &SsaSubtitle) -> Self
fn from(value: &SsaSubtitle) -> Self
source§impl From<&SsaSubtitle> for WebVttSubtitle
impl From<&SsaSubtitle> for WebVttSubtitle
source§fn from(value: &SsaSubtitle) -> Self
fn from(value: &SsaSubtitle) -> Self
source§impl From<&SubRipSubtitle> for SsaSubtitle
impl From<&SubRipSubtitle> for SsaSubtitle
source§fn from(value: &SubRipSubtitle) -> Self
fn from(value: &SubRipSubtitle) -> Self
Convert SubRip (.srt) subtitle to .ssa format.
This will replace newlines and convert HTML formatting tags (<b>
, <i>
, etc.) into .ssa style formatting tags
source§impl From<&TimedMicroDvdSubtitle> for SsaSubtitle
impl From<&TimedMicroDvdSubtitle> for SsaSubtitle
source§fn from(value: &TimedMicroDvdSubtitle) -> Self
fn from(value: &TimedMicroDvdSubtitle) -> Self
source§impl From<&WebVttSubtitle> for SsaSubtitle
impl From<&WebVttSubtitle> for SsaSubtitle
source§fn from(value: &WebVttSubtitle) -> Self
fn from(value: &WebVttSubtitle) -> Self
Convert WebVTT (.vtt) format subtitle to .ssa format.
For each line, this will convert newlines into the appropriate representation,
and it will also convert the basic HTML formatting tags (<b>
, <i>
, and <u>
).
All other tags and styles are discarded.
source§impl From<AssSubtitle> for SsaSubtitle
impl From<AssSubtitle> for SsaSubtitle
source§fn from(value: AssSubtitle) -> Self
fn from(value: AssSubtitle) -> Self
source§impl From<PlainSubtitle> for SsaSubtitle
impl From<PlainSubtitle> for SsaSubtitle
source§fn from(value: PlainSubtitle) -> Self
fn from(value: PlainSubtitle) -> Self
source§impl From<SsaSubtitle> for AssSubtitle
impl From<SsaSubtitle> for AssSubtitle
source§fn from(value: SsaSubtitle) -> Self
fn from(value: SsaSubtitle) -> Self
source§impl From<SsaSubtitle> for SubRipSubtitle
impl From<SsaSubtitle> for SubRipSubtitle
source§fn from(value: SsaSubtitle) -> Self
fn from(value: SsaSubtitle) -> Self
source§impl From<SsaSubtitle> for WebVttSubtitle
impl From<SsaSubtitle> for WebVttSubtitle
source§fn from(value: SsaSubtitle) -> Self
fn from(value: SsaSubtitle) -> Self
source§impl From<SubRipSubtitle> for SsaSubtitle
impl From<SubRipSubtitle> for SsaSubtitle
source§fn from(value: SubRipSubtitle) -> Self
fn from(value: SubRipSubtitle) -> Self
source§impl From<TimedMicroDvdSubtitle> for SsaSubtitle
impl From<TimedMicroDvdSubtitle> for SsaSubtitle
source§fn from(value: TimedMicroDvdSubtitle) -> Self
fn from(value: TimedMicroDvdSubtitle) -> Self
source§impl From<TimedSubtitleFile> for SsaSubtitle
impl From<TimedSubtitleFile> for SsaSubtitle
source§fn from(value: TimedSubtitleFile) -> Self
fn from(value: TimedSubtitleFile) -> Self
source§impl From<WebVttSubtitle> for SsaSubtitle
impl From<WebVttSubtitle> for SsaSubtitle
source§fn from(value: WebVttSubtitle) -> Self
fn from(value: WebVttSubtitle) -> Self
source§impl FromStr for SsaSubtitle
impl FromStr for SsaSubtitle
source§impl Subtitle for SsaSubtitle
impl Subtitle for SsaSubtitle
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>
source§fn events_mut(&mut self) -> &mut [SsaEvent]
fn events_mut(&mut self) -> &mut [SsaEvent]
source§fn from_path(path: impl AsRef<Path>) -> Result<Self, Error>
fn from_path(path: impl AsRef<Path>) -> Result<Self, Error>
source§impl TextSubtitle for SsaSubtitle
impl TextSubtitle for SsaSubtitle
source§fn strip_formatting(&mut self)
fn strip_formatting(&mut self)
Strip formatting tags from lines in addition to deleting styles