Created a properties form, testing dynamic UI building for the relevant MKV attributes.
This commit is contained in:
@@ -0,0 +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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user