Simplifies and improves code. Removes some duplication
All checks were successful
KnarCraft/FFmpegConvert/pipeline/head This commit looks good

This commit is contained in:
2020-05-12 00:19:01 +02:00
parent 9673266c09
commit e1256f61c7
10 changed files with 237 additions and 221 deletions

View File

@@ -7,6 +7,7 @@ public abstract class AbstractStream implements StreamObject {
int absoluteIndex;
int relativeIndex;
String codecName;
String language;
@Override
public String getCodecName() {
@@ -22,4 +23,10 @@ public abstract class AbstractStream implements StreamObject {
public int getRelativeIndex() {
return this.relativeIndex;
}
@Override
public String getLanguage() {
return this.language;
}
}

View File

@@ -4,7 +4,6 @@ package net.knarcraft.ffmpegconverter.streams;
* This class represents an ffmpeg audio stream
*/
public class AudioStream extends AbstractStream implements StreamObject {
private final String language;
private final int channels;
private final String title;
@@ -27,15 +26,6 @@ public class AudioStream extends AbstractStream implements StreamObject {
this.channels = channels;
}
/**
* Gets the language of the audio stream
*
* @return <p>The language of the audio stream.</p>
*/
public String getLanguage() {
return this.language;
}
/**
* Gets the number of channels for the audio stream
*

View File

@@ -23,4 +23,11 @@ public interface StreamObject {
*/
int getRelativeIndex();
/**
* Gets the language of the audio stream
*
* @return <p>The language of the audio stream.</p>
*/
String getLanguage();
}

View File

@@ -4,7 +4,6 @@ package net.knarcraft.ffmpegconverter.streams;
* An object representation of a subtitle stream in a media file
*/
public class SubtitleStream extends AbstractStream implements StreamObject {
final private String language;
final private String title;
final private String file;
final private boolean isFullSubtitle;
@@ -32,15 +31,6 @@ public class SubtitleStream extends AbstractStream implements StreamObject {
this.file = file;
}
/**
* Gets the language of the subtitle stream
*
* @return <p>The language of the subtitle stream.</p>
*/
public String getLanguage() {
return this.language;
}
/**
* Gets the title of the subtitle stream
*