| 6 |
| 7 | #ifndef LIBTGVOIP_WINDOWS_SANDBOX_UTILS |
| 8 | #define LIBTGVOIP_WINDOWS_SANDBOX_UTILS |
| 9 |
| 10 | #include <audioclient.h> |
| 11 | #include <windows.h> |
| 12 | #ifndef TGVOIP_WP_SILVERLIGHT |
| 13 | #include <mmdeviceapi.h> |
| 14 | #endif |
| 15 | #include <wrl.h> |
| 16 | #include <wrl/implements.h> |
| 17 |
| 18 | using namespace Microsoft::WRL; |
| 19 |
| 20 | namespace tgvoip { |
| 21 |
| 22 | #ifndef TGVOIP_WP_SILVERLIGHT |
| 23 | class ActivationHandler : |
| 24 | public RuntimeClass< RuntimeClassFlags< ClassicCom >, FtmBase, IActivateAudioInterfaceCompletionHandler > |
| 25 | { |
| 26 | public: |
| 27 | STDMETHOD(ActivateCompleted)(IActivateAudioInterfaceAsyncOperation *operation); |
| 28 |
| 29 | ActivationHandler(HANDLE _event); |
| 30 | HANDLE event; |
| 31 | IAudioClient2* client; |
| 32 | HRESULT actResult; |
| 33 | }; |
| 34 | #endif |
| 35 |
| 36 | class WindowsSandboxUtils { |
| 37 | public: |
| 38 | static IAudioClient2* ActivateAudioDevice(const wchar_t* devID, HRESULT* callResult, HRESULT* actResult); |
| 39 | }; |
| 40 | } |
| 41 |
| 42 | #endif // LIBTGVOIP_WINDOWS_SANDBOX_UTILS |
| 43 |