Rename PortSetDeviceMetadata to PortSetDefaultMetadata
[jack2.git] / windows / JackMMCSS.h
blobfaf331882240a1b7e47ddba96722e68233c95cf5
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 #define BASE_REALTIME_PRIORITY 90
42 typedef HANDLE (WINAPI *avSetMmThreadCharacteristics)(LPCTSTR, LPDWORD);
43 typedef BOOL (WINAPI *avRevertMmThreadCharacteristics)(HANDLE);
44 typedef BOOL (WINAPI *avSetMmThreadPriority)(HANDLE, AVRT_PRIORITY);
46 /*!
47 \brief MMCSS services.
50 class SERVER_EXPORT JackMMCSS
53 private:
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;
61 public:
63 JackMMCSS();
64 ~JackMMCSS();
66 static int MMCSSAcquireRealTime(jack_native_thread_t thread, int priority);
67 static int MMCSSDropRealTime(jack_native_thread_t thread);
71 } // end of namespace
73 #endif