[MMDEVAPI] Sync with Wine Staging 3.3. CORE-14434
[reactos.git] / dll / win32 / mmdevapi / mmdevapi.h
1 /*
2 * Copyright 2009 Maarten Lankhorst
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library 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 GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19 #pragma once
20
21 #ifndef __WINE_CONFIG_H
22 # error You must include config.h to use this header
23 #endif
24
25 extern HRESULT MMDevEnum_Create(REFIID riid, void **ppv) DECLSPEC_HIDDEN;
26 extern void MMDevEnum_Free(void) DECLSPEC_HIDDEN;
27
28
29 /* Changes to this enum must be synced in drivers. */
30 enum _DriverPriority {
31 Priority_Unavailable = 0, /* driver won't work */
32 Priority_Low, /* driver may work, but unlikely */
33 Priority_Neutral, /* driver makes no judgment */
34 Priority_Preferred /* driver thinks it's correct */
35 };
36
37 typedef struct _DriverFuncs {
38 HMODULE module;
39 WCHAR module_name[64];
40 int priority;
41
42 /* Returns a "priority" value for the driver. Highest priority wins.
43 * If multiple drivers think they are valid, they will return a
44 * priority value reflecting the likelihood that they are actually
45 * valid. See enum _DriverPriority. */
46 int (WINAPI *pGetPriority)(void);
47
48 /* ids gets an array of human-friendly endpoint names
49 * keys gets an array of driver-specific stuff that is used
50 * in GetAudioEndpoint to identify the endpoint
51 * it is the caller's responsibility to free both arrays, and
52 * all of the elements in both arrays with HeapFree() */
53 HRESULT (WINAPI *pGetEndpointIDs)(EDataFlow flow, WCHAR ***ids,
54 GUID **guids, UINT *num, UINT *default_index);
55 HRESULT (WINAPI *pGetAudioEndpoint)(void *key, IMMDevice *dev,
56 IAudioClient **out);
57 HRESULT (WINAPI *pGetAudioSessionManager)(IMMDevice *device,
58 IAudioSessionManager2 **out);
59 HRESULT (WINAPI *pGetPropValue)(GUID *guid,
60 const PROPERTYKEY *prop, PROPVARIANT *out);
61 } DriverFuncs;
62
63 extern DriverFuncs drvs DECLSPEC_HIDDEN;
64
65 typedef struct MMDevice {
66 IMMDevice IMMDevice_iface;
67 IMMEndpoint IMMEndpoint_iface;
68 LONG ref;
69
70 CRITICAL_SECTION crst;
71
72 EDataFlow flow;
73 DWORD state;
74 GUID devguid;
75 WCHAR *drv_id;
76 } MMDevice;
77
78 extern HRESULT AudioClient_Create(MMDevice *parent, IAudioClient **ppv) DECLSPEC_HIDDEN;
79 extern HRESULT AudioEndpointVolume_Create(MMDevice *parent, IAudioEndpointVolumeEx **ppv) DECLSPEC_HIDDEN;
80
81 extern const WCHAR drv_keyW[] DECLSPEC_HIDDEN;