PHP 클래스 Captioning\File

상속: implements captioning\FileInterface
파일 보기 프로젝트 열기: captioning/captioning 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$cues array
$encoding string
$fileContent string
$filename string
$lineEnding string
$stats array
$useIconv boolean

공개 메소드들

메소드 설명
__construct ( null $_filename = null, null $_encoding = null, boolean | false $_useIconv = false ) File constructor.
addCue ( mixed $_mixed, string $_start = null, string $_stop = null ) : File Add a cue
build ( )
changeFPS ( float $_old_fps, float $_new_fps ) : File Converts timecodes based on the specified FPS ratio
convertTo ( string $_output_format ) : mixed
getCue ( integer $_index ) : Cue | null
getCueFromStart ( $_start )
getCues ( ) : array
getCuesCount ( ) : integer
getEncoding ( ) : string
getExpectedCueClass ( captioning\FileInterface $_file, boolean | true $_full_namespace = true ) : string
getFileContent ( ) : string
getFilename ( ) : string
getFirstCue ( ) : Cue | null
getFormat ( captioning\FileInterface $_file ) : mixed
getLastCue ( ) : Cue | null
getStats ( ) Computes reading speed statistics
getUseIconv ( ) : boolean | false
loadFromFile ( null $_filename = null )
loadFromString ( string $_str )
merge ( captioning\FileInterface $_file )
removeCue ( integer $_index ) : File Removes a cue
save ( string $filename = null, boolean $writeBOM = false ) Saves the file
search ( string $_word, boolean $_case_sensitive = false, boolean $_strict = false ) : array Searches a word/expression and returns ids of the matched entries
setEncoding ( string $_encoding )
setFilename ( string $_filename )
setLineEnding ( string $_lineEnding )
setUseIconv ( boolean $_useIconv )
shift ( integer $_time, integer $_startIndex = null, integer $_endIndex = null ) Shifts a range of subtitles a specified amount of time.
sortCues ( ) Sorts cues
sync ( integer $_startIndex, integer $_startTime, integer $_endIndex, integer $_endTime, boolean $_syncLast = true ) : boolean Auto syncs a range of subtitles given their first and last correct times.

보호된 메소드들

메소드 설명
encode ( ) Encode file content
getFileContentAsArray ( ) : array
getNextValueFromArray ( array &$array ) : mixed

메소드 상세

__construct() 공개 메소드

File constructor.
public __construct ( null $_filename = null, null $_encoding = null, boolean | false $_useIconv = false )
$_filename null
$_encoding null
$_useIconv boolean | false

addCue() 공개 메소드

Add a cue
public addCue ( mixed $_mixed, string $_start = null, string $_stop = null ) : File
$_mixed mixed An cue instance or a string representing the text
$_start string A timecode
$_stop string A timecode
리턴 File

build() 공개 메소드

public build ( )

changeFPS() 공개 메소드

Converts timecodes based on the specified FPS ratio
public changeFPS ( float $_old_fps, float $_new_fps ) : File
$_old_fps float
$_new_fps float
리턴 File

convertTo() 공개 메소드

public convertTo ( string $_output_format ) : mixed
$_output_format string
리턴 mixed

encode() 보호된 메소드

Encode file content
protected encode ( )

getCue() 공개 메소드

public getCue ( integer $_index ) : Cue | null
$_index integer
리턴 Cue | null

getCueFromStart() 공개 메소드

public getCueFromStart ( $_start )

getCues() 공개 메소드

public getCues ( ) : array
리턴 array

getCuesCount() 공개 메소드

public getCuesCount ( ) : integer
리턴 integer

getEncoding() 공개 메소드

public getEncoding ( ) : string
리턴 string

getExpectedCueClass() 공개 정적인 메소드

public static getExpectedCueClass ( captioning\FileInterface $_file, boolean | true $_full_namespace = true ) : string
$_file captioning\FileInterface
$_full_namespace boolean | true
리턴 string

getFileContent() 공개 메소드

public getFileContent ( ) : string
리턴 string

getFileContentAsArray() 보호된 메소드

protected getFileContentAsArray ( ) : array
리턴 array

getFilename() 공개 메소드

public getFilename ( ) : string
리턴 string

getFirstCue() 공개 메소드

public getFirstCue ( ) : Cue | null
리턴 Cue | null

getFormat() 공개 정적인 메소드

public static getFormat ( captioning\FileInterface $_file ) : mixed
$_file captioning\FileInterface
리턴 mixed

getLastCue() 공개 메소드

public getLastCue ( ) : Cue | null
리턴 Cue | null

getNextValueFromArray() 보호된 메소드

protected getNextValueFromArray ( array &$array ) : mixed
$array array
리턴 mixed

getStats() 공개 메소드

Computes reading speed statistics
public getStats ( )

getUseIconv() 공개 메소드

public getUseIconv ( ) : boolean | false
리턴 boolean | false

loadFromFile() 공개 메소드

public loadFromFile ( null $_filename = null )
$_filename null

loadFromString() 공개 메소드

public loadFromString ( string $_str )
$_str string

merge() 공개 메소드

public merge ( captioning\FileInterface $_file )
$_file captioning\FileInterface

removeCue() 공개 메소드

Removes a cue
public removeCue ( integer $_index ) : File
$_index integer
리턴 File

save() 공개 메소드

Saves the file
public save ( string $filename = null, boolean $writeBOM = false )
$filename string
$writeBOM boolean

setEncoding() 공개 메소드

public setEncoding ( string $_encoding )
$_encoding string

setFilename() 공개 메소드

public setFilename ( string $_filename )
$_filename string The filename

setLineEnding() 공개 메소드

public setLineEnding ( string $_lineEnding )
$_lineEnding string

setUseIconv() 공개 메소드

public setUseIconv ( boolean $_useIconv )
$_useIconv boolean

shift() 공개 메소드

Shifts a range of subtitles a specified amount of time.
public shift ( integer $_time, integer $_startIndex = null, integer $_endIndex = null )
$_time integer The time to use (ms), which can be positive or negative.
$_startIndex integer The subtitle index the range begins with.
$_endIndex integer The subtitle index the range ends with.

sortCues() 공개 메소드

Sorts cues
public sortCues ( )

sync() 공개 메소드

The subtitles are first shifted to the first subtitle's correct time, and then proportionally adjusted using the last subtitle's correct time. Based on gnome-subtitles (https://git.gnome.org/browse/gnome-subtitles/)
public sync ( integer $_startIndex, integer $_startTime, integer $_endIndex, integer $_endTime, boolean $_syncLast = true ) : boolean
$_startIndex integer The subtitle index to start the adjustment with.
$_startTime integer The correct start time for the first subtitle.
$_endIndex integer The subtitle index to end the adjustment with.
$_endTime integer The correct start time for the last subtitle.
$_syncLast boolean Whether to sync the last subtitle.
리턴 boolean Whether the subtitles could be adjusted

프로퍼티 상세

$cues 보호되어 있는 프로퍼티

protected array $cues
리턴 array

$encoding 보호되어 있는 프로퍼티

protected string $encoding
리턴 string

$fileContent 보호되어 있는 프로퍼티

protected string $fileContent
리턴 string

$filename 보호되어 있는 프로퍼티

protected string $filename
리턴 string

$lineEnding 보호되어 있는 프로퍼티

protected string $lineEnding
리턴 string

$stats 보호되어 있는 프로퍼티

protected array $stats
리턴 array

$useIconv 보호되어 있는 프로퍼티

protected bool $useIconv
리턴 boolean