using System.Windows.Forms;\r
using System.IO;\r
using System.Threading;\r
-using System.Runtime.InteropServices;\r
+using Handbrake.EncodeQueue;\r
+using Handbrake.Functions;\r
using Microsoft.Win32;\r
\r
\r
delegate void SetTextCallback(string text);\r
String read_file;\r
Thread monitor;\r
- Queue.QueueHandler encodeQueue;\r
+ QueueHandler encodeQueue;\r
int position; // Position in the arraylist reached by the current log output in the rtf box.\r
string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";\r
private frmMain mainWin;\r
/// <summary>\r
/// This window should be used to display the RAW output of the handbrake CLI which is produced during an encode.\r
/// </summary>\r
- public frmActivityWindow(string file, Queue.QueueHandler eh, frmMain mw)\r
+ public frmActivityWindow(string file, QueueHandler eh, frmMain mw)\r
{\r
InitializeComponent();\r
\r
rtf_actLog.AppendText(String.Format("### Install Dir: {0} \n", Application.StartupPath));\r
rtf_actLog.AppendText(String.Format("### Data Dir: {0} \n", Application.UserAppDataPath));\r
rtf_actLog.AppendText("#########################################\n\n");\r
- if (encodeQueue.isEncoding && encodeQueue.lastQueueItem.Query != String.Empty)\r
+ if (encodeQueue.IsEncoding && encodeQueue.LastEncode.Query != String.Empty)\r
{\r
- rtf_actLog.AppendText("### CLI Query: " + encodeQueue.lastQueueItem.Query + "\n\n");\r
+ rtf_actLog.AppendText("### CLI Query: " + encodeQueue.LastEncode.Query + "\n\n");\r
rtf_actLog.AppendText("#########################################\n\n");\r
}\r
}\r
updateTextFromThread();\r
while (true)\r
{\r
- if (encodeQueue.isEncoding || mainWin.isScanning)\r
+ if (encodeQueue.IsEncoding || mainWin.isScanning)\r
updateTextFromThread();\r
else\r
{\r
#endregion\r
\r
#region System Information\r
- private struct MEMORYSTATUS // Unused var's are requred here.\r
- {\r
- public UInt32 dwLength;\r
- public UInt32 dwMemoryLoad;\r
- public UInt32 dwTotalPhys; // Used\r
- public UInt32 dwAvailPhys;\r
- public UInt32 dwTotalPageFile;\r
- public UInt32 dwAvailPageFile;\r
- public UInt32 dwTotalVirtual;\r
- public UInt32 dwAvailVirtual;\r
- }\r
-\r
- [DllImport("kernel32.dll")]\r
- private static extern void GlobalMemoryStatus\r
- (\r
- ref MEMORYSTATUS lpBuffer\r
- );\r
+ \r
\r
/// <summary>\r
/// Returns the total physical ram in a system\r
/// <returns></returns>\r
public uint TotalPhysicalMemory()\r
{\r
- MEMORYSTATUS memStatus = new MEMORYSTATUS();\r
- GlobalMemoryStatus(ref memStatus);\r
+ Win32.MEMORYSTATUS memStatus = new Win32.MEMORYSTATUS();\r
+ Win32.GlobalMemoryStatus(ref memStatus);\r
\r
uint MemoryInfo = memStatus.dwTotalPhys;\r
MemoryInfo = MemoryInfo / 1024 / 1024;\r