PHP Класс SrtParser\srtFileEntry

Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( string $_start, string $_stop, string $_text ) srtFileEntry constructor
calcDuration ( ) Computes entry duration in milliseconds
getCPS ( )
getDurationMS ( )
getReadingSpeed ( )
getStart ( )
getStartTC ( )
getStop ( )
getStopTC ( )
getStrippedText ( )
getText ( boolean $stripTags = false, boolean $stripBasic = false, array $replacements = [] ) : string Returns the text of the entry
getTimeCodeString ( $_WebVTT = false ) : string Get the full timecode of the entry
ms2tc ( integer $ms ) : string Converts milliseconds into timecode string
prepForStats ( )
scale ( $baseTime, $factor = 1 )
setStart ( integer $_start ) Sets the start timecode as milliseconds
setStartTC ( string $_start ) Sets the start timecode
setStop ( integer $_stop ) Sets the stop timecode as milliseconds
setStopTC ( string $_stop ) Sets the stop timecode
setText ( $_text ) Sets a new text value
shift ( $time ) Set a delay (positive or negative)
stripTags ( boolean $stripBasic = false, array $replacements = [] ) : boolean Strips Advanced SSA tags
strlen ( ) : integer Returns the *real* string length
tc2ms ( string $tc ) : integer Converts timecode string into milliseconds

Приватные методы

Метод Описание
calcCPS ( ) Computes car. / second ratio
calcRS ( ) Computes Reading Speed (based on VisualSubSync algorithm)
genStrippedText ( ) Generates stripped text in order to compute statistics

Описание методов

__construct() публичный Метод

srtFileEntry constructor
public __construct ( string $_start, string $_stop, string $_text )
$_start string Start timecode
$_stop string End timcode
$_text string Text of the entry

calcDuration() публичный Метод

Computes entry duration in milliseconds
public calcDuration ( )

getCPS() публичный Метод

public getCPS ( )

getDurationMS() публичный Метод

public getDurationMS ( )

getReadingSpeed() публичный Метод

public getReadingSpeed ( )

getStart() публичный Метод

public getStart ( )

getStartTC() публичный Метод

public getStartTC ( )

getStop() публичный Метод

public getStop ( )

getStopTC() публичный Метод

public getStopTC ( )

getStrippedText() публичный Метод

public getStrippedText ( )

getText() публичный Метод

Returns the text of the entry
public getText ( boolean $stripTags = false, boolean $stripBasic = false, array $replacements = [] ) : string
$stripTags boolean
$stripBasic boolean
$replacements array
Результат string

getTimeCodeString() публичный Метод

Get the full timecode of the entry
public getTimeCodeString ( $_WebVTT = false ) : string
Результат string

ms2tc() публичный статический Метод

Converts milliseconds into timecode string
public static ms2tc ( integer $ms ) : string
$ms integer
Результат string

prepForStats() публичный Метод

public prepForStats ( )

scale() публичный Метод

public scale ( $baseTime, $factor = 1 )

setStart() публичный Метод

Sets the start timecode as milliseconds
public setStart ( integer $_start )
$_start integer

setStartTC() публичный Метод

Sets the start timecode
public setStartTC ( string $_start )
$_start string

setStop() публичный Метод

Sets the stop timecode as milliseconds
public setStop ( integer $_stop )
$_stop integer

setStopTC() публичный Метод

Sets the stop timecode
public setStopTC ( string $_stop )
$_stop string

setText() публичный Метод

Sets a new text value
public setText ( $_text )

shift() публичный Метод

Set a delay (positive or negative)
public shift ( $time )

stripTags() публичный Метод

Strips Advanced SSA tags
public stripTags ( boolean $stripBasic = false, array $replacements = [] ) : boolean
$stripBasic boolean If true, , and tags will be stripped
$replacements array
Результат boolean (true if tags were actually stripped)

strlen() публичный Метод

Returns the *real* string length
public strlen ( ) : integer
Результат integer

tc2ms() публичный статический Метод

Converts timecode string into milliseconds
public static tc2ms ( string $tc ) : integer
$tc string timecode as string
Результат integer