Jack2 1.9.12

JackMMCSS.h
1 /*
2 Copyright (C) 2004-2008 Grame
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as published by
6 the Free Software Foundation; either version 2.1 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18 */
19
20
21
22 #ifndef __JackMMCSS__
23 #define __JackMMCSS__
24
25 #include "JackSystemDeps.h"
26 #include "JackCompilerDeps.h"
27 #include <windows.h>
28 #include <map>
29
30 namespace Jack
31 {
32
33 typedef enum _AVRT_PRIORITY {
34 AVRT_PRIORITY_LOW = -1,
35 AVRT_PRIORITY_NORMAL, /* 0 */
36 AVRT_PRIORITY_HIGH, /* 1 */
37 AVRT_PRIORITY_CRITICAL /* 2 */
38 } AVRT_PRIORITY, *PAVRT_PRIORITY;
39
40 #define BASE_REALTIME_PRIORITY 90
41
42 typedef HANDLE (WINAPI *avSetMmThreadCharacteristics)(LPCTSTR, LPDWORD);
43 typedef BOOL (WINAPI *avRevertMmThreadCharacteristics)(HANDLE);
44 typedef BOOL (WINAPI *avSetMmThreadPriority)(HANDLE, AVRT_PRIORITY);
45
50 class SERVER_EXPORT JackMMCSS
51 {
52
53 private:
54
55 static JACK_HANDLE fAvrtDll;
56 static avSetMmThreadCharacteristics ffMMCSSFun1;
57 static avSetMmThreadPriority ffMMCSSFun2;
58 static avRevertMmThreadCharacteristics ffMMCSSFun3;
59 static std::map<jack_native_thread_t, HANDLE> fHandleTable;
60
61 public:
62
63 JackMMCSS();
64 ~JackMMCSS();
65
66 static int MMCSSAcquireRealTime(jack_native_thread_t thread, int priority);
67 static int MMCSSDropRealTime(jack_native_thread_t thread);
68
69 };
70
71 } // end of namespace
72
73 #endif
74
Jack::JackMMCSS
MMCSS services.
Definition: JackMMCSS.h:50