Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
windows_mmcss.h
1// SPDX-FileCopyrightText: © 2020, 2023 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3/*
4 * This file incorporates work covered by the following copyright and
5 * permission notice:
6 *
7 * Copyright (C) 2015 Tim Mayberry <mojofunk@gmail.com>
8 *
9 * This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation, either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
23#include "zrythm-config.h"
24
25#ifdef _WOE32
26
27# ifndef __AUDIO_WINDOWS_MMCSS_H__
28# define __AUDIO_WINDOWS_MMCSS_H__
29
30# include <windows.h>
31
32typedef enum AVRT_PRIORITY
33{
34 AVRT_PRIORITY_VERYLOW = -2,
35 AVRT_PRIORITY_LOW,
36 AVRT_PRIORITY_NORMAL,
37 AVRT_PRIORITY_HIGH,
38 AVRT_PRIORITY_CRITICAL
39} AVRT_PRIORITY;
40
41typedef enum WindowsMMCSSErrorCode
42{
43 MMCSS_ERROR_INVALID_TASK_NAME = 1550,
44 MMCSS_ERROR_INVALID_TASK_INDEX = 1551
45} WindowsMMCSSErrorCode;
46
47int
48windows_mmcss_initialize (void);
49
50int
51windows_mmcss_deinitialize (void);
52
53int
54windows_mmcss_set_thread_characteristics (
55 const char * task_name,
56 HANDLE * task_handle);
57
58int
59windows_mmcss_revert_thread_characteristics (HANDLE task_handle);
60
61int windows_mmcss_set_thread_priority (HANDLE, AVRT_PRIORITY);
62
63# endif // __AUDIO_WINDOWS_MMCSS_H__
64#endif // _WOE32