2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
10 * $Logfile: /Freespace2/code/Network/multi_voice.h $
16 * Revision 1.2 2002/06/09 04:41:14 relnev
17 * added copyright header
19 * Revision 1.1.1.1 2002/05/03 03:28:12 root
23 * 2 10/07/98 10:53a Dave
26 * 1 10/07/98 10:50a Dave
28 * 12 4/25/98 2:02p Dave
29 * Put in multiplayer context help screens. Reworked ingame join ship
30 * select screen. Fixed places where network timestamps get hosed.
32 * 11 4/21/98 4:44p Dave
33 * Implement Vasudan ships in multiplayer. Added a debug function to bash
34 * player rank. Fixed a few rtvoice buffer overrun problems. Fixed ui
35 * problem in options screen.
37 * 10 4/17/98 5:27p Dave
38 * More work on the multi options screen. Fixed many minor ui todo bugs.
40 * 9 4/09/98 11:01p Dave
41 * Put in new multi host options screen. Tweaked multiplayer options a
44 * 8 4/07/98 5:42p Dave
45 * Put in support for ui display of voice system status (recording,
46 * playing back, etc). Make sure main hall music is stopped before
47 * entering a multiplayer game via ingame join.
49 * 7 3/30/98 6:27p Dave
50 * Put in a more official set of multiplayer options, including a system
51 * for distributing netplayer and netgame settings.
53 * 6 3/23/98 12:59a Lawrance
54 * remove obsolete parameters from multi_voice_process_next_chunk()
56 * 5 3/18/98 3:32p Dave
57 * Put in a hook for streamed rtvoice data from the rtvoice system.
59 * 4 3/17/98 12:30a Dave
60 * Put in hud support for rtvoice. Several ui interface changes.
62 * 3 3/16/98 2:35p Dave
63 * Numerous bug fixes. Made the "cue sound" sound play before incoming
66 * 2 2/26/98 4:21p Dave
67 * More robust multiplayer voice.
69 * 1 2/24/98 10:12p Dave
70 * Initial pass at multiplayer voice streaming.
75 #ifndef _MULTIPLAYER_VOICE_STREAMING_HEADER_FILE
76 #define _MULTIPLAYER_VOICE_STREAMING_HEADER_FILE
78 // --------------------------------------------------------------------------------------------------
79 // MULTI VOICE DEFINES/VARS
84 // voice system status defines
85 #define MULTI_VOICE_STATUS_IDLE 0 // nothing's happening, do nothing
86 #define MULTI_VOICE_STATUS_DENIED 1 // have been denied the token (show a red icon or something)
87 #define MULTI_VOICE_STATUS_RECORDING 2 // am currently recording (show a green icon or something)
88 #define MULTI_VOICE_STATUS_PLAYING 3 // playing back a stream (show another icon)
90 // max recording time for one stream
91 #define MULTI_VOICE_MAX_TIME 5000
93 // capabilities of this machine (make sure multi_voice_init() is called before referencing these)
94 extern int Multi_voice_can_record;
95 extern int Multi_voice_can_play;
97 // local muting preferences
98 extern int Multi_voice_local_prefs;
101 // --------------------------------------------------------------------------------------------------
102 // MULTI VOICE FUNCTIONS
105 // initialize the multiplayer voice system
106 void multi_voice_init();
108 // shutdown the multiplayer voice system
109 void multi_voice_close();
111 // reset between levels
112 void multi_voice_reset();
114 // process all voice details
115 void multi_voice_process();
117 // set the default voice quality and duration (if server passes -1, he just broadcasts the qos to all clients)
118 void multi_voice_set_vars(int qos,int duration);
120 // voice settings debug console function
121 void multi_voice_dcf();
123 // update the qos and/or duration of recording if the current setting is different from the passed in value
124 void multi_voice_maybe_update_vars(int new_qos,int new_duration);
126 // the status of the voice system - use this to determine what bitmaps to display, etc see above MULTI_VOICE_STATUS_* defines
127 int multi_voice_status();
129 // <player> sends hit bitflag settings (who he'll receive sound from, etc)
130 void multi_voice_set_prefs(int pref_flags);
133 // --------------------------------------------------------------------------------------------------
134 // MULTI VOICE / RTVOICE INTERFACE
137 // process the "next" chunk of standalone valid sound data from the rtvoice system
138 void multi_voice_process_next_chunk();
141 // --------------------------------------------------------------------------------------------------
142 // MULTI VOICE PACKET HANDLERS
145 // process an incoming voice packet of some kind or another
146 void multi_voice_process_packet(unsigned char *data, header *hinfo);
149 // --------------------------------------------------------------------------------------------------
150 // MULTI VOICE TESTING FUNCTIONS
153 // start recording voice locally for playback testing
154 void multi_voice_test_record_start();
156 // return if the test recording is going on
157 int multi_voice_test_recording();
159 // call this function if multi_voice_test_recording() is true to process various odds and ends of the test recording
160 void multi_voice_test_process();
162 // force stop any recording voice test
163 void multi_voice_test_record_stop();
165 // get a playback buffer handle (return -1 if none exist - bad)
166 int multi_voice_test_get_playback_buffer();
168 // return whether the last sampled chunk would have been too large to fit in a packet
169 int multi_voice_test_packet_tossed();