Esempio n. 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            CheckForIllegalCrossThreadCalls = false;
            AutoScaleMode = AutoScaleMode.None;

            if (!File.Exists(Paths.GetVerPath()) && Paths.GetExeDir().ToLower().Contains("temp"))
            {
                MessageBox.Show("You seem to be running Flowframes out of an archive.\nPlease extract the whole archive first!", "Error");
                IOUtils.TryDeleteIfExists(Paths.GetDataPath());
                Application.Exit();
            }

            Text = $"Flowframes {Updater.GetInstalledVer()}";

            // Main Tab
            UIUtils.InitCombox(interpFactorCombox, 0);
            UIUtils.InitCombox(outModeCombox, 0);
            UIUtils.InitCombox(aiModel, 2);
            // Video Utils
            UIUtils.InitCombox(trimCombox, 0);

            Program.mainForm = this;
            Logger.textbox   = logBox;

            NvApi.Init();
            InitAis();
            InterpolateUtils.preview = previewPicturebox;

            UpdateStepByStepControls();

            Initialized();
            Checks();

            HandleArguments();
        }
Esempio n. 2
0
        private async void Form1_Load(object sender, EventArgs e)
        {
            CheckForIllegalCrossThreadCalls = false;
            AutoScaleMode = AutoScaleMode.None;

            StartupChecks.CheckOs();

            // Main Tab
            UiUtils.InitCombox(interpFactorCombox, 0);
            UiUtils.InitCombox(outSpeedCombox, 0);
            UiUtils.InitCombox(outModeCombox, 0);
            UiUtils.InitCombox(aiModel, 2);
            // Video Utils
            UiUtils.InitCombox(trimCombox, 0);

            Program.mainForm = this;
            Logger.textbox   = logBox;
            NvApi.Init();
            InitAis();
            InterpolationProgress.preview = previewPicturebox;
            RemovePreviewIfDisabled();
            UpdateStepByStepControls();
            Initialized();
            HandleArgs();
            Text = $"Flowframes";

            if (Program.args.Contains("show-model-downloader"))
            {
                new ModelDownloadForm().ShowDialog();
            }
        }
Esempio n. 3
0
        private async void MainForm_Load(object sender, EventArgs e)
        {
            // Left Panel
            UIHelpers.InitCombox(prevClipboardTypeCombox, 0);
            UIHelpers.InitCombox(preResizeScale, 1);
            UIHelpers.InitCombox(preResizeMode, 0);
            UIHelpers.FillEnumComboBox(preResizeFilter, typeof(Upscale.Filter), 0);
            // Right Panel
            UIHelpers.InitCombox(prevOverwriteCombox, 0);
            UIHelpers.InitCombox(prevOutputFormatCombox, 0);
            UIHelpers.FillEnumComboBox(prevOutputFormatCombox, typeof(Upscale.ExportFormats));
            UIHelpers.InitCombox(postResizeScale, 1);
            UIHelpers.InitCombox(postResizeMode, 0);
            UIHelpers.FillEnumComboBox(postResizeFilter, typeof(Upscale.Filter), 0);
            // Batch Upscale
            UIHelpers.InitCombox(batchOutMode, 0);
            UIHelpers.InitCombox(preprocessMode, 0);
            await CheckInstallation();

            EmbeddedPython.Init();

            EsrganData.CheckModelDir();
            EsrganData.ReloadModelList();

            NvApi.Init();

            if (OSUtils.IsUserAdministrator())
            {
                Program.ShowMessage("Cupscale is running as administrator.\nThis will break Drag-n-Drop functionality.", "Warning");
            }
        }
Esempio n. 4
0
        private async void MainForm_Load(object sender, EventArgs e)
        {
            if (!Directory.Exists(Path.Combine(Paths.GetExeDir(), "runtimes")) && Paths.GetExeDir().ToLower().Contains("temp"))
            {
                MessageBox.Show("You seem to be running Flowframes out of an archive.\nPlease extract the whole archive first!", "Error");
                IOUtils.TryDeleteIfExists(Paths.GetDataPath());
                Application.Exit();
            }

            // Left Panel
            UIHelpers.InitCombox(prevClipboardTypeCombox, 0);
            UIHelpers.InitCombox(preResizeScale, 1);
            UIHelpers.InitCombox(preResizeMode, 0);
            UIHelpers.FillEnumComboBox(preResizeFilter, typeof(Upscale.Filter), 0);
            // Right Panel
            UIHelpers.InitCombox(prevOverwriteCombox, 0);
            UIHelpers.InitCombox(imageOutputFormat, 0);
            UIHelpers.FillEnumComboBox(imageOutputFormat, typeof(Upscale.ImgExportMode));
            UIHelpers.FillEnumComboBox(videoOutputFormat, typeof(Upscale.VidExportMode));
            UIHelpers.InitCombox(postResizeScale, 1);
            UIHelpers.InitCombox(postResizeMode, 0);
            UIHelpers.FillEnumComboBox(postResizeFilter, typeof(Upscale.Filter), 0);
            // Batch Upscale
            UIHelpers.InitCombox(batchOutMode, 0);
            UIHelpers.InitCombox(preprocessMode, 0);
            UIHelpers.InitCombox(batchCacheSplitDepth, 0);
            // Video Upscale
            UIHelpers.InitCombox(videoPreprocessMode, 1);

            await CheckInstallation();

            await EmbeddedPython.Init();

            EsrganData.CheckModelDir();
            EsrganData.ReloadModelList();

            NvApi.Init();

            if (OSUtils.IsUserAdministrator())
            {
                Program.ShowMessage("Cupscale is running as administrator.\nThis will break Drag-n-Drop functionality.", "Warning");
            }

            LoadEsrganOptions();

            flowPanelLeft.AutoScroll = false;
            flowPanelLeft.HorizontalScroll.Maximum = 0;
            flowPanelLeft.VerticalScroll.Visible   = false;
            flowPanelLeft.AutoScroll = true;

            flowPanelRight.AutoScroll = false;
            flowPanelRight.HorizontalScroll.Maximum = 0;
            flowPanelRight.VerticalScroll.Visible   = false;
            flowPanelRight.AutoScroll = true;

            initialized = true;
            BusyCheckLoop();
        }
Esempio n. 5
0
        private async void MainForm_Load(object sender, EventArgs e)
        {
            // Left Panel
            UIHelpers.InitCombox(prevClipboardTypeCombox, 0);
            UIHelpers.InitCombox(preResizeScale, 1);
            UIHelpers.InitCombox(preResizeMode, 0);
            UIHelpers.FillEnumComboBox(preResizeFilter, typeof(Upscale.Filter), 0);
            // Right Panel
            UIHelpers.InitCombox(prevOverwriteCombox, 0);
            UIHelpers.InitCombox(imageOutputFormat, 0);
            UIHelpers.FillEnumComboBox(imageOutputFormat, typeof(Upscale.ImgExportMode));
            UIHelpers.FillEnumComboBox(videoOutputFormat, typeof(Upscale.VidExportMode));
            UIHelpers.InitCombox(postResizeScale, 1);
            UIHelpers.InitCombox(postResizeMode, 0);
            UIHelpers.FillEnumComboBox(postResizeFilter, typeof(Upscale.Filter), 0);
            // Batch Upscale
            UIHelpers.InitCombox(batchOutMode, 0);
            UIHelpers.InitCombox(preprocessMode, 0);
            UIHelpers.InitCombox(batchCacheSplitDepth, 0);
            // Video Upscale
            UIHelpers.InitCombox(videoPreprocessMode, 1);

            await CheckInstallation();

            await EmbeddedPython.Init();

            EsrganData.CheckModelDir();
            EsrganData.ReloadModelList();

            NvApi.Init();

            if (OSUtils.IsUserAdministrator())
            {
                Program.ShowMessage("Cupscale is running as administrator.\nThis will break Drag-n-Drop functionality.", "Warning");
            }

            LoadEsrganOptions();

            flowPanelLeft.AutoScroll = false;
            flowPanelLeft.HorizontalScroll.Maximum = 0;
            flowPanelLeft.VerticalScroll.Visible   = false;
            flowPanelLeft.AutoScroll = true;

            flowPanelRight.AutoScroll = false;
            flowPanelRight.HorizontalScroll.Maximum = 0;
            flowPanelRight.VerticalScroll.Visible   = false;
            flowPanelRight.AutoScroll = true;

            initialized = true;
            BusyCheckLoop();
        }