diff --git a/src/main/java/net/knarcraft/ffmpegconverter/streams/AudioStream.java b/src/main/java/net/knarcraft/ffmpegconverter/streams/AudioStream.java index a467a28..9053701 100644 --- a/src/main/java/net/knarcraft/ffmpegconverter/streams/AudioStream.java +++ b/src/main/java/net/knarcraft/ffmpegconverter/streams/AudioStream.java @@ -4,18 +4,19 @@ package net.knarcraft.ffmpegconverter.streams; * This class represents an ffmpeg audio stream */ public class AudioStream extends StreamObject { - private String language; - private int channels; - private String title; + private final String language; + private final int channels; + private final String title; /** * Instantiates a new audio stream - * @param codecName

The codec of the audio stream.

+ * + * @param codecName

The codec of the audio stream.

* @param absoluteIndex

The index of the audio stream.

* @param relativeIndex

The index of the audio stream relative to other audio streams.

- * @param language

The language of the audio stream.

- * @param title

The title of the audio stream.

- * @param channels

The number of channels for the audio stream.

+ * @param language

The language of the audio stream.

+ * @param title

The title of the audio stream.

+ * @param channels

The number of channels for the audio stream.

*/ public AudioStream(String codecName, int absoluteIndex, int relativeIndex, String language, String title, int channels) { this.codecType = "audio"; @@ -29,6 +30,7 @@ public class AudioStream extends StreamObject { /** * Gets the language of the audio stream + * * @return

The language of the audio stream.

*/ public String getLanguage() { @@ -37,6 +39,7 @@ public class AudioStream extends StreamObject { /** * Gets the number of channels for the audio stream + * * @return

The number of channels for the audio stream.

*/ public int getChannels() { @@ -45,6 +48,7 @@ public class AudioStream extends StreamObject { /** * Gets the title of the audio stream + * * @return

The title of the audio stream.

*/ public String getTitle() { diff --git a/src/main/java/net/knarcraft/ffmpegconverter/streams/StreamObject.java b/src/main/java/net/knarcraft/ffmpegconverter/streams/StreamObject.java index 22a2cd1..77daf05 100644 --- a/src/main/java/net/knarcraft/ffmpegconverter/streams/StreamObject.java +++ b/src/main/java/net/knarcraft/ffmpegconverter/streams/StreamObject.java @@ -11,6 +11,7 @@ public abstract class StreamObject { /** * Gets the type of the stream codec (video/audio/subtitle) + * * @return

Codec type.

*/ public String getCodecType() { @@ -19,14 +20,16 @@ public abstract class StreamObject { /** * Gets the name of the stream codec + * * @return

Codec name.

*/ - public String getCodecName() { + String getCodecName() { return this.codecName; } /** * Gets the absolute index of a stream object + * * @return

Absolute index.

*/ public int getAbsoluteIndex() { @@ -35,6 +38,7 @@ public abstract class StreamObject { /** * Gets the relative index of a stream object (kth element of codec type) + * * @return

Relative index.

*/ public int getRelativeIndex() { diff --git a/src/main/java/net/knarcraft/ffmpegconverter/streams/SubtitleStream.java b/src/main/java/net/knarcraft/ffmpegconverter/streams/SubtitleStream.java index befe0bd..3caf5ea 100644 --- a/src/main/java/net/knarcraft/ffmpegconverter/streams/SubtitleStream.java +++ b/src/main/java/net/knarcraft/ffmpegconverter/streams/SubtitleStream.java @@ -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

The name of the codec for the subtitle stream.

+ * + * @param codecName

The name of the codec for the subtitle stream.

* @param absoluteIndex

The index of the subtitle stream.

* @param relativeIndex

The index of the subtitle stream relative to other subtitle streams.

- * @param language

The language of the subtitle stream.

- * @param title

The title of the subtitle stream.

+ * @param language

The language of the subtitle stream.

+ * @param title

The title of the subtitle stream.

+ * @param file

The file containing the subtitle.

*/ - 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

The language of the subtitle stream.

*/ public String getLanguage() { @@ -38,14 +44,25 @@ public class SubtitleStream extends StreamObject { /** * Gets the title of the subtitle stream + * * @return

The title of the subtitle stream.

*/ - public String getTitle() { + private String getTitle() { return this.title; } + /** + * Gets the file name of the file containing this subtitle + * + * @return

The file name containing the subtitle stream.

+ */ + public String getFile() { + return this.file; + } + /** * Gets whether the subtitle is an image subtitle + * * @return

Whether the subtitles is an image subtitle.

*/ public boolean getIsImageSubtitle() { @@ -54,6 +71,7 @@ public class SubtitleStream extends StreamObject { /** * Gets whether the subtitle is a full subtitle + * * @return

Whether the subtitle is a full subtitle.

*/ 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

True if the subtitle is image based.

*/ 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

True if the subtitle translates everything.

*/ private boolean isFullSubtitle() { diff --git a/src/main/java/net/knarcraft/ffmpegconverter/streams/VideoStream.java b/src/main/java/net/knarcraft/ffmpegconverter/streams/VideoStream.java index b4cf8d5..933a20a 100644 --- a/src/main/java/net/knarcraft/ffmpegconverter/streams/VideoStream.java +++ b/src/main/java/net/knarcraft/ffmpegconverter/streams/VideoStream.java @@ -4,17 +4,42 @@ package net.knarcraft.ffmpegconverter.streams; * An object representation of a video stream in a media file */ public class VideoStream extends StreamObject { + private final int width; + private final int height; /** * Instantiates a new video stream - * @param codec

The name of the codec for the video stream.

+ * + * @param codec

The name of the codec for the video stream.

* @param absoluteIndex

The index of the video stream.

* @param relativeIndex

The index of the video stream relative to other video streams.

+ * @param width

The width of the video stream.

+ * @param height

The height of the video stream.

*/ - public VideoStream(String codec, int absoluteIndex, int relativeIndex) { + public VideoStream(String codec, int absoluteIndex, int relativeIndex, int width, int height) { this.codecType = "video"; this.codecName = codec; this.absoluteIndex = absoluteIndex; this.relativeIndex = relativeIndex; + this.width = width; + this.height = height; + } + + /** + * Gets the width of the video stream + * + * @return

The width of the video steam in pixels.

+ */ + public int getWidth() { + return this.width; + } + + /** + * Gets the height of the video stream + * + * @return

The height of the video stream in pixels.

+ */ + public int getHeight() { + return this.height; } } \ No newline at end of file