Jack2  1.9.9
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 typedef HANDLE (WINAPI *avSetMmThreadCharacteristics)(LPCTSTR, LPDWORD);
41 typedef BOOL (WINAPI *avRevertMmThreadCharacteristics)(HANDLE);
42 typedef BOOL (WINAPI *avSetMmThreadPriority)(HANDLE, AVRT_PRIORITY);
43 
48 class SERVER_EXPORT JackMMCSS
49 {
50 
51  private:
52 
53  static JACK_HANDLE fAvrtDll;
54  static avSetMmThreadCharacteristics ffMMCSSFun1;
55  static avSetMmThreadPriority ffMMCSSFun2;
56  static avRevertMmThreadCharacteristics ffMMCSSFun3;
57  static std::map<jack_native_thread_t, HANDLE> fHandleTable;
58 
59  public:
60 
61  JackMMCSS();
62  ~JackMMCSS();
63 
64  static int MMCSSAcquireRealTime(jack_native_thread_t thread);
65  static int MMCSSDropRealTime(jack_native_thread_t thread);
66 
67 };
68 
69 } // end of namespace
70 
71 #endif
72 
MMCSS services.
Definition: JackMMCSS.h:48