From 4be456c1c6b177a1774a8c998d3ac39c94292057 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 9 Aug 2008 18:59:33 +0000 Subject: WinGui: - Added Memory and screen bounds to the activity log. - Removed some x264 code from frmMain. The x264 widgets are now populated from the designer file. - Removed some duplicate code from x264Panel.cs - Added the macgui's animate function to x264Panel.cs - Setup the Audio panel to default the sample rate to audio on audio track change. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1621 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/Program.cs | 39 +++------------------------------------ 1 file changed, 3 insertions(+), 36 deletions(-) (limited to 'win/C#/Program.cs') diff --git a/win/C#/Program.cs b/win/C#/Program.cs index 605195703..ae9edec6f 100644 --- a/win/C#/Program.cs +++ b/win/C#/Program.cs @@ -47,9 +47,9 @@ namespace Handbrake } // Make sure the system has enough RAM. 384MB or greater - uint memory = MemoryCheck.CheckMemeory(); - memory = memory / 1024 / 1024; - + Functions.SystemInfo info = new Functions.SystemInfo(); + uint memory = info.TotalPhysicalMemory(); + if (memory < 256) { MessageBox.Show("Your system does not meet the minimum requirements for HandBrake. \n Insufficient RAM. 384MB or greater required. You have: " + memory.ToString() + "MB", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); @@ -75,37 +75,4 @@ namespace Handbrake } } - class MemoryCheck - { - public struct MEMORYSTATUS - { - public UInt32 dwLength; - public UInt32 dwMemoryLoad; - public UInt32 dwTotalPhys; // Used - public UInt32 dwAvailPhys; - public UInt32 dwTotalPageFile; - public UInt32 dwAvailPageFile; - public UInt32 dwTotalVirtual; - public UInt32 dwAvailVirtual; - // Aditional Varibles left in for future usage (JIC) - } - - [DllImport("kernel32.dll")] - public static extern void GlobalMemoryStatus - ( - ref MEMORYSTATUS lpBuffer - ); - - public static uint CheckMemeory() - { - // Call the native GlobalMemoryStatus method - // with the defined structure. - MEMORYSTATUS memStatus = new MEMORYSTATUS(); - GlobalMemoryStatus(ref memStatus); - - uint MemoryInfo = memStatus.dwTotalPhys; - - return MemoryInfo; - } - } } \ No newline at end of file -- cgit v1.2.3