VirtualBox

source: vbox/trunk/src/VBox/Devices/Audio/VBoxMMNotificationClient.h@ 88230

最後變更 在這個檔案從88230是 88230,由 vboxsync 提交於 4 年 前

Audio: Renamed DrvAudio.h to DrvAudioCommon.h and move the DrvAudio.h structures into DrvAudio.cpp. bugref:9890

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 2.8 KB
 
1/* $Id: VBoxMMNotificationClient.h 88230 2021-03-22 09:55:26Z vboxsync $ */
2/** @file
3 * VBoxMMNotificationClient.h - Implementation of the IMMNotificationClient interface
4 * to detect audio endpoint changes.
5 */
6
7/*
8 * Copyright (C) 2017-2020 Oracle Corporation
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.alldomusa.eu.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 */
18
19#ifndef VBOX_INCLUDED_SRC_Audio_VBoxMMNotificationClient_h
20#define VBOX_INCLUDED_SRC_Audio_VBoxMMNotificationClient_h
21#ifndef RT_WITHOUT_PRAGMA_ONCE
22# pragma once
23#endif
24
25#include <iprt/critsect.h>
26#include <iprt/win/windows.h>
27
28/* Should fix warning in include\ks.h. */
29#ifndef _WIN64
30# ifdef RT_ARCH_X86
31# define _WIN64 1
32# else
33# define _WIN64 0
34# endif
35#endif
36
37#include <Mmdeviceapi.h>
38
39
40class VBoxMMNotificationClient : IMMNotificationClient
41{
42public:
43
44 VBoxMMNotificationClient();
45 virtual ~VBoxMMNotificationClient();
46
47 HRESULT Initialize();
48
49 HRESULT Register(void);
50 void Unregister(void);
51
52 int RegisterCallback(PPDMDRVINS pDrvIns, PFNPDMHOSTAUDIOCALLBACK pfnCallback);
53 void UnregisterCallback(void);
54
55 /** @name IUnknown interface
56 * @{ */
57 IFACEMETHODIMP_(ULONG) Release();
58 /** @} */
59
60private:
61
62 bool m_fRegisteredClient;
63 IMMDeviceEnumerator *m_pEnum;
64 IMMDevice *m_pEndpoint;
65
66 long m_cRef;
67
68 PPDMDRVINS m_pDrvIns;
69 PFNPDMHOSTAUDIOCALLBACK m_pfnCallback;
70
71 HRESULT AttachToDefaultEndpoint();
72 void DetachFromEndpoint();
73
74 void doCallback(void);
75
76 /** @name IMMNotificationClient interface
77 * @{ */
78 IFACEMETHODIMP OnDeviceStateChanged(LPCWSTR pwstrDeviceId, DWORD dwNewState);
79 IFACEMETHODIMP OnDeviceAdded(LPCWSTR pwstrDeviceId);
80 IFACEMETHODIMP OnDeviceRemoved(LPCWSTR pwstrDeviceId);
81 IFACEMETHODIMP OnDefaultDeviceChanged(EDataFlow flow, ERole role, LPCWSTR pwstrDefaultDeviceId);
82 IFACEMETHODIMP OnPropertyValueChanged(LPCWSTR /*pwstrDeviceId*/, const PROPERTYKEY /*key*/) { return S_OK; }
83 IFACEMETHODIMP OnDeviceQueryRemove() { return S_OK; }
84 IFACEMETHODIMP OnDeviceQueryRemoveFailed() { return S_OK; }
85 IFACEMETHODIMP OnDeviceRemovePending() { return S_OK; }
86 /** @} */
87
88 /** @name IUnknown interface
89 * @{ */
90 IFACEMETHODIMP QueryInterface(const IID& iid, void** ppUnk);
91 IFACEMETHODIMP_(ULONG) AddRef();
92 /** @} */
93};
94#endif /* !VBOX_INCLUDED_SRC_Audio_VBoxMMNotificationClient_h */
95
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette