package net.knarcraft.ffmpegconverter.streams; import net.knarcraft.ffmpegconverter.utility.SubtitleHelper; import org.jetbrains.annotations.NotNull; import java.util.Map; /** * An object representation of a subtitle stream in a media file */ public class SubtitleStream extends AbstractStream implements StreamObject { private final boolean isFullSubtitle; private final boolean isImageSubtitle; /** * Instantiates a new subtitle stream * * @param streamInfo
All info about the stream
* @param inputIndexThe index of the input file containing this stream
* @param relativeIndexThe index of the subtitle stream relative to other subtitle streams
*/ public SubtitleStream(@NotNull MapWhether the subtitles is an image subtitle.
*/ public boolean isImageSubtitle() { return this.isImageSubtitle; } /** * Gets whether the subtitle is a full subtitle * * @returnWhether the subtitle is a full subtitle.
*/ public boolean isFullSubtitle() { return this.isFullSubtitle; } /** * Checks whether the subtitle translates everything (as opposed to just songs and signs) * * @returnTrue if the subtitle translates everything.
*/ private boolean checkIfIsFullSubtitle() { return !SubtitleHelper.isSongsSignsSubtitle(this.getTitle()); } @Override public char streamTypeCharacter() { return 's'; } @Override @NotNull public String toString() { return super.toString() + " | Is full: " + this.isFullSubtitle; } }