Click here to Skip to main content
15,893,814 members
Articles / Programming Languages / C#

Convert MP3, MPEG, AVI to Windows Media Formats

Rate me:
Please Sign up or sign in to vote.
4.34/5 (27 votes)
30 May 2005CPOL8 min read 383.8K   11.8K   113  
Video conversion has never been this simple. Use the new Windows Media Encoder to convert different video and audio formats to stream Microsoft audio video standard formats like WMV and WMA.
using WMEncoderLib;
using WMPREVIEWLib;
using System.IO;
using System.Drawing;
using System;
using System.Data;
using System.Windows.Forms;
using System.Collections;
using System.ComponentModel;
namespace ConvertVideoFileFormats
{
	public class Form_BatchEncode : System.Windows.Forms.Form
	{
		const string strAppName = "Windows Media Batch Encoder Sample";
		const string strAppCopyright = "";
		const string strNoEncode = "Skip";
	
		WMEncoder glbEncoder = new WMEncoder();
		IWMEncSourceGroupCollection SrcGrpColl = null;
		long glblongPostviewStream;
		private struct strucEncodeInfo
		{
			public string Source;
			public string Destination;
			public string Profile;
			public string DRMProfile;
			public string Title;
			public string Description;
			public string Author;
			public string Copyright;
			public bool Crop;
			public long CropLeft;
			public long CropTop;
			public long CropRight;
			public long CropBottom;
			public WMENC_VIDEO_OPTIMIZATION Preproc;
			public bool TwoPass;
		}
		int glbintSourceDuration;
		string glbstrSessionFileName = "";
		string glbstrErrLocation;
		string glbstrStatusPercentComplete = "";
		bool glbTwoPassEncoding = false;
		int glbPassNumber;
		bool glbboolSessionDirty = false;
		bool glbboolAppStart = true;
		bool glbLogErrors;
		bool glbboolStartNext = true;
		bool glbboolBatchComplete;
		bool glbboolSrcGrpColl = false;
		bool glbboolEncodingContinue = true;
		bool glbboolStopButtonPressed = false;
		string glbboolCurrentFileStatus = "Encoded";
		const WMENC_VIDEO_OPTIMIZATION optSTANDARD = WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_STANDARD;
		const WMENC_VIDEO_OPTIMIZATION optDEINTERLACE = WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_DEINTERLACE;
		const WMENC_VIDEO_OPTIMIZATION optTELECINE_AUTO = WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_INVERSETELECINE | WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_INVERSETELECINE;
		const WMENC_VIDEO_OPTIMIZATION optTELECINE_AA_TOP = WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_INVERSETELECINE | WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_TELECINE_AA_TOP;
		const WMENC_VIDEO_OPTIMIZATION optTELECINE_BB_TOP = WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_INVERSETELECINE | WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_TELECINE_BB_TOP;
		const WMENC_VIDEO_OPTIMIZATION optTELECINE_BC_TOP = WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_INVERSETELECINE | WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_TELECINE_BC_TOP;
		const WMENC_VIDEO_OPTIMIZATION optTELECINE_CD_TOP = WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_INVERSETELECINE | WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_TELECINE_CD_TOP;
		const WMENC_VIDEO_OPTIMIZATION optTELECINE_DD_TOP = WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_INVERSETELECINE | WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_TELECINE_DD_TOP;
		const WMENC_VIDEO_OPTIMIZATION optTELECINE_AA_BOTTOM = WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_INVERSETELECINE | WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_TELECINE_AA_BOTTOM;
		const WMENC_VIDEO_OPTIMIZATION optTELECINE_BB_BOTTOM = WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_INVERSETELECINE | WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_TELECINE_BB_BOTTOM;
		const WMENC_VIDEO_OPTIMIZATION optTELECINE_BC_BOTTOM = WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_INVERSETELECINE | WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_TELECINE_BC_BOTTOM;
		const WMENC_VIDEO_OPTIMIZATION optTELECINE_CD_BOTTOM = WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_INVERSETELECINE | WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_TELECINE_CD_BOTTOM;
		const WMENC_VIDEO_OPTIMIZATION optTELECINE_DD_BOTTOM = WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_INVERSETELECINE | WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_TELECINE_DD_BOTTOM;
		const WMENC_VIDEO_OPTIMIZATION optINTERLACED_AUTO = WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_PROCESS_INTERLACED | WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_INTERLACED_AUTO;
		const WMENC_VIDEO_OPTIMIZATION optINTERLACED_TOP_FIRST = WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_PROCESS_INTERLACED | WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_INTERLACED_TOP_FIRST;
		const WMENC_VIDEO_OPTIMIZATION optINTERLACED_BOTTOM_FIRST = WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_PROCESS_INTERLACED | WMENC_VIDEO_OPTIMIZATION.WMENC_VIDEO_INTERLACED_BOTTOM_FIRST;
		private const short BIF_RETURNONLYFSDIRS = 1;
		private const short BIF_DONTGOBELOWDOMAIN = 2;
		private const short MAX_PATH = 260;
		[System.Runtime.InteropServices.DllImport("shell32")]
		private static extern int SHBrowseForFolder(ref Form_BatchEncode.BrowseInfo lpbi);
		[System.Runtime.InteropServices.DllImport("shell32")]
		private static extern int SHGetPathFromIDList(int pidList,System.Text.StringBuilder lpBuffer);
		[System.Runtime.InteropServices.DllImport("kernel32", EntryPoint="lstrcatA")]
		private static extern int lstrcat(string lpString1, string lpString2);
		private struct BrowseInfo
		{
			public int hWndOwner;
			public int pIDLRoot;
			public int pszDisplayName;
			public int lpszTitle;
			public int ulFlags;
			public int lpfnCallback;
			public int lParam;
			public int iImage;
		}

		public Form_BatchEncode():base()
		{
		
			InitializeComponent();
		}

		protected override void Dispose(bool disposing)
		{
			if (disposing) 
			{
				if (!((components == null))) 
				{
					components.Dispose();
				}
			}
			base.Dispose(disposing);
		}
		private System.ComponentModel.IContainer components;
		internal System.Windows.Forms.MainMenu MainMenu1;
		internal System.Windows.Forms.MenuItem MenuItem_Open;
		internal System.Windows.Forms.MenuItem MenuItem_File;
		internal System.Windows.Forms.MenuItem MenuItem_SaveAs;
		internal System.Windows.Forms.MenuItem MenuItem_Save;
		internal System.Windows.Forms.MenuItem MenuItem_Exit;
		internal System.Windows.Forms.MenuItem MenuItem_Help;
		internal System.Windows.Forms.MenuItem MenuItem_About;
		internal System.Windows.Forms.Label Label_Profile;
		internal System.Windows.Forms.ComboBox ComboBox_PreProc;
		internal System.Windows.Forms.Label Label_PreProc;
		internal System.Windows.Forms.TextBox TextBox_Destination;
		internal System.Windows.Forms.ComboBox ComboBox_DRMProfile;
		internal System.Windows.Forms.Button Button_FileOpenDestination;
		internal System.Windows.Forms.Label Label_DRMProfile;
		internal System.Windows.Forms.Label Label_Title;
		internal System.Windows.Forms.TextBox TextBox_Title;
		internal System.Windows.Forms.Label Label_Description;
		internal System.Windows.Forms.Label Label_Copyright;
		internal System.Windows.Forms.TextBox TextBox_Description;
		internal System.Windows.Forms.TextBox TextBox_Copyright;
		internal System.Windows.Forms.Label Label_Author;
		internal System.Windows.Forms.TextBox TextBox_Author;
		internal System.Windows.Forms.Button Button_Add;
		internal System.Windows.Forms.Button Button_Remove;
		internal System.Windows.Forms.Button Button_RemoveAll;
		internal System.Windows.Forms.Button Button_Start;
		internal System.Windows.Forms.DataGrid DataGrid_Batch;
		internal System.Windows.Forms.Button Button_Stop;
		internal System.Data.DataSet DataSet_Batch;
		internal System.Data.DataTable DataTable_Batch;
		internal System.Data.DataColumn DataColumn_Status;
		internal System.Data.DataColumn DataColumn_Source;
		internal System.Data.DataColumn DataColumn_Destination;
		internal System.Data.DataColumn DataColumn_Profile;
		internal System.Data.DataColumn DataColumn_PreProc;
		internal System.Data.DataColumn DataColumn_DRMProfile;
		internal System.Data.DataColumn DataColumn_Title;
		internal System.Data.DataColumn DataColumn_Description;
		internal System.Data.DataColumn DataColumn_Author;
		internal System.Data.DataColumn DataColumn_Copyright;
		internal System.Data.DataColumn DataColumn_TwoPass;
		internal System.Data.DataSet DataSet_Error;
		internal System.Data.DataTable DataTable_Error;
		internal System.Data.DataColumn DataColumn_ErrorID;
		internal System.Data.DataColumn DataColumn_ErrorString;
		internal System.Data.DataColumn DataColumn_ErrorLocation;
		internal System.Windows.Forms.GroupBox GroupBox_Crop;
		internal System.Data.DataTable DataTable_Default;
		internal System.Data.DataColumn DataColumn_DestinationDefault;
		internal System.Data.DataColumn DataColumn_ProfileDefault;
		internal System.Data.DataColumn DataColumn_PreprocessingDefault;
		internal System.Data.DataColumn DataColumn_TitleDefault;
		internal System.Data.DataColumn DataColumn_DescriptionDefault;
		internal System.Data.DataColumn DataColumn_AuthorDefault;
		internal System.Data.DataColumn DataColumn_CopyrightDefault;
		internal System.Data.DataColumn DataColumn_TwoPassDefault;
		internal System.Data.DataColumn DataColumn_PreviewDefault;
		internal System.Data.DataColumn DataColumn_CropBottomDefault;
		internal System.Data.DataColumn DataColumn_CropRightDefault;
		internal System.Data.DataColumn DataColumn_CropLeftDefault;
		internal System.Data.DataColumn DataColumn_CropTopDefault;
		internal System.Data.DataColumn DataColumn_CropEnableDefault;
		internal System.Windows.Forms.StatusBar StatusBar_Status;
		internal System.Windows.Forms.Button Button_RemoveSource;
		internal System.Windows.Forms.Button Button_SourceRemoveAll;
		internal System.Windows.Forms.MenuItem MenuItem_CurrentAsDefault;
		internal System.Windows.Forms.MenuItem MenuItem_Tools;
		internal System.Windows.Forms.Label Label_OutputFolder;
		internal System.Data.DataColumn DataColumn_ContentID;
		internal System.Windows.Forms.Button Button_FileOpenSource;
		internal System.Windows.Forms.ListBox ListBox_Source;
		internal System.Windows.Forms.GroupBox GroupBox_Sources;
		internal System.Windows.Forms.Label Label_OutputString;
		internal System.Windows.Forms.TextBox TextBox_OutputString;
		internal System.Data.DataSet DataSet_Default;
		internal System.Data.DataColumn DataColumn_OutputStringDefault;
		internal System.Windows.Forms.Timer Timer_PercentComplete;
		internal System.Windows.Forms.StatusBarPanel StatusBarPanel_PercentComplete;
		internal System.Windows.Forms.CheckBox CheckBox_TwoPass;
		internal System.Windows.Forms.MenuItem MenuItem_LogErrors;
		internal System.Windows.Forms.DataGridTableStyle DataGridTableStyle1;
		internal System.Windows.Forms.DataGridTextBoxColumn DataGridTextBoxColumn_Status;
		internal System.Windows.Forms.DataGridTextBoxColumn DataGridTextBoxColumn_ContentID;
		internal System.Windows.Forms.DataGridTextBoxColumn DataGridTextBoxColumn_Source;
		internal System.Windows.Forms.DataGridTextBoxColumn DataGridTextBoxColumn_Destination;
		internal System.Windows.Forms.DataGridTextBoxColumn DataGridTextBoxColumn_Profile;
		internal System.Windows.Forms.DataGridTextBoxColumn DataGridTextBoxColumn_PreProc;
		internal System.Windows.Forms.DataGridTextBoxColumn DataGridTextBoxColumn_DRMProfile;
		internal System.Windows.Forms.DataGridTextBoxColumn DataGridTextBoxColumn_Title;
		internal System.Windows.Forms.DataGridTextBoxColumn DataGridTextBoxColumn_Description;
		internal System.Windows.Forms.DataGridTextBoxColumn DataGridTextBoxColumn_Author;
		internal System.Windows.Forms.DataGridTextBoxColumn DataGridTextBoxColumn_Copyright;
		internal System.Windows.Forms.DataGridBoolColumn DataGridBoolColumn_Crop;
		internal System.Windows.Forms.DataGridTextBoxColumn DataGridTextBoxColumn_CropLeft;
		internal System.Windows.Forms.DataGridTextBoxColumn DataGridTextBoxColumn_CropTop;
		internal System.Windows.Forms.DataGridTextBoxColumn DataGridTextBoxColumn_CropRight;
		internal System.Windows.Forms.DataGridTextBoxColumn DataGridTextBoxColumn_CropBottom;
		internal System.Windows.Forms.DataGridBoolColumn DataGridBoolColumn_TwoPass;
		internal System.Data.DataColumn DataColumn_CropBottom;
		internal System.Data.DataColumn DataColumn_CropRight;
		internal System.Data.DataColumn DataColumn_CropTop;
		internal System.Data.DataColumn DataColumn_CropLeft;
		internal System.Data.DataColumn DataColumn_Crop;
		internal System.Windows.Forms.StatusBarPanel StatusBarPanel_Content;
		internal System.Windows.Forms.StatusBarPanel StatusBarPanel_EncoderRunState;
		internal System.Windows.Forms.CheckBox CheckBox_Crop;
		internal System.Windows.Forms.NumericUpDown NumericUpDown_CropTop;
		internal System.Windows.Forms.NumericUpDown NumericUpDown_CropLeft;
		internal System.Windows.Forms.NumericUpDown NumericUpDown_CropRight;
		internal System.Windows.Forms.NumericUpDown NumericUpDown_CropBottom;
		internal System.Windows.Forms.Label Label_CropLeft;
		internal System.Windows.Forms.Label Label_CropTop;
		internal System.Windows.Forms.Label Label_CropRight;
		internal System.Windows.Forms.Label Label_CropBottom;
		internal System.Windows.Forms.TextBox TextBox_Profile;
		internal System.Windows.Forms.Button Button_SelectProfile;
		internal System.Data.DataColumn DataColumn_DestinationSession;
		internal System.Data.DataTable DataTable_SessionInfo;
		internal System.Data.DataColumn DataColumn_ErrorLogSession;
		internal System.Data.DataColumn DataColumn_OutputStringSession;
		internal System.Data.DataColumn DataColumn_PreviewSession;
		internal System.Data.DataColumn DataColumn_TwoPassSession;
		internal System.Data.DataColumn DataColumn_CropBottomSession;
		internal System.Data.DataColumn DataColumn_CropRightSession;
		internal System.Data.DataColumn DataColumn_CropLeftSession;
		internal System.Data.DataColumn DataColumn_CropTopSession;
		internal System.Data.DataColumn DataColumn_CropEnableSession;
		internal System.Data.DataColumn DataColumn_CopyrightSession;
		internal System.Data.DataColumn DataColumn_AuthorSession;
		internal System.Data.DataColumn DataColumn_DescriptionSession;
		internal System.Data.DataColumn DataColumn_TitleSession;
		internal System.Data.DataColumn DataColumn_PreprocessingSession;
		internal System.Data.DataColumn DataColumn_ProfileSession;
		internal System.Data.DataColumn DataColumn_DRMProfileDefault;
		internal System.Data.DataColumn DataColumn_DRMProfileSession;
		internal System.Data.DataColumn DataColumn_ErrorLogDefault;
		internal System.Data.DataColumn DataColumn_SourceList;
		internal System.Data.DataTable DataTable_SourceList;
		internal System.Data.DataColumn DataColumn_TwoPassEnableSession;

		[System.Diagnostics.DebuggerStepThrough()]
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form_BatchEncode));
			this.MainMenu1 = new System.Windows.Forms.MainMenu();
			this.MenuItem_File = new System.Windows.Forms.MenuItem();
			this.MenuItem_Open = new System.Windows.Forms.MenuItem();
			this.MenuItem_Save = new System.Windows.Forms.MenuItem();
			this.MenuItem_SaveAs = new System.Windows.Forms.MenuItem();
			this.MenuItem_Exit = new System.Windows.Forms.MenuItem();
			this.MenuItem_Tools = new System.Windows.Forms.MenuItem();
			this.MenuItem_CurrentAsDefault = new System.Windows.Forms.MenuItem();
			this.MenuItem_LogErrors = new System.Windows.Forms.MenuItem();
			this.MenuItem_Help = new System.Windows.Forms.MenuItem();
			this.MenuItem_About = new System.Windows.Forms.MenuItem();
			this.Label_Profile = new System.Windows.Forms.Label();
			this.GroupBox_Crop = new System.Windows.Forms.GroupBox();
			this.NumericUpDown_CropBottom = new System.Windows.Forms.NumericUpDown();
			this.NumericUpDown_CropRight = new System.Windows.Forms.NumericUpDown();
			this.NumericUpDown_CropLeft = new System.Windows.Forms.NumericUpDown();
			this.NumericUpDown_CropTop = new System.Windows.Forms.NumericUpDown();
			this.Label_CropBottom = new System.Windows.Forms.Label();
			this.Label_CropRight = new System.Windows.Forms.Label();
			this.Label_CropTop = new System.Windows.Forms.Label();
			this.Label_CropLeft = new System.Windows.Forms.Label();
			this.CheckBox_Crop = new System.Windows.Forms.CheckBox();
			this.ComboBox_PreProc = new System.Windows.Forms.ComboBox();
			this.Label_PreProc = new System.Windows.Forms.Label();
			this.Button_FileOpenDestination = new System.Windows.Forms.Button();
			this.TextBox_Destination = new System.Windows.Forms.TextBox();
			this.Label_OutputFolder = new System.Windows.Forms.Label();
			this.ComboBox_DRMProfile = new System.Windows.Forms.ComboBox();
			this.Label_DRMProfile = new System.Windows.Forms.Label();
			this.Label_Title = new System.Windows.Forms.Label();
			this.TextBox_Title = new System.Windows.Forms.TextBox();
			this.Label_Description = new System.Windows.Forms.Label();
			this.Label_Copyright = new System.Windows.Forms.Label();
			this.TextBox_Description = new System.Windows.Forms.TextBox();
			this.TextBox_Copyright = new System.Windows.Forms.TextBox();
			this.Label_Author = new System.Windows.Forms.Label();
			this.TextBox_Author = new System.Windows.Forms.TextBox();
			this.Button_Add = new System.Windows.Forms.Button();
			this.Button_Remove = new System.Windows.Forms.Button();
			this.Button_RemoveAll = new System.Windows.Forms.Button();
			this.Button_Start = new System.Windows.Forms.Button();
			this.DataGrid_Batch = new System.Windows.Forms.DataGrid();
			this.DataSet_Batch = new System.Data.DataSet();
			this.DataTable_Batch = new System.Data.DataTable();
			this.DataColumn_Status = new System.Data.DataColumn();
			this.DataColumn_ContentID = new System.Data.DataColumn();
			this.DataColumn_Source = new System.Data.DataColumn();
			this.DataColumn_Destination = new System.Data.DataColumn();
			this.DataColumn_Profile = new System.Data.DataColumn();
			this.DataColumn_PreProc = new System.Data.DataColumn();
			this.DataColumn_DRMProfile = new System.Data.DataColumn();
			this.DataColumn_Title = new System.Data.DataColumn();
			this.DataColumn_Description = new System.Data.DataColumn();
			this.DataColumn_Author = new System.Data.DataColumn();
			this.DataColumn_Copyright = new System.Data.DataColumn();
			this.DataColumn_Crop = new System.Data.DataColumn();
			this.DataColumn_CropLeft = new System.Data.DataColumn();
			this.DataColumn_CropTop = new System.Data.DataColumn();
			this.DataColumn_CropRight = new System.Data.DataColumn();
			this.DataColumn_CropBottom = new System.Data.DataColumn();
			this.DataColumn_TwoPass = new System.Data.DataColumn();
			this.DataTable_SessionInfo = new System.Data.DataTable();
			this.DataColumn_DestinationSession = new System.Data.DataColumn();
			this.DataColumn_ProfileSession = new System.Data.DataColumn();
			this.DataColumn_PreprocessingSession = new System.Data.DataColumn();
			this.DataColumn_TitleSession = new System.Data.DataColumn();
			this.DataColumn_DescriptionSession = new System.Data.DataColumn();
			this.DataColumn_AuthorSession = new System.Data.DataColumn();
			this.DataColumn_CopyrightSession = new System.Data.DataColumn();
			this.DataColumn_CropEnableSession = new System.Data.DataColumn();
			this.DataColumn_CropTopSession = new System.Data.DataColumn();
			this.DataColumn_CropLeftSession = new System.Data.DataColumn();
			this.DataColumn_CropRightSession = new System.Data.DataColumn();
			this.DataColumn_CropBottomSession = new System.Data.DataColumn();
			this.DataColumn_TwoPassSession = new System.Data.DataColumn();
			this.DataColumn_PreviewSession = new System.Data.DataColumn();
			this.DataColumn_OutputStringSession = new System.Data.DataColumn();
			this.DataColumn_ErrorLogSession = new System.Data.DataColumn();
			this.DataColumn_DRMProfileSession = new System.Data.DataColumn();
			this.DataColumn_TwoPassEnableSession = new System.Data.DataColumn();
			this.DataTable_SourceList = new System.Data.DataTable();
			this.DataColumn_SourceList = new System.Data.DataColumn();
			this.DataGridTableStyle1 = new System.Windows.Forms.DataGridTableStyle();
			this.DataGridTextBoxColumn_Status = new System.Windows.Forms.DataGridTextBoxColumn();
			this.DataGridTextBoxColumn_ContentID = new System.Windows.Forms.DataGridTextBoxColumn();
			this.DataGridTextBoxColumn_Source = new System.Windows.Forms.DataGridTextBoxColumn();
			this.DataGridTextBoxColumn_Destination = new System.Windows.Forms.DataGridTextBoxColumn();
			this.DataGridTextBoxColumn_Profile = new System.Windows.Forms.DataGridTextBoxColumn();
			this.DataGridTextBoxColumn_PreProc = new System.Windows.Forms.DataGridTextBoxColumn();
			this.DataGridTextBoxColumn_DRMProfile = new System.Windows.Forms.DataGridTextBoxColumn();
			this.DataGridTextBoxColumn_Title = new System.Windows.Forms.DataGridTextBoxColumn();
			this.DataGridTextBoxColumn_Description = new System.Windows.Forms.DataGridTextBoxColumn();
			this.DataGridTextBoxColumn_Author = new System.Windows.Forms.DataGridTextBoxColumn();
			this.DataGridTextBoxColumn_Copyright = new System.Windows.Forms.DataGridTextBoxColumn();
			this.DataGridBoolColumn_Crop = new System.Windows.Forms.DataGridBoolColumn();
			this.DataGridTextBoxColumn_CropLeft = new System.Windows.Forms.DataGridTextBoxColumn();
			this.DataGridTextBoxColumn_CropTop = new System.Windows.Forms.DataGridTextBoxColumn();
			this.DataGridTextBoxColumn_CropRight = new System.Windows.Forms.DataGridTextBoxColumn();
			this.DataGridTextBoxColumn_CropBottom = new System.Windows.Forms.DataGridTextBoxColumn();
			this.DataGridBoolColumn_TwoPass = new System.Windows.Forms.DataGridBoolColumn();
			this.Button_Stop = new System.Windows.Forms.Button();
			this.DataSet_Error = new System.Data.DataSet();
			this.DataTable_Error = new System.Data.DataTable();
			this.DataColumn_ErrorID = new System.Data.DataColumn();
			this.DataColumn_ErrorString = new System.Data.DataColumn();
			this.DataColumn_ErrorLocation = new System.Data.DataColumn();
			this.DataSet_Default = new System.Data.DataSet();
			this.DataTable_Default = new System.Data.DataTable();
			this.DataColumn_DestinationDefault = new System.Data.DataColumn();
			this.DataColumn_ProfileDefault = new System.Data.DataColumn();
			this.DataColumn_PreprocessingDefault = new System.Data.DataColumn();
			this.DataColumn_TitleDefault = new System.Data.DataColumn();
			this.DataColumn_DescriptionDefault = new System.Data.DataColumn();
			this.DataColumn_AuthorDefault = new System.Data.DataColumn();
			this.DataColumn_CopyrightDefault = new System.Data.DataColumn();
			this.DataColumn_CropEnableDefault = new System.Data.DataColumn();
			this.DataColumn_CropTopDefault = new System.Data.DataColumn();
			this.DataColumn_CropLeftDefault = new System.Data.DataColumn();
			this.DataColumn_CropRightDefault = new System.Data.DataColumn();
			this.DataColumn_CropBottomDefault = new System.Data.DataColumn();
			this.DataColumn_TwoPassDefault = new System.Data.DataColumn();
			this.DataColumn_PreviewDefault = new System.Data.DataColumn();
			this.DataColumn_OutputStringDefault = new System.Data.DataColumn();
			this.DataColumn_ErrorLogDefault = new System.Data.DataColumn();
			this.DataColumn_DRMProfileDefault = new System.Data.DataColumn();
			this.StatusBar_Status = new System.Windows.Forms.StatusBar();
			this.StatusBarPanel_Content = new System.Windows.Forms.StatusBarPanel();
			this.StatusBarPanel_PercentComplete = new System.Windows.Forms.StatusBarPanel();
			this.StatusBarPanel_EncoderRunState = new System.Windows.Forms.StatusBarPanel();
			this.GroupBox_Sources = new System.Windows.Forms.GroupBox();
			this.Button_SourceRemoveAll = new System.Windows.Forms.Button();
			this.Button_RemoveSource = new System.Windows.Forms.Button();
			this.ListBox_Source = new System.Windows.Forms.ListBox();
			this.Button_FileOpenSource = new System.Windows.Forms.Button();
			this.TextBox_OutputString = new System.Windows.Forms.TextBox();
			this.Label_OutputString = new System.Windows.Forms.Label();
			this.Timer_PercentComplete = new System.Windows.Forms.Timer(this.components);
			this.CheckBox_TwoPass = new System.Windows.Forms.CheckBox();
			this.TextBox_Profile = new System.Windows.Forms.TextBox();
			this.Button_SelectProfile = new System.Windows.Forms.Button();
			this.GroupBox_Crop.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.NumericUpDown_CropBottom)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.NumericUpDown_CropRight)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.NumericUpDown_CropLeft)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.NumericUpDown_CropTop)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.DataGrid_Batch)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.DataSet_Batch)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.DataTable_Batch)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.DataTable_SessionInfo)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.DataTable_SourceList)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.DataSet_Error)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.DataTable_Error)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.DataSet_Default)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.DataTable_Default)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.StatusBarPanel_Content)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.StatusBarPanel_PercentComplete)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.StatusBarPanel_EncoderRunState)).BeginInit();
			this.GroupBox_Sources.SuspendLayout();
			this.SuspendLayout();
			// 
			// MainMenu1
			// 
			this.MainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					  this.MenuItem_File,
																					  this.MenuItem_Tools,
																					  this.MenuItem_Help});
			// 
			// MenuItem_File
			// 
			this.MenuItem_File.Index = 0;
			this.MenuItem_File.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																						  this.MenuItem_Open,
																						  this.MenuItem_Save,
																						  this.MenuItem_SaveAs,
																						  this.MenuItem_Exit});
			this.MenuItem_File.Text = "&File";
			// 
			// MenuItem_Open
			// 
			this.MenuItem_Open.Index = 0;
			this.MenuItem_Open.Text = "&Open Session";
			this.MenuItem_Open.Click += new System.EventHandler(this.MenuItem_Open_Click);
			// 
			// MenuItem_Save
			// 
			this.MenuItem_Save.Index = 1;
			this.MenuItem_Save.Text = "&Save Session";
			this.MenuItem_Save.Click += new System.EventHandler(this.MenuItem_Save_Click);
			// 
			// MenuItem_SaveAs
			// 
			this.MenuItem_SaveAs.Index = 2;
			this.MenuItem_SaveAs.Text = "Save Session &As";
			this.MenuItem_SaveAs.Click += new System.EventHandler(this.MenuItem_SaveAs_Click);
			// 
			// MenuItem_Exit
			// 
			this.MenuItem_Exit.Index = 3;
			this.MenuItem_Exit.Text = "E&xit";
			this.MenuItem_Exit.Click += new System.EventHandler(this.MenuItem_Exit_Click);
			// 
			// MenuItem_Tools
			// 
			this.MenuItem_Tools.Index = 1;
			this.MenuItem_Tools.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																						   this.MenuItem_CurrentAsDefault,
																						   this.MenuItem_LogErrors});
			this.MenuItem_Tools.Text = "Tools";
			// 
			// MenuItem_CurrentAsDefault
			// 
			this.MenuItem_CurrentAsDefault.Index = 0;
			this.MenuItem_CurrentAsDefault.Text = "Set Current As Default";
			this.MenuItem_CurrentAsDefault.Click += new System.EventHandler(this.MenuItem_CurrentAsDefault_Click);
			// 
			// MenuItem_LogErrors
			// 
			this.MenuItem_LogErrors.Index = 1;
			this.MenuItem_LogErrors.Text = "Log Errors";
			this.MenuItem_LogErrors.Click += new System.EventHandler(this.MenuItem_LogErrors_Click);
			// 
			// MenuItem_Help
			// 
			this.MenuItem_Help.Index = 2;
			this.MenuItem_Help.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																						  this.MenuItem_About});
			this.MenuItem_Help.Text = "&Help";
			// 
			// MenuItem_About
			// 
			this.MenuItem_About.Index = 0;
			this.MenuItem_About.Text = "&About";
			this.MenuItem_About.Click += new System.EventHandler(this.MenuItem_About_Click);
			// 
			// Label_Profile
			// 
			this.Label_Profile.Location = new System.Drawing.Point(16, 208);
			this.Label_Profile.Name = "Label_Profile";
			this.Label_Profile.Size = new System.Drawing.Size(80, 20);
			this.Label_Profile.TabIndex = 2;
			this.Label_Profile.Text = "Profile";
			// 
			// GroupBox_Crop
			// 
			this.GroupBox_Crop.Controls.Add(this.NumericUpDown_CropBottom);
			this.GroupBox_Crop.Controls.Add(this.NumericUpDown_CropRight);
			this.GroupBox_Crop.Controls.Add(this.NumericUpDown_CropLeft);
			this.GroupBox_Crop.Controls.Add(this.NumericUpDown_CropTop);
			this.GroupBox_Crop.Controls.Add(this.Label_CropBottom);
			this.GroupBox_Crop.Controls.Add(this.Label_CropRight);
			this.GroupBox_Crop.Controls.Add(this.Label_CropTop);
			this.GroupBox_Crop.Controls.Add(this.Label_CropLeft);
			this.GroupBox_Crop.Controls.Add(this.CheckBox_Crop);
			this.GroupBox_Crop.Location = new System.Drawing.Point(488, 8);
			this.GroupBox_Crop.Name = "GroupBox_Crop";
			this.GroupBox_Crop.Size = new System.Drawing.Size(288, 136);
			this.GroupBox_Crop.TabIndex = 6;
			this.GroupBox_Crop.TabStop = false;
			this.GroupBox_Crop.Text = "Crop Video (Pixels)";
			// 
			// NumericUpDown_CropBottom
			// 
			this.NumericUpDown_CropBottom.Enabled = false;
			this.NumericUpDown_CropBottom.Increment = new System.Decimal(new int[] {
																					   2,
																					   0,
																					   0,
																					   0});
			this.NumericUpDown_CropBottom.Location = new System.Drawing.Point(192, 88);
			this.NumericUpDown_CropBottom.Maximum = new System.Decimal(new int[] {
																					 1280,
																					 0,
																					 0,
																					 0});
			this.NumericUpDown_CropBottom.Name = "NumericUpDown_CropBottom";
			this.NumericUpDown_CropBottom.Size = new System.Drawing.Size(72, 20);
			this.NumericUpDown_CropBottom.TabIndex = 5;
			this.NumericUpDown_CropBottom.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			this.NumericUpDown_CropBottom.ValueChanged += new System.EventHandler(this.NumericUpDown_CropBottom_ValueChanged);
			// 
			// NumericUpDown_CropRight
			// 
			this.NumericUpDown_CropRight.Enabled = false;
			this.NumericUpDown_CropRight.Increment = new System.Decimal(new int[] {
																					  2,
																					  0,
																					  0,
																					  0});
			this.NumericUpDown_CropRight.Location = new System.Drawing.Point(192, 56);
			this.NumericUpDown_CropRight.Maximum = new System.Decimal(new int[] {
																					1280,
																					0,
																					0,
																					0});
			this.NumericUpDown_CropRight.Name = "NumericUpDown_CropRight";
			this.NumericUpDown_CropRight.Size = new System.Drawing.Size(72, 20);
			this.NumericUpDown_CropRight.TabIndex = 3;
			this.NumericUpDown_CropRight.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			this.NumericUpDown_CropRight.ValueChanged += new System.EventHandler(this.NumericUpDown_CropRight_ValueChanged);
			// 
			// NumericUpDown_CropLeft
			// 
			this.NumericUpDown_CropLeft.Enabled = false;
			this.NumericUpDown_CropLeft.Increment = new System.Decimal(new int[] {
																					 2,
																					 0,
																					 0,
																					 0});
			this.NumericUpDown_CropLeft.Location = new System.Drawing.Point(64, 88);
			this.NumericUpDown_CropLeft.Maximum = new System.Decimal(new int[] {
																				   1280,
																				   0,
																				   0,
																				   0});
			this.NumericUpDown_CropLeft.Name = "NumericUpDown_CropLeft";
			this.NumericUpDown_CropLeft.Size = new System.Drawing.Size(72, 20);
			this.NumericUpDown_CropLeft.TabIndex = 4;
			this.NumericUpDown_CropLeft.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			this.NumericUpDown_CropLeft.ValueChanged += new System.EventHandler(this.NumericUpDown_CropLeft_ValueChanged);
			// 
			// NumericUpDown_CropTop
			// 
			this.NumericUpDown_CropTop.Enabled = false;
			this.NumericUpDown_CropTop.Increment = new System.Decimal(new int[] {
																					2,
																					0,
																					0,
																					0});
			this.NumericUpDown_CropTop.Location = new System.Drawing.Point(64, 56);
			this.NumericUpDown_CropTop.Maximum = new System.Decimal(new int[] {
																				  1280,
																				  0,
																				  0,
																				  0});
			this.NumericUpDown_CropTop.Name = "NumericUpDown_CropTop";
			this.NumericUpDown_CropTop.Size = new System.Drawing.Size(72, 20);
			this.NumericUpDown_CropTop.TabIndex = 2;
			this.NumericUpDown_CropTop.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			this.NumericUpDown_CropTop.ValueChanged += new System.EventHandler(this.NumericUpDown_CropTop_ValueChanged);
			// 
			// Label_CropBottom
			// 
			this.Label_CropBottom.Location = new System.Drawing.Point(152, 88);
			this.Label_CropBottom.Name = "Label_CropBottom";
			this.Label_CropBottom.Size = new System.Drawing.Size(40, 20);
			this.Label_CropBottom.TabIndex = 46;
			this.Label_CropBottom.Text = "Bottom";
			// 
			// Label_CropRight
			// 
			this.Label_CropRight.Location = new System.Drawing.Point(152, 56);
			this.Label_CropRight.Name = "Label_CropRight";
			this.Label_CropRight.Size = new System.Drawing.Size(40, 20);
			this.Label_CropRight.TabIndex = 44;
			this.Label_CropRight.Text = "Right";
			// 
			// Label_CropTop
			// 
			this.Label_CropTop.Location = new System.Drawing.Point(24, 56);
			this.Label_CropTop.Name = "Label_CropTop";
			this.Label_CropTop.Size = new System.Drawing.Size(40, 20);
			this.Label_CropTop.TabIndex = 42;
			this.Label_CropTop.Text = "Top";
			// 
			// Label_CropLeft
			// 
			this.Label_CropLeft.Location = new System.Drawing.Point(24, 88);
			this.Label_CropLeft.Name = "Label_CropLeft";
			this.Label_CropLeft.Size = new System.Drawing.Size(40, 20);
			this.Label_CropLeft.TabIndex = 40;
			this.Label_CropLeft.Text = "Left";
			// 
			// CheckBox_Crop
			// 
			this.CheckBox_Crop.Location = new System.Drawing.Point(24, 24);
			this.CheckBox_Crop.Name = "CheckBox_Crop";
			this.CheckBox_Crop.Size = new System.Drawing.Size(96, 16);
			this.CheckBox_Crop.TabIndex = 1;
			this.CheckBox_Crop.Text = "Enable";
			this.CheckBox_Crop.CheckedChanged += new System.EventHandler(this.CheckBox_Crop_CheckedChanged);
			// 
			// ComboBox_PreProc
			// 
			this.ComboBox_PreProc.Location = new System.Drawing.Point(96, 232);
			this.ComboBox_PreProc.Name = "ComboBox_PreProc";
			this.ComboBox_PreProc.Size = new System.Drawing.Size(376, 21);
			this.ComboBox_PreProc.TabIndex = 4;
			this.ComboBox_PreProc.Text = "ComboBox_PreProc";
			this.ComboBox_PreProc.SelectedIndexChanged += new System.EventHandler(this.ComboBox_PreProc_SelectedIndexChanged);
			// 
			// Label_PreProc
			// 
			this.Label_PreProc.Location = new System.Drawing.Point(16, 232);
			this.Label_PreProc.Name = "Label_PreProc";
			this.Label_PreProc.Size = new System.Drawing.Size(80, 21);
			this.Label_PreProc.TabIndex = 52;
			this.Label_PreProc.Text = "Preprocessing";
			// 
			// Button_FileOpenDestination
			// 
			this.Button_FileOpenDestination.Location = new System.Drawing.Point(400, 160);
			this.Button_FileOpenDestination.Name = "Button_FileOpenDestination";
			this.Button_FileOpenDestination.Size = new System.Drawing.Size(72, 20);
			this.Button_FileOpenDestination.TabIndex = 85;
			this.Button_FileOpenDestination.Text = "Browse...";
			this.Button_FileOpenDestination.Click += new System.EventHandler(this.Button_FileOpenDestination_Click);
			// 
			// TextBox_Destination
			// 
			this.TextBox_Destination.Location = new System.Drawing.Point(96, 160);
			this.TextBox_Destination.Name = "TextBox_Destination";
			this.TextBox_Destination.Size = new System.Drawing.Size(296, 20);
			this.TextBox_Destination.TabIndex = 1;
			this.TextBox_Destination.Text = "C:\\";
			this.TextBox_Destination.TextChanged += new System.EventHandler(this.TextBox_Destination_TextChanged);
			// 
			// Label_OutputFolder
			// 
			this.Label_OutputFolder.Location = new System.Drawing.Point(16, 160);
			this.Label_OutputFolder.Name = "Label_OutputFolder";
			this.Label_OutputFolder.Size = new System.Drawing.Size(80, 20);
			this.Label_OutputFolder.TabIndex = 84;
			this.Label_OutputFolder.Text = "Output Folder";
			// 
			// ComboBox_DRMProfile
			// 
			this.ComboBox_DRMProfile.Location = new System.Drawing.Point(96, 256);
			this.ComboBox_DRMProfile.Name = "ComboBox_DRMProfile";
			this.ComboBox_DRMProfile.Size = new System.Drawing.Size(376, 21);
			this.ComboBox_DRMProfile.TabIndex = 5;
			this.ComboBox_DRMProfile.Text = "ComboBox_DRMProfile";
			this.ComboBox_DRMProfile.SelectedIndexChanged += new System.EventHandler(this.ComboBox_DRMProfile_SelectedIndexChanged);
			// 
			// Label_DRMProfile
			// 
			this.Label_DRMProfile.Location = new System.Drawing.Point(16, 256);
			this.Label_DRMProfile.Name = "Label_DRMProfile";
			this.Label_DRMProfile.Size = new System.Drawing.Size(80, 21);
			this.Label_DRMProfile.TabIndex = 90;
			this.Label_DRMProfile.Text = "DRM Profile";
			// 
			// Label_Title
			// 
			this.Label_Title.Location = new System.Drawing.Point(488, 184);
			this.Label_Title.Name = "Label_Title";
			this.Label_Title.Size = new System.Drawing.Size(64, 20);
			this.Label_Title.TabIndex = 100;
			this.Label_Title.Text = "Title";
			// 
			// TextBox_Title
			// 
			this.TextBox_Title.Location = new System.Drawing.Point(552, 184);
			this.TextBox_Title.Name = "TextBox_Title";
			this.TextBox_Title.Size = new System.Drawing.Size(224, 20);
			this.TextBox_Title.TabIndex = 8;
			this.TextBox_Title.Text = "TextBox_Title";
			this.TextBox_Title.TabIndexChanged += new System.EventHandler(this.TextBox_Title_TextChanged);
			// 
			// Label_Description
			// 
			this.Label_Description.Location = new System.Drawing.Point(488, 208);
			this.Label_Description.Name = "Label_Description";
			this.Label_Description.Size = new System.Drawing.Size(64, 20);
			this.Label_Description.TabIndex = 98;
			this.Label_Description.Text = "Description";
			// 
			// Label_Copyright
			// 
			this.Label_Copyright.Location = new System.Drawing.Point(488, 256);
			this.Label_Copyright.Name = "Label_Copyright";
			this.Label_Copyright.Size = new System.Drawing.Size(64, 20);
			this.Label_Copyright.TabIndex = 97;
			this.Label_Copyright.Text = "Copyright";
			// 
			// TextBox_Description
			// 
			this.TextBox_Description.Location = new System.Drawing.Point(552, 208);
			this.TextBox_Description.Name = "TextBox_Description";
			this.TextBox_Description.Size = new System.Drawing.Size(224, 20);
			this.TextBox_Description.TabIndex = 9;
			this.TextBox_Description.Text = "TextBox_Description";
			this.TextBox_Description.TextChanged += new System.EventHandler(this.TextBox_Description_TextChanged);
			// 
			// TextBox_Copyright
			// 
			this.TextBox_Copyright.Location = new System.Drawing.Point(552, 256);
			this.TextBox_Copyright.Name = "TextBox_Copyright";
			this.TextBox_Copyright.Size = new System.Drawing.Size(224, 20);
			this.TextBox_Copyright.TabIndex = 11;
			this.TextBox_Copyright.Text = "TextBox_Copyright";
			this.TextBox_Copyright.TextChanged += new System.EventHandler(this.TextBox_Copyright_TextChanged);
			// 
			// Label_Author
			// 
			this.Label_Author.Location = new System.Drawing.Point(488, 232);
			this.Label_Author.Name = "Label_Author";
			this.Label_Author.Size = new System.Drawing.Size(64, 20);
			this.Label_Author.TabIndex = 93;
			this.Label_Author.Text = "Author";
			// 
			// TextBox_Author
			// 
			this.TextBox_Author.Location = new System.Drawing.Point(552, 232);
			this.TextBox_Author.Name = "TextBox_Author";
			this.TextBox_Author.Size = new System.Drawing.Size(224, 20);
			this.TextBox_Author.TabIndex = 10;
			this.TextBox_Author.Text = "TextBox_Author";
			this.TextBox_Author.TextChanged += new System.EventHandler(this.TextBox_Author_TextChanged);
			// 
			// Button_Add
			// 
			this.Button_Add.Location = new System.Drawing.Point(144, 288);
			this.Button_Add.Name = "Button_Add";
			this.Button_Add.Size = new System.Drawing.Size(72, 24);
			this.Button_Add.TabIndex = 12;
			this.Button_Add.Text = "Add";
			this.Button_Add.Click += new System.EventHandler(this.Button_Add_Click);
			// 
			// Button_Remove
			// 
			this.Button_Remove.Enabled = false;
			this.Button_Remove.Location = new System.Drawing.Point(232, 288);
			this.Button_Remove.Name = "Button_Remove";
			this.Button_Remove.Size = new System.Drawing.Size(72, 24);
			this.Button_Remove.TabIndex = 13;
			this.Button_Remove.Text = "Remove";
			this.Button_Remove.Click += new System.EventHandler(this.Button_Remove_Click);
			// 
			// Button_RemoveAll
			// 
			this.Button_RemoveAll.Enabled = false;
			this.Button_RemoveAll.Location = new System.Drawing.Point(320, 288);
			this.Button_RemoveAll.Name = "Button_RemoveAll";
			this.Button_RemoveAll.Size = new System.Drawing.Size(72, 24);
			this.Button_RemoveAll.TabIndex = 14;
			this.Button_RemoveAll.Text = "Remove All";
			this.Button_RemoveAll.Click += new System.EventHandler(this.Button_RemoveAll_Click);
			// 
			// Button_Start
			// 
			this.Button_Start.Location = new System.Drawing.Point(704, 497);
			this.Button_Start.Name = "Button_Start";
			this.Button_Start.Size = new System.Drawing.Size(72, 24);
			this.Button_Start.TabIndex = 105;
			this.Button_Start.Text = "Start";
			this.Button_Start.Click += new System.EventHandler(this.Button_Start_Click);
			// 
			// DataGrid_Batch
			// 
			this.DataGrid_Batch.CaptionVisible = false;
			this.DataGrid_Batch.DataMember = "Table_Batch";
			this.DataGrid_Batch.DataSource = this.DataSet_Batch;
			this.DataGrid_Batch.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.DataGrid_Batch.Location = new System.Drawing.Point(16, 320);
			this.DataGrid_Batch.Name = "DataGrid_Batch";
			this.DataGrid_Batch.ReadOnly = true;
			this.DataGrid_Batch.Size = new System.Drawing.Size(760, 168);
			this.DataGrid_Batch.TabIndex = 106;
			this.DataGrid_Batch.TableStyles.AddRange(new System.Windows.Forms.DataGridTableStyle[] {
																									   this.DataGridTableStyle1});
			// 
			// DataSet_Batch
			// 
			this.DataSet_Batch.DataSetName = "NewDataSet_Batch";
			this.DataSet_Batch.Locale = new System.Globalization.CultureInfo("en-US");
			this.DataSet_Batch.Tables.AddRange(new System.Data.DataTable[] {
																			   this.DataTable_Batch,
																			   this.DataTable_SessionInfo,
																			   this.DataTable_SourceList});
			// 
			// DataTable_Batch
			// 
			this.DataTable_Batch.Columns.AddRange(new System.Data.DataColumn[] {
																				   this.DataColumn_Status,
																				   this.DataColumn_ContentID,
																				   this.DataColumn_Source,
																				   this.DataColumn_Destination,
																				   this.DataColumn_Profile,
																				   this.DataColumn_PreProc,
																				   this.DataColumn_DRMProfile,
																				   this.DataColumn_Title,
																				   this.DataColumn_Description,
																				   this.DataColumn_Author,
																				   this.DataColumn_Copyright,
																				   this.DataColumn_Crop,
																				   this.DataColumn_CropLeft,
																				   this.DataColumn_CropTop,
																				   this.DataColumn_CropRight,
																				   this.DataColumn_CropBottom,
																				   this.DataColumn_TwoPass});
			this.DataTable_Batch.TableName = "Table_Batch";
			// 
			// DataColumn_Status
			// 
			this.DataColumn_Status.Caption = "Status";
			this.DataColumn_Status.ColumnName = "Column_Status";
			// 
			// DataColumn_ContentID
			// 
			this.DataColumn_ContentID.AutoIncrement = true;
			this.DataColumn_ContentID.Caption = "Content";
			this.DataColumn_ContentID.ColumnName = "Column_ContentID";
			this.DataColumn_ContentID.DataType = typeof(int);
			// 
			// DataColumn_Source
			// 
			this.DataColumn_Source.Caption = "Source";
			this.DataColumn_Source.ColumnName = "Column_Source";
			// 
			// DataColumn_Destination
			// 
			this.DataColumn_Destination.Caption = "Destination";
			this.DataColumn_Destination.ColumnName = "Column_Destination";
			// 
			// DataColumn_Profile
			// 
			this.DataColumn_Profile.Caption = "Profile";
			this.DataColumn_Profile.ColumnName = "Column_Profile";
			// 
			// DataColumn_PreProc
			// 
			this.DataColumn_PreProc.Caption = "Preprocess";
			this.DataColumn_PreProc.ColumnName = "Column_PreProc";
			// 
			// DataColumn_DRMProfile
			// 
			this.DataColumn_DRMProfile.Caption = "DRM Profile";
			this.DataColumn_DRMProfile.ColumnName = "Column_DRMProfile";
			// 
			// DataColumn_Title
			// 
			this.DataColumn_Title.Caption = "Title";
			this.DataColumn_Title.ColumnName = "Column_Title";
			// 
			// DataColumn_Description
			// 
			this.DataColumn_Description.Caption = "Description";
			this.DataColumn_Description.ColumnName = "Column_Description";
			// 
			// DataColumn_Author
			// 
			this.DataColumn_Author.Caption = "Author";
			this.DataColumn_Author.ColumnName = "Column_Author";
			// 
			// DataColumn_Copyright
			// 
			this.DataColumn_Copyright.Caption = "Copyright";
			this.DataColumn_Copyright.ColumnName = "Column_Copyright";
			// 
			// DataColumn_Crop
			// 
			this.DataColumn_Crop.Caption = "Crop";
			this.DataColumn_Crop.ColumnName = "Column_Crop";
			this.DataColumn_Crop.DataType = typeof(bool);
			// 
			// DataColumn_CropLeft
			// 
			this.DataColumn_CropLeft.Caption = "Crop Left";
			this.DataColumn_CropLeft.ColumnName = "Column_CropLeft";
			this.DataColumn_CropLeft.DataType = typeof(int);
			// 
			// DataColumn_CropTop
			// 
			this.DataColumn_CropTop.Caption = "Crop Top";
			this.DataColumn_CropTop.ColumnName = "Column_CropTop";
			this.DataColumn_CropTop.DataType = typeof(int);
			// 
			// DataColumn_CropRight
			// 
			this.DataColumn_CropRight.Caption = "Crop Right";
			this.DataColumn_CropRight.ColumnName = "Column_CropRight";
			this.DataColumn_CropRight.DataType = typeof(int);
			// 
			// DataColumn_CropBottom
			// 
			this.DataColumn_CropBottom.Caption = "Crop Bottom";
			this.DataColumn_CropBottom.ColumnName = "Column_CropBottom";
			this.DataColumn_CropBottom.DataType = typeof(int);
			// 
			// DataColumn_TwoPass
			// 
			this.DataColumn_TwoPass.Caption = "Two Pass";
			this.DataColumn_TwoPass.ColumnName = "Column_TwoPass";
			this.DataColumn_TwoPass.DataType = typeof(bool);
			// 
			// DataTable_SessionInfo
			// 
			this.DataTable_SessionInfo.Columns.AddRange(new System.Data.DataColumn[] {
																						 this.DataColumn_DestinationSession,
																						 this.DataColumn_ProfileSession,
																						 this.DataColumn_PreprocessingSession,
																						 this.DataColumn_TitleSession,
																						 this.DataColumn_DescriptionSession,
																						 this.DataColumn_AuthorSession,
																						 this.DataColumn_CopyrightSession,
																						 this.DataColumn_CropEnableSession,
																						 this.DataColumn_CropTopSession,
																						 this.DataColumn_CropLeftSession,
																						 this.DataColumn_CropRightSession,
																						 this.DataColumn_CropBottomSession,
																						 this.DataColumn_TwoPassSession,
																						 this.DataColumn_PreviewSession,
																						 this.DataColumn_OutputStringSession,
																						 this.DataColumn_ErrorLogSession,
																						 this.DataColumn_DRMProfileSession,
																						 this.DataColumn_TwoPassEnableSession});
			this.DataTable_SessionInfo.TableName = "Table_SessionInfo";
			// 
			// DataColumn_DestinationSession
			// 
			this.DataColumn_DestinationSession.ColumnName = "Column_DestinationSession";
			// 
			// DataColumn_ProfileSession
			// 
			this.DataColumn_ProfileSession.ColumnName = "Column_ProfileSession";
			// 
			// DataColumn_PreprocessingSession
			// 
			this.DataColumn_PreprocessingSession.ColumnName = "Column_PreprocessingSession";
			// 
			// DataColumn_TitleSession
			// 
			this.DataColumn_TitleSession.ColumnName = "Column_TitleSession";
			// 
			// DataColumn_DescriptionSession
			// 
			this.DataColumn_DescriptionSession.ColumnName = "Column_DescriptionSession";
			// 
			// DataColumn_AuthorSession
			// 
			this.DataColumn_AuthorSession.ColumnName = "Column_AuthorSession";
			// 
			// DataColumn_CopyrightSession
			// 
			this.DataColumn_CopyrightSession.ColumnName = "Column_CopyrightSession";
			// 
			// DataColumn_CropEnableSession
			// 
			this.DataColumn_CropEnableSession.ColumnName = "Column_CropEnableSession";
			this.DataColumn_CropEnableSession.DataType = typeof(bool);
			// 
			// DataColumn_CropTopSession
			// 
			this.DataColumn_CropTopSession.ColumnName = "Column_CropTopSession";
			this.DataColumn_CropTopSession.DataType = typeof(int);
			// 
			// DataColumn_CropLeftSession
			// 
			this.DataColumn_CropLeftSession.ColumnName = "Column_CropLeftSession";
			this.DataColumn_CropLeftSession.DataType = typeof(int);
			// 
			// DataColumn_CropRightSession
			// 
			this.DataColumn_CropRightSession.ColumnName = "Column_CropRightSession";
			this.DataColumn_CropRightSession.DataType = typeof(int);
			// 
			// DataColumn_CropBottomSession
			// 
			this.DataColumn_CropBottomSession.ColumnName = "Column_CropBottomSession";
			this.DataColumn_CropBottomSession.DataType = typeof(int);
			// 
			// DataColumn_TwoPassSession
			// 
			this.DataColumn_TwoPassSession.ColumnName = "Column_TwoPassSession";
			this.DataColumn_TwoPassSession.DataType = typeof(bool);
			// 
			// DataColumn_PreviewSession
			// 
			this.DataColumn_PreviewSession.ColumnName = "Column_PreviewSession";
			this.DataColumn_PreviewSession.DataType = typeof(bool);
			// 
			// DataColumn_OutputStringSession
			// 
			this.DataColumn_OutputStringSession.ColumnName = "Column_OutputStringSession";
			// 
			// DataColumn_ErrorLogSession
			// 
			this.DataColumn_ErrorLogSession.ColumnName = "Column_ErrorLogSession";
			this.DataColumn_ErrorLogSession.DataType = typeof(bool);
			// 
			// DataColumn_DRMProfileSession
			// 
			this.DataColumn_DRMProfileSession.ColumnName = "Column_DRMProfileSession";
			// 
			// DataColumn_TwoPassEnableSession
			// 
			this.DataColumn_TwoPassEnableSession.ColumnName = "Column_TwoPassEnableSession";
			this.DataColumn_TwoPassEnableSession.DataType = typeof(bool);
			// 
			// DataTable_SourceList
			// 
			this.DataTable_SourceList.Columns.AddRange(new System.Data.DataColumn[] {
																						this.DataColumn_SourceList});
			this.DataTable_SourceList.TableName = "Table_SourceList";
			// 
			// DataColumn_SourceList
			// 
			this.DataColumn_SourceList.ColumnName = "Column_SourceList";
			// 
			// DataGridTableStyle1
			// 
			this.DataGridTableStyle1.DataGrid = this.DataGrid_Batch;
			this.DataGridTableStyle1.GridColumnStyles.AddRange(new System.Windows.Forms.DataGridColumnStyle[] {
																												  this.DataGridTextBoxColumn_Status,
																												  this.DataGridTextBoxColumn_ContentID,
																												  this.DataGridTextBoxColumn_Source,
																												  this.DataGridTextBoxColumn_Destination,
																												  this.DataGridTextBoxColumn_Profile,
																												  this.DataGridTextBoxColumn_PreProc,
																												  this.DataGridTextBoxColumn_DRMProfile,
																												  this.DataGridTextBoxColumn_Title,
																												  this.DataGridTextBoxColumn_Description,
																												  this.DataGridTextBoxColumn_Author,
																												  this.DataGridTextBoxColumn_Copyright,
																												  this.DataGridBoolColumn_Crop,
																												  this.DataGridTextBoxColumn_CropLeft,
																												  this.DataGridTextBoxColumn_CropTop,
																												  this.DataGridTextBoxColumn_CropRight,
																												  this.DataGridTextBoxColumn_CropBottom,
																												  this.DataGridBoolColumn_TwoPass});
			this.DataGridTableStyle1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.DataGridTableStyle1.MappingName = "Table_Batch";
			// 
			// DataGridTextBoxColumn_Status
			// 
			this.DataGridTextBoxColumn_Status.Format = "";
			this.DataGridTextBoxColumn_Status.FormatInfo = null;
			this.DataGridTextBoxColumn_Status.HeaderText = "Status";
			this.DataGridTextBoxColumn_Status.MappingName = "Column_Status";
			this.DataGridTextBoxColumn_Status.Width = 150;
			// 
			// DataGridTextBoxColumn_ContentID
			// 
			this.DataGridTextBoxColumn_ContentID.Format = "";
			this.DataGridTextBoxColumn_ContentID.FormatInfo = null;
			this.DataGridTextBoxColumn_ContentID.HeaderText = "Content";
			this.DataGridTextBoxColumn_ContentID.MappingName = "Column_ContentID";
			this.DataGridTextBoxColumn_ContentID.Width = 50;
			// 
			// DataGridTextBoxColumn_Source
			// 
			this.DataGridTextBoxColumn_Source.Format = "";
			this.DataGridTextBoxColumn_Source.FormatInfo = null;
			this.DataGridTextBoxColumn_Source.HeaderText = "Source";
			this.DataGridTextBoxColumn_Source.MappingName = "Column_Source";
			this.DataGridTextBoxColumn_Source.Width = 200;
			// 
			// DataGridTextBoxColumn_Destination
			// 
			this.DataGridTextBoxColumn_Destination.Format = "";
			this.DataGridTextBoxColumn_Destination.FormatInfo = null;
			this.DataGridTextBoxColumn_Destination.HeaderText = "Destination";
			this.DataGridTextBoxColumn_Destination.MappingName = "Column_Destination";
			this.DataGridTextBoxColumn_Destination.Width = 75;
			// 
			// DataGridTextBoxColumn_Profile
			// 
			this.DataGridTextBoxColumn_Profile.Format = "";
			this.DataGridTextBoxColumn_Profile.FormatInfo = null;
			this.DataGridTextBoxColumn_Profile.HeaderText = "Profile";
			this.DataGridTextBoxColumn_Profile.MappingName = "Column_Profile";
			this.DataGridTextBoxColumn_Profile.Width = 75;
			// 
			// DataGridTextBoxColumn_PreProc
			// 
			this.DataGridTextBoxColumn_PreProc.Format = "";
			this.DataGridTextBoxColumn_PreProc.FormatInfo = null;
			this.DataGridTextBoxColumn_PreProc.HeaderText = "PreProc";
			this.DataGridTextBoxColumn_PreProc.MappingName = "Column_PreProc";
			this.DataGridTextBoxColumn_PreProc.Width = 75;
			// 
			// DataGridTextBoxColumn_DRMProfile
			// 
			this.DataGridTextBoxColumn_DRMProfile.Format = "";
			this.DataGridTextBoxColumn_DRMProfile.FormatInfo = null;
			this.DataGridTextBoxColumn_DRMProfile.HeaderText = "DRM Profile";
			this.DataGridTextBoxColumn_DRMProfile.MappingName = "Column_DRMProfile";
			this.DataGridTextBoxColumn_DRMProfile.Width = 75;
			// 
			// DataGridTextBoxColumn_Title
			// 
			this.DataGridTextBoxColumn_Title.Format = "";
			this.DataGridTextBoxColumn_Title.FormatInfo = null;
			this.DataGridTextBoxColumn_Title.HeaderText = "Title";
			this.DataGridTextBoxColumn_Title.MappingName = "Column_Title";
			this.DataGridTextBoxColumn_Title.Width = 75;
			// 
			// DataGridTextBoxColumn_Description
			// 
			this.DataGridTextBoxColumn_Description.Format = "";
			this.DataGridTextBoxColumn_Description.FormatInfo = null;
			this.DataGridTextBoxColumn_Description.HeaderText = "Description";
			this.DataGridTextBoxColumn_Description.MappingName = "Column_Description";
			this.DataGridTextBoxColumn_Description.Width = 75;
			// 
			// DataGridTextBoxColumn_Author
			// 
			this.DataGridTextBoxColumn_Author.Format = "";
			this.DataGridTextBoxColumn_Author.FormatInfo = null;
			this.DataGridTextBoxColumn_Author.HeaderText = "Author";
			this.DataGridTextBoxColumn_Author.MappingName = "Column_Author";
			this.DataGridTextBoxColumn_Author.Width = 75;
			// 
			// DataGridTextBoxColumn_Copyright
			// 
			this.DataGridTextBoxColumn_Copyright.Format = "";
			this.DataGridTextBoxColumn_Copyright.FormatInfo = null;
			this.DataGridTextBoxColumn_Copyright.HeaderText = "Copyright";
			this.DataGridTextBoxColumn_Copyright.MappingName = "Column_Copyright";
			this.DataGridTextBoxColumn_Copyright.Width = 75;
			// 
			// DataGridBoolColumn_Crop
			// 
			this.DataGridBoolColumn_Crop.Alignment = System.Windows.Forms.HorizontalAlignment.Center;
			this.DataGridBoolColumn_Crop.AllowNull = false;
			this.DataGridBoolColumn_Crop.FalseValue = false;
			this.DataGridBoolColumn_Crop.HeaderText = "Crop";
			this.DataGridBoolColumn_Crop.MappingName = "Column_Crop";
			this.DataGridBoolColumn_Crop.NullValue = null;
			this.DataGridBoolColumn_Crop.TrueValue = true;
			this.DataGridBoolColumn_Crop.Width = 75;
			// 
			// DataGridTextBoxColumn_CropLeft
			// 
			this.DataGridTextBoxColumn_CropLeft.Format = "";
			this.DataGridTextBoxColumn_CropLeft.FormatInfo = null;
			this.DataGridTextBoxColumn_CropLeft.HeaderText = "Crop Left";
			this.DataGridTextBoxColumn_CropLeft.MappingName = "Column_CropLeft";
			this.DataGridTextBoxColumn_CropLeft.Width = 75;
			// 
			// DataGridTextBoxColumn_CropTop
			// 
			this.DataGridTextBoxColumn_CropTop.Format = "";
			this.DataGridTextBoxColumn_CropTop.FormatInfo = null;
			this.DataGridTextBoxColumn_CropTop.HeaderText = "Crop Top";
			this.DataGridTextBoxColumn_CropTop.MappingName = "Column_CropTop";
			this.DataGridTextBoxColumn_CropTop.Width = 75;
			// 
			// DataGridTextBoxColumn_CropRight
			// 
			this.DataGridTextBoxColumn_CropRight.Format = "";
			this.DataGridTextBoxColumn_CropRight.FormatInfo = null;
			this.DataGridTextBoxColumn_CropRight.HeaderText = "Crop Right";
			this.DataGridTextBoxColumn_CropRight.MappingName = "Column_CropRight";
			this.DataGridTextBoxColumn_CropRight.Width = 75;
			// 
			// DataGridTextBoxColumn_CropBottom
			// 
			this.DataGridTextBoxColumn_CropBottom.Format = "";
			this.DataGridTextBoxColumn_CropBottom.FormatInfo = null;
			this.DataGridTextBoxColumn_CropBottom.HeaderText = "Crop Bottom";
			this.DataGridTextBoxColumn_CropBottom.MappingName = "Column_CropBottom";
			this.DataGridTextBoxColumn_CropBottom.Width = 75;
			// 
			// DataGridBoolColumn_TwoPass
			// 
			this.DataGridBoolColumn_TwoPass.Alignment = System.Windows.Forms.HorizontalAlignment.Center;
			this.DataGridBoolColumn_TwoPass.AllowNull = false;
			this.DataGridBoolColumn_TwoPass.FalseValue = false;
			this.DataGridBoolColumn_TwoPass.HeaderText = "Two Pass";
			this.DataGridBoolColumn_TwoPass.MappingName = "Column_TwoPass";
			this.DataGridBoolColumn_TwoPass.NullValue = null;
			this.DataGridBoolColumn_TwoPass.TrueValue = true;
			this.DataGridBoolColumn_TwoPass.Width = 75;
			// 
			// Button_Stop
			// 
			this.Button_Stop.Location = new System.Drawing.Point(704, 498);
			this.Button_Stop.Name = "Button_Stop";
			this.Button_Stop.Size = new System.Drawing.Size(72, 24);
			this.Button_Stop.TabIndex = 109;
			this.Button_Stop.Text = "Stop";
			this.Button_Stop.Visible = false;
			this.Button_Stop.Click += new System.EventHandler(this.Button_Stop_Click);
			// 
			// DataSet_Error
			// 
			this.DataSet_Error.DataSetName = "NewDataSet_Error";
			this.DataSet_Error.Locale = new System.Globalization.CultureInfo("en-US");
			this.DataSet_Error.Tables.AddRange(new System.Data.DataTable[] {
																			   this.DataTable_Error});
			// 
			// DataTable_Error
			// 
			this.DataTable_Error.Columns.AddRange(new System.Data.DataColumn[] {
																				   this.DataColumn_ErrorID,
																				   this.DataColumn_ErrorString,
																				   this.DataColumn_ErrorLocation});
			this.DataTable_Error.TableName = "Table_Error";
			// 
			// DataColumn_ErrorID
			// 
			this.DataColumn_ErrorID.AutoIncrement = true;
			this.DataColumn_ErrorID.ColumnName = "Column_ErrorID";
			this.DataColumn_ErrorID.DataType = typeof(int);
			// 
			// DataColumn_ErrorString
			// 
			this.DataColumn_ErrorString.ColumnName = "Column_ErrorString";
			// 
			// DataColumn_ErrorLocation
			// 
			this.DataColumn_ErrorLocation.ColumnName = "Column_ErrorLocation";
			// 
			// DataSet_Default
			// 
			this.DataSet_Default.DataSetName = "NewDataSet_Default";
			this.DataSet_Default.Locale = new System.Globalization.CultureInfo("en-US");
			this.DataSet_Default.Tables.AddRange(new System.Data.DataTable[] {
																				 this.DataTable_Default});
			// 
			// DataTable_Default
			// 
			this.DataTable_Default.Columns.AddRange(new System.Data.DataColumn[] {
																					 this.DataColumn_DestinationDefault,
																					 this.DataColumn_ProfileDefault,
																					 this.DataColumn_PreprocessingDefault,
																					 this.DataColumn_TitleDefault,
																					 this.DataColumn_DescriptionDefault,
																					 this.DataColumn_AuthorDefault,
																					 this.DataColumn_CopyrightDefault,
																					 this.DataColumn_CropEnableDefault,
																					 this.DataColumn_CropTopDefault,
																					 this.DataColumn_CropLeftDefault,
																					 this.DataColumn_CropRightDefault,
																					 this.DataColumn_CropBottomDefault,
																					 this.DataColumn_TwoPassDefault,
																					 this.DataColumn_PreviewDefault,
																					 this.DataColumn_OutputStringDefault,
																					 this.DataColumn_ErrorLogDefault,
																					 this.DataColumn_DRMProfileDefault});
			this.DataTable_Default.TableName = "Table_Default";
			// 
			// DataColumn_DestinationDefault
			// 
			this.DataColumn_DestinationDefault.ColumnName = "Column_DestinationDefault";
			// 
			// DataColumn_ProfileDefault
			// 
			this.DataColumn_ProfileDefault.ColumnName = "Column_ProfileDefault";
			// 
			// DataColumn_PreprocessingDefault
			// 
			this.DataColumn_PreprocessingDefault.ColumnName = "Column_PreprocessingDefault";
			// 
			// DataColumn_TitleDefault
			// 
			this.DataColumn_TitleDefault.ColumnName = "Column_TitleDefault";
			// 
			// DataColumn_DescriptionDefault
			// 
			this.DataColumn_DescriptionDefault.ColumnName = "Column_DescriptionDefault";
			// 
			// DataColumn_AuthorDefault
			// 
			this.DataColumn_AuthorDefault.ColumnName = "Column_AuthorDefault";
			// 
			// DataColumn_CopyrightDefault
			// 
			this.DataColumn_CopyrightDefault.ColumnName = "Column_CopyrightDefault";
			// 
			// DataColumn_CropEnableDefault
			// 
			this.DataColumn_CropEnableDefault.ColumnName = "Column_CropEnableDefault";
			this.DataColumn_CropEnableDefault.DataType = typeof(bool);
			// 
			// DataColumn_CropTopDefault
			// 
			this.DataColumn_CropTopDefault.ColumnName = "Column_CropTopDefault";
			this.DataColumn_CropTopDefault.DataType = typeof(int);
			// 
			// DataColumn_CropLeftDefault
			// 
			this.DataColumn_CropLeftDefault.ColumnName = "Column_CropLeftDefault";
			this.DataColumn_CropLeftDefault.DataType = typeof(int);
			// 
			// DataColumn_CropRightDefault
			// 
			this.DataColumn_CropRightDefault.ColumnName = "Column_CropRightDefault";
			this.DataColumn_CropRightDefault.DataType = typeof(int);
			// 
			// DataColumn_CropBottomDefault
			// 
			this.DataColumn_CropBottomDefault.ColumnName = "Column_CropBottomDefault";
			this.DataColumn_CropBottomDefault.DataType = typeof(int);
			// 
			// DataColumn_TwoPassDefault
			// 
			this.DataColumn_TwoPassDefault.ColumnName = "Column_TwoPassDefault";
			this.DataColumn_TwoPassDefault.DataType = typeof(bool);
			// 
			// DataColumn_PreviewDefault
			// 
			this.DataColumn_PreviewDefault.ColumnName = "Column_PreviewDefault";
			this.DataColumn_PreviewDefault.DataType = typeof(bool);
			// 
			// DataColumn_OutputStringDefault
			// 
			this.DataColumn_OutputStringDefault.ColumnName = "Column_OutputStringDefault";
			// 
			// DataColumn_ErrorLogDefault
			// 
			this.DataColumn_ErrorLogDefault.ColumnName = "Column_ErrorLogDefault";
			this.DataColumn_ErrorLogDefault.DataType = typeof(bool);
			// 
			// DataColumn_DRMProfileDefault
			// 
			this.DataColumn_DRMProfileDefault.ColumnName = "Column_DRMProfileDefault";
			// 
			// StatusBar_Status
			// 
			this.StatusBar_Status.Location = new System.Drawing.Point(0, 523);
			this.StatusBar_Status.Name = "StatusBar_Status";
			this.StatusBar_Status.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
																								this.StatusBarPanel_Content,
																								this.StatusBarPanel_PercentComplete,
																								this.StatusBarPanel_EncoderRunState});
			this.StatusBar_Status.ShowPanels = true;
			this.StatusBar_Status.Size = new System.Drawing.Size(792, 22);
			this.StatusBar_Status.SizingGrip = false;
			this.StatusBar_Status.TabIndex = 120;
			this.StatusBar_Status.Text = "StatusBar_Status";
			// 
			// StatusBarPanel_Content
			// 
			this.StatusBarPanel_Content.Text = "StatusBarPanel_Content";
			this.StatusBarPanel_Content.Width = 428;
			// 
			// StatusBarPanel_PercentComplete
			// 
			this.StatusBarPanel_PercentComplete.Text = "StatusBarPanel_PercentComplete";
			// 
			// StatusBarPanel_EncoderRunState
			// 
			this.StatusBarPanel_EncoderRunState.Text = "StatusBarPanel_EncoderRunState";
			this.StatusBarPanel_EncoderRunState.Width = 264;
			// 
			// GroupBox_Sources
			// 
			this.GroupBox_Sources.Controls.Add(this.Button_SourceRemoveAll);
			this.GroupBox_Sources.Controls.Add(this.Button_RemoveSource);
			this.GroupBox_Sources.Controls.Add(this.ListBox_Source);
			this.GroupBox_Sources.Controls.Add(this.Button_FileOpenSource);
			this.GroupBox_Sources.Location = new System.Drawing.Point(16, 8);
			this.GroupBox_Sources.Name = "GroupBox_Sources";
			this.GroupBox_Sources.Size = new System.Drawing.Size(456, 136);
			this.GroupBox_Sources.TabIndex = 0;
			this.GroupBox_Sources.TabStop = false;
			this.GroupBox_Sources.Text = "Sources";
			// 
			// Button_SourceRemoveAll
			// 
			this.Button_SourceRemoveAll.Enabled = false;
			this.Button_SourceRemoveAll.Location = new System.Drawing.Point(368, 96);
			this.Button_SourceRemoveAll.Name = "Button_SourceRemoveAll";
			this.Button_SourceRemoveAll.Size = new System.Drawing.Size(72, 24);
			this.Button_SourceRemoveAll.TabIndex = 125;
			this.Button_SourceRemoveAll.Text = "Remove All";
			this.Button_SourceRemoveAll.Click += new System.EventHandler(this.Button_SourceRemoveAll_Click);
			// 
			// Button_RemoveSource
			// 
			this.Button_RemoveSource.Enabled = false;
			this.Button_RemoveSource.Location = new System.Drawing.Point(368, 60);
			this.Button_RemoveSource.Name = "Button_RemoveSource";
			this.Button_RemoveSource.Size = new System.Drawing.Size(72, 24);
			this.Button_RemoveSource.TabIndex = 124;
			this.Button_RemoveSource.Text = "Remove";
			this.Button_RemoveSource.Click += new System.EventHandler(this.Button_RemoveSource_Click);
			// 
			// ListBox_Source
			// 
			this.ListBox_Source.AllowDrop = true;
			this.ListBox_Source.Location = new System.Drawing.Point(16, 24);
			this.ListBox_Source.Name = "ListBox_Source";
			this.ListBox_Source.Size = new System.Drawing.Size(336, 95);
			this.ListBox_Source.TabIndex = 123;
			this.ListBox_Source.DragDrop += new System.Windows.Forms.DragEventHandler(this.ListBox_Source_DragDrop);
			this.ListBox_Source.DragEnter += new System.Windows.Forms.DragEventHandler(this.ListBox_Source_DragEnter);
			// 
			// Button_FileOpenSource
			// 
			this.Button_FileOpenSource.Location = new System.Drawing.Point(368, 24);
			this.Button_FileOpenSource.Name = "Button_FileOpenSource";
			this.Button_FileOpenSource.Size = new System.Drawing.Size(72, 24);
			this.Button_FileOpenSource.TabIndex = 122;
			this.Button_FileOpenSource.TabStop = false;
			this.Button_FileOpenSource.Text = "Add";
			this.Button_FileOpenSource.Click += new System.EventHandler(this.Button_FileOpenSource_Click);
			// 
			// TextBox_OutputString
			// 
			this.TextBox_OutputString.Location = new System.Drawing.Point(96, 184);
			this.TextBox_OutputString.Name = "TextBox_OutputString";
			this.TextBox_OutputString.Size = new System.Drawing.Size(376, 20);
			this.TextBox_OutputString.TabIndex = 2;
			this.TextBox_OutputString.Text = "TextBox_OutputString";
			this.TextBox_OutputString.TextChanged += new System.EventHandler(this.TextBox_OutputString_TextChanged);
			// 
			// Label_OutputString
			// 
			this.Label_OutputString.Location = new System.Drawing.Point(16, 184);
			this.Label_OutputString.Name = "Label_OutputString";
			this.Label_OutputString.Size = new System.Drawing.Size(80, 20);
			this.Label_OutputString.TabIndex = 124;
			this.Label_OutputString.Text = "Output String";
			// 
			// Timer_PercentComplete
			// 
			this.Timer_PercentComplete.Interval = 1000;
			this.Timer_PercentComplete.Tick += new System.EventHandler(this.Timer_PercentComplete_Tick);
			// 
			// CheckBox_TwoPass
			// 
			this.CheckBox_TwoPass.Location = new System.Drawing.Point(552, 160);
			this.CheckBox_TwoPass.Name = "CheckBox_TwoPass";
			this.CheckBox_TwoPass.Size = new System.Drawing.Size(168, 16);
			this.CheckBox_TwoPass.TabIndex = 7;
			this.CheckBox_TwoPass.Text = "Enable Two Pass Encoding";
			this.CheckBox_TwoPass.CheckedChanged += new System.EventHandler(this.CheckBox_TwoPass_CheckedChanged);
			// 
			// TextBox_Profile
			// 
			this.TextBox_Profile.Location = new System.Drawing.Point(96, 208);
			this.TextBox_Profile.Name = "TextBox_Profile";
			this.TextBox_Profile.Size = new System.Drawing.Size(296, 20);
			this.TextBox_Profile.TabIndex = 127;
			this.TextBox_Profile.Text = "TextBox_Profile";
			this.TextBox_Profile.TabIndexChanged += new System.EventHandler(this.TextBox_Profile_TextChanged);
			// 
			// Button_SelectProfile
			// 
			this.Button_SelectProfile.Location = new System.Drawing.Point(400, 208);
			this.Button_SelectProfile.Name = "Button_SelectProfile";
			this.Button_SelectProfile.Size = new System.Drawing.Size(72, 20);
			this.Button_SelectProfile.TabIndex = 128;
			this.Button_SelectProfile.Text = "Select...";
			this.Button_SelectProfile.Click += new System.EventHandler(this.Button_SelectProfile_Click);
			// 
			// Form_BatchEncode
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(792, 545);
			this.Controls.Add(this.Button_SelectProfile);
			this.Controls.Add(this.TextBox_Profile);
			this.Controls.Add(this.TextBox_OutputString);
			this.Controls.Add(this.TextBox_Title);
			this.Controls.Add(this.TextBox_Description);
			this.Controls.Add(this.TextBox_Copyright);
			this.Controls.Add(this.TextBox_Author);
			this.Controls.Add(this.TextBox_Destination);
			this.Controls.Add(this.CheckBox_TwoPass);
			this.Controls.Add(this.Label_OutputString);
			this.Controls.Add(this.GroupBox_Sources);
			this.Controls.Add(this.StatusBar_Status);
			this.Controls.Add(this.DataGrid_Batch);
			this.Controls.Add(this.Button_RemoveAll);
			this.Controls.Add(this.Button_Remove);
			this.Controls.Add(this.Button_Add);
			this.Controls.Add(this.Label_Title);
			this.Controls.Add(this.Label_Description);
			this.Controls.Add(this.Label_Copyright);
			this.Controls.Add(this.Label_Author);
			this.Controls.Add(this.ComboBox_DRMProfile);
			this.Controls.Add(this.Label_DRMProfile);
			this.Controls.Add(this.Button_FileOpenDestination);
			this.Controls.Add(this.Label_OutputFolder);
			this.Controls.Add(this.ComboBox_PreProc);
			this.Controls.Add(this.Label_PreProc);
			this.Controls.Add(this.GroupBox_Crop);
			this.Controls.Add(this.Label_Profile);
			this.Controls.Add(this.Button_Stop);
			this.Controls.Add(this.Button_Start);
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.Menu = this.MainMenu1;
			this.Name = "Form_BatchEncode";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "BatchEncode";
			this.Closing += new System.ComponentModel.CancelEventHandler(this.Form_BatchEncode_Closing);
			this.Load += new System.EventHandler(this.Form_BatchEncode_Load);
			this.GroupBox_Crop.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.NumericUpDown_CropBottom)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.NumericUpDown_CropRight)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.NumericUpDown_CropLeft)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.NumericUpDown_CropTop)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.DataGrid_Batch)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.DataSet_Batch)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.DataTable_Batch)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.DataTable_SessionInfo)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.DataTable_SourceList)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.DataSet_Error)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.DataTable_Error)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.DataSet_Default)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.DataTable_Default)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.StatusBarPanel_Content)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.StatusBarPanel_PercentComplete)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.StatusBarPanel_EncoderRunState)).EndInit();
			this.GroupBox_Sources.ResumeLayout(false);
			this.ResumeLayout(false);

		}

		private void Form_BatchEncode_Load(object sender, System.EventArgs e)
		{
			glbEncoder.OnStateChange+=new _IWMEncoderEvents_OnStateChangeEventHandler(this.Encoder_OnStateChange); 
			SrcGrpColl = glbEncoder.SourceGroupCollection;
			sEnumDRMProfiles();
			sEnumPreprocess();
			sSetInitialValues();
			glbboolAppStart = false;
		}

		private void Button_Add_Click(object sender, System.EventArgs e)
		{
			bool boolDataValidates = true;
			int i;
			string strSource;
			string strDestination = TextBox_Destination.Text;
			string strProfile = TextBox_Profile.Text;
			string strPreProc = ComboBox_PreProc.Text;
			string strDRMProfile = ComboBox_DRMProfile.Text;
			string strOutputString = TextBox_OutputString.Text;
			string strTitleAdd = TextBox_Title.Text;
			string strDescriptionAdd = TextBox_Description.Text;
			string strAuthorAdd = TextBox_Author.Text;
			string strCopyrightAdd = TextBox_Copyright.Text;
			bool boolCrop=false;
			long lngCropLeft=0;
			string lngCropTop="";
			string lngCropRight="";
			string lngCropBottom="";
			bool boolTwoPass=false;
			string strDestExtension="";
			int intChars=0;
			string strSourceExtension="";
			string strDestinationExtension="";
			string strOutputFolder="";
			string strOutputPath="";
			string strFilename="";
			WMEncProfile2 Pro = new WMEncProfile2();
			Int32 intProContentType=0;
			bool boolProInterlaceMode=false;
			bool boolProInterlaceValid=false;
			bool boolValidDRMProfile=false;
			try 
			{
				if (CheckBox_Crop.CheckState == CheckState.Checked) 
				{
					boolCrop = true;
				} 
				else 
				{
					boolCrop = false;
				}
				if (CheckBox_TwoPass.CheckState == CheckState.Checked) 
				{
					boolTwoPass = true;
				} 
				else 
				{
					boolTwoPass = false;
				}
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
			try 
			{
				if (System.IO.File.Exists(strProfile) == true) 
				{
					Pro.LoadFromFile(strProfile);
					intProContentType = Pro.ContentType;
				} 
				else 
				{
					sDisplayMessage("Cannot find a profile at " + strProfile + "." + Environment.NewLine + Environment.NewLine + "Please check the path or clear the field and use the Select button.");
					TextBox_Profile.Focus();
					return;
				}
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
			try 
			{
				if (strDestination == "") 
				{
					sDisplayMessage("You must specify a destination path.");
					TextBox_Destination.Focus();
					return;
				}
				if (strProfile == "") 
				{
					sDisplayMessage("You must specify a profile.");
					TextBox_Profile.Focus();
					return;
				}
				if (strOutputString == "") 
				{
					sDisplayMessage("You must specify an output string.");
					TextBox_OutputString.Focus();
					return;
				}
				if (boolCrop == true) 
				{
					if (NumericUpDown_CropLeft.Text == "") 
					{
						sDisplayMessage("Left cropping value cannot be blank");
						NumericUpDown_CropLeft.Focus();
						return;
					}
					if (NumericUpDown_CropTop.Text == "") 
					{
						sDisplayMessage("Top cropping value cannot be blank");
						NumericUpDown_CropTop.Focus();
						return;
					}
					if (NumericUpDown_CropRight.Text == "") 
					{
						sDisplayMessage("Right cropping value cannot be blank");
						NumericUpDown_CropRight.Focus();
						return;
					}
					if (NumericUpDown_CropBottom.Text == "") 
					{
						sDisplayMessage("Bottom cropping value cannot be blank");
						NumericUpDown_CropBottom.Focus();
						return;
					}
					if (IsEvenNumber(System.Convert.ToInt32(NumericUpDown_CropLeft.Text)) == false) 
					{
						sDisplayMessage("Left cropping value must be an even number");
						NumericUpDown_CropLeft.Focus();
						return;
					}
					if (IsEvenNumber(System.Convert.ToInt32(NumericUpDown_CropTop.Text)) == false) 
					{
						sDisplayMessage("Top cropping value must be an even number");
						NumericUpDown_CropTop.Focus();
						return;
					}
					if (IsEvenNumber(System.Convert.ToInt32(NumericUpDown_CropRight.Text)) == false) 
					{
						sDisplayMessage("Right cropping value must be an even number");
						NumericUpDown_CropRight.Focus();
						return;
					}
					if (IsEvenNumber(System.Convert.ToInt32(NumericUpDown_CropBottom.Text)) == false) 
					{
						sDisplayMessage("Bottom cropping value must be an even number");
						NumericUpDown_CropBottom.Focus();
						return;
					}
					lngCropLeft =long.Parse (NumericUpDown_CropLeft.Text);
					lngCropTop = NumericUpDown_CropTop.Text;
					lngCropRight = NumericUpDown_CropRight.Text;
					lngCropBottom = NumericUpDown_CropBottom.Text;
				}
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
			try 
			{
				if (intProContentType == 16 || intProContentType == 17) 
				{
					Pro.set_InterlaceMode(0,boolProInterlaceMode);
					if (boolProInterlaceMode == false) 
					{
						if (strPreProc == "Standard") 
						{
							boolProInterlaceValid = true;
						} 
						else if (strPreProc == "Deinterlace") 
						{
							boolProInterlaceValid = true;
						} 
						else if (strPreProc == "Inverse Telecine Auto") 
						{
							boolProInterlaceValid = true;
						} 
						else if (strPreProc == "Inverse Telecine AA Top") 
						{
							boolProInterlaceValid = true;
						} 
						else if (strPreProc == "Inverse Telecine BB Top") 
						{
							boolProInterlaceValid = true;
						} 
						else if (strPreProc == "Inverse Telecine BC Top") 
						{
							boolProInterlaceValid = true;
						} 
						else if (strPreProc == "Inverse Telecine CD Top") 
						{
							boolProInterlaceValid = true;
						} 
						else if (strPreProc == "Inverse Telecine DD Top") 
						{
							boolProInterlaceValid = true;
						} 
						else if (strPreProc == "Inverse Telecine AA Bottom") 
						{
							boolProInterlaceValid = true;
						} 
						else if (strPreProc == "Inverse Telecine BB Bottom") 
						{
							boolProInterlaceValid = true;
						} 
						else if (strPreProc == "Inverse Telecine BC Bottom") 
						{
							boolProInterlaceValid = true;
						} 
						else if (strPreProc == "Inverse Telecine CD Bottom") 
						{
							boolProInterlaceValid = true;
						} 
						else if (strPreProc == "Inverse Telecine DD Bottom") 
						{
							boolProInterlaceValid = true;
						} 
						else if (strPreProc == "Process Interlaced Auto") 
						{
							boolProInterlaceValid = false;
						} 
						else if (strPreProc == "Process Interlaced Top First") 
						{
							boolProInterlaceValid = false;
						} 
						else if (strPreProc == "Process Interlaced Bottom First") 
						{
							boolProInterlaceValid = false;
						}
						if (boolProInterlaceValid == false) 
						{
							sDisplayMessage("The profile does not support the type of preprocessing selected." + Environment.NewLine + Environment.NewLine + "Change the preprocessing selected or check the box" + Environment.NewLine  + "in the profile editor next to 'Allow Interlaced Processing' for this profile.");
							ComboBox_PreProc.Focus();
							return;
						}
					}
				} 
				else if (intProContentType == 1) 
				{
				}
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
			try 
			{
				boolValidDRMProfile = false;
				if (strDRMProfile == "None") 
				{
					boolValidDRMProfile = true;
				} 
				else if (strDRMProfile == "") 
				{
					boolValidDRMProfile = false;
				} 
				else 
				{
					for (i = 0; i <= ComboBox_DRMProfile.Items.Count - 1; i++) 
					{
						if (strDRMProfile == ComboBox_DRMProfile.Items[i].ToString()) 
						{
							boolValidDRMProfile = true;
							break;
						}
					}
				}
				if (boolValidDRMProfile == false) 
				{
					sDisplayMessage("You must select a valid DRM profile in the drop down list.  'None' is a valid profile");
					ComboBox_DRMProfile.Focus();
					return;
				}
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
			try 
			{
				for (i = 0; i <= ListBox_Source.Items.Count - 1; i++) 
				{
					DataRow newRow1 = DataSet_Batch.Tables[0].NewRow();
					strSource = ListBox_Source.Items[i].ToString();
					strSourceExtension = sReturnExtension(strSource);
					strOutputFolder = TextBox_Destination.Text;
					intChars = strOutputFolder.LastIndexOf ("\\");
					if (intChars != 1) 
					{
						strOutputFolder = strOutputFolder + "\\";
					}
					intChars = strSource.LastIndexOf ( "\\");
					strFilename = strSource.Substring (intChars +1);
					strSourceExtension = sReturnExtension(strSource);
					strFilename = strFilename.Substring (0,strFilename.Length  - 4);
					if (intProContentType == 1) 
					{
						strOutputPath = strOutputFolder + strOutputString + strFilename + ".wma";
					} 
					else if (intProContentType == 16) 
					{
						strOutputPath = strOutputFolder + strOutputString + strFilename + ".wmv";
					} 
					else if (intProContentType == 17) 
					{
						strOutputPath = strOutputFolder + strOutputString + strFilename + ".wmv";
					} 
					else 
					{
						strOutputPath = strOutputFolder + strOutputString + strFilename + ".wmv";
						boolDataValidates = false;
					}
					newRow1[0] = "Pending";
					newRow1[2] = strSource;
					newRow1[3] = strOutputPath;
					newRow1[4] = strProfile;
					newRow1[5] = strPreProc;
					newRow1[6] = strDRMProfile;
					newRow1[7] = strTitleAdd;
					newRow1[8] = strDescriptionAdd;
					newRow1[9] = strAuthorAdd;
					newRow1[10] = strCopyrightAdd;
					newRow1[11] = boolCrop;
					if (boolCrop == true) 
					{
						newRow1[12] = lngCropLeft;
						newRow1[13] = lngCropTop;
						newRow1[14] = lngCropRight;
						newRow1[15] = lngCropBottom;
					} 
					else 
					{
						newRow1[12] = 0;
						newRow1[13] = 0;
						newRow1[14] = 0;
						newRow1[15] = 0;
					}
					newRow1[16] = boolTwoPass;
					DataSet_Batch.Tables[0].Rows.Add(newRow1);
					newRow1 = null;
				}
				if (boolDataValidates == false) 
				{
					sDisplayMessage("There are some issues with the content." + Environment.NewLine +Environment.NewLine + "The content has been added to the batch," + Environment.NewLine  + "but some values may not be valid for" + Environment.NewLine  + "the encoding process." + Environment.NewLine + Environment.NewLine + "Please double-check the values specified.");
				} 
				else 
				{
					ListBox_Source.Items.Clear();
				}
				sCountSources();
				sCountBatch();
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private void sCountBatch()
		{
			if (DataSet_Batch.Tables[0].Rows.Count > 0) 
			{
				Button_Add.Enabled = true;
				Button_Remove.Enabled = true;
				Button_RemoveAll.Enabled = true;
			} 
			else 
			{
				Button_Add.Enabled = true;
				Button_Remove.Enabled = false;
				Button_RemoveAll.Enabled = false;
				Button_Add.Focus();
			}
			glbboolSessionDirty = true;
		}

		private void CheckBox_Crop_CheckedChanged(object sender, System.EventArgs e)
		{
			try 
			{
				if (CheckBox_Crop.CheckState == CheckState.Checked) 
				{
					NumericUpDown_CropLeft.Enabled = true;
					NumericUpDown_CropTop.Enabled = true;
					NumericUpDown_CropRight.Enabled = true;
					NumericUpDown_CropBottom.Enabled = true;
				} 
				else 
				{
					NumericUpDown_CropLeft.Enabled = false;
					NumericUpDown_CropTop.Enabled = false;
					NumericUpDown_CropRight.Enabled = false;
					NumericUpDown_CropBottom.Enabled = false;
				}
				glbboolSessionDirty = true;
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private void sCreateFoldersCheck()
		{
			DataTable myData = DataSet_Batch.Tables[0];
			FileFolderExist dlgFolder = new FileFolderExist();
			string strCreateFolderAction = "No";
			string strDestination;
			string strDestFolder;
			int intChars;
			foreach (DataRow myRow in myData.Rows) 
			{
				if (!myRow[0].ToString().Equals (strNoEncode)) 
				{
					strDestination =(string) myRow[3];
					intChars = strDestination.IndexOf ("\\");
					strDestFolder = strDestination.Substring (0,intChars);
					if (strCreateFolderAction == "YesToAll") 
					{
						Directory.CreateDirectory(strDestFolder);
					} 
					else if (strCreateFolderAction == "NoToAll") 
					{
						myRow[0] = strNoEncode;
					} 
					else if (strCreateFolderAction == "No" || strCreateFolderAction == "Yes") 
					{
						if (Directory.Exists(strDestFolder) == false) 
						{
							dlgFolder.TextDialogInput = strDestFolder;
							dlgFolder.TextInformation = "This output folder does not exist:";
							dlgFolder.TextQuestion = "Do you want to create this folder?";
							dlgFolder.TextCaption = "Create Folder?";
							dlgFolder.ShowDialog();
							if (dlgFolder.ActionResult == "YesToAll") 
							{
								strCreateFolderAction = "YesToAll";
								Directory.CreateDirectory(strDestFolder);
								myRow[0] = "Pending";
							} 
							else if (dlgFolder.ActionResult == "Yes") 
							{
								strCreateFolderAction = "Yes";
								Directory.CreateDirectory(strDestFolder);
								myRow[0] = "Pending";
							} 
							else if (dlgFolder.ActionResult == "No") 
							{
								strCreateFolderAction = "No";
								myRow[0]= strNoEncode;
							} 
							else if (dlgFolder.ActionResult == "NoToAll") 
							{
								strCreateFolderAction = "NoToAll";
								myRow[0] = strNoEncode;
							}
						}
					}
				}
			}
		}

		private void sOverWriteFilesCheck()
		{
			DataTable myData = DataSet_Batch.Tables[0];
			DataRow myRow;
			string strDestination;
			string strFileOverwriteAction = "No";
			FileFolderExist dlgFile = new FileFolderExist();
			foreach (DataRow myRow23 in myData.Rows) 
			{
				if (!((string)myRow23[0]).Equals(strNoEncode)) 
				{
					strDestination = (string)myRow23[3];
					if (strFileOverwriteAction == "YesToAll") 
					{
						myRow23[0] = "Pending";
					} 
					else if (strFileOverwriteAction == "NoToAll") 
					{
						myRow23[0] = strNoEncode;
					} 
					else if (strFileOverwriteAction == "No" || strFileOverwriteAction == "Yes") 
					{
						if (System.IO.File.Exists(strDestination) == true) 
						{
							dlgFile.TextDialogInput = strDestination;
							dlgFile.TextInformation = "This file already exists:";
							dlgFile.TextQuestion = "Do you want to overwrite?";
							dlgFile.TextCaption = "Overwrite File?";
							dlgFile.ShowDialog();
							if (dlgFile.ActionResult == "YesToAll") 
							{
								strFileOverwriteAction = "YesToAll";
								myRow23[0] = "Pending";
							} 
							else if (dlgFile.ActionResult == "Yes") 
							{
								strFileOverwriteAction = "Yes";
								myRow23[0] = "Pending";
							} 
							else if (dlgFile.ActionResult == "No") 
							{
								strFileOverwriteAction = "No";
								myRow23[0] = strNoEncode;
							} 
							else if (dlgFile.ActionResult == "NoToAll") 
							{
								strFileOverwriteAction = "NoToAll";
								myRow23[0] = strNoEncode;
							}
						}
					}
				}
			}
		}

		private bool sEncodeFile(strucEncodeInfo myInfo)
		{
			bool boolErrorOccur = false;
			try 
			{
				IWMDRMContentAuthor DRMAuthor = glbEncoder.EncoderDRMContentAuthor;
				IWMDRMProfileCollection DRMProColl = DRMAuthor.DRMProfileCollection;
				IWMDRMProfile DRMPro = null;
			
				object vKeyID=null;
				if (myInfo.DRMProfile != "None") 
				{
					int intDRMProCount = 0;
					for (intDRMProCount = 0; intDRMProCount <= DRMProColl.Count - 1; intDRMProCount++) 
					{
						if (DRMProColl.Item(intDRMProCount).Name == myInfo.DRMProfile) 
						{
							DRMPro = DRMProColl.Item(intDRMProCount);
							break;
						}
					}
					DRMAuthor.SetSessionDRMProfile(DRMPro.ID, ref vKeyID);
				} 
				else 
				{
					DRMAuthor.SetSessionDRMProfile(System.DBNull.Value.ToString(), ref vKeyID);
					DRMAuthor = null;
					DRMProColl = null;
					DRMPro = null;
					vKeyID = null;
				}
			} 
			catch (Exception ex) 
			{
				glbstrErrLocation = "Specify DRM Profile - " + ex.Message.ToString();
				string strError = ex.ToString();
				sLogErr(strError);
				boolErrorOccur = true;
			}
			WMEncProfile2 Pro = new WMEncProfile2();
			Int32 intProContentType=0;
			int intProVBRModeAudio=0;
			int intProVBRModeVideo=0;
			try 
			{
				Pro.LoadFromFile(myInfo.Profile);
				intProContentType = Pro.ContentType;
				intProVBRModeAudio = (int)Pro.get_VBRMode(WMENC_SOURCE_TYPE.WMENC_AUDIO, 0);
				intProVBRModeVideo = (int)Pro.get_VBRMode(WMENC_SOURCE_TYPE.WMENC_VIDEO, 0);
			} 
			catch (Exception ex) 
			{
				glbstrErrLocation = "Load Profile - " + ex.Message.ToString();
				string strError = ex.ToString();
				sLogErr(strError);
				boolErrorOccur = true;
			}
			IWMEncSourceGroup SrcGrp=null;
			try 
			{
				SrcGrp = SrcGrpColl.Add("BatchEncode");
				glbboolSrcGrpColl = true;
			} 
			catch (Exception ex) 
			{
				glbstrErrLocation = "Source Group - " + ex.Message.ToString();
				string strError = ex.ToString();
				sLogErr(strError);
				boolErrorOccur = true;
			}
			IWMEncAudioSource SrcAud=null;
			IWMEncVideoSource2 SrcVid=null;
			string strDestExtension = sReturnExtension(myInfo.Destination);
			try 
			{
				if (intProContentType == 1) 
				{
					SrcAud =(WMEncoderLib.IWMEncAudioSource )  SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO);
					SrcAud.SetInput(myInfo.Source,"","");
				} 
				else if (intProContentType == 16) 
				{
					SrcVid = (WMEncoderLib.IWMEncVideoSource2 ) SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO);
					SrcVid.SetInput(myInfo.Source,"","");
				} 
				else if (intProContentType == 17) 
				{
					SrcAud = (WMEncoderLib.IWMEncAudioSource )SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO);
					SrcAud.SetInput(myInfo.Source,"","");
					SrcVid = (WMEncoderLib.IWMEncVideoSource2 )SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO);
					SrcVid.SetInput(myInfo.Source,"","");
				} 
				else 
				{
					Console.Error.WriteLine ("BatchEncode does not support this type of profile");
				}
			} 
			catch (Exception ex) 
			{
				glbstrErrLocation = "Video / Audio Source - " + ex.Message.ToString();
				string strError = ex.ToString();
				sLogErr(strError);
				boolErrorOccur = true;
				return false;
			}
			try 
			{
				SrcGrp.set_Profile(Pro);
			} 
			catch (Exception ex) 
			{
				glbstrErrLocation = "Encoding Profile - " + ex.Message.ToString();
				string strError = ex.ToString();
				sLogErr(strError);
				boolErrorOccur = true;
			}
			IWMEncDisplayInfo Descr = glbEncoder.DisplayInfo;
			try 
			{
				if (myInfo.Title != "") 
				{
					Descr.Title = myInfo.Title;
				}
				if (myInfo.Description != "") 
				{
					Descr.Description = myInfo.Description;
				}
				if (myInfo.Author != "") 
				{
					Descr.Author = myInfo.Author;
				}
				if (myInfo.Copyright != "") 
				{
					Descr.Copyright = myInfo.Copyright;
				}
			} 
			catch (Exception ex) 
			{
				glbstrErrLocation = "Display Information - " + ex.Message.ToString();
				string strError = ex.ToString();
				sLogErr(strError);
				boolErrorOccur = true;
			}
			try 
			{
				if (intProContentType == 16 || intProContentType == 17) 
				{
					if (myInfo.Crop == true) 
					{
						SrcVid.CroppingBottomMargin =(int) myInfo.CropBottom;
						SrcVid.CroppingTopMargin = (int)myInfo.CropTop;
						SrcVid.CroppingLeftMargin = (int)myInfo.CropLeft;
						SrcVid.CroppingRightMargin = (int)myInfo.CropRight;
					}
				}
			} 
			catch (Exception ex) 
			{
				glbstrErrLocation = "Cropping - " + ex.Message.ToString();
				string strError = ex.ToString();
				sLogErr(strError);
				boolErrorOccur = true;
			}
			try 
			{
				if (intProContentType == 16 || intProContentType == 17) 
				{
					SrcVid.Optimization = myInfo.Preproc;
				}
			} 
			catch (Exception ex) 
			{
				glbstrErrLocation = "Video Optimization - " + ex.Message.ToString();
				string strError = ex.ToString();
				sLogErr(strError);
				boolErrorOccur = true;
			}
			try 
			{
				if (intProContentType == 1) 
				{
					if (myInfo.TwoPass == false) 
					{
						SrcAud.PreProcessPass = 0;
						glbTwoPassEncoding = false;
					} 
					else 
					{
						SrcAud.PreProcessPass = 1;
						glbTwoPassEncoding = true;
						glbPassNumber = 1;
					}
				} 
				else if (intProContentType == 16) 
				{
					if (myInfo.TwoPass == false) 
					{
						SrcVid.PreProcessPass = 0;
						glbTwoPassEncoding = false;
					} 
					else 
					{
						SrcVid.PreProcessPass = 1;
						glbTwoPassEncoding = true;
						glbPassNumber = 1;
					}
				} 
				else if (intProContentType == 17) 
				{
					if (myInfo.TwoPass == false) 
					{
						SrcAud.PreProcessPass = 0;
						SrcVid.PreProcessPass = 0;
						glbTwoPassEncoding = false;
					} 
					else 
					{
						if (intProVBRModeAudio == 1) 
						{
							SrcAud.PreProcessPass = 1;
						} 
						else if (intProVBRModeAudio == 2) 
						{
							SrcAud.PreProcessPass=1;
						} 
						else if (intProVBRModeAudio == 3) 
						{
							SrcAud.PreProcessPass= 0;
						} 
						else if (intProVBRModeAudio == 4) 
						{
							SrcAud.PreProcessPass= 1;
						}
						if (intProVBRModeVideo == 1) 
						{
							SrcVid.PreProcessPass = 1;
						} 
						else if (intProVBRModeVideo == 2) 
						{
							SrcVid.PreProcessPass = 1;
						} 
						else if (intProVBRModeVideo == 3) 
						{
							SrcVid.PreProcessPass = 0;
						} 
						else if (intProVBRModeVideo == 4) 
						{
							SrcVid.PreProcessPass = 1;
						}
						glbTwoPassEncoding = true;
						glbPassNumber = 1;
					}
				} 
				else 
				{
					Console.Error.WriteLine ("BatchEncode does not support this type of profile");
				}
			} 
			catch (Exception ex) 
			{
				glbstrErrLocation = "Passes - " + ex.Message.ToString();
				string strError = ex.ToString();
				sLogErr(strError);
				boolErrorOccur = true;
			}
			IWMEncFile2 File =(IWMEncFile2) glbEncoder.File;
			try 
			{
				File.LocalFileName = myInfo.Destination;
			} 
			catch (Exception ex) 
			{
				glbstrErrLocation = "Output File - " + ex.Message.ToString();
				string strError = ex.ToString();
				sLogErr(strError);
				boolErrorOccur = true;
			}
			int intDurationAudio = 0;
			int intDurationVideo = 0;
			int intDurationFinal;
			try 
			{
				if (boolErrorOccur == false) 
				{
					glbEncoder.PrepareToEncode(true);
				}
			} 
			catch (Exception ex) 
			{
				glbstrErrLocation = "Encoder Prepare - " + ex.Message.ToString();
				string strError = ex.ToString();
				sLogErr(strError);
				sRemoveSrcGrpColl();
				boolErrorOccur = true;
			}
			try 
			{
				intDurationAudio = System.Convert.ToInt32(SrcAud.Duration  / 1000);
			} 
			catch (Exception ex) 
			{
			}
			try 
			{
				intDurationVideo = System.Convert.ToInt32(SrcVid.Duration  / 1000);
			} 
			catch (Exception ex) 
			{
			}
			if (intDurationAudio == 0) 
			{
				intDurationFinal = intDurationVideo;
			} 
			else if (intDurationVideo == 0) 
			{
				intDurationFinal = intDurationAudio;
			} 
			else 
			{
				if (intDurationVideo >= intDurationAudio) 
				{
					intDurationFinal = intDurationVideo;
				} 
				else 
				{
					intDurationFinal = intDurationAudio;
				}
			}
			glbintSourceDuration = intDurationFinal;
			try 
			{
				if (glbboolEncodingContinue == true & boolErrorOccur == false) 
				{
					glbEncoder.Start();
				}
			} 
			catch (Exception ex) 
			{
				glbstrErrLocation = "Encoder Start - " + ex.Message.ToString();
				string strError = ex.ToString();
				sLogErr(strError);
				boolErrorOccur = true;
			}
			try 
			{
				if (boolErrorOccur == false) 
				{
					Timer_PercentComplete.Enabled = true;
				}
			} 
			catch (Exception ex) 
			{
				glbstrErrLocation = "Enable Timer - " + ex.Message.ToString();
				string strError = ex.ToString();
				sLogErr(strError);
			}
			if (boolErrorOccur == false) 
			{
				return true;
			} 
			else 
			{
				sRemoveSrcGrpColl();
				return false;
			}
		}

		private void Encoder_OnStateChange(WMEncoderLib.WMENC_ENCODER_STATE enumState)
		{
			string strRunState="";
			if (enumState == WMENC_ENCODER_STATE.WMENC_ENCODER_STARTING) 
			{
				strRunState = "Encoder Starting";
			} 
			else if (enumState == WMENC_ENCODER_STATE.WMENC_ENCODER_RUNNING) 
			{
				if (glbTwoPassEncoding == true) 
				{
					if (glbPassNumber == 1) 
					{
						strRunState = "Encoder Running Pass 1 of 2 (No Preview)";
					} 
					else 
					{
						strRunState = "Encoder Running Pass 2 of 2";
					}
				} 
				else 
				{
					strRunState = "Encoder Running Pass 1 of 1";
				}
			} 
			else if (enumState == WMENC_ENCODER_STATE.WMENC_ENCODER_END_PREPROCESS) 
			{
				strRunState = "Encoder End Preprocess";
				glbPassNumber = 2;
			} 
			else if (enumState == WMENC_ENCODER_STATE.WMENC_ENCODER_PAUSING) 
			{
				strRunState = "Encoder Pausing";
			} 
			else if (enumState == WMENC_ENCODER_STATE.WMENC_ENCODER_PAUSED) 
			{
				strRunState = "Encoder Paused";
			} 
			else if (enumState == WMENC_ENCODER_STATE.WMENC_ENCODER_STOPPING) 
			{
				strRunState = "Encoder Stopping";
			} 
			else if (enumState == WMENC_ENCODER_STATE.WMENC_ENCODER_STOPPED) 
			{
				strRunState = "Encoder Stopped";
				if (glbboolBatchComplete == true) 
				{
					strRunState = "Batch Complete";
					StatusBarPanel_PercentComplete.Text = "Ready";
					Timer_PercentComplete.Enabled = false;
					sEnableButtons(false);
					sCountBatch();
				}
				sRemoveSrcGrpColl();
				glbboolStartNext = true;
			}
			StatusBarPanel_EncoderRunState.Text = strRunState;
		}

		private void sRemoveSrcGrpColl()
		{
			try 
			{
				if (glbboolSrcGrpColl == true) 
				{
					SrcGrpColl.Remove(0);
					glbboolSrcGrpColl = false;
				}
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private void sEnableButtons(bool boolStart)
		{
			try 
			{
				if (boolStart == true) 
				{
					Button_Start.Visible = false;
					Button_Stop.Visible = true;
					glbboolEncodingContinue = true;
				} 
				else 
				{
					Button_Start.Visible = true;
					Button_Stop.Visible = false;
					glbboolEncodingContinue = false;
				}
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private void Button_Start_Click(object sender, System.EventArgs e)
		{
			strucEncodeInfo batchInfo = new strucEncodeInfo();
			DataTable myData = DataSet_Batch.Tables[0];
			int myRowCount=0;
			int intCountRow = 1;
			string strContentID="";
			string strSource="";
			string strDestination="";
			string strProfile="";
			string strPreProc="";
			string strDRMProfile="";
			string strTitle="";
			string strDescription="";
			string strAuthor="";
			string strCopyright="";
			bool boolCrop=false;
			long lngCropLeft=0;
			string lngCropTop="";
			string lngCropRight="";
			string lngCropBottom="";
			bool boolTwoPass=false;
			object tmpPreproc = null;
			bool boolEncodeStart=false;
			glbboolBatchComplete = false;
			glbboolStopButtonPressed = false;
			sEnableButtons(true);
			Button_Add.Enabled = false;
			Button_RemoveAll.Enabled = false;
			Button_Remove.Enabled = false;
			try 
			{
				DataSet_Batch.AcceptChanges();
				myRowCount = myData.Rows.Count;
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
			try 
			{
				foreach (DataRow myRow in myData.Rows) 
				{
					myRow[0] = "Pending";
				}
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
			sCreateFoldersCheck();
			sOverWriteFilesCheck();
			foreach (DataRow myRow in myData.Rows) 
			{
				if (!((string)myRow[0]).Equals(strNoEncode)) 
				{
					try 
					{
						glbstrErrLocation = "Read Row";
						strContentID = ((int) myRow[1]).ToString ();
						strSource = (string)myRow[2];
						strDestination = (string)myRow[3];
						strProfile =(string) myRow[4];
						strPreProc =(string) myRow[5];
						strDRMProfile =(string) myRow[6];
						strTitle =(string) myRow[7];
						strDescription =(string) myRow[8];
						strAuthor = (string)myRow[9];
						strCopyright = (string)myRow[10];
						boolCrop = (bool)myRow[11];
						lngCropLeft = long.Parse ( myRow[12].ToString());
						lngCropTop = myRow[13].ToString();
						lngCropRight = myRow[14].ToString ();
						lngCropBottom = myRow[15].ToString ();
						boolTwoPass = (bool)myRow[16];
						batchInfo.DRMProfile = strDRMProfile;
						batchInfo.Source = strSource;
						batchInfo.Destination = strDestination;
						batchInfo.Profile = strProfile;
						if (strPreProc == "Standard") 
						{
							tmpPreproc = optSTANDARD;
						} 
						else if (strPreProc == "Deinterlace") 
						{
							tmpPreproc = optDEINTERLACE;
						} 
						else if (strPreProc == "Inverse Telecine Auto") 
						{
							tmpPreproc = optTELECINE_AUTO;
						} 
						else if (strPreProc == "Inverse Telecine AA Top") 
						{
							tmpPreproc = optTELECINE_AA_TOP;
						} 
						else if (strPreProc == "Inverse Telecine BB Top") 
						{
							tmpPreproc = optTELECINE_BB_TOP;
						} 
						else if (strPreProc == "Inverse Telecine BC Top") 
						{
							tmpPreproc = optTELECINE_BC_TOP;
						} 
						else if (strPreProc == "Inverse Telecine CD Top") 
						{
							tmpPreproc = optTELECINE_CD_TOP;
						} 
						else if (strPreProc == "Inverse Telecine DD Top") 
						{
							tmpPreproc = optTELECINE_DD_TOP;
						} 
						else if (strPreProc == "Inverse Telecine AA Bottom") 
						{
							tmpPreproc = optTELECINE_AA_BOTTOM;
						} 
						else if (strPreProc == "Inverse Telecine BB Bottom") 
						{
							tmpPreproc = optTELECINE_BB_BOTTOM;
						} 
						else if (strPreProc == "Inverse Telecine BC Bottom") 
						{
							tmpPreproc = optTELECINE_BC_BOTTOM;
						} 
						else if (strPreProc == "Inverse Telecine CD Bottom") 
						{
							tmpPreproc = optTELECINE_CD_BOTTOM;
						} 
						else if (strPreProc == "Inverse Telecine DD Bottom") 
						{
							tmpPreproc = optTELECINE_DD_BOTTOM;
						} 
						else if (strPreProc == "Process Interlaced Auto") 
						{
							tmpPreproc = optINTERLACED_AUTO;
						} 
						else if (strPreProc == "Process Interlaced Top First") 
						{
							tmpPreproc = optINTERLACED_TOP_FIRST;
						} 
						else if (strPreProc == "Process Interlaced Bottom First") 
						{
							tmpPreproc = optINTERLACED_BOTTOM_FIRST;
						}
						batchInfo.Preproc =(WMEncoderLib.WMENC_VIDEO_OPTIMIZATION ) tmpPreproc;
						batchInfo.DRMProfile = strDRMProfile;
						batchInfo.Title = strTitle;
						batchInfo.Description = strDescription;
						batchInfo.Author = strAuthor;
						batchInfo.Copyright = strCopyright;
						batchInfo.Crop = boolCrop;
						batchInfo.CropLeft = lngCropLeft;
						batchInfo.CropTop =long.Parse ( lngCropTop);
						batchInfo.CropRight = long.Parse ( lngCropRight);
						batchInfo.CropBottom = long.Parse ( lngCropBottom);
						batchInfo.TwoPass = boolTwoPass;
						Timer_PercentComplete.Enabled = false;
						boolEncodeStart = sEncodeFile(batchInfo);
						if (boolEncodeStart == true) 
						{
							myRow[0] = "Encoding";
							StatusBarPanel_Content.Text = strSource;
							
							glbboolStartNext = false;
						} 
						else 
						{
							myRow[0] = "Error: " + glbstrErrLocation;
							glbboolStartNext = true;
						}
						if (intCountRow == myRowCount) 
						{
							glbboolBatchComplete = true;
						}
						StatusBarPanel_PercentComplete.Text = "Ready";
						while (glbboolStartNext == false) 
						{
							Application.DoEvents();
						}
						if (glbboolStopButtonPressed == true) 
						{
							myRow[0] = "Cancelled";
						} 
						else 
						{
							if (boolEncodeStart == true) 
							{
								myRow[0] = "Encoded";
							}
						}
						if (glbboolEncodingContinue == false) 
						{
							break;
						}
					} 
					catch (Exception ex) 
					{
						string strError = ex.ToString();
						sDisplayErrMessage(strError);
						sLogErr(strError);
					}
				}
				intCountRow = intCountRow + 1;
			}
		
			sEnableButtons(false);
			sCountBatch();
		}

		private void Timer_PercentComplete_Tick(object sender, System.EventArgs e)
		{
			sReportPercentComplete();
		}

		private void sReportPercentComplete()
		{
			if (glbEncoder.RunState == WMENC_ENCODER_STATE.WMENC_ENCODER_RUNNING) 
			{
				IWMEncStatistics Stats = glbEncoder.Statistics;
				IWMEncFileArchiveStats FileStats = (IWMEncFileArchiveStats)Stats.FileArchiveStats;
				int intCurrentFileDuration;
				int intPercentComplete;
				intCurrentFileDuration = System.Convert.ToInt32(FileStats.FileDuration * 10);
				try 
				{
					if (glbPassNumber == 1) 
					{
						if (glbstrStatusPercentComplete.Length == 10) 
						{
							glbstrStatusPercentComplete = "";
						}
						glbstrStatusPercentComplete = glbstrStatusPercentComplete + "�";
						StatusBarPanel_PercentComplete.Text = glbstrStatusPercentComplete;
					} 
					else 
					{
						intPercentComplete = intCurrentFileDuration / glbintSourceDuration * 100;
						StatusBarPanel_PercentComplete.Text = intPercentComplete.ToString() + "% Complete";
					}
				} 
				catch (Exception ex) 
				{
					string strError = ex.ToString();
					sDisplayErrMessage(strError);
					sLogErr(strError);
				} 
				finally 
				{
					FileStats = null;
					Stats = null;
				}
			}
		}

		private void sSetInitialValues()
		{
			Text = strAppName;
			StatusBarPanel_Content.Text = "";
			StatusBarPanel_EncoderRunState.Text = "Encoder Stopped";
			StatusBarPanel_PercentComplete.Text = "Ready";
			try 
			{
				DataSet_Default.ReadXml("Default.xml");
			} 
			catch (Exception ex) 
			{
				TextBox_OutputString.Text = "";
				TextBox_Title.Text = "";
				TextBox_Description.Text = "";
				TextBox_Author.Text = "";
				TextBox_Copyright.Text = "";
				TextBox_Profile.Text = "";
				glbboolSessionDirty = false;
				return;
			}
			DataRow MyRow = DataSet_Default.Tables[0].Rows[0];
			try 
			{
				TextBox_Destination.Text = (string)MyRow[0];
				TextBox_Profile.Text = (string)MyRow[1];
				ComboBox_PreProc.Text = (string)MyRow[2];
				TextBox_Title.Text = (string)MyRow[3];
				TextBox_Description.Text =(string) MyRow[4];
				TextBox_Author.Text =(string) MyRow[5];
				TextBox_Copyright.Text =(string) MyRow[6];
				if ((bool)MyRow[7] == true) 
				{
					CheckBox_Crop.CheckState = CheckState.Checked;
				} 
				else 
				{
					CheckBox_Crop.CheckState = CheckState.Unchecked;
				}
				NumericUpDown_CropLeft.Text = MyRow[8].ToString ();
				NumericUpDown_CropTop.Text = MyRow[9].ToString ();
				NumericUpDown_CropRight.Text = MyRow[10].ToString ();
				NumericUpDown_CropBottom.Text = MyRow[11].ToString ();
				if ((bool)MyRow[12] == true) 
				{
					CheckBox_TwoPass.CheckState = CheckState.Checked;
				} 
				else 
				{
					CheckBox_TwoPass.CheckState = CheckState.Unchecked;
				}
			
				TextBox_OutputString.Text = (string)MyRow[14];
				MenuItem_LogErrors.Checked = (bool)MyRow[15];
				glbLogErrors =(bool) MyRow[15];
				glbboolSessionDirty = false;
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
				TextBox_OutputString.Text = "";
				TextBox_Title.Text = "";
				TextBox_Description.Text = "";
				TextBox_Author.Text = "";
				TextBox_Copyright.Text = "";
				TextBox_Profile.Text = "";
				glbboolSessionDirty = false;
			}
		}

		private void sDisplayErrMessage(string strError)
		{
			MessageBox.Show(strError, strAppName, MessageBoxButtons.OK, MessageBoxIcon.Error);
		}

		private void sDisplayMessage(string strMsg)
		{
			try 
			{
				MessageBox.Show(strMsg, strAppName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private void sLogErr(string strError)
		{
			if (glbLogErrors == true) 
			{
				DataRow newrow1 = DataSet_Error.Tables[0].NewRow();
				newrow1[1] = strError;
				newrow1[2] = glbstrErrLocation;
				DataSet_Error.Tables[0].Rows.Add(newrow1);
				DataSet_Error.WriteXml("ErrorLog.xml");
			}
		}

		private void MenuItem_Save_Click(object sender, System.EventArgs e)
		{
			sSaveSession(false);
		}

		private void MenuItem_SaveAs_Click(object sender, System.EventArgs e)
		{
			sSaveSession(true);
		}

		private void MenuItem_About_Click(object sender, System.EventArgs e)
		{
			MessageBox.Show(strAppCopyright, strAppName, MessageBoxButtons.OK, MessageBoxIcon.Information);
		}

		private void MenuItem_Exit_Click(object sender, System.EventArgs e)
		{
			Close();
		}

		private void MenuItem_Open_Click(object sender, System.EventArgs e)
		{
			OpenFileDialog dlgFileOpen = new OpenFileDialog();
			DataRow MyRow1;
			DataTable myData2 = DataSet_Batch.Tables[2];
			string strResultPath;
			try 
			{
				sDetermineSessionState();
				dlgFileOpen.Filter = "XML Files (*.xml)|*.xml|All files (*.*)|*.*";
				dlgFileOpen.FilterIndex = 1;
				dlgFileOpen.RestoreDirectory = true;
				if (dlgFileOpen.ShowDialog() == DialogResult.OK) 
				{
					DataSet_Batch.Clear();
					strResultPath = dlgFileOpen.FileName;
					DataSet_Batch.ReadXml(strResultPath);
					MyRow1 = DataSet_Batch.Tables[1].Rows[0];
					TextBox_Destination.Text = (string)MyRow1[0];
					TextBox_Profile.Text = (string)MyRow1[1];
					ComboBox_PreProc.Text = (string)MyRow1[2];
					TextBox_Title.Text = (string)MyRow1[3];
					TextBox_Description.Text = (string)MyRow1[4];
					TextBox_Author.Text = (string)MyRow1[5];
					TextBox_Copyright.Text = (string)MyRow1[6];
					if ((bool)MyRow1[7] == true) 
					{
						CheckBox_Crop.CheckState = CheckState.Checked;
					} 
					else 
					{
						CheckBox_Crop.CheckState = CheckState.Unchecked;
					}
					NumericUpDown_CropTop.Text = (string)MyRow1[8];
					NumericUpDown_CropLeft.Text =(string) MyRow1[9];
					NumericUpDown_CropRight.Text = (string)MyRow1[10];
					NumericUpDown_CropBottom.Text =(string) MyRow1[11];
					if ((bool)MyRow1[12] == true) 
					{
						CheckBox_TwoPass.CheckState = CheckState.Checked;
					} 
					else 
					{
						CheckBox_TwoPass.CheckState = CheckState.Unchecked;
					}
					TextBox_OutputString.Text = (string)MyRow1[14];
					MenuItem_LogErrors.Checked =(bool) MyRow1[15];
					if ((bool)MyRow1[15] == true) 
					{
						glbLogErrors = true;
					}
					ComboBox_DRMProfile.Text =(string) MyRow1[16];
					CheckBox_TwoPass.Enabled = (bool)MyRow1[17];
					ListBox_Source.Items.Clear();
					foreach (DataRow myRow2 in myData2.Rows) 
					{
						ListBox_Source.Items.Add(myRow2[0].ToString());
					}
					glbstrSessionFileName = strResultPath;
					sCountBatch();
					sCountSources();
					glbboolSessionDirty = false;
				}
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private void MenuItem_CurrentAsDefault_Click(object sender, System.EventArgs e)
		{
			DataRow MyRow1 = DataSet_Default.Tables[0].NewRow();
			try 
			{
				if (DataSet_Default.Tables[0].Rows.Count != 0) 
				{
					DataSet_Default.Tables[0].Rows.Clear();
				}
				MyRow1[0] = TextBox_Destination.Text;
				MyRow1[1] = TextBox_Profile.Text;
				MyRow1[2] = ComboBox_PreProc.Text;
				MyRow1[3] = TextBox_Title.Text;
				MyRow1[4] = TextBox_Description.Text;
				MyRow1[5] = TextBox_Author.Text;
				MyRow1[6] = TextBox_Copyright.Text;
				MyRow1[7] = CheckBox_Crop.CheckState;
				MyRow1[8] = NumericUpDown_CropTop.Text;
				MyRow1[9] = NumericUpDown_CropLeft.Text;
				MyRow1[10] = NumericUpDown_CropRight.Text;
				MyRow1[11] = NumericUpDown_CropBottom.Text;
				MyRow1[12] = CheckBox_TwoPass.CheckState;
				MyRow1[13] = false;
				MyRow1[14] = TextBox_OutputString.Text;
				MyRow1[15] = MenuItem_LogErrors.Checked;
				MyRow1[16] = ComboBox_DRMProfile.Text;
				DataSet_Default.Tables[0].Rows.Add(MyRow1);
				DataSet_Default.WriteXml("Default.xml");
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private void Button_RemoveAll_Click(object sender, System.EventArgs e)
		{
			try 
			{
				DataSet_Batch.Clear();
				sCountBatch();
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private void Button_Remove_Click(object sender, System.EventArgs e)
		{
			try 
			{
				if (DataGrid_Batch.CurrentRowIndex != -1) 
				{
					DataSet_Batch.Tables[0].Rows[DataGrid_Batch.CurrentRowIndex].Delete();
				}
				sCountBatch();
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private void Button_Stop_Click(object sender, System.EventArgs e)
		{
			Timer_PercentComplete.Enabled = false;
			try 
			{
				sEnableButtons(false);
				StatusBarPanel_Content.Text = "";
				StatusBarPanel_PercentComplete.Text = "Ready";
				glbboolBatchComplete = true;
				glbboolStopButtonPressed = true;
				glbEncoder.Stop();
				sCountBatch();
				sCountSources();
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				glbstrErrLocation = "Encoder Stopped Button Pressed";
				sLogErr(strError);
			}
		}

		private void Button_SourceRemoveAll_Click(object sender, System.EventArgs e)
		{
			try 
			{
				ListBox_Source.Items.Clear();
				sCountSources();
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private void Button_RemoveSource_Click(object sender, System.EventArgs e)
		{
			try 
			{
				ListBox_Source.Items.Remove(ListBox_Source.SelectedItem);
				sCountSources();
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private void Button_FileOpenSource_Click(object sender, System.EventArgs e)
		{
			OpenFileDialog dlgFileOpen = new OpenFileDialog();
			string strFilter = "Media files (*.avi;*.mpg;*.wmv;*.mp3;*.wav;*.wma)|*.avi;*.mpg;*.wmv;*.mp3;*.wav;*.wma|" + "Video files (*.avi;*.mpg;*.wmv)|*.avi;*.mpg;*.wmv|" + "Audio files (*.mp3;*.wav;*.wma)|*.mp3;*.wav;*.wma|" + "All files (*.*)|*.*";
			try 
			{
				dlgFileOpen.Multiselect = true;
				dlgFileOpen.Filter = strFilter;
				dlgFileOpen.FilterIndex = 1;
				dlgFileOpen.RestoreDirectory = true;
				if (dlgFileOpen.ShowDialog() == DialogResult.OK) 
				{
					if (!((dlgFileOpen.FileNames == null))) 
					{
						int i;
						for ( i = 0; i <= dlgFileOpen.FileNames.Length - 1; i++) 
						{
							ListBox_Source.Items.Add(dlgFileOpen.FileNames[i]);
						}
						sCountSources();
					}
				}
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private void Button_FileOpenDestination_Click(object sender, System.EventArgs e)
		{
			string strFolder = sReturnFolder();
			if (strFolder != "") 
			{
				TextBox_Destination.Text = strFolder;
			}
		}

		private void sCountSources()
		{
			if (ListBox_Source.Items.Count > 0) 
			{
				Button_RemoveSource.Enabled = true;
				Button_SourceRemoveAll.Enabled = true;
			} 
			else 
			{
				Button_RemoveSource.Enabled = false;
				Button_SourceRemoveAll.Enabled = false;
				Button_FileOpenSource.Focus();
			}
			glbboolSessionDirty = true;
		}

		private void sEnumDRMProfiles()
		{
			WMEncoder tempEncoder = new WMEncoder();
			IWMDRMContentAuthor DRM = tempEncoder.EncoderDRMContentAuthor;
			IWMDRMProfileCollection DRMProColl = DRM.DRMProfileCollection;
			IWMDRMProfile DRMPro;
			int i;
			try 
			{
				ComboBox_DRMProfile.Items.Add("None");
				for ( i = 0; i <= DRMProColl.Count - 1; i++) 
				{
					ComboBox_DRMProfile.Items.Add(DRMProColl.Item(i).Name);
				}
				ComboBox_DRMProfile.SelectedIndex = 0;
				tempEncoder = null;
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private void sEnumPreprocess()
		{
			try 
			{
				ComboBox_PreProc.Items.Add("Standard");
				ComboBox_PreProc.Items.Add("Deinterlace");
				ComboBox_PreProc.Items.Add("Inverse Telecine Auto");
				ComboBox_PreProc.Items.Add("Inverse Telecine AA Top");
				ComboBox_PreProc.Items.Add("Inverse Telecine BB Top");
				ComboBox_PreProc.Items.Add("Inverse Telecine BC Top");
				ComboBox_PreProc.Items.Add("Inverse Telecine CD Top");
				ComboBox_PreProc.Items.Add("Inverse Telecine DD Top");
				ComboBox_PreProc.Items.Add("Inverse Telecine AA Bottom");
				ComboBox_PreProc.Items.Add("Inverse Telecine BB Bottom");
				ComboBox_PreProc.Items.Add("Inverse Telecine BC Bottom");
				ComboBox_PreProc.Items.Add("Inverse Telecine CD Bottom");
				ComboBox_PreProc.Items.Add("Inverse Telecine DD Bottom");
				ComboBox_PreProc.Items.Add("Process Interlaced Auto");
				ComboBox_PreProc.Items.Add("Process Interlaced Top First");
				ComboBox_PreProc.Items.Add("Process Interlaced Bottom First");
				ComboBox_PreProc.SelectedIndex = 0;
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private bool IsEvenNumber(int intValue)
		{
			try 
			{
				if ((intValue % 2) == 1) 
				{
					return false;
				} 
				else 
				{
					return true;
				}
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			
			}
			return false;
		}

		private string sReturnExtension(string strValue)
		{
			try 
			{
				return strValue.Substring (strValue.Length - 3).ToLower ();
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
			return "";
		}

		private string sReturnFolder()
		{
			try 
			{
				int longpIDList;
				System.Text.StringBuilder strBuffer= new System.Text.StringBuilder(MAX_PATH);
				string strTitle="";
				Form_BatchEncode.BrowseInfo structBrowseInfo = new Form_BatchEncode.BrowseInfo();
				strTitle = "Select Folder";
				structBrowseInfo.hWndOwner = this.Handle.ToInt32();
				structBrowseInfo.lpszTitle = lstrcat(strTitle, "");
				structBrowseInfo.ulFlags = BIF_RETURNONLYFSDIRS + BIF_DONTGOBELOWDOMAIN;
				longpIDList = SHBrowseForFolder(ref structBrowseInfo);
				if (longpIDList!=0) 
				{
					SHGetPathFromIDList(longpIDList, strBuffer);
					return strBuffer.ToString ();
				}
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
			return "";
		}

		private void sSaveSession(bool boolSaveAs)
		{
			SaveFileDialog dlgFileSave = new SaveFileDialog();
			DataRow MyRow1 = DataSet_Batch.Tables[1].NewRow() ;
			int i;
			try 
			{
				if (DataSet_Batch.Tables[1].Rows.Count != 0) 
				{
					DataSet_Batch.Tables[1].Rows.Clear();
				}
				MyRow1[0] = TextBox_Destination.Text;
				MyRow1[1] = TextBox_Profile.Text;
				MyRow1[2] = ComboBox_PreProc.Text;
				MyRow1[3] = TextBox_Title.Text;
				MyRow1[4] = TextBox_Description.Text;
				MyRow1[5] = TextBox_Author.Text;
				MyRow1[6] = TextBox_Copyright.Text;
				MyRow1[7] = CheckBox_Crop.CheckState;
				MyRow1[8] = NumericUpDown_CropTop.Text;
				MyRow1[9] = NumericUpDown_CropLeft.Text;
				MyRow1[10] = NumericUpDown_CropRight.Text;
				MyRow1[11] = NumericUpDown_CropBottom.Text;
				MyRow1[12] = CheckBox_TwoPass.CheckState;
				MyRow1[13] = false;
				MyRow1[14] = TextBox_OutputString.Text;
				MyRow1[15] = MenuItem_LogErrors.Checked;
				MyRow1[16] = ComboBox_DRMProfile.Text;
				MyRow1[17] = CheckBox_TwoPass.Enabled;
				DataSet_Batch.Tables[1].Rows.Add(MyRow1);
				if (DataSet_Batch.Tables[2].Rows.Count != 0) 
				{
					DataSet_Batch.Tables[2].Rows.Clear();
				}
				for ( i = 0; i <= ListBox_Source.Items.Count - 1; i++) 
				{
					DataRow myRow2 = DataSet_Batch.Tables[2].NewRow();
					myRow2[0] = ListBox_Source.Items[i].ToString();
					DataSet_Batch.Tables[2].Rows.Add(myRow2);
					myRow2 = null;
				}
				if (boolSaveAs == true | glbstrSessionFileName == "") 
				{
					dlgFileSave.Filter = "XML Files (*.xml)|*.xml|All files (*.*)|*.*";
					dlgFileSave.FilterIndex = 1;
					dlgFileSave.RestoreDirectory = true;
					if (dlgFileSave.ShowDialog() == DialogResult.OK) 
					{
						glbstrSessionFileName = dlgFileSave.FileName;
						DataSet_Batch.WriteXml(glbstrSessionFileName);
						glbboolSessionDirty = false;
					}
				} 
				else 
				{
					DataSet_Batch.WriteXml(glbstrSessionFileName);
					glbboolSessionDirty = false;
				}
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private void ListBox_Source_DragEnter(object sender, System.Windows.Forms.DragEventArgs e)
		{
			try 
			{
				if (e.Data.GetDataPresent(DataFormats.FileDrop)) 
				{
					e.Effect = DragDropEffects.All;
				} 
				else 
				{
					e.Effect = DragDropEffects.None;
				}
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private void ListBox_Source_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
		{
			string[] droppedFiles = ((string [])(e.Data.GetData(DataFormats.FileDrop, false)));
		
			bool boolValidFile=false;
			try 
			{
				foreach (string strFilename in droppedFiles) 
				{
					if (sReturnExtension(strFilename) == "avi" || sReturnExtension(strFilename) == "mpg" || sReturnExtension(strFilename) == "wmv" || sReturnExtension(strFilename) == "wav" || sReturnExtension(strFilename) == "mp3" || sReturnExtension(strFilename) == "wma") 
					{
						ListBox_Source.Items.Add(strFilename);
					}
				}
				sCountSources();
				glbboolSessionDirty = true;
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private void Form_BatchEncode_Closing(object sender, System.ComponentModel.CancelEventArgs e)
		{
			try 
			{
				if (glbEncoder.RunState == WMENC_ENCODER_STATE.WMENC_ENCODER_RUNNING) 
				{
					glbEncoder.Stop();
				}
				sDetermineSessionState();
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private void sDetermineSessionState()
		{
			if (glbboolSessionDirty == true) 
			{
				if (MessageBox.Show("The current session has not been saved." + Environment.NewLine + Environment.NewLine + "Do you want to save the current session?", strAppName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) 
				{
					sSaveSession(false);
				}
			}
		}

		private void MenuItem_LogErrors_Click(object sender, System.EventArgs e)
		{
			try 
			{
				if (MenuItem_LogErrors.Checked == false) 
				{
					MenuItem_LogErrors.Checked = true;
					glbLogErrors = true;
				} 
				else 
				{
					MenuItem_LogErrors.Checked = false;
					glbLogErrors = false;
				}
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private void Button_SelectProfile_Click(object sender, System.EventArgs e)
		{
			OpenFileDialog dlgFileOpen = new OpenFileDialog();
			string strFilter = "Encoder Profiles (*.prx)|*.prx|" + "All files (*.*)|*.*";
			try 
			{
				dlgFileOpen.Multiselect = false;
				dlgFileOpen.Filter = strFilter;
				dlgFileOpen.FilterIndex = 1;
				dlgFileOpen.RestoreDirectory = true;
				if (dlgFileOpen.ShowDialog() == DialogResult.OK) 
				{
					if (!((dlgFileOpen.FileName == null))) 
					{
						TextBox_Profile.Text = dlgFileOpen.FileName;
						sEvalProfile(dlgFileOpen.FileName);
					}
				}
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private void TextBox_Profile_Leave(object sender, System.EventArgs e)
		{
			string strProfile = TextBox_Profile.Text;
			try 
			{
				if (System.IO.File.Exists(strProfile)) 
				{
					sEvalProfile(strProfile);
				} 
				else if (strProfile == "") 
				{
					CheckBox_TwoPass.Enabled = true;
					CheckBox_TwoPass.CheckState = CheckState.Unchecked;
					return;
				} 
				else 
				{
					sDisplayMessage("Cannot find a profile at " + strProfile + "." + Environment.NewLine + Environment.NewLine + "Please check the path or clear the field and use the Select button.");
					TextBox_Profile.Focus();
				}
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private void sEvalProfile(string strProfilePath)
		{
			WMEncProfile2 pro = new WMEncProfile2();
			int intVideoMode=0;
			int intAudioMode=0;
			bool boolVideoTwoPassLock=false;
			int intVideoPasses=0;
			bool boolAudioTwoPassLock=false;
			int intAudioPasses=0;
			try 
			{
				pro.LoadFromFile(strProfilePath);
				intVideoMode =(int) pro.get_VBRMode(WMENC_SOURCE_TYPE.WMENC_VIDEO, 0);
				intAudioMode =(int) pro.get_VBRMode(WMENC_SOURCE_TYPE.WMENC_AUDIO, 0);
				if (intVideoMode == 1) 
				{
					boolVideoTwoPassLock = false;
					intVideoPasses = 0;
				} 
				else if (intVideoMode == 2) 
				{
					boolVideoTwoPassLock = true;
					intVideoPasses = 2;
				} 
				else if (intVideoMode == 3) 
				{
					boolVideoTwoPassLock = true;
					intVideoPasses = 1;
				} 
				else if (intVideoMode == 4) 
				{
					boolVideoTwoPassLock = true;
					intVideoPasses = 2;
				}
				if (intAudioMode == 1) 
				{
					boolAudioTwoPassLock = false;
					intAudioPasses = 0;
				} 
				else if (intAudioMode == 2) 
				{
					boolAudioTwoPassLock = true;
					intAudioPasses = 2;
				} 
				else if (intAudioMode == 3) 
				{
					boolAudioTwoPassLock = true;
					intAudioPasses = 1;
				} 
				else if (intAudioMode == 4) 
				{
					boolAudioTwoPassLock = true;
					intAudioPasses = 2;
				}
				if (boolAudioTwoPassLock == true | boolVideoTwoPassLock == true) 
				{
					CheckBox_TwoPass.Enabled = false;
				} 
				else 
				{
					CheckBox_TwoPass.Enabled = true;
				}
				if (intVideoPasses > intAudioPasses) 
				{
					if (intVideoPasses == 0) 
					{
						CheckBox_TwoPass.CheckState = CheckState.Unchecked;
					} 
					else if (intVideoPasses == 1) 
					{
						CheckBox_TwoPass.CheckState = CheckState.Unchecked;
					} 
					else if (intVideoPasses == 2) 
					{
						CheckBox_TwoPass.CheckState = CheckState.Checked;
					}
				} 
				else 
				{
					if (intAudioPasses == 0) 
					{
						CheckBox_TwoPass.CheckState = CheckState.Unchecked;
					} 
					else if (intAudioPasses == 1) 
					{
						CheckBox_TwoPass.CheckState = CheckState.Unchecked;
					} 
					else if (intAudioPasses == 2) 
					{
						CheckBox_TwoPass.CheckState = CheckState.Checked;
					}
				}
			} 
			catch (Exception ex) 
			{
				string strError = ex.ToString();
				sDisplayErrMessage(strError);
				sLogErr(strError);
			}
		}

		private void TextBox_Destination_TextChanged(object sender, System.EventArgs e)
		{
			glbboolSessionDirty = true;
		}

		private void TextBox_OutputString_TextChanged(object sender, System.EventArgs e)
		{
			glbboolSessionDirty = true;
		}

		private void TextBox_Profile_TextChanged(object sender, System.EventArgs e)
		{
			glbboolSessionDirty = true;
		}

		private void ComboBox_PreProc_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			glbboolSessionDirty = true;
		}

		private void ComboBox_DRMProfile_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			glbboolSessionDirty = true;
		}

		private void NumericUpDown_CropTop_ValueChanged(object sender, System.EventArgs e)
		{
			glbboolSessionDirty = true;
		}

		private void NumericUpDown_CropRight_ValueChanged(object sender, System.EventArgs e)
		{
			glbboolSessionDirty = true;
		}

		private void NumericUpDown_CropLeft_ValueChanged(object sender, System.EventArgs e)
		{
			glbboolSessionDirty = true;
		}

		private void NumericUpDown_CropBottom_ValueChanged(object sender, System.EventArgs e)
		{
			glbboolSessionDirty = true;
		}

		private void CheckBox_TwoPass_CheckedChanged(object sender, System.EventArgs e)
		{
			glbboolSessionDirty = true;
		}

		private void TextBox_Title_TextChanged(object sender, System.EventArgs e)
		{
			glbboolSessionDirty = true;
		}

		private void TextBox_Description_TextChanged(object sender, System.EventArgs e)
		{
			glbboolSessionDirty = true;
		}

		private void TextBox_Author_TextChanged(object sender, System.EventArgs e)
		{
			glbboolSessionDirty = true;
		}

		private void TextBox_Copyright_TextChanged(object sender, System.EventArgs e)
		{
			glbboolSessionDirty = true;
		}
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new Form_BatchEncode ());
		
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
Pakistan Pakistan
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions