예제 #1
0
        public static void Test()
        {
            var temp = new MediaPreset
            {
            };

            File.WriteAllText("preset.example", JsonConvert.SerializeObject(temp, Formatting.Indented));
        }
예제 #2
0
        private void bgwThread_DoWork(object sender, DoWorkEventArgs e)
        {
            // Init
            Language.Load();
            Plugin.Load();
            MediaPreset.Load();
            AviSynth.Load();

            // Init FFmpeg
            var arch = Properties.Settings.Default.FFmpegArch;

            FFmpegDotNet.FFmpeg.Main  = Path.Combine(Get.AppRootDir, "plugin", $"ffmpeg{arch}", "ffmpeg");
            FFmpegDotNet.FFmpeg.Probe = Path.Combine(Get.AppRootDir, "plugin", $"ffmpeg{arch}", "ffprobe");

            // Init Folder
            if (Get.IsValidPath(Get.FolderTemp))
            {
                if (!Directory.Exists(Get.FolderTemp))
                {
                    Directory.CreateDirectory(Get.FolderTemp);
                }
            }
            else
            {
                Get.FolderTemp = Path.Combine(Path.GetTempPath(), "IFME");

                if (!Directory.Exists(Get.FolderTemp))
                {
                    Directory.CreateDirectory(Get.FolderTemp);
                }
            }

            if (Get.IsValidPath(Get.FolderSave))
            {
                if (!Directory.Exists(Get.FolderSave))
                {
                    Directory.CreateDirectory(Get.FolderSave);
                }
            }
            else
            {
                var path = Environment.GetFolderPath(Environment.SpecialFolder.MyVideos);

                // windows xp
                if (path.IsDisable())
                {
                    path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                }

                Get.FolderSave = Path.Combine(path, "IFME");

                if (!Directory.Exists(Get.FolderSave))
                {
                    Directory.CreateDirectory(Get.FolderSave);
                }
            }
        }