Esempio n. 1
0
        private void Okボタン_Click(object sender, EventArgs e)
        {
            // check
            {
                string dir = this.ffmpegのパス.Text;

                dir = Path.GetFullPath(dir);

                string SYSTEM_DRV_ROOT = Environment.GetEnvironmentVariable("SystemDrive")[0] + @":\";

                if (StringTools.IsSame(dir, SYSTEM_DRV_ROOT, true))
                {
                    if (MessageBox.Show(
                            "システムドライブのルートディレクトリが指定されました。\n" +
                            "間違いありませんか?",
                            "確認",
                            MessageBoxButtons.YesNo,
                            MessageBoxIcon.Warning
                            )
                        != System.Windows.Forms.DialogResult.Yes
                        )
                    {
                        return;
                    }
                }
            }

            Gnd.ffmpegDir = this.ffmpegのパス.Text;
            Gnd.SaveData();
            this.Close();
        }
Esempio n. 2
0
        private void _開始ボタン_Click(object sender, EventArgs e)
        {
            this.SaveData();
            Gnd.SaveData();

            try
            {
                Gnd.Conv = new Conv();
                Gnd.Conv.Prep();
            }
            catch (Exception ex)
            {
                Gnd.ConvLog.Writeln(ex);

                MessageBox.Show(
                    ex.Message,
                    "開始できません",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Warning
                    );

                return;
            }
            this.Visible = false;

            using (BusyDlg f = new BusyDlg())
            {
                f.Th = new Thread((ThreadStart) delegate
                {
                    try
                    {
                        Gnd.Conv.Main();
                    }
                    catch (Exception ex)
                    {
                        Gnd.ConvLog.Writeln(ex);

                        Gnd.Conv.Errored = true;
                        Gnd.Conv.Error   = ex;
                    }
                    finally
                    {
                        Gnd.Conv.MainCleanup();
                    }
                });

                Gnd.BusyDlg = f;
                f.ShowDialog();
                Gnd.BusyDlg = null;
            }
            Gnd.ConvLog.Close();

            using (ResultDlg f = new ResultDlg())
            {
                f.ShowDialog();
            }
            this.Close();
        }
Esempio n. 3
0
        private void ffmpegFToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.SaveData();
            Gnd.SaveData();

            using (ffmpegSettingDlg f = new ffmpegSettingDlg())
            {
                f.ShowDialog();
            }
        }
Esempio n. 4
0
        private void RegisterWin_FormClosed(object sender, FormClosedEventArgs e)
        {
            // normalize
            {
                for (int index = 0; index < Gnd.ClientInfos.Count; index++)
                {
                    if (Gnd.ClientInfos[index].Url[0] != 'h')
                    {
                        Gnd.ClientInfos.RemoveAt(index);
                        index--;
                    }
                }
            }

            Gnd.SaveToFile();
        }
Esempio n. 5
0
		static void Main()
		{
			BootTools.OnBoot();

			Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
			AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
			SystemEvents.SessionEnding += new SessionEndingEventHandler(SessionEnding);

			Mutex procMutex = new Mutex(false, APP_IDENT);

			if (procMutex.WaitOne(0) && GlobalProcMtx.Create(APP_IDENT, APP_TITLE))
			{
				CheckSelfDir();
				CheckCopiedExe();

				Gnd.NormLog = new Logger(StringTools.Combine(
					BootTools.SelfDir,
					Path.GetFileNameWithoutExtension(BootTools.SelfFile) + "_normal.log"
					));

				Utils.AntiWindowsDefenderSmartScreen();

				Gnd.ConvLog = new Logger(StringTools.Combine(
					BootTools.SelfDir,
					Path.GetFileNameWithoutExtension(BootTools.SelfFile) + "_conversion.log"
					));

				Gnd.LoadData();

				// orig >

				Application.EnableVisualStyles();
				Application.SetCompatibleTextRenderingDefault(false);
				Application.Run(new MainWin());

				// < orig

				Gnd.SaveData();

				Gnd.NormLog.Close();
				Gnd.ConvLog.Close();

				GlobalProcMtx.Release();
				procMutex.ReleaseMutex();
			}
			procMutex.Close();
		}
Esempio n. 6
0
        private void SaveData()
        {
            Gnd.ProxyMode = (Gnd.ProxyMode_e) this.ProxyMode.SelectedIndex;
            Gnd.ProxyHost = this.ProxyHost.Text;
            Gnd.ProxyPort = IntTools.ToInt(this.ProxyPort.Text, 1, 65535, 8080);

            // normalize
            {
                if (Gnd.ProxyHost == "")
                {
                    Gnd.ProxyHost = "none";
                }

                Gnd.ProxyHost = JString.ToAsciiToken(Gnd.ProxyHost, 1, 300);
            }

            Gnd.SaveToFile();
        }
Esempio n. 7
0
        static void Main()
        {
            BootTools.OnBoot();

            Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
            SystemEvents.SessionEnding += new SessionEndingEventHandler(SessionEnding);

            Mutex procMutex = new Mutex(false, "{b68179af-7285-4a8c-a16e-f36b107e42cc}");

            if (procMutex.WaitOne(0) && GlobalProcMtx.Create("{82820e8e-4256-4c75-87a2-9a9851f46c5b}", APP_TITLE))
            {
                CheckSelfDir();
                CheckCopiedExe();

                Gnd.Init();
                Gnd.LoadConf();
                Gnd.LoadFromFile();

                // orig >

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new MainWin());

                // < orig

                // ここではフォームは開けない -> MainWin.cs CloseWindow()

                Gnd.SaveToFile();

                GlobalProcMtx.Release();
                procMutex.ReleaseMutex();
            }
            procMutex.Close();
        }
Esempio n. 8
0
        // < sync

        public static bool Is初回起動()
        {
            return(Gnd.Is初回起動());
        }