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