netvoice.h

来自「游戏音频程序设计-Beginning.Game.Audio.Programmin」· C头文件 代码 · 共 54 行

H
54
字号
//-----------------------------------------------------------------------------
// File: NetVoice.h
//
// Desc: 
//
// Copyright (C) 2000-2001 Microsoft Corporation. All Rights Reserved.
//-----------------------------------------------------------------------------
#ifndef NETVOICE_H
#define NETVOICE_H


#include <windows.h>
#include <dvoice.h>


class CNetVoice
{
public:
    CNetVoice( LPDVMESSAGEHANDLER pfnDirectPlayClientVoiceMessageHandler,
               LPDVMESSAGEHANDLER pfnDirectPlayServerVoiceMessageHandler );
    virtual ~CNetVoice();

    HRESULT Init( HWND hDlg, BOOL bCreateSession, BOOL bConnectToSession, 
                  LPUNKNOWN pDirectPlay, DWORD dwSessionType, GUID* pGuidCT, 
                  DVCLIENTCONFIG* pdvClientConfig, LPDIRECTSOUND lpds = NULL );
    HRESULT Free();

    HRESULT HostMigrate( LPDIRECTPLAYVOICESERVER pdvServerInterface );
    HRESULT IsHalfDuplex() { return m_bHalfDuplex; }
    HRESULT ChangeVoiceClientSettings( DVCLIENTCONFIG* pdvClientConfig );

    LPDIRECTPLAYVOICECLIENT GetVoiceClient() { return m_pVoiceClient; }
    LPDIRECTPLAYVOICESERVER GetVoiceServer() { return m_pVoiceServer; }

protected:
    LPDIRECTPLAYVOICECLIENT m_pVoiceClient;
    LPDIRECTPLAYVOICESERVER m_pVoiceServer;                                                                             
    LPDVMESSAGEHANDLER m_pfnDirectPlayClientVoiceMessageHandler;
    LPDVMESSAGEHANDLER m_pfnDirectPlayServerVoiceMessageHandler;

    HRESULT VoiceSessionCreate( LPUNKNOWN pDirectPlay, DWORD dwSessionType, GUID* pGuidCT );
    HRESULT VoiceSessionTestAudioSetup( HWND hDlg );
    HRESULT VoiceSessionConnect( HWND hDlg, LPUNKNOWN pDirectPlay, 
                                 DVCLIENTCONFIG* pdvClientConfig, LPDIRECTSOUND lpds = NULL );
    HRESULT VoiceSessionDisconnect();
    HRESULT VoiceSessionDestroy();

    HRESULT m_bHalfDuplex;
};


#endif // NETVOICE_H

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?