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 _WIN32
26
27# ifndef __AUDIO_WINDOWS_MMCSS_H__
28# define __AUDIO_WINDOWS_MMCSS_H__
29
30# include <windows.h>
31
32typedef enum
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
41# define MMCSS_ERROR_INVALID_TASK_NAME 1550
42# define MMCSS_ERROR_INVALID_TASK_INDEX 1551
43
44int
45windows_mmcss_initialize (void);
46
47int
48windows_mmcss_deinitialize (void);
49
50int
51windows_mmcss_set_thread_characteristics (
52 const char * task_name,
53 HANDLE * task_handle);
54
55int
56windows_mmcss_revert_thread_characteristics (HANDLE task_handle);
57
58int windows_mmcss_set_thread_priority (HANDLE, AVRT_PRIORITY);
59
60# endif // __AUDIO_WINDOWS_MMCSS_H__
61#endif // _WIN32