📄 voice_server.h
字号:
/* $Id: voice_server.h,v 1.10 2004/01/02 15:42:45 mbn Exp $
**
** ClanLib Game SDK
** Copyright (C) 2003 The ClanLib Team
** For a total list of contributers see the file CREDITS.
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License as published by the Free Software Foundation; either
** version 2.1 of the License, or (at your option) any later version.
**
** This library is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public
** License along with this library; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
**
*/
//! clanVoice="Network"
//! header=voice.h
#ifndef header_voice_server
#define header_voice_server
#if _MSC_VER > 1000
#pragma once
#endif
class CL_NetObject_Client;
class CL_VoiceServer_Generic;
//: Voice Server
//- !group=Voice/Network!
//- !header=voice.h!
class CL_VoiceServer
{
//! Construction:
public:
//: Construct a voice server.
CL_VoiceServer();
//: Destroy voice server.
~CL_VoiceServer();
//! Attributes:
public:
//! Operations:
public:
//: Connect voice client.
void connect(CL_NetObject_Client &client);
//: Disconnect voice client.
void disconnect(CL_NetObject_Client &client);
//: Disconnect voice clients from computer.
void disconnect(CL_NetComputer &client);
//: Mute all voice from client 'source' destinated to client 'dest'.
void mute(CL_NetObject_Client &source, CL_NetObject_Client &dest);
//: Mute all voice from netcomputer 'source' destinated to netcomputer 'dest'.
void mute(CL_NetComputer &source, CL_NetComputer &dest);
//: Unmute all voice from client 'source' destinated to client 'dest'.
void unmute(CL_NetObject_Client &source, CL_NetObject_Client &dest);
//: Unmute all voice from netcomputer 'source' destinated to netcomputer 'dest'.
void unmute(CL_NetComputer &source, CL_NetComputer &dest);
//! Implementation:
private:
CL_VoiceServer_Generic *impl;
};
#endif
/*
class VoiceServer
{
public:
// Connect client to server.
void connect_client(CL_NetObject_Client &client)
{
clients.push_back(client);
slots.connect(client.sig_received_message(msg_voicedata), this, &VoiceServer::on_voice_received);
}
private:
// Called when server received voicedata from a client.
void on_voice_received(CL_NetPacket &voicedata)
{
std::list<CL_NetObject_Client>::iterator it;
for (it = clients.begin(); it != clients.end(); it++)
{
it->send(msg_voicedata, voicedata);
}
}
std::list<CL_NetObject_Client> clients;
CL_SlotContainer slots;
};
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -