You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
92 lines
2.4 KiB
92 lines
2.4 KiB
// SAFIntercomClient.h : Declaration of the CSAFIntercomClient
|
|
|
|
#ifndef __SAFIntercomClient_H_
|
|
#define __SAFIntercomClient_H_
|
|
|
|
//JP:not in connectivitylib.h//#include "resource.h" // main symbols
|
|
|
|
#include <MPC_COM.h>
|
|
#include <MPC_Utils.h>
|
|
|
|
#include <rtccore.h>
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CSAFIntercomClient
|
|
class ATL_NO_VTABLE CSAFIntercomClient : // Hungarian safi
|
|
public IDispatchImpl < ISAFIntercomClient, &IID_ISAFIntercomClient, &LIBID_HelpCenterTypeLib >,
|
|
public MPC::ConnectionPointImpl< CSAFIntercomClient, &DIID_DSAFIntercomClientEvents, MPC::CComSafeMultiThreadModel >,
|
|
public IRTCEventNotification
|
|
{
|
|
private:
|
|
|
|
CComPtr<IRTCClient> m_pRTCClient;
|
|
CComPtr<IRTCSession> m_pRTCSession;
|
|
|
|
DWORD m_dwSinkCookie;
|
|
|
|
BOOL m_bOnCall;
|
|
BOOL m_bRTCInit;
|
|
BOOL m_bAdvised;
|
|
|
|
int m_iSamplingRate;
|
|
|
|
CComPtr<IDispatch> m_sink_onVoiceConnected;
|
|
CComPtr<IDispatch> m_sink_onVoiceDisconnected;
|
|
CComPtr<IDispatch> m_sink_onVoiceDisabled;
|
|
|
|
HRESULT Fire_onVoiceConnected (ISAFIntercomClient * safe);
|
|
HRESULT Fire_onVoiceDisconnected (ISAFIntercomClient * safe);
|
|
HRESULT Fire_onVoiceDisabled (ISAFIntercomClient * safe);
|
|
|
|
// Worker functions
|
|
HRESULT Init();
|
|
HRESULT Cleanup();
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
CSAFIntercomClient();
|
|
~CSAFIntercomClient();
|
|
|
|
|
|
|
|
//DECLARE_PROTECT_FINAL_CONSTRUCT() // TODO: JP: Do we need this here?
|
|
|
|
BEGIN_COM_MAP(CSAFIntercomClient)
|
|
COM_INTERFACE_ENTRY(ISAFIntercomClient)
|
|
COM_INTERFACE_ENTRY(IDispatch)
|
|
COM_INTERFACE_ENTRY(IRTCEventNotification)
|
|
END_COM_MAP()
|
|
|
|
// ISAFIntercomClient
|
|
public:
|
|
|
|
STDMETHOD(Disconnect)();
|
|
STDMETHOD(Connect)(BSTR bstrIP, BSTR bstrKey);
|
|
STDMETHOD(RunSetupWizard)();
|
|
|
|
STDMETHOD(Exit)();
|
|
|
|
STDMETHOD(put_onVoiceConnected) (/* in */ IDispatch * function);
|
|
STDMETHOD(put_onVoiceDisconnected) (/* in */ IDispatch * function);
|
|
STDMETHOD(put_onVoiceDisabled) (/* in */ IDispatch * function);
|
|
|
|
STDMETHOD(put_SamplingRate) (/* in */ LONG newVal);
|
|
STDMETHOD(get_SamplingRate) (/* out, retval */ LONG * pVal);
|
|
|
|
|
|
// IRTCEventNotification
|
|
STDMETHOD(Event)( RTC_EVENT RTCEvent, IDispatch * pEvent );
|
|
|
|
HRESULT OnSessionChange(IRTCSession *pSession,
|
|
RTC_SESSION_STATE nState,
|
|
HRESULT ResCode);
|
|
|
|
HRESULT onMediaEvent(IRTCMediaEvent * pMedEvent);
|
|
|
|
|
|
};
|
|
|
|
#endif //__SAFIntercomClient_H_
|