Class GlobalSettings

java.lang.Object
yearreview.app.config.GlobalSettings

public abstract class GlobalSettings extends Object
A class that stores general settings for the video.
Author:
ColdStone37
  • Field Details

    • inputPath

      private static Path inputPath
      Stores the path to the configuration file. (Used to construct relative paths)
    • outputFilename

      private static String outputFilename
      Stores the name of the output video file. (Default: out.mp4)
    • videoWidth

      private static int videoWidth
      Stores the width of the video. (Default: 1920)
    • videoHeight

      private static int videoHeight
      Stores the height of the video. (Default: 1080)
    • videoFramerate

      private static int videoFramerate
      Stores the framerate of the video. (Default: 60)
    • superSampling

      private static int superSampling
      Resolution 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

      private static Instant startTime
      Stores the time at that the video should start. (No default value)
    • endTime

      private static Instant endTime
      Stores the time at that the video should end. (No default value)
    • backgroundColor

      private static Color backgroundColor
      Background of the video. (Default: Color.BLACK)
    • cornerRadius

      private static float cornerRadius
      Radius of the corners of the widgets. (Default: 10f)
    • gridWidth

      private static int gridWidth
      Width of the grid used for placing the widgets. (Default: 16)
    • gridHeight

      private static int gridHeight
      Height of the grid used for placing the widgets. (Default: 9)
    • gridInnerSpacing

      private static int gridInnerSpacing
      Spacing in pixels between two widgets next to each other. (Default: 10)
    • gridOuterSpacing

      private static int gridOuterSpacing
      Spacing in pixels between the widgets and the border of the video. (Default: 15)
    • audioMinCoverResolution

      private static int audioMinCoverResolution
      Minimum size for covers downloaded for AudioPieces.
    • lengthUnit

      private static io.jenetics.jpx.Length.Unit lengthUnit
      Unit used for all length. (Default: Length.Unit.METER)
    • animationDuration

      private static Duration animationDuration
      Duration of all Animations happening in the video. (Default: 750ms)
  • Constructor Details

    • GlobalSettings

      public GlobalSettings()
  • Method Details

    • setInputFilename

      protected static void setInputFilename(String filename)
      Sets the filename of the input file.
      Parameters:
      filename - name of the input file
    • setOutputFilename

      protected static void setOutputFilename(String filename)
      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 video
      height - 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

      protected static void setVideoStart(Instant time)
      Sets the starting time of the video.
      Parameters:
      time - time at which the animation should start
    • setVideoEnd

      protected static void setVideoEnd(Instant time)
      Sets the ending time of the video.
      Parameters:
      time - time at which the animation should end
    • setBackgroundColor

      protected static void setBackgroundColor(Color c)
      Sets the background color for the video.
      Parameters:
      c - background color
    • setCornerRadius

      protected static void setCornerRadius(float r)
      Sets the corner radius of the widgets.
      Parameters:
      r - radius of the corners in pixels
    • setGridSize

      protected static void setGridSize(int width, int height)
      Sets the size of the grid used for placing the widgets by the manager.
      Parameters:
      width - width of the grid
      height - height of the grid
    • setGridWidth

      protected static void setGridWidth(int width)
      Sets the width of the grid used for placing the widgets by the manager.
      Parameters:
      width - width of the grid
    • setGridHeight

      protected static void setGridHeight(int height)
      Sets the height of the grid used for placing the widgets by the manager.
      Parameters:
      height - height of the grid
    • setGridInnerSpacing

      protected static void setGridInnerSpacing(int spacing)
      Sets the inner spacing between two widgets.
      Parameters:
      spacing - spacing in pixels
    • setGridOuterSpacing

      protected static void setGridOuterSpacing(int spacing)
      Sets the outer spacing between the widgets 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 for AudioPieces
      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

      protected static void setAnimationDuration(Duration d)
      Sets the Duration of all animations.
      Parameters:
      d - duration of the animations
    • getRelativePath

      public static File getRelativePath(String file)
      Gets a relative path from the config file.
      Parameters:
      file - file to construct a relative path for
      Returns:
      file relative from config path
    • getOutputFilename

      public static String 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

      public static Instant getStartTime()
      Gets the starting time of the video.
      Returns:
      time at which the animation should start
    • getEndTime

      public static Instant getEndTime()
      Gets the ending time of the video.
      Returns:
      time at which the animation should end
    • getBackgroundColor

      public static Color getBackgroundColor()
      Gets the background-color of the video.
      Returns:
      background-color
    • getScaledCornerRadius

      public static float getScaledCornerRadius()
      Gets the corner radius of the widgets automatically scaled by the supersapling resolution.
      Returns:
      scaled corner radius
    • getGridWidth

      public static int getGridWidth()
      Gets the width of the grid used for placing the widgets.
      Returns:
      width of the grid
    • getGridHeight

      public static int getGridHeight()
      Gets the height of the grid used for placing the widgets.
      Returns:
      height of the grid
    • getScaledGridInnerSpacing

      public static int getScaledGridInnerSpacing()
      Gets the scaled spacing between two widgets.
      Returns:
      spacing in pixels
    • getScaledGridOuterSpacing

      public static int getScaledGridOuterSpacing()
      Gets the scaled spacing between widgets and the border of the video.
      Returns:
      spacing in pixels
    • getAudioMinCoverResolution

      public static int getAudioMinCoverResolution()
      Gets the minimum resolution for covers to be downloaded for AudioPieces.
      Returns:
      minimum resolution
    • getLengthUnit

      public static io.jenetics.jpx.Length.Unit getLengthUnit()
      Gets the unit used for all lengths.
      Returns:
      length unit used
    • getAnimationDuration

      public static Duration getAnimationDuration()
      Gets the duration of all animations.
      Returns:
      duration of animations