Merge pull request #4011 from fritsch/vdpau-settings
[vuplus_xbmc] / lib / UnrarXLib / system.cpp
1 #include "rar.hpp"
2
3 #ifndef _WIN_CE
4 static int SleepTime=0;
5
6 void InitSystemOptions(int SleepTime)
7 {
8   ::SleepTime=SleepTime;
9 }
10 #endif
11
12
13 #if !defined(SFX_MODULE) && !defined(_WIN_CE)
14
15 #if defined(_WIN_32) && !defined(BELOW_NORMAL_PRIORITY_CLASS)
16 #define BELOW_NORMAL_PRIORITY_CLASS 0x00004000
17 #define ABOVE_NORMAL_PRIORITY_CLASS 0x00008000
18 #endif
19
20 void SetPriority(int Priority)
21 {
22 #if defined(_WIN_32)
23   uint PriorityClass;
24   int PriorityLevel;
25   if (Priority<1 || Priority>15)
26     return;
27   if (Priority==1)
28   {
29     PriorityClass=IDLE_PRIORITY_CLASS;
30     PriorityLevel=THREAD_PRIORITY_IDLE;
31   }
32   else
33     if (Priority<7)
34     {
35       PriorityClass=IDLE_PRIORITY_CLASS;
36       PriorityLevel=Priority-4;
37     }
38     else
39       if (Priority<11)
40       {
41         PriorityClass=NORMAL_PRIORITY_CLASS;
42         PriorityLevel=Priority-9;
43       }
44       else
45       {
46         PriorityClass=HIGH_PRIORITY_CLASS;
47         PriorityLevel=Priority-13;
48       }
49   SetPriorityClass(GetCurrentProcess(),PriorityClass);
50   SetThreadPriority(GetCurrentThread(),PriorityLevel);
51 #endif
52 }
53 #endif
54
55
56 void Wait()
57 {
58 }