package com.xugame.bean;

import androidx.annotation.NonNull;

public class SystemAVInfo {
    public static class GameGeometry {
        /* Nominal video width of game. */
        private int baseWidth;
        /* Nominal video height of game. */
        private int baseHeight;
        /* Maximum possible width of game. */
        private int maxWidth;
        /* Maximum possible height of game. */
        private int maxHeight;

        /* Nominal aspect ratio of game. If
         * aspectRatio is <= 0.0, an aspect ratio
         * of baseWidth / baseHeight is assumed.
         * A frontend could override this setting,
         * if desired. */
        private float aspectRatio;

        public GameGeometry() {
            this.baseWidth = 1;
            this.baseHeight = 1;
            this.maxWidth = 1;
            this.maxHeight = 1;
            this.aspectRatio = 1.0f;
        }

        public GameGeometry(int baseWidth, int baseHeight, int maxWidth, int maxHeight, float aspectRatio) {
            this.baseWidth = baseWidth;
            this.baseHeight = baseHeight;
            this.maxWidth = maxWidth;
            this.maxHeight = maxHeight;
            this.aspectRatio = aspectRatio;
        }

        public int getBaseWidth() {
            return baseWidth;
        }

        public void setBaseWidth(int baseWidth) {
            this.baseWidth = baseWidth;
        }

        public int getBaseHeight() {
            return baseHeight;
        }

        public void setBaseHeight(int baseHeight) {
            this.baseHeight = baseHeight;
        }

        public int getMaxWidth() {
            return maxWidth;
        }

        public void setMaxWidth(int maxWidth) {
            this.maxWidth = maxWidth;
        }

        public int getMaxHeight() {
            return maxHeight;
        }

        public void setMaxHeight(int maxHeight) {
            this.maxHeight = maxHeight;
        }

        public float getAspectRatio() {
            return aspectRatio;
        }

        public void setAspectRatio(float aspectRatio) {
            this.aspectRatio = aspectRatio;
        }

        @NonNull
        @Override
        public String toString() {
            return "baseWidth: " + this.baseWidth +
                    ", baseHeight: " + this.baseHeight +
                    ", maxWidth: " + this.maxWidth +
                    ", maxHeight: " + this.maxHeight +
                    ", aspectRatio: " + this.aspectRatio;
        }
    }

    public static class SystemTiming {
        double fps;
        double sampleRate;

        public SystemTiming() {
            fps = 0.0;
            sampleRate = 0.0;
        }

        public SystemTiming(double fps, double sampleRate) {
            this.fps = fps;
            this.sampleRate = sampleRate;
        }

        @NonNull
        @Override
        public String toString() {
            return "fps: " + this.fps +
                    ", sampleRate: " + this.sampleRate;
        }
    }

    private GameGeometry geometry;
    private SystemTiming systemTiming;

    public SystemAVInfo(GameGeometry geometry, SystemTiming systemTiming) {
        this.geometry = geometry;
        this.systemTiming = systemTiming;
    }

    public SystemAVInfo() {
        geometry = new GameGeometry();
        systemTiming = new SystemTiming();
    }

    public GameGeometry getGeometry() {
        return geometry;
    }

    public void setGeometry(GameGeometry geometry) {
        this.geometry = geometry;
    }

    public SystemTiming getSystemTiming() {
        return systemTiming;
    }

    public void setSystemTiming(SystemTiming systemTiming) {
        this.systemTiming = systemTiming;
    }

    @NonNull
    @Override
    public String toString() {
        return "geometry: { " + this.geometry.toString() +
                " }, systemTiming: { " + this.systemTiming.toString() +
                " }";
    }
}
