2 * $Logfile: /Freespace2/code/Network/multi_voice.h $
8 * Revision 1.1 2002/05/03 03:28:12 root
12 * 2 10/07/98 10:53a Dave
15 * 1 10/07/98 10:50a Dave
17 * 12 4/25/98 2:02p Dave
18 * Put in multiplayer context help screens. Reworked ingame join ship
19 * select screen. Fixed places where network timestamps get hosed.
21 * 11 4/21/98 4:44p Dave
22 * Implement Vasudan ships in multiplayer. Added a debug function to bash
23 * player rank. Fixed a few rtvoice buffer overrun problems. Fixed ui
24 * problem in options screen.
26 * 10 4/17/98 5:27p Dave
27 * More work on the multi options screen. Fixed many minor ui todo bugs.
29 * 9 4/09/98 11:01p Dave
30 * Put in new multi host options screen. Tweaked multiplayer options a
33 * 8 4/07/98 5:42p Dave
34 * Put in support for ui display of voice system status (recording,
35 * playing back, etc). Make sure main hall music is stopped before
36 * entering a multiplayer game via ingame join.
38 * 7 3/30/98 6:27p Dave
39 * Put in a more official set of multiplayer options, including a system
40 * for distributing netplayer and netgame settings.
42 * 6 3/23/98 12:59a Lawrance
43 * remove obsolete parameters from multi_voice_process_next_chunk()
45 * 5 3/18/98 3:32p Dave
46 * Put in a hook for streamed rtvoice data from the rtvoice system.
48 * 4 3/17/98 12:30a Dave
49 * Put in hud support for rtvoice. Several ui interface changes.
51 * 3 3/16/98 2:35p Dave
52 * Numerous bug fixes. Made the "cue sound" sound play before incoming
55 * 2 2/26/98 4:21p Dave
56 * More robust multiplayer voice.
58 * 1 2/24/98 10:12p Dave
59 * Initial pass at multiplayer voice streaming.
64 #ifndef _MULTIPLAYER_VOICE_STREAMING_HEADER_FILE
65 #define _MULTIPLAYER_VOICE_STREAMING_HEADER_FILE
67 // --------------------------------------------------------------------------------------------------
68 // MULTI VOICE DEFINES/VARS
73 // voice system status defines
74 #define MULTI_VOICE_STATUS_IDLE 0 // nothing's happening, do nothing
75 #define MULTI_VOICE_STATUS_DENIED 1 // have been denied the token (show a red icon or something)
76 #define MULTI_VOICE_STATUS_RECORDING 2 // am currently recording (show a green icon or something)
77 #define MULTI_VOICE_STATUS_PLAYING 3 // playing back a stream (show another icon)
79 // max recording time for one stream
80 #define MULTI_VOICE_MAX_TIME 5000
82 // capabilities of this machine (make sure multi_voice_init() is called before referencing these)
83 extern int Multi_voice_can_record;
84 extern int Multi_voice_can_play;
86 // local muting preferences
87 extern int Multi_voice_local_prefs;
90 // --------------------------------------------------------------------------------------------------
91 // MULTI VOICE FUNCTIONS
94 // initialize the multiplayer voice system
95 void multi_voice_init();
97 // shutdown the multiplayer voice system
98 void multi_voice_close();
100 // reset between levels
101 void multi_voice_reset();
103 // process all voice details
104 void multi_voice_process();
106 // set the default voice quality and duration (if server passes -1, he just broadcasts the qos to all clients)
107 void multi_voice_set_vars(int qos,int duration);
109 // voice settings debug console function
110 void multi_voice_dcf();
112 // update the qos and/or duration of recording if the current setting is different from the passed in value
113 void multi_voice_maybe_update_vars(int new_qos,int new_duration);
115 // the status of the voice system - use this to determine what bitmaps to display, etc see above MULTI_VOICE_STATUS_* defines
116 int multi_voice_status();
118 // <player> sends hit bitflag settings (who he'll receive sound from, etc)
119 void multi_voice_set_prefs(int pref_flags);
122 // --------------------------------------------------------------------------------------------------
123 // MULTI VOICE / RTVOICE INTERFACE
126 // process the "next" chunk of standalone valid sound data from the rtvoice system
127 void multi_voice_process_next_chunk();
130 // --------------------------------------------------------------------------------------------------
131 // MULTI VOICE PACKET HANDLERS
134 // process an incoming voice packet of some kind or another
135 void multi_voice_process_packet(unsigned char *data, header *hinfo);
138 // --------------------------------------------------------------------------------------------------
139 // MULTI VOICE TESTING FUNCTIONS
142 // start recording voice locally for playback testing
143 void multi_voice_test_record_start();
145 // return if the test recording is going on
146 int multi_voice_test_recording();
148 // call this function if multi_voice_test_recording() is true to process various odds and ends of the test recording
149 void multi_voice_test_process();
151 // force stop any recording voice test
152 void multi_voice_test_record_stop();
154 // get a playback buffer handle (return -1 if none exist - bad)
155 int multi_voice_test_get_playback_buffer();
157 // return whether the last sampled chunk would have been too large to fit in a packet
158 int multi_voice_test_packet_tossed();