diff --git a/src/main/java/net/knarcraft/ffmpegconverter/streams/AudioStream.java b/src/main/java/net/knarcraft/ffmpegconverter/streams/AudioStream.java index afa4808..a467a28 100644 --- a/src/main/java/net/knarcraft/ffmpegconverter/streams/AudioStream.java +++ b/src/main/java/net/knarcraft/ffmpegconverter/streams/AudioStream.java @@ -1,13 +1,25 @@ package net.knarcraft.ffmpegconverter.streams; +/** + * This class represents an ffmpeg audio stream + */ public class AudioStream extends StreamObject { - private String language; //The audio language - private int channels; //Whether mono, stereo, etc - private String title; //Titles exist + private String language; + private int channels; + private String title; - public AudioStream(String codec, int absoluteIndex, int relativeIndex, String language, String title, int channels) { + /** + * Instantiates a new audio stream + * @param codecName
The codec of the audio stream.
+ * @param absoluteIndexThe index of the audio stream.
+ * @param relativeIndexThe index of the audio stream relative to other audio streams.
+ * @param languageThe language of the audio stream.
+ * @param titleThe title of the audio stream.
+ * @param channelsThe number of channels for the audio stream.
+ */ + public AudioStream(String codecName, int absoluteIndex, int relativeIndex, String language, String title, int channels) { this.codecType = "audio"; - this.codecName = codec; + this.codecName = codecName; this.absoluteIndex = absoluteIndex; this.language = language; this.title = title; @@ -15,14 +27,26 @@ public class AudioStream extends StreamObject { this.channels = channels; } + /** + * Gets the language of the audio stream + * @returnThe language of the audio stream.
+ */ public String getLanguage() { return this.language; } + /** + * Gets the number of channels for the audio stream + * @returnThe number of channels for the audio stream.
+ */ public int getChannels() { return this.channels; } + /** + * Gets the title of the audio stream + * @returnThe title of the audio stream.
+ */ public String getTitle() { return this.title; } diff --git a/src/main/java/net/knarcraft/ffmpegconverter/streams/StreamObject.java b/src/main/java/net/knarcraft/ffmpegconverter/streams/StreamObject.java index 6415042..22a2cd1 100644 --- a/src/main/java/net/knarcraft/ffmpegconverter/streams/StreamObject.java +++ b/src/main/java/net/knarcraft/ffmpegconverter/streams/StreamObject.java @@ -11,7 +11,7 @@ public abstract class StreamObject { /** * Gets the type of the stream codec (video/audio/subtitle) - * @return codec type + * @returnCodec type.
*/ public String getCodecType() { return this.codecType; @@ -19,7 +19,7 @@ public abstract class StreamObject { /** * Gets the name of the stream codec - * @return codec name + * @returnCodec name.
*/ public String getCodecName() { return this.codecName; @@ -27,7 +27,7 @@ public abstract class StreamObject { /** * Gets the absolute index of a stream object - * @return absolute index + * @returnAbsolute index.
*/ public int getAbsoluteIndex() { return this.absoluteIndex; @@ -35,7 +35,7 @@ public abstract class StreamObject { /** * Gets the relative index of a stream object (kth element of codec type) - * @return relative index + * @returnRelative index.
*/ public int getRelativeIndex() { return this.relativeIndex; diff --git a/src/main/java/net/knarcraft/ffmpegconverter/streams/SubtitleStream.java b/src/main/java/net/knarcraft/ffmpegconverter/streams/SubtitleStream.java index 547cbdd..befe0bd 100644 --- a/src/main/java/net/knarcraft/ffmpegconverter/streams/SubtitleStream.java +++ b/src/main/java/net/knarcraft/ffmpegconverter/streams/SubtitleStream.java @@ -5,10 +5,18 @@ package net.knarcraft.ffmpegconverter.streams; */ public class SubtitleStream extends StreamObject { final private String language; - final private String title; //Title shown - final private boolean isFullSubtitle; //Songs and signs will be false + final private String title; + final private boolean isFullSubtitle; final private boolean isImageSubtitle; + /** + * Instantiates a new subtitle stream + * @param codecNameThe name of the codec for the subtitle stream.
+ * @param absoluteIndexThe index of the subtitle stream.
+ * @param relativeIndexThe index of the subtitle stream relative to other subtitle streams.
+ * @param languageThe language of the subtitle stream.
+ * @param titleThe title of the subtitle stream.
+ */ public SubtitleStream(String codecName, int absoluteIndex, int relativeIndex, String language, String title) { this.codecType = "subtitle"; this.codecName = codecName; @@ -20,17 +28,49 @@ public class SubtitleStream extends StreamObject { this.isImageSubtitle = isImageSubtitle(); } + /** + * Gets the language of the subtitle stream + * @returnThe language of the subtitle stream.
+ */ + public String getLanguage() { + return this.language; + } + + /** + * Gets the title of the subtitle stream + * @returnThe title of the subtitle stream.
+ */ + public String getTitle() { + return this.title; + } + + /** + * Gets whether the subtitle is an image subtitle + * @returnWhether the subtitles is an image subtitle.
+ */ + public boolean getIsImageSubtitle() { + return this.isImageSubtitle; + } + + /** + * Gets whether the subtitle is a full subtitle + * @returnWhether the subtitle is a full subtitle.
+ */ + public boolean getIsFullSubtitle() { + return this.isFullSubtitle; + } + /** * Checks whether a subtitle is image based (as opposed to text based) - * @return True if the subtitle is image based + * @returnTrue if the subtitle is image based.
*/ private boolean isImageSubtitle() { return codecName != null && getCodecName().equals("hdmv_pgs_subtitle"); } /** - * Checks whether translates everything (as opposed to just songs and signs) - * @return True if the subtitles translate everything + * Checks whether the subtitle translates everything (as opposed to just songs and signs) + * @returnTrue if the subtitle translates everything.
*/ private boolean isFullSubtitle() { if (getTitle() == null) { @@ -41,20 +81,4 @@ public class SubtitleStream extends StreamObject { !titleLowercase.matches("songs?[ &\\/a-z]+signs?") && !titleLowercase.matches("forced"); } - - public String getLanguage() { - return this.language; - } - - public String getTitle() { - return this.title; - } - - public boolean getIsImageSubtitle() { - return this.isImageSubtitle; - } - - public boolean getIsFullSubtitle() { - return this.isFullSubtitle; - } } \ No newline at end of file diff --git a/src/main/java/net/knarcraft/ffmpegconverter/streams/VideoStream.java b/src/main/java/net/knarcraft/ffmpegconverter/streams/VideoStream.java index 847ed70..b4cf8d5 100644 --- a/src/main/java/net/knarcraft/ffmpegconverter/streams/VideoStream.java +++ b/src/main/java/net/knarcraft/ffmpegconverter/streams/VideoStream.java @@ -4,6 +4,13 @@ package net.knarcraft.ffmpegconverter.streams; * An object representation of a video stream in a media file */ public class VideoStream extends StreamObject { + + /** + * Instantiates a new video stream + * @param codecThe name of the codec for the video stream.
+ * @param absoluteIndexThe index of the video stream.
+ * @param relativeIndexThe index of the video stream relative to other video streams.
+ */ public VideoStream(String codec, int absoluteIndex, int relativeIndex) { this.codecType = "video"; this.codecName = codec;