1
0
mirror of https://github.com/upscayl/upscayl.git synced 2025-02-14 18:02:38 +01:00
upscayl/electron/utils/config-variables.ts

55 lines
1.4 KiB
TypeScript
Raw Normal View History

2023-09-10 14:44:04 +05:30
import { ChildProcessWithoutNullStreams } from "child_process";
2023-09-10 23:12:18 +05:30
export let imagePath: string | undefined = "";
export let folderPath: string | undefined = undefined;
export let customModelsFolderPath: string | undefined = undefined;
export let outputFolderPath: string | undefined = undefined;
export let saveOutputFolder = false;
2023-09-13 19:37:45 +05:30
export let compression = 0;
2023-09-10 23:12:18 +05:30
export let overwrite = false;
export let stopped = false;
export let childProcesses: {
2023-09-10 14:44:04 +05:30
process: ChildProcessWithoutNullStreams;
kill: () => boolean;
}[] = [];
export function setImagePath(value: string | undefined): void {
2023-09-10 23:12:18 +05:30
imagePath = value;
2023-09-10 14:44:04 +05:30
}
export function setFolderPath(value: string | undefined): void {
2023-09-10 23:12:18 +05:30
folderPath = value;
2023-09-10 14:44:04 +05:30
}
export function setCustomModelsFolderPath(value: string | undefined): void {
2023-09-10 23:12:18 +05:30
customModelsFolderPath = value;
2023-09-10 14:44:04 +05:30
}
// SETTERS
export function setOutputFolderPath(value: string | undefined): void {
2023-09-10 23:12:18 +05:30
outputFolderPath = value;
2023-09-10 14:44:04 +05:30
}
export function setSaveOutputFolder(value: boolean): void {
2023-09-10 23:12:18 +05:30
saveOutputFolder = value;
2023-09-10 14:44:04 +05:30
}
2023-09-13 19:37:45 +05:30
export function setCompression(value: number): void {
compression = value;
2023-09-10 14:44:04 +05:30
}
export function setOverwrite(value: boolean): void {
2023-09-10 23:12:18 +05:30
overwrite = value;
2023-09-10 14:44:04 +05:30
}
2023-09-10 23:12:18 +05:30
export function setStopped(value: boolean): void {
stopped = value;
2023-09-10 14:44:04 +05:30
}
export function setChildProcesses(value: {
process: ChildProcessWithoutNullStreams;
kill: () => boolean;
}): void {
childProcesses.push(value);
}