summaryrefslogtreecommitdiff
path: root/libs/pbd/pbd
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2015-09-14 13:26:07 +1000
committerTim Mayberry <mojofunk@gmail.com>2015-09-16 11:22:16 +1000
commit091c4ed3a718c22ebcf205abdb3f2e2bad786459 (patch)
tree228e85ee18f7707e1696980c3b9c29026d556ade /libs/pbd/pbd
parent76a0c823caab700725fe8318d1a4c4e33f067847 (diff)
Move Windows MMCSS related utility functions into libpbd
Diffstat (limited to 'libs/pbd/pbd')
-rw-r--r--libs/pbd/pbd/windows_mmcss.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/libs/pbd/pbd/windows_mmcss.h b/libs/pbd/pbd/windows_mmcss.h
new file mode 100644
index 0000000000..28dc737c4d
--- /dev/null
+++ b/libs/pbd/pbd/windows_mmcss.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2015 Tim Mayberry <mojofunk@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef PBD_WINDOWS_MMCSS_H
+#define PBD_WINDOWS_MMCSS_H
+
+#include <windows.h>
+
+#include <string>
+
+namespace PBD {
+
+namespace MMCSS {
+
+enum AVRT_PRIORITY {
+ AVRT_PRIORITY_VERYLOW = -2,
+ AVRT_PRIORITY_LOW,
+ AVRT_PRIORITY_NORMAL,
+ AVRT_PRIORITY_HIGH,
+ AVRT_PRIORITY_CRITICAL
+};
+
+enum error_codes {
+ ERROR_INVALID_TASK_NAME = 1550,
+ ERROR_INVALID_TASK_INDEX = 1551
+};
+
+bool initialize ();
+
+bool deinitialize ();
+
+bool set_thread_characteristics (const std::string& task_name, HANDLE *task_handle);
+
+bool revert_thread_characteristics (HANDLE task_handle);
+
+bool set_thread_priority (HANDLE, AVRT_PRIORITY);
+
+} // namespace MMCSS
+
+} // namespace PBD
+
+#endif // PBD_WINDOWS_MMCSS_H