| 194 | } |
| 195 | |
| 196 | void UpdateVoices(void) { |
| 197 | char filename[_MAX_PATH]; |
| 198 | int flags; |
| 199 | |
| 200 | if (!CurrentVoiceHandle.inuse) { |
| 201 | // see if we have something waiting |
| 202 | if (vq.GetNextVoice(filename, &flags)) { |
| 203 | mprintf(0, "Playing queued voice %s\n", filename); |
| 204 | StartVoice(filename, flags); |
| 205 | return; |
| 206 | } |
| 207 | return; |
| 208 | } |
| 209 | |
| 210 | // according to the handle, the current voice is inuse, lets make sure |
| 211 | if (Sound_system.IsSoundPlaying(CurrentVoiceHandle.handle)) |
| 212 | return; // it is |
| 213 | |
| 214 | // it isn't, so stop it and play the next voice in the queue if any |
| 215 | StopVoice(); |
| 216 | if (vq.GetNextVoice(filename, &flags)) { |
| 217 | mprintf(0, "Playing queued voice %s\n", filename); |
| 218 | StartVoice(filename, flags); |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | ////////////////////// |
| 223 | // Voice Queue Implementation |
no test coverage detected