Adds width and height to video streams and subtitle file to subtitle streams

This commit is contained in:
2020-05-08 19:09:20 +02:00
parent 1090a61f2e
commit 29437f1256
4 changed files with 68 additions and 15 deletions

View File

@ -6,18 +6,22 @@ package net.knarcraft.ffmpegconverter.streams;
public class SubtitleStream extends StreamObject {
final private String language;
final private String title;
final private String file;
final private boolean isFullSubtitle;
final private boolean isImageSubtitle;
/**
* Instantiates a new subtitle stream
* @param codecName <p>The name of the codec for the subtitle stream.</p>
*
* @param codecName <p>The name of the codec for the subtitle stream.</p>
* @param absoluteIndex <p>The index of the subtitle stream.</p>
* @param relativeIndex <p>The index of the subtitle stream relative to other subtitle streams.</p>
* @param language <p>The language of the subtitle stream.</p>
* @param title <p>The title of the subtitle stream.</p>
* @param language <p>The language of the subtitle stream.</p>
* @param title <p>The title of the subtitle stream.</p>
* @param file <p>The file containing the subtitle.</p>
*/
public SubtitleStream(String codecName, int absoluteIndex, int relativeIndex, String language, String title) {
public SubtitleStream(String codecName, int absoluteIndex, int relativeIndex, String language, String title,
String file) {
this.codecType = "subtitle";
this.codecName = codecName;
this.absoluteIndex = absoluteIndex;
@ -26,10 +30,12 @@ public class SubtitleStream extends StreamObject {
this.isFullSubtitle = isFullSubtitle();
this.relativeIndex = relativeIndex;
this.isImageSubtitle = isImageSubtitle();
this.file = file;
}
/**
* Gets the language of the subtitle stream
*
* @return <p>The language of the subtitle stream.</p>
*/
public String getLanguage() {
@ -38,14 +44,25 @@ public class SubtitleStream extends StreamObject {
/**
* Gets the title of the subtitle stream
*
* @return <p>The title of the subtitle stream.</p>
*/
public String getTitle() {
private String getTitle() {
return this.title;
}
/**
* Gets the file name of the file containing this subtitle
*
* @return <p>The file name containing the subtitle stream.</p>
*/
public String getFile() {
return this.file;
}
/**
* Gets whether the subtitle is an image subtitle
*
* @return <p>Whether the subtitles is an image subtitle.</p>
*/
public boolean getIsImageSubtitle() {
@ -54,6 +71,7 @@ public class SubtitleStream extends StreamObject {
/**
* Gets whether the subtitle is a full subtitle
*
* @return <p>Whether the subtitle is a full subtitle.</p>
*/
public boolean getIsFullSubtitle() {
@ -62,6 +80,7 @@ public class SubtitleStream extends StreamObject {
/**
* Checks whether a subtitle is image based (as opposed to text based)
*
* @return <p>True if the subtitle is image based.</p>
*/
private boolean isImageSubtitle() {
@ -70,6 +89,7 @@ public class SubtitleStream extends StreamObject {
/**
* Checks whether the subtitle translates everything (as opposed to just songs and signs)
*
* @return <p>True if the subtitle translates everything.</p>
*/
private boolean isFullSubtitle() {