Esempio n. 1
0
        private async Task ensureFFmpegPathAsync()
        {
            bool succ = false;

            if (!string.IsNullOrWhiteSpace(Settings.FFMpegDirectory))
            {
                succ = await _converter.VerifyFFmpegPathVersionAsync(_interactionHandler.Interact);
            }
            else
            {
                string ffmpegdir = ApplEnv.ApplDirectory;
                string path      = Path.Combine(ffmpegdir, FFmpeg.FFMPEG_EXE);
                if (File.Exists(path))
                {
                    Settings.FFMpegDirectory = ffmpegdir;
                    using (new ResourceGuard(() => Settings.FFMpegDirectory = null))
                        succ = await _converter.VerifyFFmpegPathVersionAsync(_interactionHandler.Interact);
                }
            }

            if (!succ)
            {
                FFmpegLocationForm dlg = new FFmpegLocationForm(_converter, _interactionHandler.Interact);
                var result             = dlg.ShowDialog();
                succ = result == DialogResult.OK;
            }

            _ffMpegPathVerified = succ;
            enableAll(true);
        }