package ctbrec;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import ctbrec.event.EventHandlerConfiguration;
import ctbrec.recorder.postprocessing.PostProcessor;

public class Settings {

    public enum DirectoryStructure {
        FLAT("all recordings in one directory"),
        ONE_PER_MODEL("one directory for each model"),
        ONE_PER_RECORDING("one directory for each recording");

        private String description;
        DirectoryStructure(String description) {
            this.description = description;
        }

        @Override
        public String toString() {
            return description;
        }
    }

    public enum ProxyType {
        DIRECT,
        HTTP,
        SOCKS4,
        SOCKS5
    }

    public enum SplitStrategy {
        DONT,
        TIME,
        SIZE,
        TIME_OR_SIZE
    }

    public String bongacamsBaseUrl = "https://bongacams.com";
    public String bongaPassword = "";
    public String bongaUsername = "";
    public String cam4Password = "";
    public String cam4Username = "";
    public String camsodaPassword = "";
    public String camsodaUsername = "";
    public String chaturbatePassword = "";
    public String chaturbateUsername = "";
    public String chaturbateBaseUrl = "https://chaturbate.com";
    public boolean chooseStreamQuality = false;
    public String colorAccent = "#FFFFFF";
    public String colorBase = "#FFFFFF";
    public int concurrentRecordings = 0;
    public boolean confirmationForDangerousActions = false;
    public boolean determineResolution = false;
    public List<String> disabledSites = new ArrayList<>();
    public String downloadFilename = "${modelSanitizedName}-${localDateTime}";
    public List<EventHandlerConfiguration> eventHandlers = new ArrayList<>();
    public boolean fastPlaylistGenerator = false;
    public boolean fastScrollSpeed = true;
    public String fc2livePassword = "";
    public String fc2liveUsername = "";
    public String ffmpegMergedDownloadArgs = "-c:v copy -c:a copy -movflags faststart -y -f mpegts";
    public String ffmpegFileSuffix = "ts";
    public String flirt4freePassword;
    public String flirt4freeUsername;
    public boolean generatePlaylist = true;
    public String hlsdlExecutable = "hlsdl";
    public int httpPort = 8080;
    public int httpSecurePort = 8443;
    public String httpServer = "localhost";
    public int httpTimeout = 10000;
    public String httpUserAgent = "Mozilla/5.0 (X11; Linux x86_64; rv:82.0) Gecko/20100101 Firefox/82.0";
    public String httpUserAgentMobile = "Mozilla/5.0 (Android 9.0; Mobile; rv:82.0) Gecko/82.0 Firefox/82.0";
    public byte[] key = null;
    public String lastDownloadDir = "";
    public String livejasminBaseUrl = "https://www.livejasmin.com";
    public boolean livejasminBetaAcknowledged = false;
    public String livejasminPassword = "";
    public String livejasminUsername = "";
    public boolean livePreviews = false;
    public boolean localRecording = true;
    public boolean logFFmpegOutput = false;
    public boolean loghlsdlOutput = false;
    public int minimumResolution = 0;
    public int maximumResolution = 8640;
    public int maximumResolutionPlayer = 0;
    public String mediaPlayer = "/usr/bin/mpv";
    public String mediaPlayerParams = "";
    public String mfcBaseUrl = "https://www.myfreecams.com";
    public List<String> mfcDisabledModelsTableColumns = new ArrayList<>();
    public String[] mfcModelsTableColumnIds = new String[0];
    public double[] mfcModelsTableColumnWidths = new double[0];
    public String mfcModelsTableFilter = "";
    public String mfcModelsTableSortColumn = "";
    public String mfcModelsTableSortType = "";
    public String mfcPassword = "";
    public String mfcUsername = "";
    public int minimumLengthInSeconds = 0;
    public long minimumSpaceLeftInBytes = 0;
    public Map<String, String> modelNotes = new HashMap<>();
    public List<Model> models = new ArrayList<>();
    public List<Model> modelsIgnored = new ArrayList<>();
    public boolean monitorClipboard = false;
    public int onlineCheckIntervalInSecs = 60;
    public boolean onlineCheckSkipsPausedModels = false;
    public int overviewUpdateIntervalInSecs = 10;
    @Deprecated
    public String password = "";
    @Deprecated
    public String postProcessing = "";
    public int playlistRequestTimeout = 2000;
    public int postProcessingThreads = 2;
    public List<PostProcessor> postProcessors = new ArrayList<>();
    public String proxyHost;
    public String proxyPassword;
    public String proxyPort;
    public ProxyType proxyType = ProxyType.DIRECT;
    public String proxyUser;
    public boolean recentlyWatched = true;
    public double[] recordLaterColumnWidths = new double[0];
    public String[] recordLaterColumnIds = new String[0];
    public String recordLaterSortColumn = "";
    public String recordLaterSortType = "";
    public double[] recordedModelsColumnWidths = new double[0];
    public String[] recordedModelsColumnIds = new String[0];
    public String recordedModelsSortColumn = "";
    public String recordedModelsSortType = "";
    public double[] recordingsColumnWidths = new double[0];
    public String[] recordingsColumnIds = new String[0];
    public String recordingsDir = System.getProperty("user.home") + File.separator + "ctbrec";
    public DirectoryStructure recordingsDirStructure = DirectoryStructure.FLAT;
    public String recordingsSortColumn = "";
    public String recordingsSortType = "";
    public List<Model> recordLater = new ArrayList<>();
    public boolean recordSingleFile = false;
    public boolean removeRecordingAfterPostProcessing = false;
    public boolean requireAuthentication = false;
    public String servletContext = "";
    public boolean showPlayerStarting = false;
    public String showupUsername = "";
    public String showupPassword = "";
    public boolean singlePlayer = true;
    @Deprecated
    public int splitRecordings = 0;
    public SplitStrategy splitStrategy = SplitStrategy.DONT;
    public int splitRecordingsAfterSecs = 0;
    public long splitRecordingsBiggerThanBytes = 0;
    public String startTab = "Settings";
    public String streamatePassword = "";
    public String streamateUsername = "";
    public String stripchatUsername = "";
    public String stripchatPassword = "";
    public boolean stripchatUseXhamster = false;
    public boolean totalModelCountInTitle = false;
    public boolean transportLayerSecurity = true;
    public int thumbWidth = 180;
    public boolean updateThumbnails = true;
    public boolean useHlsdl = false;
    @Deprecated
    public String username = "";
    public int windowHeight = 800;
    public boolean windowMaximized = false;
    public int windowWidth = 1340;
    public int windowX;
    public int windowY;
    public boolean webinterface = false;
    public String webinterfaceUsername = "ctbrec";
    public String webinterfacePassword = "sucks";
}
