OSDN Git Service

Change the fifo size from being statically tuned for a Mac Pro with 4 CPUs to dynamic...
[handbrake-jp/handbrake-jp-git.git] / win / C# / frmDvdInfo.cs
index 130ffa2..b416020 100644 (file)
@@ -5,24 +5,73 @@ using System.Data;
 using System.Drawing;\r
 using System.Text;\r
 using System.Windows.Forms;\r
+using System.IO;\r
+\r
 \r
 namespace Handbrake\r
 {\r
     public partial class frmDvdInfo : Form\r
     {\r
-\r
-        /*\r
-         * This window should be used to display the RAW output of the handbrake CLI which is produced during the scan.\r
-         */\r
-\r
+        /// <summary>\r
+        /// This window should be used to display the RAW output of the handbrake CLI which is produced during the scan.\r
+        /// </summary>\r
         public frmDvdInfo()\r
         {\r
             InitializeComponent();\r
+            this.rtf_dvdInfo.Text = string.Empty;\r
+            \r
         }\r
 \r
+        /*public void HandleParsedData(object Sender, string Data)\r
+        {\r
+            if (this.InvokeRequired)\r
+            {\r
+                this.BeginInvoke(new Parsing.DataReadEventHandler(HandleParsedData), new object[] { Sender, Data });\r
+                return;\r
+            }\r
+            this.rtf_dvdInfo.AppendText(Data + System.Environment.NewLine);\r
+        }*/\r
+\r
         private void btn_close_Click(object sender, EventArgs e)\r
         {\r
-            this.Close();\r
+            this.Hide();\r
+        }\r
+\r
+        private void frmDvdInfo_Load(object sender, EventArgs e)\r
+        {\r
+            this.rtf_dvdInfo.Text = string.Empty;\r
+            readFile();\r
         }\r
+\r
+        private void readFile()\r
+        {\r
+            try\r
+            {\r
+                string appPath = Application.StartupPath.ToString();\r
+                appPath = appPath + "\\";\r
+                StreamReader sr = new StreamReader(appPath + "dvdinfo.dat");\r
+\r
+                string line = sr.ReadLine();\r
+\r
+                while (line != null)\r
+                {\r
+                    this.rtf_dvdInfo.AppendText(line + System.Environment.NewLine);\r
+                    line = sr.ReadLine();\r
+                }\r
+                sr.Close();\r
+            }\r
+            catch (Exception)\r
+            {\r
+                // Don't do anything\r
+            }\r
+        }\r
+\r
+        /*protected override void OnClosing(CancelEventArgs e)\r
+        {\r
+            e.Cancel = true;\r
+            this.Hide();\r
+            base.OnClosing(e);\r
+        }*/\r
+\r
     }\r
 }
\ No newline at end of file