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
Modifier and TypeFieldDescriptionprivate static Duration
Duration of all Animations happening in the video.private static int
Minimum size for covers downloaded forAudioPieces
.private static Color
Background of the video.private static float
Radius of the corners of thewidgets
.private static Instant
Stores the time at that the video should end.private static int
Height of the grid used for placing thewidgets
.private static int
Spacing in pixels between twowidgets
next to each other.private static int
Spacing in pixels between thewidgets
and the border of the video.private static int
Width of the grid used for placing thewidgets
.private static Path
Stores the path to the configuration file.private static io.jenetics.jpx.Length.Unit
Unit used for all length.private static String
Stores the name of the output video file.private static Instant
Stores the time at that the video should start.private static int
Resolution at which the frames will be rendered before downscaling.private static int
Stores the framerate of the video.private static int
Stores the height of the video.private static int
Stores the width of the video. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Duration
Gets the duration of all animations.static int
Gets the minimum resolution for covers to be downloaded forAudioPieces
.static Color
Gets the background-color of the video.static Instant
Gets the ending time of the video.static int
Gets the height of the grid used for placing thewidgets
.static int
Gets the width of the grid used for placing thewidgets
.static io.jenetics.jpx.Length.Unit
Gets the unit used for all lengths.static String
Gets the name of the output file of the video.static File
getRelativePath
(String file) Gets a relative path from the config file.static int
Gets the height of the render target-resolution.static int
Gets the width of the render target-resolution.static float
Gets the corner radius of thewidgets
automatically scaled by the supersapling resolution.static int
Gets the scaled spacing between twowidgets
.static int
Gets the scaled spacing betweenwidgets
and the border of the video.static Instant
Gets the starting time of the video.static int
Gets the supersampling-resolution.static int
Gets the framerate of the output video.static int
Gets the pixel-height of the output video.static int
Gets the pixel-width of the output video.protected static void
Sets the Duration of all animations.protected static void
setAudioMinCoverResolution
(int resolution) Sets the minimum resolution for covers downloaded forAudioPieces
protected static void
Sets the background color for the video.protected static void
setCornerRadius
(float r) Sets the corner radius of thewidgets
.protected static void
setGridHeight
(int height) protected static void
setGridInnerSpacing
(int spacing) Sets the inner spacing between twowidgets
.protected static void
setGridOuterSpacing
(int spacing) Sets the outer spacing between thewidgets
and the border of the video.protected static void
setGridSize
(int width, int height) protected static void
setGridWidth
(int width) protected static void
setInputFilename
(String filename) Sets the filename of the input file.protected static void
setLengthUnit
(io.jenetics.jpx.Length.Unit unit) Sets the length unit to use.protected static void
setOutputFilename
(String filename) Sets the name of the output file.protected static void
setSupersampling
(int quality) Sets the supersampling resolution of the video.protected static void
setVideoEnd
(Instant time) Sets the ending time of the video.protected static void
setVideoFramerate
(int framerate) Sets the framerate of the output video.protected static void
setVideoHeight
(int height) Sets the output video height.protected static void
setVideoResolution
(int width, int height) Sets the output video resolution.protected static void
setVideoStart
(Instant time) Sets the starting time of the video.protected static void
setVideoWidth
(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 twowidgets
next to each other. (Default: 10) -
gridOuterSpacing
private static int gridOuterSpacingSpacing in pixels between thewidgets
and 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 thewidgets
and 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 thewidgets
automatically 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 betweenwidgets
and 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
-