Package yearreview.app.config
Class GlobalSettings
java.lang.Object
yearreview.app.config.GlobalSettings
A class that stores general settings for the video.
- Author:
- ColdStone37
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static DurationDuration of all Animations happening in the video.private static intMinimum size for covers downloaded forAudioPieces.private static ColorBackground of the video.private static floatRadius of the corners of thewidgets.private static InstantStores the time at that the video should end.private static intHeight of the grid used for placing thewidgets.private static intSpacing in pixels between twowidgetsnext to each other.private static intSpacing in pixels between thewidgetsand the border of the video.private static intWidth of the grid used for placing thewidgets.private static PathStores the path to the configuration file.private static io.jenetics.jpx.Length.UnitUnit used for all length.private static StringStores the name of the output video file.private static InstantStores the time at that the video should start.private static intResolution at which the frames will be rendered before downscaling.private static intStores the framerate of the video.private static intStores the height of the video.private static intStores the width of the video. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DurationGets the duration of all animations.static intGets the minimum resolution for covers to be downloaded forAudioPieces.static ColorGets the background-color of the video.static InstantGets the ending time of the video.static intGets the height of the grid used for placing thewidgets.static intGets the width of the grid used for placing thewidgets.static io.jenetics.jpx.Length.UnitGets the unit used for all lengths.static StringGets the name of the output file of the video.static FilegetRelativePath(String file) Gets a relative path from the config file.static intGets the height of the render target-resolution.static intGets the width of the render target-resolution.static floatGets the corner radius of thewidgetsautomatically scaled by the supersapling resolution.static intGets the scaled spacing between twowidgets.static intGets the scaled spacing betweenwidgetsand the border of the video.static InstantGets the starting time of the video.static intGets the supersampling-resolution.static intGets the framerate of the output video.static intGets the pixel-height of the output video.static intGets the pixel-width of the output video.protected static voidSets the Duration of all animations.protected static voidsetAudioMinCoverResolution(int resolution) Sets the minimum resolution for covers downloaded forAudioPiecesprotected static voidSets the background color for the video.protected static voidsetCornerRadius(float r) Sets the corner radius of thewidgets.protected static voidsetGridHeight(int height) protected static voidsetGridInnerSpacing(int spacing) Sets the inner spacing between twowidgets.protected static voidsetGridOuterSpacing(int spacing) Sets the outer spacing between thewidgetsand the border of the video.protected static voidsetGridSize(int width, int height) protected static voidsetGridWidth(int width) protected static voidsetInputFilename(String filename) Sets the filename of the input file.protected static voidsetLengthUnit(io.jenetics.jpx.Length.Unit unit) Sets the length unit to use.protected static voidsetOutputFilename(String filename) Sets the name of the output file.protected static voidsetSupersampling(int quality) Sets the supersampling resolution of the video.protected static voidsetVideoEnd(Instant time) Sets the ending time of the video.protected static voidsetVideoFramerate(int framerate) Sets the framerate of the output video.protected static voidsetVideoHeight(int height) Sets the output video height.protected static voidsetVideoResolution(int width, int height) Sets the output video resolution.protected static voidsetVideoStart(Instant time) Sets the starting time of the video.protected static voidsetVideoWidth(int width) Sets the output video width.
-
Field Details
-
inputPath
Stores the path to the configuration file. (Used to construct relative paths) -
outputFilename
Stores the name of the output video file. (Default: out.mp4) -
videoWidth
private static int videoWidthStores the width of the video. (Default: 1920) -
videoHeight
private static int videoHeightStores the height of the video. (Default: 1080) -
videoFramerate
private static int videoFramerateStores the framerate of the video. (Default: 60) -
superSampling
private static int superSamplingResolution at which the frames will be rendered before downscaling. The render resolution will be videoWidth*superSampling x videoHeight*supersampling. 1 means no supersampling will be happening. (Default: 1) -
startTime
Stores the time at that the video should start. (No default value) -
endTime
Stores the time at that the video should end. (No default value) -
backgroundColor
Background of the video. (Default:Color.BLACK) -
cornerRadius
private static float cornerRadiusRadius of the corners of thewidgets. (Default: 10f) -
gridWidth
private static int gridWidthWidth of the grid used for placing thewidgets. (Default: 16) -
gridHeight
private static int gridHeightHeight of the grid used for placing thewidgets. (Default: 9) -
gridInnerSpacing
private static int gridInnerSpacingSpacing in pixels between twowidgetsnext to each other. (Default: 10) -
gridOuterSpacing
private static int gridOuterSpacingSpacing in pixels between thewidgetsand the border of the video. (Default: 15) -
audioMinCoverResolution
private static int audioMinCoverResolutionMinimum size for covers downloaded forAudioPieces. -
lengthUnit
private static io.jenetics.jpx.Length.Unit lengthUnitUnit used for all length. (Default:Length.Unit.METER) -
animationDuration
Duration of all Animations happening in the video. (Default: 750ms)
-
-
Constructor Details
-
GlobalSettings
public GlobalSettings()
-
-
Method Details
-
setInputFilename
Sets the filename of the input file.- Parameters:
filename- name of the input file
-
setOutputFilename
Sets the name of the output file.- Parameters:
filename- name that is used for the video file
-
setVideoResolution
protected static void setVideoResolution(int width, int height) Sets the output video resolution.- Parameters:
width- width of the videoheight- height of the video
-
setVideoWidth
protected static void setVideoWidth(int width) Sets the output video width.- Parameters:
width- width of the video
-
setVideoHeight
protected static void setVideoHeight(int height) Sets the output video height.- Parameters:
height- height of the video
-
setVideoFramerate
protected static void setVideoFramerate(int framerate) Sets the framerate of the output video.- Parameters:
framerate- framerate to use for the video
-
setSupersampling
protected static void setSupersampling(int quality) Sets the supersampling resolution of the video.- Parameters:
quality- quality of the supersampling
-
setVideoStart
Sets the starting time of the video.- Parameters:
time- time at which the animation should start
-
setVideoEnd
Sets the ending time of the video.- Parameters:
time- time at which the animation should end
-
setBackgroundColor
Sets the background color for the video.- Parameters:
c- background color
-
setCornerRadius
protected static void setCornerRadius(float r) Sets the corner radius of thewidgets.- Parameters:
r- radius of the corners in pixels
-
setGridSize
protected static void setGridSize(int width, int height) - Parameters:
width- width of the gridheight- height of the grid
-
setGridWidth
protected static void setGridWidth(int width) - Parameters:
width- width of the grid
-
setGridHeight
protected static void setGridHeight(int height) - Parameters:
height- height of the grid
-
setGridInnerSpacing
protected static void setGridInnerSpacing(int spacing) Sets the inner spacing between twowidgets.- Parameters:
spacing- spacing in pixels
-
setGridOuterSpacing
protected static void setGridOuterSpacing(int spacing) Sets the outer spacing between thewidgetsand the border of the video.- Parameters:
spacing- spacing in pixels
-
setAudioMinCoverResolution
protected static void setAudioMinCoverResolution(int resolution) Sets the minimum resolution for covers downloaded forAudioPieces- Parameters:
resolution- minimum resolution
-
setLengthUnit
protected static void setLengthUnit(io.jenetics.jpx.Length.Unit unit) Sets the length unit to use.- Parameters:
unit- unit to use
-
setAnimationDuration
Sets the Duration of all animations.- Parameters:
d- duration of the animations
-
getRelativePath
Gets a relative path from the config file.- Parameters:
file- file to construct a relative path for- Returns:
- file relative from config path
-
getOutputFilename
Gets the name of the output file of the video.- Returns:
- name to be used for the output file
-
getRenderWidth
public static int getRenderWidth()Gets the width of the render target-resolution. (meaning videoWidth * supersampling)- Returns:
- width of the render
-
getRenderHeight
public static int getRenderHeight()Gets the height of the render target-resolution. (meaning videoHeight * supersampling)- Returns:
- height of the render
-
getVideoWidth
public static int getVideoWidth()Gets the pixel-width of the output video.- Returns:
- pixel-width
-
getVideoHeight
public static int getVideoHeight()Gets the pixel-height of the output video.- Returns:
- pixel-height
-
getVideoFramerate
public static int getVideoFramerate()Gets the framerate of the output video.- Returns:
- framerate
-
getSuperSampling
public static int getSuperSampling()Gets the supersampling-resolution.- Returns:
- quality of supersampling
-
getStartTime
Gets the starting time of the video.- Returns:
- time at which the animation should start
-
getEndTime
Gets the ending time of the video.- Returns:
- time at which the animation should end
-
getBackgroundColor
Gets the background-color of the video.- Returns:
- background-color
-
getScaledCornerRadius
public static float getScaledCornerRadius()Gets the corner radius of thewidgetsautomatically scaled by the supersapling resolution.- Returns:
- scaled corner radius
-
getGridWidth
public static int getGridWidth()Gets the width of the grid used for placing thewidgets.- Returns:
- width of the grid
-
getGridHeight
public static int getGridHeight()Gets the height of the grid used for placing thewidgets.- Returns:
- height of the grid
-
getScaledGridInnerSpacing
public static int getScaledGridInnerSpacing()Gets the scaled spacing between twowidgets.- Returns:
- spacing in pixels
-
getScaledGridOuterSpacing
public static int getScaledGridOuterSpacing()Gets the scaled spacing betweenwidgetsand the border of the video.- Returns:
- spacing in pixels
-
getAudioMinCoverResolution
public static int getAudioMinCoverResolution()Gets the minimum resolution for covers to be downloaded forAudioPieces.- Returns:
- minimum resolution
-
getLengthUnit
public static io.jenetics.jpx.Length.Unit getLengthUnit()Gets the unit used for all lengths.- Returns:
- length unit used
-
getAnimationDuration
Gets the duration of all animations.- Returns:
- duration of animations
-