Exemplo n.º 1
0
        public static async Task Done()
        {
            await Cleanup();

            Program.mainForm.SetWorking(false);
            Logger.Log("Total processing time: " + FormatUtils.Time(sw.Elapsed));
            sw.Stop();

            if (!BatchProcessing.busy)
            {
                OsUtils.ShowNotificationIfInBackground("Flowframes", $"Finished interpolation after {FormatUtils.Time(sw.Elapsed)}.");
            }

            Program.mainForm.InterpolationDone();
        }
Exemplo n.º 2
0
        public static async void Start()
        {
            if (busy)
            {
                Logger.Log("Queue: Start() has been called, but I'm already busy - Returning!", true);
                return;
            }

            SetBusy(true);

            if (Config.GetBool(Config.Key.clearLogOnInput))
            {
                Logger.ClearLogBox();
            }

            stopped = false;
            Program.mainForm.SetTab("preview");
            int initTaskCount = Program.batchQueue.Count;

            for (int i = 0; i < initTaskCount; i++)
            {
                if (!stopped && Program.batchQueue.Count > 0)
                {
                    try
                    {
                        Logger.Log($"Queue: Running queue task {i + 1}/{initTaskCount}, {Program.batchQueue.Count} tasks left.");
                        await RunEntry(Program.batchQueue.Peek());

                        if (currentBatchForm != null)
                        {
                            currentBatchForm.RefreshGui();
                        }
                    }
                    catch (Exception e)
                    {
                        Logger.Log($"Failed to run batch queue entry. If this happened after force stopping the queue, it's non-critical. {e.Message}", true);
                    }
                }

                await Task.Delay(500);
            }

            Logger.Log("Queue: Finished queue processing.");
            OsUtils.ShowNotificationIfInBackground("Flowframes Queue", "Finished queue processing.");
            SetBusy(false);
            Program.mainForm.SetTab("interpolation");
            Program.mainForm.CompletionAction();
        }