diff options
author | theuni <theuni-nospam-@xbmc.org> | 2011-01-24 16:05:21 -0500 |
---|---|---|
committer | theuni <theuni-nospam-@xbmc.org> | 2011-01-24 16:05:21 -0500 |
commit | c51b1189e3d5353e842991f5859ddcea0f73e426 (patch) | |
tree | ef2cb8a6184699aa614f3655dca4ce661cdc108e /lib/UnrarXLib/system.cpp | |
parent | be61ebdc9e897fe40c6f371111724de79ddee8d5 (diff) |
Merged cptspiff's code-reshuffle branch.
Squashed commit due to build breakage during code-reshuffle history.
Conflicts:
xbmc/Util.cpp
xbmc/cdrip/CDDARipper.cpp
xbmc/filesystem/Directory.cpp
xbmc/filesystem/File.cpp
Diffstat (limited to 'lib/UnrarXLib/system.cpp')
-rw-r--r-- | lib/UnrarXLib/system.cpp | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/lib/UnrarXLib/system.cpp b/lib/UnrarXLib/system.cpp new file mode 100644 index 0000000000..e53199b51e --- /dev/null +++ b/lib/UnrarXLib/system.cpp @@ -0,0 +1,83 @@ +#include "rar.hpp" + +#ifndef _WIN_CE +static int SleepTime=0; + +void InitSystemOptions(int SleepTime) +{ + ::SleepTime=SleepTime; +} +#endif + + +#if !defined(SFX_MODULE) && !defined(_WIN_CE) + +#if defined(_WIN_32) && !defined(BELOW_NORMAL_PRIORITY_CLASS) +#define BELOW_NORMAL_PRIORITY_CLASS 0x00004000 +#define ABOVE_NORMAL_PRIORITY_CLASS 0x00008000 +#endif + +void SetPriority(int Priority) +{ +#ifdef _XBOX + int PriorityLevel; + if (Priority<1 || Priority>15) + return; + if (Priority==1) + { + PriorityLevel=THREAD_PRIORITY_IDLE; + } + else + if (Priority<7) + { + PriorityLevel=Priority-4; + } + else + if (Priority<11) + { + PriorityLevel=Priority-9; + } + else + { + PriorityLevel=Priority-13; + } + SetThreadPriority(GetCurrentThread(),PriorityLevel); + +//#ifdef _WIN_32 +#elif defined(_WIN_32) + uint PriorityClass; + int PriorityLevel; + if (Priority<1 || Priority>15) + return; + if (Priority==1) + { + PriorityClass=IDLE_PRIORITY_CLASS; + PriorityLevel=THREAD_PRIORITY_IDLE; + } + else + if (Priority<7) + { + PriorityClass=IDLE_PRIORITY_CLASS; + PriorityLevel=Priority-4; + } + else + if (Priority<11) + { + PriorityClass=NORMAL_PRIORITY_CLASS; + PriorityLevel=Priority-9; + } + else + { + PriorityClass=HIGH_PRIORITY_CLASS; + PriorityLevel=Priority-13; + } + SetPriorityClass(GetCurrentProcess(),PriorityClass); + SetThreadPriority(GetCurrentThread(),PriorityLevel); +#endif +} +#endif + + +void Wait() +{ +} |