]> icculus.org git repositories - taylor/freespace2.git/blob - include/multi_voice.h
rendering functions mostly done; more complete shader setup
[taylor/freespace2.git] / include / multi_voice.h
1 /*
2  * Copyright (C) Volition, Inc. 1999.  All rights reserved.
3  *
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
6  * the source.
7  */
8
9 /*
10  * $Logfile: /Freespace2/code/Network/multi_voice.h $
11  * $Revision$
12  * $Date$
13  * $Author$
14  *
15  * $Log$
16  * Revision 1.2  2002/06/09 04:41:14  relnev
17  * added copyright header
18  *
19  * Revision 1.1.1.1  2002/05/03 03:28:12  root
20  * Initial import.
21  * 
22  * 
23  * 2     10/07/98 10:53a Dave
24  * Initial checkin.
25  * 
26  * 1     10/07/98 10:50a Dave
27  * 
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.
31  * 
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. 
36  * 
37  * 10    4/17/98 5:27p Dave
38  * More work on the multi options screen. Fixed many minor ui todo bugs.
39  * 
40  * 9     4/09/98 11:01p Dave
41  * Put in new multi host options screen. Tweaked multiplayer options a
42  * bit.
43  * 
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.
48  * 
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.
52  * 
53  * 6     3/23/98 12:59a Lawrance
54  * remove obsolete parameters from multi_voice_process_next_chunk()
55  * 
56  * 5     3/18/98 3:32p Dave
57  * Put in a hook for streamed rtvoice data from the rtvoice system.
58  * 
59  * 4     3/17/98 12:30a Dave
60  * Put in hud support for rtvoice. Several ui interface changes.
61  * 
62  * 3     3/16/98 2:35p Dave
63  * Numerous bug fixes. Made the "cue sound" sound play before incoming
64  * voice. 
65  * 
66  * 2     2/26/98 4:21p Dave
67  * More robust multiplayer voice.
68  * 
69  * 1     2/24/98 10:12p Dave
70  * Initial pass at multiplayer voice streaming.
71  *  
72  * $NoKeywords: $
73  */
74
75 #ifndef _MULTIPLAYER_VOICE_STREAMING_HEADER_FILE
76 #define _MULTIPLAYER_VOICE_STREAMING_HEADER_FILE
77
78 // --------------------------------------------------------------------------------------------------
79 // MULTI VOICE DEFINES/VARS
80 //
81
82 struct header;
83
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)
89
90 // max recording time for one stream
91 #define MULTI_VOICE_MAX_TIME                                            5000
92
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;
96
97 // local muting preferences
98 extern int Multi_voice_local_prefs;
99
100
101 // --------------------------------------------------------------------------------------------------
102 // MULTI VOICE FUNCTIONS
103 //
104
105 // initialize the multiplayer voice system
106 void multi_voice_init();
107
108 // shutdown the multiplayer voice system
109 void multi_voice_close();
110
111 // reset between levels
112 void multi_voice_reset();
113
114 // process all voice details
115 void multi_voice_process();
116
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);
119
120 // voice settings debug console function
121 void multi_voice_dcf();
122
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);
125
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();
128
129 // <player> sends hit bitflag settings (who he'll receive sound from, etc)
130 void multi_voice_set_prefs(int pref_flags);
131
132
133 // --------------------------------------------------------------------------------------------------
134 // MULTI VOICE / RTVOICE INTERFACE
135 //
136
137 // process the "next" chunk of standalone valid sound data from the rtvoice system
138 void multi_voice_process_next_chunk();
139
140
141 // --------------------------------------------------------------------------------------------------
142 // MULTI VOICE PACKET HANDLERS
143 //
144
145 // process an incoming voice packet of some kind or another
146 void multi_voice_process_packet(unsigned char *data, header *hinfo);
147
148
149 // --------------------------------------------------------------------------------------------------
150 // MULTI VOICE TESTING FUNCTIONS
151 //
152
153 // start recording voice locally for playback testing
154 void multi_voice_test_record_start();
155
156 // return if the test recording is going on
157 int multi_voice_test_recording();
158
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();
161
162 // force stop any recording voice test
163 void multi_voice_test_record_stop();
164
165 // get a playback buffer handle (return -1 if none exist - bad)
166 int multi_voice_test_get_playback_buffer();
167
168 // return whether the last sampled chunk would have been too large to fit in a packet
169 int multi_voice_test_packet_tossed();
170
171 #endif
172