mmdevapi: Move test_connect handling into mmdevapi.
[wine.git] / dlls / mmdevapi / mmdevapi.h
blobcd5b5a25a553304a44cac185681910d508f0de0c
1 /*
2 * Copyright 2009 Maarten Lankhorst
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.
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.
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
19 #include "unixlib.h"
21 #include <winternl.h>
23 #include <wine/list.h>
24 #include <wine/unixlib.h>
26 extern HRESULT MMDevEnum_Create(REFIID riid, void **ppv) DECLSPEC_HIDDEN;
27 extern void MMDevEnum_Free(void) DECLSPEC_HIDDEN;
29 typedef struct _DriverFuncs {
30 HMODULE module;
31 unixlib_handle_t module_unixlib;
32 WCHAR module_name[64];
34 /* Highest priority wins.
35 * If multiple drivers think they are valid, they will return a
36 * priority value reflecting the likelihood that they are actually
37 * valid. See enum _DriverPriority. */
38 int priority;
40 /* ids gets an array of human-friendly endpoint names
41 * keys gets an array of driver-specific stuff that is used
42 * in GetAudioEndpoint to identify the endpoint
43 * it is the caller's responsibility to free both arrays, and
44 * all of the elements in both arrays with HeapFree() */
45 HRESULT (WINAPI *pGetEndpointIDs)(EDataFlow flow, WCHAR ***ids,
46 GUID **guids, UINT *num, UINT *default_index);
47 HRESULT (WINAPI *pGetAudioEndpoint)(void *key, IMMDevice *dev,
48 IAudioClient **out);
49 HRESULT (WINAPI *pGetAudioSessionManager)(IMMDevice *device,
50 IAudioSessionManager2 **out);
51 HRESULT (WINAPI *pGetPropValue)(GUID *guid,
52 const PROPERTYKEY *prop, PROPVARIANT *out);
53 } DriverFuncs;
55 extern DriverFuncs drvs DECLSPEC_HIDDEN;
57 typedef struct MMDevice {
58 IMMDevice IMMDevice_iface;
59 IMMEndpoint IMMEndpoint_iface;
60 LONG ref;
62 CRITICAL_SECTION crst;
64 EDataFlow flow;
65 DWORD state;
66 GUID devguid;
67 WCHAR *drv_id;
69 struct list entry;
70 } MMDevice;
72 extern HRESULT AudioClient_Create(MMDevice *parent, IAudioClient **ppv) DECLSPEC_HIDDEN;
73 extern HRESULT AudioEndpointVolume_Create(MMDevice *parent, IAudioEndpointVolumeEx **ppv) DECLSPEC_HIDDEN;
74 extern HRESULT SpatialAudioClient_Create(IMMDevice *device, ISpatialAudioClient **out) DECLSPEC_HIDDEN;
76 extern HRESULT load_devices_from_reg(void) DECLSPEC_HIDDEN;
77 extern HRESULT load_driver_devices(EDataFlow flow) DECLSPEC_HIDDEN;
79 extern const WCHAR drv_keyW[] DECLSPEC_HIDDEN;