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

📄 voice_client.h

📁 这是一款2d游戏引擎
💻 H
字号:
/*  $Id: voice_client.h,v 1.11 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_client
#define header_voice_client

#if _MSC_VER > 1000
#pragma once
#endif

class CL_NetObject_Server;
class CL_VoiceClient_Generic;

//: Voice client
//- !group=Voice/Network!
//- !header=voice.h!
class CL_VoiceClient
{
//! Construction:
public:
	//: Construct voice client.
	CL_VoiceClient(CL_NetObject_Controller *controller);

	//: Destroy voice client.
	~CL_VoiceClient();

//! Attributes:
public:

//! Operations:
public:
	//: Connect to voice server.
	void connect(CL_NetComputer &server, CL_NetPacket &connect_data);

	//: Disconnect from voice server.
	void disconnect(CL_NetComputer &server);

	//: Start local recording and upload to server.
	void start_recording();

	//: Stop local recording and upload to server.
	void stop_recording();

//! Implementation:
private:
	CL_VoiceClient_Generic *impl;
};

#endif


/*

#define msg_connect   0
#define msg_voicedata 1

	VoiceClient(CL_NetObject_Controller *controller)
	: handle(controller)
	{
		slots.connect(handle.sig_received_message(msg_voicedata), this, &VoiceClient::on_voice_from_server);
	}

	void connect_server(CL_NetComputer server, CL_NetPacket &connectdata)
	{
		servers.push_back(server);
		handle.send(server, msg_connect, connectdata);
	}

	void voice_from_mic(CL_NetPacket &voicedata)
	{
		std::list<CL_NetComputer>::iterator it;
		for (it = servers.begin(); it != servers.end(); it++)
		{
			handle.send(server_computer, msg_voicedata, voicedata);
		}
	}

	void on_voice_from_server(const CL_NetComputer &computer CL_NetPacket &voicedata)
	{
		play_on_soundcard(voicedata);
	}

	CL_NetObject_Server handle;
	std::list<CL_NetComputer> servers;
	CL_SlotContainer slots;

*/

⌨️ 快捷键说明

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