aboutsummaryrefslogtreecommitdiffstats
path: root/code/client/cl_input.c
diff options
context:
space:
mode:
authoricculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-06-04 21:50:00 +0000
committericculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-06-04 21:50:00 +0000
commit41fd71487ee41196b9fbe3e701a6c5414f20a8a3 (patch)
treeb27c897b249457699e936306946dac5e16e4ad58 /code/client/cl_input.c
parentb949e776ca74e15d78e597fbcb86630cc6c257f7 (diff)
downloadioquake3-aero-41fd71487ee41196b9fbe3e701a6c5414f20a8a3.tar.gz
ioquake3-aero-41fd71487ee41196b9fbe3e701a6c5414f20a8a3.zip
VoIP: functionality to adjust incoming audio gain, per-user.
git-svn-id: svn://svn.icculus.org/quake3/trunk@1366 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/client/cl_input.c')
-rw-r--r--code/client/cl_input.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/code/client/cl_input.c b/code/client/cl_input.c
index ff0e5b1..46ede87 100644
--- a/code/client/cl_input.c
+++ b/code/client/cl_input.c
@@ -759,6 +759,33 @@ void CL_WritePacket( void ) {
}
#if USE_VOIP
+ // Move cl_voipSendTarget from a string to a
+ if (cl_voipSendTarget->modified) {
+ const char *target = cl_voipSendTarget->string;
+ if ((*target == '\0') || (Q_stricmp(target, "all") == 0)) {
+ clc.voipTarget1 = clc.voipTarget2 = clc.voipTarget3 = 0x7FFFFFFF;
+ } else if (Q_stricmp(target, "none") == 0) {
+ clc.voipTarget1 = clc.voipTarget2 = clc.voipTarget3 = 0;
+ } else {
+ clc.voipTarget1 = clc.voipTarget2 = clc.voipTarget3 = 0;
+ const char *ptr = target;
+ do {
+ if ((*ptr == ',') || (*ptr == '\0')) {
+ const int val = atoi(target);
+ target = ptr + 1;
+ if ((val >= 0) && (val < 31)) {
+ clc.voipTarget1 |= (1 << (val-0));
+ } else if ((val >= 31) && (val < 62)) {
+ clc.voipTarget2 |= (1 << (val-31));
+ } else if ((val >= 62) && (val < 93)) {
+ clc.voipTarget3 |= (1 << (val-62));
+ }
+ }
+ } while (*(ptr++));
+ }
+ cl_voipSendTarget->modified = qfalse;
+ }
+
if (clc.voipOutgoingDataSize > 0) { // only send if data.
MSG_WriteByte (&buf, clc_EOF); // placate legacy servers.
MSG_WriteByte (&buf, clc_extension);
@@ -766,9 +793,9 @@ void CL_WritePacket( void ) {
MSG_WriteByte (&buf, clc.voipOutgoingGeneration);
MSG_WriteLong (&buf, clc.voipOutgoingSequence);
MSG_WriteByte (&buf, clc.voipOutgoingDataFrames);
- MSG_WriteLong (&buf, 0x7FFFFFFF); // !!! FIXME: send to specific people.
- MSG_WriteLong (&buf, 0x7FFFFFFF); // !!! FIXME: send to specific people.
- MSG_WriteLong (&buf, 0x7FFFFFFF); // !!! FIXME: send to specific people.
+ MSG_WriteLong (&buf, clc.voipTarget1);
+ MSG_WriteLong (&buf, clc.voipTarget2);
+ MSG_WriteLong (&buf, clc.voipTarget3);
MSG_WriteShort (&buf, clc.voipOutgoingDataSize);
MSG_WriteData (&buf, clc.voipOutgoingData, clc.voipOutgoingDataSize);
clc.voipOutgoingSequence += clc.voipOutgoingDataFrames;