2020-03-30 12:00:09 +00:00
|
|
|
//
|
|
|
|
// libtgvoip is free and unencumbered public domain software.
|
|
|
|
// For more information, see http://unlicense.org or the UNLICENSE file
|
|
|
|
// you should have received with this source code distribution.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef LIBTGVOIP_WINDOWS_SANDBOX_UTILS
|
|
|
|
#define LIBTGVOIP_WINDOWS_SANDBOX_UTILS
|
|
|
|
|
|
|
|
#include <audioclient.h>
|
|
|
|
#include <windows.h>
|
|
|
|
#ifndef TGVOIP_WP_SILVERLIGHT
|
|
|
|
#include <mmdeviceapi.h>
|
|
|
|
#endif
|
|
|
|
#include <wrl.h>
|
|
|
|
#include <wrl/implements.h>
|
|
|
|
|
|
|
|
using namespace Microsoft::WRL;
|
|
|
|
|
2020-04-24 09:21:58 +00:00
|
|
|
namespace tgvoip
|
|
|
|
{
|
2020-03-30 12:00:09 +00:00
|
|
|
|
|
|
|
#ifndef TGVOIP_WP_SILVERLIGHT
|
2020-04-24 09:21:58 +00:00
|
|
|
class ActivationHandler : public RuntimeClass<RuntimeClassFlags<ClassicCom>, FtmBase, IActivateAudioInterfaceCompletionHandler>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
STDMETHOD(ActivateCompleted)
|
|
|
|
(IActivateAudioInterfaceAsyncOperation* operation);
|
|
|
|
|
|
|
|
ActivationHandler(HANDLE _event);
|
|
|
|
HANDLE event;
|
|
|
|
IAudioClient2* client;
|
|
|
|
HRESULT actResult;
|
|
|
|
};
|
2020-03-30 12:00:09 +00:00
|
|
|
#endif
|
|
|
|
|
2020-04-24 09:21:58 +00:00
|
|
|
class WindowsSandboxUtils
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static IAudioClient2* ActivateAudioDevice(const wchar_t* devID, HRESULT* callResult, HRESULT* actResult);
|
|
|
|
};
|
2020-03-30 12:00:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // LIBTGVOIP_WINDOWS_SANDBOX_UTILS
|