⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 netvoice.h

📁 游戏编程精粹2第四章源码
💻 H
字号:
//-----------------------------------------------------------------------------
// File: NetVoice.h
//
// Desc: 
//
// Copyright (C) 2000 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -