Correct Changelog.
[jack2.git] / windows / JackMMCSS.h
blob39d89a6a808fc089171443fd8b40e2298c2d04b6
1 /*
2 Copyright (C) 2004-2008 Grame
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.
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.
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.
22 #ifndef __JackMMCSS__
23 #define __JackMMCSS__
25 #include "JackSystemDeps.h"
26 #include "JackCompilerDeps.h"
27 #include <windows.h>
28 #include <map>
30 namespace Jack
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;
40 typedef HANDLE (WINAPI *avSetMmThreadCharacteristics)(LPCTSTR, LPDWORD);
41 typedef BOOL (WINAPI *avRevertMmThreadCharacteristics)(HANDLE);
42 typedef BOOL (WINAPI *avSetMmThreadPriority)(HANDLE, AVRT_PRIORITY);
44 /*!
45 \brief MMCSS services.
48 class SERVER_EXPORT JackMMCSS
51 private:
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;
59 public:
61 JackMMCSS();
62 ~JackMMCSS();
64 static int MMCSSAcquireRealTime(jack_native_thread_t thread);
65 static int MMCSSDropRealTime(jack_native_thread_t thread);
69 } // end of namespace
71 #endif