[SHELL/EXPERIMENTS]
[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 #include <wine/config.h>
20 #include <wine/port.h>
21
22 #include <stdarg.h>
23
24 #define WIN32_NO_STATUS
25 #define _INC_WINDOWS
26 #define COM_NO_WINDOWS_H
27
28 #define COBJMACROS
29 #define NONAMELESSUNION
30
31 #include <windef.h>
32 #include <winbase.h>
33 #include <wingdi.h>
34 #include <winreg.h>
35 #include <objbase.h>
36 #include <audiopolicy.h>
37 #include <endpointvolume.h>
38 #include <mmdeviceapi.h>
39
40 #include <wine/debug.h>
41 #include <wine/unicode.h>
42
43 WINE_DEFAULT_DEBUG_CHANNEL(mmdevapi);
44
45 extern HRESULT MMDevEnum_Create(REFIID riid, void **ppv) DECLSPEC_HIDDEN;
46 extern void MMDevEnum_Free(void) DECLSPEC_HIDDEN;
47
48
49 /* Changes to this enum must be synced in drivers. */
50 enum _DriverPriority {
51 Priority_Unavailable = 0, /* driver won't work */
52 Priority_Low, /* driver may work, but unlikely */
53 Priority_Neutral, /* driver makes no judgment */
54 Priority_Preferred /* driver thinks it's correct */
55 };
56
57 typedef struct _DriverFuncs {
58 HMODULE module;
59 WCHAR module_name[64];
60 int priority;
61
62 /* Returns a "priority" value for the driver. Highest priority wins.
63 * If multiple drivers think they are valid, they will return a
64 * priority value reflecting the likelihood that they are actually
65 * valid. See enum _DriverPriority. */
66 int (WINAPI *pGetPriority)(void);
67
68 /* ids gets an array of human-friendly endpoint names
69 * keys gets an array of driver-specific stuff that is used
70 * in GetAudioEndpoint to identify the endpoint
71 * it is the caller's responsibility to free both arrays, and
72 * all of the elements in both arrays with HeapFree() */
73 HRESULT (WINAPI *pGetEndpointIDs)(EDataFlow flow, WCHAR ***ids,
74 GUID **guids, UINT *num, UINT *default_index);
75 HRESULT (WINAPI *pGetAudioEndpoint)(void *key, IMMDevice *dev,
76 IAudioClient **out);
77 HRESULT (WINAPI *pGetAudioSessionManager)(IMMDevice *device,
78 IAudioSessionManager2 **out);
79 } DriverFuncs;
80
81 extern DriverFuncs drvs DECLSPEC_HIDDEN;
82
83 typedef struct MMDevice {
84 IMMDevice IMMDevice_iface;
85 IMMEndpoint IMMEndpoint_iface;
86 LONG ref;
87
88 CRITICAL_SECTION crst;
89
90 EDataFlow flow;
91 DWORD state;
92 GUID devguid;
93 WCHAR *drv_id;
94 } MMDevice;
95
96 extern HRESULT AudioClient_Create(MMDevice *parent, IAudioClient **ppv) DECLSPEC_HIDDEN;
97 extern HRESULT AudioEndpointVolume_Create(MMDevice *parent, IAudioEndpointVolume **ppv) DECLSPEC_HIDDEN;
98
99 extern const WCHAR drv_keyW[] DECLSPEC_HIDDEN;