From 10afaeef337e0d19b37cb7dbe3fccee48bf18a43 Mon Sep 17 00:00:00 2001 From: icculus Date: Sun, 1 Jun 2008 07:51:23 +0000 Subject: Initial patch for in-game VoIP support! git-svn-id: svn://svn.icculus.org/quake3/trunk@1348 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/client/client.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'code/client/client.h') diff --git a/code/client/client.h b/code/client/client.h index b064404..802e99f 100644 --- a/code/client/client.h +++ b/code/client/client.h @@ -34,6 +34,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "cl_curl.h" #endif /* USE_CURL */ +#if USE_VOIP +#include "speex/speex.h" +#endif + // file full of random crap that gets used to create cl_guid #define QKEY_FILE "qkey" #define QKEY_SIZE 2048 @@ -225,6 +229,30 @@ typedef struct { int timeDemoMaxDuration; // maximum frame duration unsigned char timeDemoDurations[ MAX_TIMEDEMO_DURATIONS ]; // log of frame durations +#if USE_VOIP + qboolean speexInitialized; + int speexFrameSize; + + // incoming data... + // !!! FIXME: convert from parallel arrays to array of a struct. + SpeexBits speexDecoderBits[MAX_CLIENTS]; + void *speexDecoder[MAX_CLIENTS]; + byte voipIncomingGeneration[MAX_CLIENTS]; + int voipIncomingSequence[MAX_CLIENTS]; + qboolean voipIgnore[MAX_CLIENTS]; + qboolean voipMuteAll; + + // outgoing data... + SpeexBits speexEncoderBits; + void *speexEncoder; + int voipOutgoingDataSize; + int voipOutgoingDataFrames; + int voipOutgoingSequence; + byte voipOutgoingGeneration; + byte voipOutgoingData[1024]; + float voipPower; +#endif + // big stuff at end of structure so most offsets are 15 bits or less netchan_t netchan; } clientConnection_t; @@ -372,6 +400,12 @@ extern cvar_t *cl_useMumble; extern cvar_t *cl_mumbleScale; #endif +#if USE_VOIP +extern cvar_t *cl_voipSend; +extern cvar_t *cl_voipGainDuringCapture; +extern cvar_t *voip; +#endif + //================================================= // @@ -426,6 +460,10 @@ extern kbutton_t in_mlook, in_klook; extern kbutton_t in_strafe; extern kbutton_t in_speed; +#if USE_VOIP +extern kbutton_t in_voiprecord; +#endif + void CL_InitInput (void); void CL_SendCmd (void); void CL_ClearState (void); @@ -447,6 +485,11 @@ void Key_SetCatcher( int catcher ); extern int cl_connectedToPureServer; extern int cl_connectedToCheatServer; +#if USE_VOIP +extern int cl_connectedToVoipServer; +void CL_Voip_f( void ); +#endif + void CL_SystemInfoChanged( void ); void CL_ParseServerMessage( msg_t *msg ); -- cgit v1.2.3