diff --git a/.gitignore b/.gitignore index 48cdbb6..1d690a0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ -!*.exe -packages/ -MKVTest/bin -MKVTest/obj -*.mkv -*.txt -MKVTest/.vs +!*.exe +packages/ +MKVTest/bin +MKVTest/obj +*.mkv +*.txt +MKVTest/.vs .vs \ No newline at end of file diff --git a/MKVTest.sln b/MKVTest.sln index 2cc048c..6d26d31 100644 --- a/MKVTest.sln +++ b/MKVTest.sln @@ -1,25 +1,25 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.10 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MKVTest", "MKVTest\MKVTest.csproj", "{A750A634-6881-4083-B909-73EFE4C96802}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A750A634-6881-4083-B909-73EFE4C96802}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A750A634-6881-4083-B909-73EFE4C96802}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A750A634-6881-4083-B909-73EFE4C96802}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A750A634-6881-4083-B909-73EFE4C96802}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {1DE3F207-A6CC-4FE8-B26A-DFC0A7448E8D} - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26730.10 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MKVTest", "MKVTest\MKVTest.csproj", "{A750A634-6881-4083-B909-73EFE4C96802}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A750A634-6881-4083-B909-73EFE4C96802}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A750A634-6881-4083-B909-73EFE4C96802}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A750A634-6881-4083-B909-73EFE4C96802}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A750A634-6881-4083-B909-73EFE4C96802}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1DE3F207-A6CC-4FE8-B26A-DFC0A7448E8D} + EndGlobalSection +EndGlobal diff --git a/MKVTest/App.config b/MKVTest/App.config index 731f6de..00bfd11 100644 --- a/MKVTest/App.config +++ b/MKVTest/App.config @@ -1,6 +1,6 @@ - - - - - + + + + + \ No newline at end of file diff --git a/MKVTest/Form1.Designer.cs b/MKVTest/Form1.Designer.cs index 8a84e72..3a4c655 100644 --- a/MKVTest/Form1.Designer.cs +++ b/MKVTest/Form1.Designer.cs @@ -1,234 +1,234 @@ -namespace MKVTest -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.selectFolderButton = new System.Windows.Forms.Button(); - this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.mainMenuStrip = new System.Windows.Forms.MenuStrip(); - this.fileMainMenu = new System.Windows.Forms.ToolStripMenuItem(); - this.openFolderFileMainMenu = new System.Windows.Forms.ToolStripMenuItem(); - this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.debugToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.inputFilesListView = new System.Windows.Forms.ListView(); - this.detailsGroupBox = new System.Windows.Forms.GroupBox(); - this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); - this.currentTitleLabel = new System.Windows.Forms.Label(); - this.buttonPanel = new System.Windows.Forms.Panel(); - this.applyChangesButton = new System.Windows.Forms.Button(); - this.tableLayoutPanel1.SuspendLayout(); - this.mainMenuStrip.SuspendLayout(); - this.detailsGroupBox.SuspendLayout(); - this.flowLayoutPanel1.SuspendLayout(); - this.buttonPanel.SuspendLayout(); - this.SuspendLayout(); - // - // selectFolderButton - // - this.selectFolderButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.selectFolderButton.Location = new System.Drawing.Point(2, 9); - this.selectFolderButton.Margin = new System.Windows.Forms.Padding(2); - this.selectFolderButton.Name = "selectFolderButton"; - this.selectFolderButton.Size = new System.Drawing.Size(80, 29); - this.selectFolderButton.TabIndex = 1; - this.selectFolderButton.Text = "Select Folder"; - this.selectFolderButton.UseVisualStyleBackColor = true; - this.selectFolderButton.Click += new System.EventHandler(this.button1_Click); - // - // tableLayoutPanel1 - // - this.tableLayoutPanel1.ColumnCount = 3; - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 40F)); - this.tableLayoutPanel1.Controls.Add(this.mainMenuStrip, 0, 0); - this.tableLayoutPanel1.Controls.Add(this.inputFilesListView, 0, 1); - this.tableLayoutPanel1.Controls.Add(this.detailsGroupBox, 2, 1); - this.tableLayoutPanel1.Controls.Add(this.buttonPanel, 2, 4); - this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); - this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - this.tableLayoutPanel1.RowCount = 5; - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25.08529F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 37.45736F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 37.45736F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 43F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(560, 401); - this.tableLayoutPanel1.TabIndex = 2; - // - // mainMenuStrip - // - this.tableLayoutPanel1.SetColumnSpan(this.mainMenuStrip, 3); - this.mainMenuStrip.ImageScalingSize = new System.Drawing.Size(28, 28); - this.mainMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileMainMenu, - this.debugToolStripMenuItem}); - this.mainMenuStrip.Location = new System.Drawing.Point(0, 0); - this.mainMenuStrip.Name = "mainMenuStrip"; - this.mainMenuStrip.Size = new System.Drawing.Size(560, 24); - this.mainMenuStrip.TabIndex = 2; - this.mainMenuStrip.Text = "menuStrip1"; - // - // fileMainMenu - // - this.fileMainMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.openFolderFileMainMenu, - this.exitToolStripMenuItem}); - this.fileMainMenu.Name = "fileMainMenu"; - this.fileMainMenu.Size = new System.Drawing.Size(37, 20); - this.fileMainMenu.Text = "&File"; - // - // openFolderFileMainMenu - // - this.openFolderFileMainMenu.Name = "openFolderFileMainMenu"; - this.openFolderFileMainMenu.Size = new System.Drawing.Size(139, 22); - this.openFolderFileMainMenu.Text = "&Open Folder"; - this.openFolderFileMainMenu.Click += new System.EventHandler(this.openFolderFileMainMenu_Click); - // - // exitToolStripMenuItem - // - this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(139, 22); - this.exitToolStripMenuItem.Text = "E&xit"; - this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); - // - // debugToolStripMenuItem - // - this.debugToolStripMenuItem.Name = "debugToolStripMenuItem"; - this.debugToolStripMenuItem.Size = new System.Drawing.Size(54, 20); - this.debugToolStripMenuItem.Text = "Debug"; - this.debugToolStripMenuItem.Click += new System.EventHandler(this.debugToolStripMenuItem_Click); - // - // inputFilesListView - // - this.tableLayoutPanel1.SetColumnSpan(this.inputFilesListView, 2); - this.inputFilesListView.Dock = System.Windows.Forms.DockStyle.Fill; - this.inputFilesListView.LabelWrap = false; - this.inputFilesListView.Location = new System.Drawing.Point(3, 33); - this.inputFilesListView.Name = "inputFilesListView"; - this.tableLayoutPanel1.SetRowSpan(this.inputFilesListView, 4); - this.inputFilesListView.Size = new System.Drawing.Size(330, 365); - this.inputFilesListView.TabIndex = 3; - this.inputFilesListView.UseCompatibleStateImageBehavior = false; - this.inputFilesListView.View = System.Windows.Forms.View.Details; - // - // detailsGroupBox - // - this.detailsGroupBox.Controls.Add(this.flowLayoutPanel1); - this.detailsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.detailsGroupBox.Location = new System.Drawing.Point(339, 33); - this.detailsGroupBox.Name = "detailsGroupBox"; - this.tableLayoutPanel1.SetRowSpan(this.detailsGroupBox, 3); - this.detailsGroupBox.Size = new System.Drawing.Size(218, 320); - this.detailsGroupBox.TabIndex = 5; - this.detailsGroupBox.TabStop = false; - this.detailsGroupBox.Text = "Details"; - // - // flowLayoutPanel1 - // - this.flowLayoutPanel1.Controls.Add(this.currentTitleLabel); - this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 16); - this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(212, 301); - this.flowLayoutPanel1.TabIndex = 0; - // - // currentTitleLabel - // - this.currentTitleLabel.AutoSize = true; - this.currentTitleLabel.Location = new System.Drawing.Point(2, 0); - this.currentTitleLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.currentTitleLabel.Name = "currentTitleLabel"; - this.currentTitleLabel.Size = new System.Drawing.Size(67, 13); - this.currentTitleLabel.TabIndex = 11; - this.currentTitleLabel.Text = "Current Title:"; - // - // buttonPanel - // - this.buttonPanel.Controls.Add(this.applyChangesButton); - this.buttonPanel.Controls.Add(this.selectFolderButton); - this.buttonPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.buttonPanel.Location = new System.Drawing.Point(339, 359); - this.buttonPanel.Name = "buttonPanel"; - this.buttonPanel.Size = new System.Drawing.Size(218, 39); - this.buttonPanel.TabIndex = 8; - // - // applyChangesButton - // - this.applyChangesButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.applyChangesButton.Enabled = false; - this.applyChangesButton.Location = new System.Drawing.Point(112, 7); - this.applyChangesButton.Name = "applyChangesButton"; - this.applyChangesButton.Size = new System.Drawing.Size(102, 29); - this.applyChangesButton.TabIndex = 2; - this.applyChangesButton.Text = "Apply Changes"; - this.applyChangesButton.UseVisualStyleBackColor = true; - this.applyChangesButton.Click += new System.EventHandler(this.applyChangesButton_Click); - // - // Form1 - // - this.AcceptButton = this.selectFolderButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(560, 401); - this.Controls.Add(this.tableLayoutPanel1); - this.MainMenuStrip = this.mainMenuStrip; - this.Margin = new System.Windows.Forms.Padding(2); - this.Name = "Form1"; - this.Text = "Form1"; - this.tableLayoutPanel1.ResumeLayout(false); - this.tableLayoutPanel1.PerformLayout(); - this.mainMenuStrip.ResumeLayout(false); - this.mainMenuStrip.PerformLayout(); - this.detailsGroupBox.ResumeLayout(false); - this.flowLayoutPanel1.ResumeLayout(false); - this.flowLayoutPanel1.PerformLayout(); - this.buttonPanel.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - private System.Windows.Forms.Button selectFolderButton; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; - private System.Windows.Forms.MenuStrip mainMenuStrip; - private System.Windows.Forms.ToolStripMenuItem fileMainMenu; - private System.Windows.Forms.ToolStripMenuItem openFolderFileMainMenu; - private System.Windows.Forms.ListView inputFilesListView; - private System.Windows.Forms.GroupBox detailsGroupBox; - private System.Windows.Forms.Panel buttonPanel; - private System.Windows.Forms.Button applyChangesButton; - private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; - private System.Windows.Forms.Label currentTitleLabel; - private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem debugToolStripMenuItem; - } -} - +namespace MKVTest +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.selectFolderButton = new System.Windows.Forms.Button(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.mainMenuStrip = new System.Windows.Forms.MenuStrip(); + this.fileMainMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.openFolderFileMainMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.debugToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.inputFilesListView = new System.Windows.Forms.ListView(); + this.detailsGroupBox = new System.Windows.Forms.GroupBox(); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.currentTitleLabel = new System.Windows.Forms.Label(); + this.buttonPanel = new System.Windows.Forms.Panel(); + this.applyChangesButton = new System.Windows.Forms.Button(); + this.tableLayoutPanel1.SuspendLayout(); + this.mainMenuStrip.SuspendLayout(); + this.detailsGroupBox.SuspendLayout(); + this.flowLayoutPanel1.SuspendLayout(); + this.buttonPanel.SuspendLayout(); + this.SuspendLayout(); + // + // selectFolderButton + // + this.selectFolderButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.selectFolderButton.Location = new System.Drawing.Point(2, 9); + this.selectFolderButton.Margin = new System.Windows.Forms.Padding(2); + this.selectFolderButton.Name = "selectFolderButton"; + this.selectFolderButton.Size = new System.Drawing.Size(80, 29); + this.selectFolderButton.TabIndex = 1; + this.selectFolderButton.Text = "Select Folder"; + this.selectFolderButton.UseVisualStyleBackColor = true; + this.selectFolderButton.Click += new System.EventHandler(this.button1_Click); + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 3; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 40F)); + this.tableLayoutPanel1.Controls.Add(this.mainMenuStrip, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.inputFilesListView, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.detailsGroupBox, 2, 1); + this.tableLayoutPanel1.Controls.Add(this.buttonPanel, 2, 4); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 5; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25.08529F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 37.45736F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 37.45736F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 43F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(560, 401); + this.tableLayoutPanel1.TabIndex = 2; + // + // mainMenuStrip + // + this.tableLayoutPanel1.SetColumnSpan(this.mainMenuStrip, 3); + this.mainMenuStrip.ImageScalingSize = new System.Drawing.Size(28, 28); + this.mainMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileMainMenu, + this.debugToolStripMenuItem}); + this.mainMenuStrip.Location = new System.Drawing.Point(0, 0); + this.mainMenuStrip.Name = "mainMenuStrip"; + this.mainMenuStrip.Size = new System.Drawing.Size(560, 24); + this.mainMenuStrip.TabIndex = 2; + this.mainMenuStrip.Text = "menuStrip1"; + // + // fileMainMenu + // + this.fileMainMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.openFolderFileMainMenu, + this.exitToolStripMenuItem}); + this.fileMainMenu.Name = "fileMainMenu"; + this.fileMainMenu.Size = new System.Drawing.Size(37, 20); + this.fileMainMenu.Text = "&File"; + // + // openFolderFileMainMenu + // + this.openFolderFileMainMenu.Name = "openFolderFileMainMenu"; + this.openFolderFileMainMenu.Size = new System.Drawing.Size(139, 22); + this.openFolderFileMainMenu.Text = "&Open Folder"; + this.openFolderFileMainMenu.Click += new System.EventHandler(this.openFolderFileMainMenu_Click); + // + // exitToolStripMenuItem + // + this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + this.exitToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.exitToolStripMenuItem.Text = "E&xit"; + this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); + // + // debugToolStripMenuItem + // + this.debugToolStripMenuItem.Name = "debugToolStripMenuItem"; + this.debugToolStripMenuItem.Size = new System.Drawing.Size(54, 20); + this.debugToolStripMenuItem.Text = "Debug"; + this.debugToolStripMenuItem.Click += new System.EventHandler(this.debugToolStripMenuItem_Click); + // + // inputFilesListView + // + this.tableLayoutPanel1.SetColumnSpan(this.inputFilesListView, 2); + this.inputFilesListView.Dock = System.Windows.Forms.DockStyle.Fill; + this.inputFilesListView.LabelWrap = false; + this.inputFilesListView.Location = new System.Drawing.Point(3, 33); + this.inputFilesListView.Name = "inputFilesListView"; + this.tableLayoutPanel1.SetRowSpan(this.inputFilesListView, 4); + this.inputFilesListView.Size = new System.Drawing.Size(330, 365); + this.inputFilesListView.TabIndex = 3; + this.inputFilesListView.UseCompatibleStateImageBehavior = false; + this.inputFilesListView.View = System.Windows.Forms.View.Details; + // + // detailsGroupBox + // + this.detailsGroupBox.Controls.Add(this.flowLayoutPanel1); + this.detailsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.detailsGroupBox.Location = new System.Drawing.Point(339, 33); + this.detailsGroupBox.Name = "detailsGroupBox"; + this.tableLayoutPanel1.SetRowSpan(this.detailsGroupBox, 3); + this.detailsGroupBox.Size = new System.Drawing.Size(218, 320); + this.detailsGroupBox.TabIndex = 5; + this.detailsGroupBox.TabStop = false; + this.detailsGroupBox.Text = "Details"; + // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.Controls.Add(this.currentTitleLabel); + this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 16); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(212, 301); + this.flowLayoutPanel1.TabIndex = 0; + // + // currentTitleLabel + // + this.currentTitleLabel.AutoSize = true; + this.currentTitleLabel.Location = new System.Drawing.Point(2, 0); + this.currentTitleLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.currentTitleLabel.Name = "currentTitleLabel"; + this.currentTitleLabel.Size = new System.Drawing.Size(67, 13); + this.currentTitleLabel.TabIndex = 11; + this.currentTitleLabel.Text = "Current Title:"; + // + // buttonPanel + // + this.buttonPanel.Controls.Add(this.applyChangesButton); + this.buttonPanel.Controls.Add(this.selectFolderButton); + this.buttonPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.buttonPanel.Location = new System.Drawing.Point(339, 359); + this.buttonPanel.Name = "buttonPanel"; + this.buttonPanel.Size = new System.Drawing.Size(218, 39); + this.buttonPanel.TabIndex = 8; + // + // applyChangesButton + // + this.applyChangesButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.applyChangesButton.Enabled = false; + this.applyChangesButton.Location = new System.Drawing.Point(112, 7); + this.applyChangesButton.Name = "applyChangesButton"; + this.applyChangesButton.Size = new System.Drawing.Size(102, 29); + this.applyChangesButton.TabIndex = 2; + this.applyChangesButton.Text = "Apply Changes"; + this.applyChangesButton.UseVisualStyleBackColor = true; + this.applyChangesButton.Click += new System.EventHandler(this.applyChangesButton_Click); + // + // Form1 + // + this.AcceptButton = this.selectFolderButton; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(560, 401); + this.Controls.Add(this.tableLayoutPanel1); + this.MainMenuStrip = this.mainMenuStrip; + this.Margin = new System.Windows.Forms.Padding(2); + this.Name = "Form1"; + this.Text = "Form1"; + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.mainMenuStrip.ResumeLayout(false); + this.mainMenuStrip.PerformLayout(); + this.detailsGroupBox.ResumeLayout(false); + this.flowLayoutPanel1.ResumeLayout(false); + this.flowLayoutPanel1.PerformLayout(); + this.buttonPanel.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + private System.Windows.Forms.Button selectFolderButton; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.MenuStrip mainMenuStrip; + private System.Windows.Forms.ToolStripMenuItem fileMainMenu; + private System.Windows.Forms.ToolStripMenuItem openFolderFileMainMenu; + private System.Windows.Forms.ListView inputFilesListView; + private System.Windows.Forms.GroupBox detailsGroupBox; + private System.Windows.Forms.Panel buttonPanel; + private System.Windows.Forms.Button applyChangesButton; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + private System.Windows.Forms.Label currentTitleLabel; + private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem debugToolStripMenuItem; + } +} + diff --git a/MKVTest/Form1.cs b/MKVTest/Form1.cs index 40fed4e..d735b79 100644 --- a/MKVTest/Form1.cs +++ b/MKVTest/Form1.cs @@ -1,330 +1,330 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Text; -using System.Windows.Forms; -using System.Xml; -using System.Xml.Linq; - -namespace MKVTest -{ - /* Call mkvpropedit.exe - * Edit "Title" detail property: --edit info --set "title=%TITLE%" %FILE% - * Edit video track one: --edit track:v1 --set "name(or language)="%VAR%" %FILE% - * Edit audio track one: --edit track:a1 --set "name(or language)="%VAR%" %FILE% - * To add simply replace "--set" with "--add". - */ - public partial class Form1 : Form - { - public static string Language = "eng"; - private static readonly ContextMenuStrip menu = new ContextMenuStrip(); - - public Form1() - { - InitializeComponent(); - inputFilesListView.ItemSelectionChanged += UpdateFilePropPrediction; - inputFilesListView.MouseClick += ShowMenu; - Resize += Form1_Resize; - - var item = new ToolStripMenuItem - { - Name = "RemoveItem", - Text = @"Remove" - }; - menu.Items.Add(item); - - var inputColumn = new ColumnHeader - { - Text = @"Files", - Name = @"HeaderColumn", - Width = inputFilesListView.Width - 10 - }; - inputFilesListView.Columns.Add(inputColumn); - } - - private void ShowMenu(object sender, MouseEventArgs e) - { - if (e.Button == MouseButtons.Right) - { - if (inputFilesListView.FocusedItem.Bounds.Contains(e.Location)) - { - menu.Show(Cursor.Position); - } - } - } - - private void UpdateFilePropPrediction(object sender, ListViewItemSelectionChangedEventArgs e) - { - var info = new MkvFileInfo(); - var file = info.GetAttributes(e.Item.Name); - flowLayoutPanel1.Controls.Clear(); - flowLayoutPanel1.Invalidate(); - - var titleLabel = new Label - { - Parent = flowLayoutPanel1, - Text = @"Current Title: " + file.SegementInformation?.Title, - AutoSize = true - }; - - flowLayoutPanel1.Container?.Add(titleLabel); - - var videoTrackNumber = 1; - var audioTrackNumber = 1; - var subtitleTrackNumber = 1; - - foreach (var fileTrack in file.Tracks) - { - if (fileTrack.Type == MkvTrack.TrackType.Video) - { - var nameLabel = new Label - { - AutoSize = true, - Text = @"Track:v" + videoTrackNumber + @" Name: " + fileTrack.Name, - Parent = flowLayoutPanel1 - }; - - var languageLabel = new Label - { - AutoSize = true, - Text = @"Track:v" + videoTrackNumber + @" Language: " + fileTrack.Language, - Parent = flowLayoutPanel1 - }; - videoTrackNumber++; - if (flowLayoutPanel1.Container != null) - { - flowLayoutPanel1.Container.Add(nameLabel); - flowLayoutPanel1.Container.Add(languageLabel); - } - } - - if (fileTrack.Type == MkvTrack.TrackType.Audio) - { - var nameLabel = new Label - { - AutoSize = true, - Text = @"Track:a" + audioTrackNumber + @" Name: " + fileTrack.Name, - Parent = flowLayoutPanel1 - }; - var languageLabel = new Label - { - AutoSize = true, - Text = @"Track:a" + audioTrackNumber + @" Language: " + fileTrack.Language, - Parent = flowLayoutPanel1 - }; - audioTrackNumber++; - if (flowLayoutPanel1.Container != null) - { - flowLayoutPanel1.Container.Add(nameLabel); - flowLayoutPanel1.Container.Add(languageLabel); - } - } - - if (fileTrack.Type == MkvTrack.TrackType.Subtitle) - { - var nameLabel = new Label - { - AutoSize = true, - Text = @"Track:s" + subtitleTrackNumber + @" Name: " + fileTrack.Name, - Parent = flowLayoutPanel1 - }; - var languageLabel = new Label - { - AutoSize = true, - Text = @"Track:s" + subtitleTrackNumber + @" Language: " + fileTrack.Language, - Parent = flowLayoutPanel1 - }; - subtitleTrackNumber++; - if (flowLayoutPanel1.Container != null) - { - flowLayoutPanel1.Container.Add(nameLabel); - flowLayoutPanel1.Container.Add(languageLabel); - } - } - } - } - - /// - /// - /// - /// - /// - private string GetEpisodeName(string text) - { - var s = new StringBuilder(); - var hyphenCount = 0; - var index = 0; - var fileExtensionStartPoint = text.LastIndexOf(".", StringComparison.InvariantCulture); - foreach (var c in text) - { - if (c == '-' && hyphenCount != 2) - { - hyphenCount++; - index++; - continue; - } - - if (hyphenCount == 2) - { - if (c == '.' && index == fileExtensionStartPoint) - { - break; - } - s.Append(c); - } - - index++; - } - - return s.ToString().Trim(); - } - - private void ListFiles(string folderPath) - { - var dir = new DirectoryInfo(folderPath); - var files = dir.GetFiles("*.mkv", SearchOption.TopDirectoryOnly); - foreach (var file in files) - { - var node = new ListViewItem - { - Tag = true, //Assume the file needs to be updated. - Name = file.FullName, - Text = file.Name - }; - inputFilesListView.Items.Add(node); - } - - if (inputFilesListView.Items.Count > 0) - { - applyChangesButton.Enabled = true; - } - } - - private void button1_Click(object sender, EventArgs e) - { - var d = new FolderBrowserDialog(); - if (d.ShowDialog() != DialogResult.OK) return; - ClearForm(); - ListFiles(d.SelectedPath); - } - - private void Form1_Resize(object sender, EventArgs e) - { - inputFilesListView.Columns[0].Width = inputFilesListView.Width - 10; - } - - private void applyChangesButton_Click(object sender, EventArgs e) - { - - foreach (ListViewItem node in inputFilesListView.Items) - { - //Check to see if the item has been modified. - if (node.Tag == null || (bool) node.Tag == false) continue; - if (!File.Exists(node.Name)) continue; - var command = "/C mkvpropedit.exe --edit info --set \"title=" + GetEpisodeName(node.Text) + - "\" --edit track:v1 --set \"name=" + GetEpisodeName(node.Text) + - "\" --edit track:v1 --set \"language=eng\" --edit track:a1 --set \"name=English\" --edit track:a1 --set \"language=eng\" \"" + node.Name + "\" > temp.txt"; - var process = new Process(); - var startInfo = new ProcessStartInfo - { - WindowStyle = ProcessWindowStyle.Normal, - FileName = "cmd.exe", - Arguments = command - }; - process.StartInfo = startInfo; - process.Start(); - while (!process.HasExited) - { - - } - if (process.ExitCode == 0) continue; - var error = File.ReadAllLines("temp.txt"); - MessageBox.Show(@"Error on node: " + node.Text + (error.Length > 0 ? Environment.NewLine + error[0] : string.Empty)); - break; - } - - File.Delete("temp.txt"); - } - - private void ClearForm() - { - inputFilesListView.Items.Clear(); - flowLayoutPanel1.Controls.Clear(); - flowLayoutPanel1.Invalidate(); - } - - private void openFolderFileMainMenu_Click(object sender, EventArgs e) - { - var d = new FolderBrowserDialog(); - if (d.ShowDialog() != DialogResult.OK) return; - ClearForm(); - ListFiles(d.SelectedPath); - } - - private void exitToolStripMenuItem_Click(object sender, EventArgs e) => Application.Exit(); - - public static bool CheckFiles() - { - return File.Exists("mkvpropedit.exe") && File.Exists("mkvinfo.exe"); - } - - private void ReadXml(string s) - { - var xReader = new XmlTextReader(new StringReader(s)); - var r = new StringBuilder(); - ClearForm(); - var tags = new List(); - while (xReader.Read()) - { - switch (xReader.NodeType) - { - case XmlNodeType.Element: - //inputFilesListView.Items.Add(xReader.Name + ": " + xReader.Value); - var t = new XmlTag - { - Name = xReader.Name - }; - tags.Add(t); - break; - case XmlNodeType.Text: - //inputFilesListView.Items.Add(xReader.Value); - tags[tags.Count - 1].Value = xReader.Value; - break; - } - } - - foreach (var tag in tags) - { - var label = new Label - { - Text = tag.Name - }; - var textBox = new TextBox - { - Text = tag.Value - }; - if (flowLayoutPanel1.Container != null) - { - flowLayoutPanel1.Container.Add(label); - flowLayoutPanel1.Container.Add(textBox); - } - //inputFilesListView.Items.Add(tag.Name + ": " + tag.Value); - } - } - - private void debugToolStripMenuItem_Click(object sender, EventArgs e) - { - //var xml = new SerializeMkvInfo(); - //var x = xml.SerializeFile("info.txt"); - //var text = new StringBuilder(); - //foreach (var line in x) - //{ - // text.Append(line.Trim()); - //} - //ReadXml(text.ToString()); - var p = new FrmProperties(); - p.ShowDialog(); - } - } -} +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Text; +using System.Windows.Forms; +using System.Xml; +using System.Xml.Linq; + +namespace MKVTest +{ + /* Call mkvpropedit.exe + * Edit "Title" detail property: --edit info --set "title=%TITLE%" %FILE% + * Edit video track one: --edit track:v1 --set "name(or language)="%VAR%" %FILE% + * Edit audio track one: --edit track:a1 --set "name(or language)="%VAR%" %FILE% + * To add simply replace "--set" with "--add". + */ + public partial class Form1 : Form + { + public static string Language = "eng"; + private static readonly ContextMenuStrip menu = new ContextMenuStrip(); + + public Form1() + { + InitializeComponent(); + inputFilesListView.ItemSelectionChanged += UpdateFilePropPrediction; + inputFilesListView.MouseClick += ShowMenu; + Resize += Form1_Resize; + + var item = new ToolStripMenuItem + { + Name = "RemoveItem", + Text = @"Remove" + }; + menu.Items.Add(item); + + var inputColumn = new ColumnHeader + { + Text = @"Files", + Name = @"HeaderColumn", + Width = inputFilesListView.Width - 10 + }; + inputFilesListView.Columns.Add(inputColumn); + } + + private void ShowMenu(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Right) + { + if (inputFilesListView.FocusedItem.Bounds.Contains(e.Location)) + { + menu.Show(Cursor.Position); + } + } + } + + private void UpdateFilePropPrediction(object sender, ListViewItemSelectionChangedEventArgs e) + { + var info = new MkvFileInfo(); + var file = info.GetAttributes(e.Item.Name); + flowLayoutPanel1.Controls.Clear(); + flowLayoutPanel1.Invalidate(); + + var titleLabel = new Label + { + Parent = flowLayoutPanel1, + Text = @"Current Title: " + file.SegementInformation?.Title, + AutoSize = true + }; + + flowLayoutPanel1.Container?.Add(titleLabel); + + var videoTrackNumber = 1; + var audioTrackNumber = 1; + var subtitleTrackNumber = 1; + + foreach (var fileTrack in file.Tracks) + { + if (fileTrack.Type == MkvTrack.TrackType.Video) + { + var nameLabel = new Label + { + AutoSize = true, + Text = @"Track:v" + videoTrackNumber + @" Name: " + fileTrack.Name, + Parent = flowLayoutPanel1 + }; + + var languageLabel = new Label + { + AutoSize = true, + Text = @"Track:v" + videoTrackNumber + @" Language: " + fileTrack.Language, + Parent = flowLayoutPanel1 + }; + videoTrackNumber++; + if (flowLayoutPanel1.Container != null) + { + flowLayoutPanel1.Container.Add(nameLabel); + flowLayoutPanel1.Container.Add(languageLabel); + } + } + + if (fileTrack.Type == MkvTrack.TrackType.Audio) + { + var nameLabel = new Label + { + AutoSize = true, + Text = @"Track:a" + audioTrackNumber + @" Name: " + fileTrack.Name, + Parent = flowLayoutPanel1 + }; + var languageLabel = new Label + { + AutoSize = true, + Text = @"Track:a" + audioTrackNumber + @" Language: " + fileTrack.Language, + Parent = flowLayoutPanel1 + }; + audioTrackNumber++; + if (flowLayoutPanel1.Container != null) + { + flowLayoutPanel1.Container.Add(nameLabel); + flowLayoutPanel1.Container.Add(languageLabel); + } + } + + if (fileTrack.Type == MkvTrack.TrackType.Subtitle) + { + var nameLabel = new Label + { + AutoSize = true, + Text = @"Track:s" + subtitleTrackNumber + @" Name: " + fileTrack.Name, + Parent = flowLayoutPanel1 + }; + var languageLabel = new Label + { + AutoSize = true, + Text = @"Track:s" + subtitleTrackNumber + @" Language: " + fileTrack.Language, + Parent = flowLayoutPanel1 + }; + subtitleTrackNumber++; + if (flowLayoutPanel1.Container != null) + { + flowLayoutPanel1.Container.Add(nameLabel); + flowLayoutPanel1.Container.Add(languageLabel); + } + } + } + } + + /// + /// + /// + /// + /// + private string GetEpisodeName(string text) + { + var s = new StringBuilder(); + var hyphenCount = 0; + var index = 0; + var fileExtensionStartPoint = text.LastIndexOf(".", StringComparison.InvariantCulture); + foreach (var c in text) + { + if (c == '-' && hyphenCount != 2) + { + hyphenCount++; + index++; + continue; + } + + if (hyphenCount == 2) + { + if (c == '.' && index == fileExtensionStartPoint) + { + break; + } + s.Append(c); + } + + index++; + } + + return s.ToString().Trim(); + } + + private void ListFiles(string folderPath) + { + var dir = new DirectoryInfo(folderPath); + var files = dir.GetFiles("*.mkv", SearchOption.TopDirectoryOnly); + foreach (var file in files) + { + var node = new ListViewItem + { + Tag = true, //Assume the file needs to be updated. + Name = file.FullName, + Text = file.Name + }; + inputFilesListView.Items.Add(node); + } + + if (inputFilesListView.Items.Count > 0) + { + applyChangesButton.Enabled = true; + } + } + + private void button1_Click(object sender, EventArgs e) + { + var d = new FolderBrowserDialog(); + if (d.ShowDialog() != DialogResult.OK) return; + ClearForm(); + ListFiles(d.SelectedPath); + } + + private void Form1_Resize(object sender, EventArgs e) + { + inputFilesListView.Columns[0].Width = inputFilesListView.Width - 10; + } + + private void applyChangesButton_Click(object sender, EventArgs e) + { + + foreach (ListViewItem node in inputFilesListView.Items) + { + //Check to see if the item has been modified. + if (node.Tag == null || (bool) node.Tag == false) continue; + if (!File.Exists(node.Name)) continue; + var command = "/C mkvpropedit.exe --edit info --set \"title=" + GetEpisodeName(node.Text) + + "\" --edit track:v1 --set \"name=" + GetEpisodeName(node.Text) + + "\" --edit track:v1 --set \"language=eng\" --edit track:a1 --set \"name=English\" --edit track:a1 --set \"language=eng\" \"" + node.Name + "\" > temp.txt"; + var process = new Process(); + var startInfo = new ProcessStartInfo + { + WindowStyle = ProcessWindowStyle.Normal, + FileName = "cmd.exe", + Arguments = command + }; + process.StartInfo = startInfo; + process.Start(); + while (!process.HasExited) + { + + } + if (process.ExitCode == 0) continue; + var error = File.ReadAllLines("temp.txt"); + MessageBox.Show(@"Error on node: " + node.Text + (error.Length > 0 ? Environment.NewLine + error[0] : string.Empty)); + break; + } + + File.Delete("temp.txt"); + } + + private void ClearForm() + { + inputFilesListView.Items.Clear(); + flowLayoutPanel1.Controls.Clear(); + flowLayoutPanel1.Invalidate(); + } + + private void openFolderFileMainMenu_Click(object sender, EventArgs e) + { + var d = new FolderBrowserDialog(); + if (d.ShowDialog() != DialogResult.OK) return; + ClearForm(); + ListFiles(d.SelectedPath); + } + + private void exitToolStripMenuItem_Click(object sender, EventArgs e) => Application.Exit(); + + public static bool CheckFiles() + { + return File.Exists("mkvpropedit.exe") && File.Exists("mkvinfo.exe"); + } + + private void ReadXml(string s) + { + var xReader = new XmlTextReader(new StringReader(s)); + var r = new StringBuilder(); + ClearForm(); + var tags = new List(); + while (xReader.Read()) + { + switch (xReader.NodeType) + { + case XmlNodeType.Element: + //inputFilesListView.Items.Add(xReader.Name + ": " + xReader.Value); + var t = new XmlTag + { + Name = xReader.Name + }; + tags.Add(t); + break; + case XmlNodeType.Text: + //inputFilesListView.Items.Add(xReader.Value); + tags[tags.Count - 1].Value = xReader.Value; + break; + } + } + + foreach (var tag in tags) + { + var label = new Label + { + Text = tag.Name + }; + var textBox = new TextBox + { + Text = tag.Value + }; + if (flowLayoutPanel1.Container != null) + { + flowLayoutPanel1.Container.Add(label); + flowLayoutPanel1.Container.Add(textBox); + } + //inputFilesListView.Items.Add(tag.Name + ": " + tag.Value); + } + } + + private void debugToolStripMenuItem_Click(object sender, EventArgs e) + { + //var xml = new SerializeMkvInfo(); + //var x = xml.SerializeFile("info.txt"); + //var text = new StringBuilder(); + //foreach (var line in x) + //{ + // text.Append(line.Trim()); + //} + //ReadXml(text.ToString()); + var p = new FrmProperties(); + p.ShowDialog(); + } + } +} diff --git a/MKVTest/Form1.resx b/MKVTest/Form1.resx index f80b0f3..850ff99 100644 --- a/MKVTest/Form1.resx +++ b/MKVTest/Form1.resx @@ -1,123 +1,123 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + \ No newline at end of file diff --git a/MKVTest/FrmProperties.Designer.cs b/MKVTest/FrmProperties.Designer.cs index 06fad6e..09f3fe7 100644 --- a/MKVTest/FrmProperties.Designer.cs +++ b/MKVTest/FrmProperties.Designer.cs @@ -1,185 +1,185 @@ -namespace MKVTest -{ - partial class FrmProperties - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.mainLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); - this.mainMenu = new System.Windows.Forms.MenuStrip(); - this.fileMainMenu = new System.Windows.Forms.ToolStripMenuItem(); - this.videoTrackGroupBox = new System.Windows.Forms.GroupBox(); - this.audioTrackGoupBox = new System.Windows.Forms.GroupBox(); - this.subtitleTrackGroupBox = new System.Windows.Forms.GroupBox(); - this.chapterTrackGroupBox = new System.Windows.Forms.GroupBox(); - this.videoFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel(); - this.audioFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel(); - this.subtitleFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel(); - this.mainLayoutPanel.SuspendLayout(); - this.mainMenu.SuspendLayout(); - this.videoTrackGroupBox.SuspendLayout(); - this.audioTrackGoupBox.SuspendLayout(); - this.subtitleTrackGroupBox.SuspendLayout(); - this.SuspendLayout(); - // - // mainLayoutPanel - // - this.mainLayoutPanel.ColumnCount = 3; - this.mainLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); - this.mainLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33334F)); - this.mainLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33334F)); - this.mainLayoutPanel.Controls.Add(this.mainMenu, 0, 0); - this.mainLayoutPanel.Controls.Add(this.videoTrackGroupBox, 0, 1); - this.mainLayoutPanel.Controls.Add(this.audioTrackGoupBox, 1, 1); - this.mainLayoutPanel.Controls.Add(this.subtitleTrackGroupBox, 2, 1); - this.mainLayoutPanel.Controls.Add(this.chapterTrackGroupBox, 0, 2); - this.mainLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.mainLayoutPanel.Location = new System.Drawing.Point(0, 0); - this.mainLayoutPanel.Name = "mainLayoutPanel"; - this.mainLayoutPanel.RowCount = 3; - this.mainLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); - this.mainLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 75F)); - this.mainLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); - this.mainLayoutPanel.Size = new System.Drawing.Size(515, 406); - this.mainLayoutPanel.TabIndex = 0; - // - // mainMenu - // - this.mainLayoutPanel.SetColumnSpan(this.mainMenu, 3); - this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileMainMenu}); - this.mainMenu.Location = new System.Drawing.Point(0, 0); - this.mainMenu.Name = "mainMenu"; - this.mainMenu.Size = new System.Drawing.Size(515, 24); - this.mainMenu.TabIndex = 0; - this.mainMenu.Text = "menuStrip1"; - // - // fileMainMenu - // - this.fileMainMenu.Name = "fileMainMenu"; - this.fileMainMenu.Size = new System.Drawing.Size(37, 20); - this.fileMainMenu.Text = "&File"; - // - // videoTrackGroupBox - // - this.videoTrackGroupBox.Controls.Add(this.videoFlowLayoutPanel); - this.videoTrackGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.videoTrackGroupBox.Location = new System.Drawing.Point(3, 28); - this.videoTrackGroupBox.Name = "videoTrackGroupBox"; - this.videoTrackGroupBox.Size = new System.Drawing.Size(165, 279); - this.videoTrackGroupBox.TabIndex = 1; - this.videoTrackGroupBox.TabStop = false; - this.videoTrackGroupBox.Text = "Video Track"; - // - // audioTrackGoupBox - // - this.audioTrackGoupBox.Controls.Add(this.audioFlowLayoutPanel); - this.audioTrackGoupBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.audioTrackGoupBox.Location = new System.Drawing.Point(174, 28); - this.audioTrackGoupBox.Name = "audioTrackGoupBox"; - this.audioTrackGoupBox.Size = new System.Drawing.Size(165, 279); - this.audioTrackGoupBox.TabIndex = 2; - this.audioTrackGoupBox.TabStop = false; - this.audioTrackGoupBox.Text = "Audio Tracks"; - // - // subtitleTrackGroupBox - // - this.subtitleTrackGroupBox.Controls.Add(this.subtitleFlowLayoutPanel); - this.subtitleTrackGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.subtitleTrackGroupBox.Location = new System.Drawing.Point(345, 28); - this.subtitleTrackGroupBox.Name = "subtitleTrackGroupBox"; - this.subtitleTrackGroupBox.Size = new System.Drawing.Size(167, 279); - this.subtitleTrackGroupBox.TabIndex = 3; - this.subtitleTrackGroupBox.TabStop = false; - this.subtitleTrackGroupBox.Text = "Subtitles"; - // - // chapterTrackGroupBox - // - this.chapterTrackGroupBox.Location = new System.Drawing.Point(3, 313); - this.chapterTrackGroupBox.Name = "chapterTrackGroupBox"; - this.chapterTrackGroupBox.Size = new System.Drawing.Size(165, 90); - this.chapterTrackGroupBox.TabIndex = 4; - this.chapterTrackGroupBox.TabStop = false; - this.chapterTrackGroupBox.Text = "Chapter Markers"; - // - // videoFlowLayoutPanel - // - this.videoFlowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.videoFlowLayoutPanel.Location = new System.Drawing.Point(3, 16); - this.videoFlowLayoutPanel.Name = "videoFlowLayoutPanel"; - this.videoFlowLayoutPanel.Size = new System.Drawing.Size(159, 260); - this.videoFlowLayoutPanel.TabIndex = 0; - // - // audioFlowLayoutPanel - // - this.audioFlowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.audioFlowLayoutPanel.Location = new System.Drawing.Point(3, 16); - this.audioFlowLayoutPanel.Name = "audioFlowLayoutPanel"; - this.audioFlowLayoutPanel.Size = new System.Drawing.Size(159, 260); - this.audioFlowLayoutPanel.TabIndex = 0; - // - // subtitleFlowLayoutPanel - // - this.subtitleFlowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.subtitleFlowLayoutPanel.Location = new System.Drawing.Point(3, 16); - this.subtitleFlowLayoutPanel.Name = "subtitleFlowLayoutPanel"; - this.subtitleFlowLayoutPanel.Size = new System.Drawing.Size(161, 260); - this.subtitleFlowLayoutPanel.TabIndex = 0; - // - // FrmProperties - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(515, 406); - this.Controls.Add(this.mainLayoutPanel); - this.MainMenuStrip = this.mainMenu; - this.Name = "FrmProperties"; - this.Text = "Properties"; - this.mainLayoutPanel.ResumeLayout(false); - this.mainLayoutPanel.PerformLayout(); - this.mainMenu.ResumeLayout(false); - this.mainMenu.PerformLayout(); - this.videoTrackGroupBox.ResumeLayout(false); - this.audioTrackGoupBox.ResumeLayout(false); - this.subtitleTrackGroupBox.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.TableLayoutPanel mainLayoutPanel; - private System.Windows.Forms.MenuStrip mainMenu; - private System.Windows.Forms.ToolStripMenuItem fileMainMenu; - private System.Windows.Forms.GroupBox videoTrackGroupBox; - private System.Windows.Forms.GroupBox audioTrackGoupBox; - private System.Windows.Forms.GroupBox subtitleTrackGroupBox; - private System.Windows.Forms.GroupBox chapterTrackGroupBox; - private System.Windows.Forms.FlowLayoutPanel videoFlowLayoutPanel; - private System.Windows.Forms.FlowLayoutPanel audioFlowLayoutPanel; - private System.Windows.Forms.FlowLayoutPanel subtitleFlowLayoutPanel; - } +namespace MKVTest +{ + partial class FrmProperties + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.mainLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); + this.mainMenu = new System.Windows.Forms.MenuStrip(); + this.fileMainMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.videoTrackGroupBox = new System.Windows.Forms.GroupBox(); + this.audioTrackGoupBox = new System.Windows.Forms.GroupBox(); + this.subtitleTrackGroupBox = new System.Windows.Forms.GroupBox(); + this.chapterTrackGroupBox = new System.Windows.Forms.GroupBox(); + this.videoFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel(); + this.audioFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel(); + this.subtitleFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel(); + this.mainLayoutPanel.SuspendLayout(); + this.mainMenu.SuspendLayout(); + this.videoTrackGroupBox.SuspendLayout(); + this.audioTrackGoupBox.SuspendLayout(); + this.subtitleTrackGroupBox.SuspendLayout(); + this.SuspendLayout(); + // + // mainLayoutPanel + // + this.mainLayoutPanel.ColumnCount = 3; + this.mainLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); + this.mainLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33334F)); + this.mainLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33334F)); + this.mainLayoutPanel.Controls.Add(this.mainMenu, 0, 0); + this.mainLayoutPanel.Controls.Add(this.videoTrackGroupBox, 0, 1); + this.mainLayoutPanel.Controls.Add(this.audioTrackGoupBox, 1, 1); + this.mainLayoutPanel.Controls.Add(this.subtitleTrackGroupBox, 2, 1); + this.mainLayoutPanel.Controls.Add(this.chapterTrackGroupBox, 0, 2); + this.mainLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.mainLayoutPanel.Location = new System.Drawing.Point(0, 0); + this.mainLayoutPanel.Name = "mainLayoutPanel"; + this.mainLayoutPanel.RowCount = 3; + this.mainLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.mainLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 75F)); + this.mainLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.mainLayoutPanel.Size = new System.Drawing.Size(515, 406); + this.mainLayoutPanel.TabIndex = 0; + // + // mainMenu + // + this.mainLayoutPanel.SetColumnSpan(this.mainMenu, 3); + this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileMainMenu}); + this.mainMenu.Location = new System.Drawing.Point(0, 0); + this.mainMenu.Name = "mainMenu"; + this.mainMenu.Size = new System.Drawing.Size(515, 24); + this.mainMenu.TabIndex = 0; + this.mainMenu.Text = "menuStrip1"; + // + // fileMainMenu + // + this.fileMainMenu.Name = "fileMainMenu"; + this.fileMainMenu.Size = new System.Drawing.Size(37, 20); + this.fileMainMenu.Text = "&File"; + // + // videoTrackGroupBox + // + this.videoTrackGroupBox.Controls.Add(this.videoFlowLayoutPanel); + this.videoTrackGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.videoTrackGroupBox.Location = new System.Drawing.Point(3, 28); + this.videoTrackGroupBox.Name = "videoTrackGroupBox"; + this.videoTrackGroupBox.Size = new System.Drawing.Size(165, 279); + this.videoTrackGroupBox.TabIndex = 1; + this.videoTrackGroupBox.TabStop = false; + this.videoTrackGroupBox.Text = "Video Track"; + // + // audioTrackGoupBox + // + this.audioTrackGoupBox.Controls.Add(this.audioFlowLayoutPanel); + this.audioTrackGoupBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.audioTrackGoupBox.Location = new System.Drawing.Point(174, 28); + this.audioTrackGoupBox.Name = "audioTrackGoupBox"; + this.audioTrackGoupBox.Size = new System.Drawing.Size(165, 279); + this.audioTrackGoupBox.TabIndex = 2; + this.audioTrackGoupBox.TabStop = false; + this.audioTrackGoupBox.Text = "Audio Tracks"; + // + // subtitleTrackGroupBox + // + this.subtitleTrackGroupBox.Controls.Add(this.subtitleFlowLayoutPanel); + this.subtitleTrackGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.subtitleTrackGroupBox.Location = new System.Drawing.Point(345, 28); + this.subtitleTrackGroupBox.Name = "subtitleTrackGroupBox"; + this.subtitleTrackGroupBox.Size = new System.Drawing.Size(167, 279); + this.subtitleTrackGroupBox.TabIndex = 3; + this.subtitleTrackGroupBox.TabStop = false; + this.subtitleTrackGroupBox.Text = "Subtitles"; + // + // chapterTrackGroupBox + // + this.chapterTrackGroupBox.Location = new System.Drawing.Point(3, 313); + this.chapterTrackGroupBox.Name = "chapterTrackGroupBox"; + this.chapterTrackGroupBox.Size = new System.Drawing.Size(165, 90); + this.chapterTrackGroupBox.TabIndex = 4; + this.chapterTrackGroupBox.TabStop = false; + this.chapterTrackGroupBox.Text = "Chapter Markers"; + // + // videoFlowLayoutPanel + // + this.videoFlowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.videoFlowLayoutPanel.Location = new System.Drawing.Point(3, 16); + this.videoFlowLayoutPanel.Name = "videoFlowLayoutPanel"; + this.videoFlowLayoutPanel.Size = new System.Drawing.Size(159, 260); + this.videoFlowLayoutPanel.TabIndex = 0; + // + // audioFlowLayoutPanel + // + this.audioFlowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.audioFlowLayoutPanel.Location = new System.Drawing.Point(3, 16); + this.audioFlowLayoutPanel.Name = "audioFlowLayoutPanel"; + this.audioFlowLayoutPanel.Size = new System.Drawing.Size(159, 260); + this.audioFlowLayoutPanel.TabIndex = 0; + // + // subtitleFlowLayoutPanel + // + this.subtitleFlowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.subtitleFlowLayoutPanel.Location = new System.Drawing.Point(3, 16); + this.subtitleFlowLayoutPanel.Name = "subtitleFlowLayoutPanel"; + this.subtitleFlowLayoutPanel.Size = new System.Drawing.Size(161, 260); + this.subtitleFlowLayoutPanel.TabIndex = 0; + // + // FrmProperties + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(515, 406); + this.Controls.Add(this.mainLayoutPanel); + this.MainMenuStrip = this.mainMenu; + this.Name = "FrmProperties"; + this.Text = "Properties"; + this.mainLayoutPanel.ResumeLayout(false); + this.mainLayoutPanel.PerformLayout(); + this.mainMenu.ResumeLayout(false); + this.mainMenu.PerformLayout(); + this.videoTrackGroupBox.ResumeLayout(false); + this.audioTrackGoupBox.ResumeLayout(false); + this.subtitleTrackGroupBox.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel mainLayoutPanel; + private System.Windows.Forms.MenuStrip mainMenu; + private System.Windows.Forms.ToolStripMenuItem fileMainMenu; + private System.Windows.Forms.GroupBox videoTrackGroupBox; + private System.Windows.Forms.GroupBox audioTrackGoupBox; + private System.Windows.Forms.GroupBox subtitleTrackGroupBox; + private System.Windows.Forms.GroupBox chapterTrackGroupBox; + private System.Windows.Forms.FlowLayoutPanel videoFlowLayoutPanel; + private System.Windows.Forms.FlowLayoutPanel audioFlowLayoutPanel; + private System.Windows.Forms.FlowLayoutPanel subtitleFlowLayoutPanel; + } } \ No newline at end of file diff --git a/MKVTest/FrmProperties.cs b/MKVTest/FrmProperties.cs index c6c04a8..abb3db8 100644 --- a/MKVTest/FrmProperties.cs +++ b/MKVTest/FrmProperties.cs @@ -1,114 +1,114 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using System.Xml; - -namespace MKVTest -{ - public partial class FrmProperties : Form - { - public FrmProperties() - { - InitializeComponent(); - GeneratePropertiesFile(@"C:\Users\glmcc\Desktop\Death Note\Black Lagoon - 1x02 - Mangrove Heaven.mkv"); - ReadPropertiesFile(); - } - - private void GeneratePropertiesFile(string filePath) - { - var command = "/C mkvinfo.exe \"" + filePath + "\" > properties.txt"; - var process = new System.Diagnostics.Process(); - var startInfo = new System.Diagnostics.ProcessStartInfo - { - WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal, - FileName = "cmd.exe", - Arguments = command - }; - process.StartInfo = startInfo; - process.Start(); - while (!process.HasExited) - { - - } - } - - private void ReadPropertiesFile() - { - var serializer = new SerializeMkvInfo(); - var xml = serializer.SerializeFile("properties.txt"); - var text = new StringBuilder(); - foreach (var line in xml) - { - text.Append(line.Trim()); - } - ReadXml(text.ToString()); - } - - private void ReadXml(string s) - { - var xReader = new XmlTextReader(new StringReader(s)); - var r = new StringBuilder(); - ClearForm(); - var tags = new List(); - var subGroup = new GroupBox(); - while (xReader.Read()) - { - switch (xReader.NodeType) - { - case XmlNodeType.Element: - var t = new XmlTag - { - Name = xReader.Name - }; - tags.Add(t); - break; - case XmlNodeType.Text: - tags[tags.Count - 1].Value = xReader.Value; - break; - case XmlNodeType.EndElement: - - tags.Clear(); - break; - } - } - - //foreach (var tag in tags) - //{ - // //Foreach tag create a new row in the table layout panel. - // mainLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 30)); - // var label = new Label - // { - // Text = tag.Name //Static property name. - - // }; - // var textBox = new TextBox - // { - // Text = tag.Value //Allows the user to - // }; - // mainLayoutPanel.Controls.Add(label, 0, mainLayoutPanel.RowCount - 1); - // mainLayoutPanel.Controls.Add(textBox, 0, mainLayoutPanel.RowCount - 1); - //} - } - - private void BuildForm(List tags) - { - - foreach (var tag in tags) - { - - } - } - - private void ClearForm() - { - - } - } -} +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.Xml; + +namespace MKVTest +{ + public partial class FrmProperties : Form + { + public FrmProperties() + { + InitializeComponent(); + GeneratePropertiesFile(@"C:\Users\glmcc\Desktop\Death Note\Black Lagoon - 1x02 - Mangrove Heaven.mkv"); + ReadPropertiesFile(); + } + + private void GeneratePropertiesFile(string filePath) + { + var command = "/C mkvinfo.exe \"" + filePath + "\" > properties.txt"; + var process = new System.Diagnostics.Process(); + var startInfo = new System.Diagnostics.ProcessStartInfo + { + WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal, + FileName = "cmd.exe", + Arguments = command + }; + process.StartInfo = startInfo; + process.Start(); + while (!process.HasExited) + { + + } + } + + private void ReadPropertiesFile() + { + var serializer = new SerializeMkvInfo(); + var xml = serializer.SerializeFile("properties.txt"); + var text = new StringBuilder(); + foreach (var line in xml) + { + text.Append(line.Trim()); + } + ReadXml(text.ToString()); + } + + private void ReadXml(string s) + { + var xReader = new XmlTextReader(new StringReader(s)); + var r = new StringBuilder(); + ClearForm(); + var tags = new List(); + var subGroup = new GroupBox(); + while (xReader.Read()) + { + switch (xReader.NodeType) + { + case XmlNodeType.Element: + var t = new XmlTag + { + Name = xReader.Name + }; + tags.Add(t); + break; + case XmlNodeType.Text: + tags[tags.Count - 1].Value = xReader.Value; + break; + case XmlNodeType.EndElement: + + tags.Clear(); + break; + } + } + + //foreach (var tag in tags) + //{ + // //Foreach tag create a new row in the table layout panel. + // mainLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 30)); + // var label = new Label + // { + // Text = tag.Name //Static property name. + + // }; + // var textBox = new TextBox + // { + // Text = tag.Value //Allows the user to + // }; + // mainLayoutPanel.Controls.Add(label, 0, mainLayoutPanel.RowCount - 1); + // mainLayoutPanel.Controls.Add(textBox, 0, mainLayoutPanel.RowCount - 1); + //} + } + + private void BuildForm(List tags) + { + + foreach (var tag in tags) + { + + } + } + + private void ClearForm() + { + + } + } +} diff --git a/MKVTest/FrmProperties.resx b/MKVTest/FrmProperties.resx index d588226..534ec4d 100644 --- a/MKVTest/FrmProperties.resx +++ b/MKVTest/FrmProperties.resx @@ -1,123 +1,123 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + \ No newline at end of file diff --git a/MKVTest/MKVTest.csproj b/MKVTest/MKVTest.csproj index 76acca5..5abfc6c 100644 --- a/MKVTest/MKVTest.csproj +++ b/MKVTest/MKVTest.csproj @@ -1,107 +1,107 @@ - - - - - Debug - AnyCPU - {A750A634-6881-4083-B909-73EFE4C96802} - WinExe - MKVTest - MKVTest - v4.6.1 - 512 - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - Form - - - Form1.cs - - - Form - - - FrmProperties.cs - - - - - - - - - - - - - Form1.cs - - - FrmProperties.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - - - - PreserveNewest - - - PreserveNewest - - - + + + + + Debug + AnyCPU + {A750A634-6881-4083-B909-73EFE4C96802} + WinExe + MKVTest + MKVTest + v4.6.1 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + Form + + + FrmProperties.cs + + + + + + + + + + + + + Form1.cs + + + FrmProperties.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + PreserveNewest + + + PreserveNewest + + + \ No newline at end of file diff --git a/MKVTest/MkvAttribute.cs b/MKVTest/MkvAttribute.cs index 920b629..6564124 100644 --- a/MKVTest/MkvAttribute.cs +++ b/MKVTest/MkvAttribute.cs @@ -1,14 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace MKVTest -{ - class MkvAttribute - { - public string Name; - public string Value; - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MKVTest +{ + class MkvAttribute + { + public string Name; + public string Value; + } +} diff --git a/MKVTest/MkvFile.cs b/MKVTest/MkvFile.cs index aa40d4c..17f998a 100644 --- a/MKVTest/MkvFile.cs +++ b/MKVTest/MkvFile.cs @@ -1,17 +1,17 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace MKVTest -{ - class MkvFile - { - public List Tracks; - public List Attributes; - public MkvSegmentInformation SegementInformation; - public string FullName; - public string FileName; - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MKVTest +{ + class MkvFile + { + public List Tracks; + public List Attributes; + public MkvSegmentInformation SegementInformation; + public string FullName; + public string FileName; + } +} diff --git a/MKVTest/MkvFileInfo.cs b/MKVTest/MkvFileInfo.cs index a7470ce..97b4823 100644 --- a/MKVTest/MkvFileInfo.cs +++ b/MKVTest/MkvFileInfo.cs @@ -1,114 +1,114 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace MKVTest -{ - class MkvFileInfo - { - - public MkvFile GetAttributes(string filePath) - { - var file = new MkvFile { Tracks = GetShit(filePath, out MkvSegmentInformation info), SegementInformation = info }; - return file; - } - - private static List GetShit(string filePath, out MkvSegmentInformation information) - { - var tracks = new List(); - information = null; - var command = "/C mkvinfo.exe \"" + filePath + "\" > info.txt"; - var process = new System.Diagnostics.Process(); - var startInfo = new System.Diagnostics.ProcessStartInfo - { - WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal, - FileName = "cmd.exe", - Arguments = command - }; - process.StartInfo = startInfo; - if (!Form1.CheckFiles()) - { - MessageBox.Show(@"The two required files, mkvpropedit.exe and mkvinfo.exe are missing from this program's startup folder. These files are required to edit MKV files.", @"Missing Required Files"); - } - process.Start(); - while (!process.HasExited) - { - - } - var info = File.ReadAllLines("info.txt"); - var readingSegInfo = false; - var readingTrack = false; - var track = new MkvTrack(); - for (var i = 0; i < info.Length; i++) - { - if (info[i] == "|+ Segment information") - { - readingSegInfo = true; - readingTrack = false; - continue; - } - - if (info[i] == "| + A track") - { - readingTrack = true; - readingSegInfo = false; - if (track.Name == null && track.Language == null) continue; - tracks.Add(track); - track = new MkvTrack(); - } - - if (readingSegInfo) - { - if (info[i].Contains("Title:")) - { - var index = info[i].IndexOf(":", StringComparison.Ordinal) + 1; - var seg = new MkvSegmentInformation - { - Title = info[i].Substring(index, info[i].Length - index).Trim() - }; - information = seg; - } - } - - if (readingTrack) - { - if (info[i].Contains("Name:")) - { - var index = info[i].IndexOf(":", StringComparison.Ordinal) + 1; - track.Name = info[i].Substring(index, (info[i].Length - index)).Trim(); - if(track.Type == MkvTrack.TrackType.Subtitle) tracks.Add(track); - } - - if (info[i].Contains("Language:")) - { - var index = info[i].IndexOf(":", StringComparison.Ordinal) + 1; - track.Language = info[i].Substring(index, (info[i].Length - index)).Trim(); - } - - if (info[i].Contains("Video track")) - { - track.Type = MkvTrack.TrackType.Video; - } - if (info[i].Contains("Audio track")) - { - track.Type = MkvTrack.TrackType.Audio; - } - if (info[i].Contains("Track type: subtitles")) - { - track.Type = MkvTrack.TrackType.Subtitle; - } - } - } - if (information == null) - { - information = new MkvSegmentInformation(); - } - - return tracks; - } - } -} +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace MKVTest +{ + class MkvFileInfo + { + + public MkvFile GetAttributes(string filePath) + { + var file = new MkvFile { Tracks = GetShit(filePath, out MkvSegmentInformation info), SegementInformation = info }; + return file; + } + + private static List GetShit(string filePath, out MkvSegmentInformation information) + { + var tracks = new List(); + information = null; + var command = "/C mkvinfo.exe \"" + filePath + "\" > info.txt"; + var process = new System.Diagnostics.Process(); + var startInfo = new System.Diagnostics.ProcessStartInfo + { + WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal, + FileName = "cmd.exe", + Arguments = command + }; + process.StartInfo = startInfo; + if (!Form1.CheckFiles()) + { + MessageBox.Show(@"The two required files, mkvpropedit.exe and mkvinfo.exe are missing from this program's startup folder. These files are required to edit MKV files.", @"Missing Required Files"); + } + process.Start(); + while (!process.HasExited) + { + + } + var info = File.ReadAllLines("info.txt"); + var readingSegInfo = false; + var readingTrack = false; + var track = new MkvTrack(); + for (var i = 0; i < info.Length; i++) + { + if (info[i] == "|+ Segment information") + { + readingSegInfo = true; + readingTrack = false; + continue; + } + + if (info[i] == "| + A track") + { + readingTrack = true; + readingSegInfo = false; + if (track.Name == null && track.Language == null) continue; + tracks.Add(track); + track = new MkvTrack(); + } + + if (readingSegInfo) + { + if (info[i].Contains("Title:")) + { + var index = info[i].IndexOf(":", StringComparison.Ordinal) + 1; + var seg = new MkvSegmentInformation + { + Title = info[i].Substring(index, info[i].Length - index).Trim() + }; + information = seg; + } + } + + if (readingTrack) + { + if (info[i].Contains("Name:")) + { + var index = info[i].IndexOf(":", StringComparison.Ordinal) + 1; + track.Name = info[i].Substring(index, (info[i].Length - index)).Trim(); + if(track.Type == MkvTrack.TrackType.Subtitle) tracks.Add(track); + } + + if (info[i].Contains("Language:")) + { + var index = info[i].IndexOf(":", StringComparison.Ordinal) + 1; + track.Language = info[i].Substring(index, (info[i].Length - index)).Trim(); + } + + if (info[i].Contains("Video track")) + { + track.Type = MkvTrack.TrackType.Video; + } + if (info[i].Contains("Audio track")) + { + track.Type = MkvTrack.TrackType.Audio; + } + if (info[i].Contains("Track type: subtitles")) + { + track.Type = MkvTrack.TrackType.Subtitle; + } + } + } + if (information == null) + { + information = new MkvSegmentInformation(); + } + + return tracks; + } + } +} diff --git a/MKVTest/MkvSegmentInformation.cs b/MKVTest/MkvSegmentInformation.cs index c77d602..ed6c429 100644 --- a/MKVTest/MkvSegmentInformation.cs +++ b/MKVTest/MkvSegmentInformation.cs @@ -1,13 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace MKVTest -{ - class MkvSegmentInformation - { - public string Title; - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MKVTest +{ + class MkvSegmentInformation + { + public string Title; + } +} diff --git a/MKVTest/MkvTrack.cs b/MKVTest/MkvTrack.cs index 1bbb152..4274646 100644 --- a/MKVTest/MkvTrack.cs +++ b/MKVTest/MkvTrack.cs @@ -1,25 +1,25 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace MKVTest -{ - class MkvTrack - { - public string Name; - public string Language; - public TrackType Type; - - - - public enum TrackType - { - Video = 1, - Audio = 2, - Subtitle = 3, - Unkown = 0 - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MKVTest +{ + class MkvTrack + { + public string Name; + public string Language; + public TrackType Type; + + + + public enum TrackType + { + Video = 1, + Audio = 2, + Subtitle = 3, + Unkown = 0 + } + } +} diff --git a/MKVTest/MkvWriter.cs b/MKVTest/MkvWriter.cs index 7569efa..cfdec6a 100644 --- a/MKVTest/MkvWriter.cs +++ b/MKVTest/MkvWriter.cs @@ -1,44 +1,44 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace MKVTest -{ - class MkvWriter - { - - public bool WriteMkvMetaData(string commandString) - { - var process = new Process(); - var startInfo = new ProcessStartInfo - { - WindowStyle = ProcessWindowStyle.Normal, - FileName = "cmd.exe", - Arguments = commandString - }; - if (!CheckFiles()) - { - throw new FileNotFoundException("Required files, mkvpropedit.exe and mkvinfo.exe not found."); - } - process.StartInfo = startInfo; - process.Start(); - while (!process.HasExited) - { - - } - if (process.ExitCode == 0) return true; - var error = File.ReadAllLines("temp.txt"); - throw new ApplicationException(error.ToString()); - } - - public static bool CheckFiles() - { - return File.Exists("mkvpropedit.exe") && File.Exists("mkvinfo.exe"); - } - } -} +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace MKVTest +{ + class MkvWriter + { + + public bool WriteMkvMetaData(string commandString) + { + var process = new Process(); + var startInfo = new ProcessStartInfo + { + WindowStyle = ProcessWindowStyle.Normal, + FileName = "cmd.exe", + Arguments = commandString + }; + if (!CheckFiles()) + { + throw new FileNotFoundException("Required files, mkvpropedit.exe and mkvinfo.exe not found."); + } + process.StartInfo = startInfo; + process.Start(); + while (!process.HasExited) + { + + } + if (process.ExitCode == 0) return true; + var error = File.ReadAllLines("temp.txt"); + throw new ApplicationException(error.ToString()); + } + + public static bool CheckFiles() + { + return File.Exists("mkvpropedit.exe") && File.Exists("mkvinfo.exe"); + } + } +} diff --git a/MKVTest/Program.cs b/MKVTest/Program.cs index 4b8be12..8fddf00 100644 --- a/MKVTest/Program.cs +++ b/MKVTest/Program.cs @@ -1,22 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace MKVTest -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace MKVTest +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/MKVTest/Properties/AssemblyInfo.cs b/MKVTest/Properties/AssemblyInfo.cs index e718c8f..70eb862 100644 --- a/MKVTest/Properties/AssemblyInfo.cs +++ b/MKVTest/Properties/AssemblyInfo.cs @@ -1,36 +1,36 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("MKVTest")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("MKVTest")] -[assembly: AssemblyCopyright("Copyright © 2017")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("a750a634-6881-4083-b909-73efe4c96802")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.0.0")] -[assembly: AssemblyFileVersion("1.1.0.0")] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MKVTest")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MKVTest")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a750a634-6881-4083-b909-73efe4c96802")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.1.0.0")] +[assembly: AssemblyFileVersion("1.1.0.0")] diff --git a/MKVTest/Properties/Resources.Designer.cs b/MKVTest/Properties/Resources.Designer.cs index c3b5087..d1f3626 100644 --- a/MKVTest/Properties/Resources.Designer.cs +++ b/MKVTest/Properties/Resources.Designer.cs @@ -1,71 +1,71 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace MKVTest.Properties -{ - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MKVTest.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace MKVTest.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MKVTest.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/MKVTest/Properties/Resources.resx b/MKVTest/Properties/Resources.resx index af7dbeb..ffecec8 100644 --- a/MKVTest/Properties/Resources.resx +++ b/MKVTest/Properties/Resources.resx @@ -1,117 +1,117 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/MKVTest/Properties/Settings.Designer.cs b/MKVTest/Properties/Settings.Designer.cs index 3fe9777..6e2ff6d 100644 --- a/MKVTest/Properties/Settings.Designer.cs +++ b/MKVTest/Properties/Settings.Designer.cs @@ -1,30 +1,30 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace MKVTest.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace MKVTest.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/MKVTest/Properties/Settings.settings b/MKVTest/Properties/Settings.settings index 3964565..abf36c5 100644 --- a/MKVTest/Properties/Settings.settings +++ b/MKVTest/Properties/Settings.settings @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/MKVTest/SerializeMkvInfo.cs b/MKVTest/SerializeMkvInfo.cs index 3c775ce..4698c22 100644 --- a/MKVTest/SerializeMkvInfo.cs +++ b/MKVTest/SerializeMkvInfo.cs @@ -1,191 +1,191 @@ -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; - -namespace MKVTest -{ - internal class SerializeMkvInfo - { - public List SerializeFile(string filePath) - { - var file = File.ReadAllLines(filePath); - if (file.Length == 0) return new List(); - var lastDepthLevel = 0; - //var xml = new StringBuilder(); - var stack = new Stack(); - var xml = new List {""}; - //Create a root node for the file. - var rootNode = new XmlTag() - { - Name = "File" - }; - stack.Push(rootNode); - for (var i = 0; i < file.Length; i++) - { - var depth = GetDepth(file[i]); - var tag = CreateTagFromString(file[i], depth); - var padding = new StringBuilder(); - for (var j = tag.Depth - 1; j > 0; j--) - { - padding.Append(" "); - } - if (i == file.Length - 1) - { - var t = stack.Pop(); - xml.Insert(xml.Count - 1, padding + "<" + t.Name + ">" + t.Value + ""); - xml[xml.Count - 1] = padding + "<" + tag.Name + ">" + tag.Value + ""; - //Unwind the stack. - xml.AddRange(stack.Select(s => "")); - - continue; - } - if (depth == lastDepthLevel) - { - if (stack.Count != 0) - { - var t = stack.Pop(); - xml[xml.Count - 1] = padding + "<" + t.Name + ">" + t.Value + ""; - } - } - else if (depth < lastDepthLevel) - { - //Moving up - if (stack.Count != 0) - { - var t = stack.Pop(); - xml[xml.Count - 1] = padding + "<" + t.Name + ">" + t.Value + ""; - var diff = lastDepthLevel - depth; - var subPadding = new StringBuilder(); - for (var j = 0; j < diff; j++) - { - subPadding.Clear(); - var subTag = stack.Pop(); - for (var k = subTag.Depth - 1; k != 0; k--) - { - subPadding.Append(" "); - } - if (stack.Count != 0) - { - xml.Add(subPadding + ""); - } - else - { - break; - } - } - } - } - if(tag.Name != string.Empty) xml.Add(padding + "<" + tag.Name + ">"); - stack.Push(tag); - lastDepthLevel = depth; - } - //File.WriteAllLines(@"C:\Users\glmcc\Desktop\Test.info", xml); - return xml; - } - - private static XmlTag CreateTagFromString(string text, int tagDepth) - { - var tag = new XmlTag(); - var clearingPadding = true; - var foundDelimiter = false; - var insideBraces = false; - var name = new StringBuilder(); - var value = new StringBuilder(); - //var attributes = new List(); - - for (var i = 0; i < text.Length; i++) - { - if ((char.IsSymbol(text[i]) || char.IsPunctuation(text[i]) || char.IsWhiteSpace(text[i])) && clearingPadding) - { - continue; - } - - if ((text[i].ToString() == ":" || text[i] == ',') && !foundDelimiter) - { - foundDelimiter = true; - continue; - } - - clearingPadding = false; - if (foundDelimiter) - { - if (text[i] == '(') - { - insideBraces = true; - continue; - } - if (insideBraces && text[i] == ')') - { - insideBraces = false; - continue; - } - - if(!insideBraces) value.Append(text[i]); - } - else - { - if (text[i] == '(') - { - insideBraces = true; - continue; - } - if(text[i] == ')') - { - insideBraces = false; - continue; - } - if(!insideBraces) name.Append(text[i]); - } - } - tag.Name = FormatTagName(name.ToString()); - tag.Value = value.ToString().Trim(); - tag.Depth = tagDepth; - - return tag; - } - - private static string FormatTagName(string text) - { - if (text.Length == 0) return string.Empty; - var name = new StringBuilder(); - var previousCharWasWhiteSpace = false; - - foreach (var c in text) - { - if (!char.IsWhiteSpace(c)) - { - name.Append(previousCharWasWhiteSpace ? char.ToUpper(c) : c); - previousCharWasWhiteSpace = false; - } - - if (char.IsWhiteSpace(c)) - { - previousCharWasWhiteSpace = true; - } - } - - return name.ToString(); - } - - private static int GetDepth(string line) - { - if (line.Length == 0) return -1; - var depth = 0; - - for (var i = 0; i < line.Length; i++) - { - if (char.IsPunctuation(line[i]) || char.IsWhiteSpace(line[i]) || char.IsSymbol(line[i])) - { - depth++; - } - else - { - break; - } - } - - return depth; - } - } -} +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; + +namespace MKVTest +{ + internal class SerializeMkvInfo + { + public List SerializeFile(string filePath) + { + var file = File.ReadAllLines(filePath); + if (file.Length == 0) return new List(); + var lastDepthLevel = 0; + //var xml = new StringBuilder(); + var stack = new Stack(); + var xml = new List {""}; + //Create a root node for the file. + var rootNode = new XmlTag() + { + Name = "File" + }; + stack.Push(rootNode); + for (var i = 0; i < file.Length; i++) + { + var depth = GetDepth(file[i]); + var tag = CreateTagFromString(file[i], depth); + var padding = new StringBuilder(); + for (var j = tag.Depth - 1; j > 0; j--) + { + padding.Append(" "); + } + if (i == file.Length - 1) + { + var t = stack.Pop(); + xml.Insert(xml.Count - 1, padding + "<" + t.Name + ">" + t.Value + ""); + xml[xml.Count - 1] = padding + "<" + tag.Name + ">" + tag.Value + ""; + //Unwind the stack. + xml.AddRange(stack.Select(s => "")); + + continue; + } + if (depth == lastDepthLevel) + { + if (stack.Count != 0) + { + var t = stack.Pop(); + xml[xml.Count - 1] = padding + "<" + t.Name + ">" + t.Value + ""; + } + } + else if (depth < lastDepthLevel) + { + //Moving up + if (stack.Count != 0) + { + var t = stack.Pop(); + xml[xml.Count - 1] = padding + "<" + t.Name + ">" + t.Value + ""; + var diff = lastDepthLevel - depth; + var subPadding = new StringBuilder(); + for (var j = 0; j < diff; j++) + { + subPadding.Clear(); + var subTag = stack.Pop(); + for (var k = subTag.Depth - 1; k != 0; k--) + { + subPadding.Append(" "); + } + if (stack.Count != 0) + { + xml.Add(subPadding + ""); + } + else + { + break; + } + } + } + } + if(tag.Name != string.Empty) xml.Add(padding + "<" + tag.Name + ">"); + stack.Push(tag); + lastDepthLevel = depth; + } + //File.WriteAllLines(@"C:\Users\glmcc\Desktop\Test.info", xml); + return xml; + } + + private static XmlTag CreateTagFromString(string text, int tagDepth) + { + var tag = new XmlTag(); + var clearingPadding = true; + var foundDelimiter = false; + var insideBraces = false; + var name = new StringBuilder(); + var value = new StringBuilder(); + //var attributes = new List(); + + for (var i = 0; i < text.Length; i++) + { + if ((char.IsSymbol(text[i]) || char.IsPunctuation(text[i]) || char.IsWhiteSpace(text[i])) && clearingPadding) + { + continue; + } + + if ((text[i].ToString() == ":" || text[i] == ',') && !foundDelimiter) + { + foundDelimiter = true; + continue; + } + + clearingPadding = false; + if (foundDelimiter) + { + if (text[i] == '(') + { + insideBraces = true; + continue; + } + if (insideBraces && text[i] == ')') + { + insideBraces = false; + continue; + } + + if(!insideBraces) value.Append(text[i]); + } + else + { + if (text[i] == '(') + { + insideBraces = true; + continue; + } + if(text[i] == ')') + { + insideBraces = false; + continue; + } + if(!insideBraces) name.Append(text[i]); + } + } + tag.Name = FormatTagName(name.ToString()); + tag.Value = value.ToString().Trim(); + tag.Depth = tagDepth; + + return tag; + } + + private static string FormatTagName(string text) + { + if (text.Length == 0) return string.Empty; + var name = new StringBuilder(); + var previousCharWasWhiteSpace = false; + + foreach (var c in text) + { + if (!char.IsWhiteSpace(c)) + { + name.Append(previousCharWasWhiteSpace ? char.ToUpper(c) : c); + previousCharWasWhiteSpace = false; + } + + if (char.IsWhiteSpace(c)) + { + previousCharWasWhiteSpace = true; + } + } + + return name.ToString(); + } + + private static int GetDepth(string line) + { + if (line.Length == 0) return -1; + var depth = 0; + + for (var i = 0; i < line.Length; i++) + { + if (char.IsPunctuation(line[i]) || char.IsWhiteSpace(line[i]) || char.IsSymbol(line[i])) + { + depth++; + } + else + { + break; + } + } + + return depth; + } + } +} diff --git a/MKVTest/XmlTag.cs b/MKVTest/XmlTag.cs index 94dce35..bea36e6 100644 --- a/MKVTest/XmlTag.cs +++ b/MKVTest/XmlTag.cs @@ -1,15 +1,15 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace MKVTest -{ - class XmlTag - { - public string Name; - public string Value; - public int Depth; - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MKVTest +{ + class XmlTag + { + public string Name; + public string Value; + public int Depth; + } +} diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..4302380 --- /dev/null +++ b/readme.md @@ -0,0 +1,7 @@ +A program I slapped together to see if I could perform or automate batch operations on MKV meta-data. + +Nothing to complex, all this really is is a 'GUI' for the MKVTools. Keeping this only as a reference +if I decide to revisit this, unlikely as that may be. Again this repo is just for me to preserve some +of my old projects that are now inactive. + +Originally this repo existed in BitBucket. \ No newline at end of file