|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsears.file.SubtitleFile
public abstract class SubtitleFile
Class SubtitleFile.
Summary:
This method represent a subtitle file.
It provides facilities on subtitles, as delay, resynchro.
It must be specialized to the subtitle file type you want to open.
Field Summary | |
---|---|
protected java.lang.String |
END_OF_LINE
(String) END_OF_LINE: The system END_OF_LINE |
protected java.io.File |
file
The system File that contains the file |
protected boolean |
fileChanged
A boolean to know if file has changed |
protected java.util.ArrayList<Subtitle> |
subtitleList
The ArrayList of subtitles found |
protected java.io.File |
temporaryFile
The temporary file |
Constructor Summary | |
---|---|
SubtitleFile()
Constructor SubtitleFile. |
|
SubtitleFile(java.io.File _file,
java.util.ArrayList<Subtitle> _subtitlesList)
Constructor SubtitleFile. |
|
SubtitleFile(java.lang.String fileToOpen,
java.util.ArrayList<Subtitle> _subtitlesList)
Constructor SubtitleFile. |
Method Summary | |
---|---|
void |
accentRepair(int[] selectedIndex)
Method accentRepair. |
void |
addFakeSub()
Method addFakeSub. |
void |
addSubtitle(Subtitle subtitle)
Method addSubtitle. |
void |
addSubtitle(Subtitle subtitle,
boolean updateNumber)
Method addSubtitle. |
void |
append(SubtitleFile subtitleFileToAppend,
int delay)
Method append. |
void |
delay(int delay)
Method delay. |
void |
delay(int[] indexToDelay,
int delay)
Method delay. |
void |
delay(int beginIndex,
int endIndex,
int delay)
Method delay. |
void |
fileChanged()
Method fileChanged Summary: Set the fileChanged status flag to true. |
java.io.File |
getContentDirectory()
Method getContentDirectory. |
java.io.File |
getFile()
Method getFile. |
protected abstract SubtitleFile |
getNewInstance()
Method getNewInstance. |
Subtitle |
getSubtitleAtDate(int date)
Method getSubtitleIndex. |
protected java.util.ArrayList<Subtitle> |
getSubtitles()
Method getSubtitles. |
java.io.File |
getTemporaryFile()
Method getTemporaryFile. |
void |
htmlRepair(int[] selectedIndex)
Method htmlRepair. |
boolean |
isFileChanged()
|
void |
magicResynchro()
Method magicResynchro. |
void |
normalizeDuration(int[] indexToNormalize,
int minDuration,
int maxDuration)
Method normalizeDuration. |
void |
normalizeDuration(int minDuration,
int maxDuration)
Method normalizeDuration. |
void |
orderRepair()
Method orderRepair. |
protected abstract void |
parse()
Method parse. |
void |
resynchro(int[] result)
Method resynchro. |
void |
setFile(java.io.File file)
Method setFile. |
protected void |
shiftToZero()
Method shiftToZero. |
SubtitleFile[] |
split(java.io.File[] destinationFiles,
int subtitleIndex,
int secondPartDelay)
Method split. |
static int |
stringToTime(java.lang.String time)
Method stringToTime. |
void |
timeRepair()
Method timeRepair. |
static java.lang.String |
timeToString(int milliseconds)
Method timeToString. |
abstract void |
writeToFile(java.io.File fileToWrite)
Method writeToFile. |
abstract void |
writeToTemporaryFile()
Method writeToTemporaryFile. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.io.File file
protected java.util.ArrayList<Subtitle> subtitleList
protected boolean fileChanged
protected java.io.File temporaryFile
protected final java.lang.String END_OF_LINE
Constructor Detail |
---|
public SubtitleFile()
public SubtitleFile(java.lang.String fileToOpen, java.util.ArrayList<Subtitle> _subtitlesList)
fileToOpen
- The (String) path to file to open._subtitlesList
- The (ArrayList) List of subtitles.public SubtitleFile(java.io.File _file, java.util.ArrayList<Subtitle> _subtitlesList)
_file
- The (File) file to open._subtitlesList
- The (ArrayList) List of subtitles.Method Detail |
---|
protected abstract void parse()
public java.io.File getContentDirectory()
public java.io.File getFile()
public java.io.File getTemporaryFile()
public static java.lang.String timeToString(int milliseconds)
milliseconds
- The number of milliseconds to transform
public static int stringToTime(java.lang.String time) throws java.lang.NumberFormatException
time
- The string srt time representation.
java.lang.NumberFormatException
public abstract void writeToFile(java.io.File fileToWrite)
fileToWrite
- The File to write the file.public abstract void writeToTemporaryFile()
public void addFakeSub()
public void delay(int beginIndex, int endIndex, int delay)
beginIndex
- The first index to begin delay.endIndex
- The last index to put a delaydelay
- The delay to Apply.public void delay(int[] indexToDelay, int delay)
indexToDelay
- The array of subtitle's index to be delayed.delay
- The delay to apply.public void delay(int delay)
delay
- The delay to apply.public void normalizeDuration(int minDuration, int maxDuration)
minDuration
- The min duration to ensure.maxDuration
- The max duration to ensure.public void normalizeDuration(int[] indexToNormalize, int minDuration, int maxDuration)
indexToNormalize
- The array of subtitle index to be normalized.minDuration
- The min duration to ensure.maxDuration
- The max duration to ensure.public void resynchro(int[] result)
result
- The resynchro parameter, an int array organized like this:
[0]:The source 1
[1]:The destination 1
[2]:The source 2
[3]:The destination 2public void setFile(java.io.File file)
file
- The file to set.public void addSubtitle(Subtitle subtitle)
subtitle
- The Subtitle to add to the file.public void addSubtitle(Subtitle subtitle, boolean updateNumber)
subtitle
- The Subtitle to add to the file.updateNumber
- A boolean, true if want to update the number with its index. False not to update it.public SubtitleFile[] split(java.io.File[] destinationFiles, int subtitleIndex, int secondPartDelay)
destinationFiles
- The File[] where to save the two parts of the file.subtitleIndex
- The int subtitle index, from wich create the second part of the subtitle.secondPartDelay
- The int initial delay to apply to the second part.protected void shiftToZero()
protected abstract SubtitleFile getNewInstance()
public void append(SubtitleFile subtitleFileToAppend, int delay)
subtitleFileToAppend
- The SubtitleFile subtitle file to append.delay
- The int delay to use.protected java.util.ArrayList<Subtitle> getSubtitles()
public boolean isFileChanged()
public void fileChanged()
public void accentRepair(int[] selectedIndex)
selectedIndex
- The index to remove the accents.public void htmlRepair(int[] selectedIndex)
selectedIndex
- The index to remove the accents.public void timeRepair()
public void orderRepair()
public Subtitle getSubtitleAtDate(int date)
date
- The date (in milliseconds).
public void magicResynchro()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |