pub struct GsiBlock { /* private fields */ }Expand description
General Subtitle Information (GSI) block, the first 1024 bytes of an STL file.
Implementations§
Source§impl GsiBlock
impl GsiBlock
Sourcepub fn code_page_number(&self) -> &CodePageNumber
pub fn code_page_number(&self) -> &CodePageNumber
Code Page Number (CPN), the code page of the text in the GSI block.
Sourcepub fn disk_format_code(&self) -> &DiskFormatCode
pub fn disk_format_code(&self) -> &DiskFormatCode
Disk Format Code (DFC), the frame rate of the time codes.
Sourcepub fn display_standard_code(&self) -> &DisplayStandardCode
pub fn display_standard_code(&self) -> &DisplayStandardCode
Display Standard Code (DSC).
Sourcepub fn character_code_table(&self) -> &CharacterCodeTable
pub fn character_code_table(&self) -> &CharacterCodeTable
Character Code Table (CCT) of the Text Fields in the TTI blocks.
Sourcepub fn language(
&self,
) -> Result<Option<LanguageCode>, InvalidFieldValue<String>>
pub fn language( &self, ) -> Result<Option<LanguageCode>, InvalidFieldValue<String>>
Language Code (LC), validated as two hexadecimal digits 00h-7Fh, the range of the codes in
Appendix 3. A validated code may still be unassigned, see LanguageCode::name. None if
blank.
On error, InvalidFieldValue::value gives the value as stored in the file.
§Example
let stl = ebustl_parser::parse_stl_from_file("stls/test.stl").unwrap();
// The test file uses 2Fh, which is reserved for national assignment
let language = stl.gsi.language().unwrap().unwrap();
assert_eq!(0x2F, language.0);
assert_eq!(None, language.name());Sourcepub fn original_programme_title(&self) -> Option<&str>
pub fn original_programme_title(&self) -> Option<&str>
Original Programme Title (OPT), without the trailing space padding. None if blank.
§Example
let stl = ebustl_parser::parse_stl_from_file("stls/test.stl").unwrap();
assert_eq!(Some("TEST"), stl.gsi.original_programme_title());Sourcepub fn original_episode_title(&self) -> Option<&str>
pub fn original_episode_title(&self) -> Option<&str>
Original Episode Title (OET), without the trailing space padding. None if blank.
On error, InvalidFieldValue::value gives the value as stored in the file.
§Example
let stl = ebustl_parser::parse_stl_from_file("stls/test.stl").unwrap();
assert_eq!(Some("TEST EPISODE"), stl.gsi.original_episode_title());Sourcepub fn translated_programme_title(&self) -> Option<&str>
pub fn translated_programme_title(&self) -> Option<&str>
Translated Programme Title (TPT), without the trailing space padding. None if blank.
§Example
let stl = ebustl_parser::parse_stl_from_file("stls/test.stl").unwrap();
assert_eq!(Some("TEST"), stl.gsi.translated_programme_title());Sourcepub fn translated_episode_title(&self) -> Option<&str>
pub fn translated_episode_title(&self) -> Option<&str>
Translated Episode Title (TET), without the trailing space padding. None if blank.
§Example
let stl = ebustl_parser::parse_stl_from_file("stls/test.stl").unwrap();
assert_eq!(Some("EPISODE DE TEST"), stl.gsi.translated_episode_title());Sourcepub fn translators_name(&self) -> Option<&str>
pub fn translators_name(&self) -> Option<&str>
Translator’s Name (TN), without the trailing space padding. None if blank.
On error, InvalidFieldValue::value gives the value as stored in the file.
§Example
let stl = ebustl_parser::parse_stl_from_file("stls/test.stl").unwrap();
assert_eq!(Some("C. Lebeaupin"), stl.gsi.translators_name());Sourcepub fn translators_contact_details(&self) -> Option<&str>
pub fn translators_contact_details(&self) -> Option<&str>
Translator’s Contact Details (TCD), without the trailing space padding. None if blank.
§Example
let stl = ebustl_parser::parse_stl_from_file("stls/test.stl").unwrap();
assert_eq!(None, stl.gsi.translators_contact_details());Sourcepub fn subtitle_list_reference_code(&self) -> Option<&str>
pub fn subtitle_list_reference_code(&self) -> Option<&str>
Subtitle List Reference Code (SLR), without the trailing space padding. None if blank.
§Example
let stl = ebustl_parser::parse_stl_from_file("stls/test.stl").unwrap();
assert_eq!(None, stl.gsi.subtitle_list_reference_code());Sourcepub fn creation_date(&self) -> Result<Option<Date>, InvalidFieldValue<String>>
pub fn creation_date(&self) -> Result<Option<Date>, InvalidFieldValue<String>>
Creation Date (CD), validated as an existing date in the format YYMMDD. None if blank.
On error, InvalidFieldValue::value gives the value as stored in the file.
§Example
use ebustl_parser::Date;
let stl = ebustl_parser::parse_stl_from_file("stls/test.stl").unwrap();
let date = Date { year: 2013, month: 10, day: 10 };
assert_eq!(Ok(Some(date)), stl.gsi.creation_date());Sourcepub fn revision_date(&self) -> Result<Option<Date>, InvalidFieldValue<String>>
pub fn revision_date(&self) -> Result<Option<Date>, InvalidFieldValue<String>>
Revision Date (RD), validated as an existing date in the format YYMMDD. None if blank.
On error, InvalidFieldValue::value gives the value as stored in the file.
§Example
use ebustl_parser::Date;
let stl = ebustl_parser::parse_stl_from_file("stls/test.stl").unwrap();
let date = Date { year: 2013, month: 10, day: 17 };
assert_eq!(Ok(Some(date)), stl.gsi.revision_date());Sourcepub fn revision_number(&self) -> Result<Option<u8>, InvalidFieldValue<String>>
pub fn revision_number(&self) -> Result<Option<u8>, InvalidFieldValue<String>>
Revision Number (RN), validated as 0-99, ignoring space padding. None if blank.
On error, InvalidFieldValue::value gives the value as stored in the file.
§Example
let stl = ebustl_parser::parse_stl_from_file("stls/test.stl").unwrap();
// Blank in the test file
assert_eq!(Ok(None), stl.gsi.revision_number());Sourcepub fn total_number_of_text_and_timing_blocks(&self) -> u32
pub fn total_number_of_text_and_timing_blocks(&self) -> u32
Total Number of TTI Blocks (TNB), including extension blocks.
Sourcepub fn total_number_of_subtitles(&self) -> u32
pub fn total_number_of_subtitles(&self) -> u32
Total Number of Subtitles (TNS).
Sourcepub fn total_number_of_subtitle_groups(&self) -> u16
pub fn total_number_of_subtitle_groups(&self) -> u16
Total Number of Subtitle Groups (TNG).
Sourcepub fn max_number_of_chars_in_row(&self) -> u16
pub fn max_number_of_chars_in_row(&self) -> u16
Maximum Number of Displayable Characters in any text row (MNC).
Sourcepub fn max_number_of_rows(&self) -> u16
pub fn max_number_of_rows(&self) -> u16
Maximum Number of Displayable Rows (MNR).
Sourcepub fn time_code_status(&self) -> &TimeCodeStatus
pub fn time_code_status(&self) -> &TimeCodeStatus
Time Code: Status (TCS), whether the time codes in the GSI and TTI blocks are intended for use.
Sourcepub fn time_code_start_of_programme(
&self,
) -> Result<Option<Time>, InvalidFieldValue<String>>
pub fn time_code_start_of_programme( &self, ) -> Result<Option<Time>, InvalidFieldValue<String>>
Time Code: Start-of-Programme (TCP), validated as HHMMSSFF with minutes and seconds 0-59 and
frames according to the Disk Format Code. Hours may exceed 23, e.g. for a programme that
continues past midnight. None if blank.
On error, InvalidFieldValue::value gives the value as stored in the file.
§Example
use ebustl_parser::Time;
let stl = ebustl_parser::parse_stl_from_file("stls/test.stl").unwrap();
let time = Time { hours: 10, minutes: 0, seconds: 0, frames: 0 };
assert_eq!(Ok(Some(time)), stl.gsi.time_code_start_of_programme());Sourcepub fn time_code_first_in_cue(
&self,
) -> Result<Option<Time>, InvalidFieldValue<String>>
pub fn time_code_first_in_cue( &self, ) -> Result<Option<Time>, InvalidFieldValue<String>>
Time Code: First In-Cue (TCF), validated as HHMMSSFF with minutes and seconds 0-59 and
frames according to the Disk Format Code. Hours may exceed 23, e.g. for a programme that
continues past midnight. None if blank.
On error, InvalidFieldValue::value gives the value as stored in the file.
§Example
use ebustl_parser::Time;
let stl = ebustl_parser::parse_stl_from_file("stls/test.stl").unwrap();
let time = Time { hours: 10, minutes: 0, seconds: 0, frames: 0 };
assert_eq!(Ok(Some(time)), stl.gsi.time_code_first_in_cue());Sourcepub fn total_number_of_disks(&self) -> u8
pub fn total_number_of_disks(&self) -> u8
Total Number of Disks (TND) in the set holding the subtitle list.
Sourcepub fn disk_sequence_number(&self) -> u8
pub fn disk_sequence_number(&self) -> u8
Disk Sequence Number (DSN) of this disk in the set, starting at 1.
Sourcepub fn country_of_origin(
&self,
) -> Result<Option<&str>, InvalidFieldValue<String>>
pub fn country_of_origin( &self, ) -> Result<Option<&str>, InvalidFieldValue<String>>
Country of Origin (CO), validated as three upper case letters (ISO 3166 alpha-3). None if
blank.
On error, InvalidFieldValue::value gives the value as stored in the file.
§Example
let stl = ebustl_parser::parse_stl_from_file("stls/test.stl").unwrap();
assert_eq!(Ok(Some("FRA")), stl.gsi.country_of_origin());Sourcepub fn publisher(&self) -> Option<&str>
pub fn publisher(&self) -> Option<&str>
Publisher (PUB), without the trailing space padding. None if blank.
§Example
let stl = ebustl_parser::parse_stl_from_file("stls/test.stl").unwrap();
assert_eq!(Some("TESTSUB"), stl.gsi.publisher());Sourcepub fn editors_name(&self) -> Option<&str>
pub fn editors_name(&self) -> Option<&str>
Editor’s Name (EN), without the trailing space padding. None if blank.
On error, InvalidFieldValue::value gives the value as stored in the file.
§Example
let stl = ebustl_parser::parse_stl_from_file("stls/test.stl").unwrap();
assert_eq!(Some("TESTSUB 1.0.1"), stl.gsi.editors_name());Sourcepub fn editors_contact_details(&self) -> Option<&str>
pub fn editors_contact_details(&self) -> Option<&str>
Editor’s Contact Details (ECD), without the trailing space padding. None if blank.
On error, InvalidFieldValue::value gives the value as stored in the file.
§Example
let stl = ebustl_parser::parse_stl_from_file("stls/test.stl").unwrap();
assert_eq!(None, stl.gsi.editors_contact_details());Sourcepub fn user_defined_area(&self) -> &str
pub fn user_defined_area(&self) -> &str
User-Defined Area (UDA), decoded with the code page of the GSI block.