void FlushTrack(Track track) { track.ToBeRemoved = true; if (track.SouStreamUsed) { _mixer.StopHandle(track.MixChanHandle); } else if (track.Stream != null) { this.Trace().Write(TraceSwitches.Music, "FlushTrack() - soundId:{0}", track.SoundId); // Finalize the appendable stream, then remove our reference to it. // Note that there might still be some data left in the buffers of the // appendable stream. We play it nice and wait till all of it // played. The audio mixer will take care of it afterwards (and dispose it). track.Stream.Finish(); track.Stream = null; if (track.SoundDesc != null) { _sound.CloseSound(track.SoundDesc); track.SoundDesc = null; } } if (!_mixer.IsSoundHandleActive(track.MixChanHandle)) { track.Clear(); } }
public void FlushTracks() { lock (_mutex) { this.Trace().Write(TraceSwitches.Music, "flushTracks()"); for (int l = 0; l < MaxDigitalTracks + MaxDigitalFadeTracks; l++) { Track track = _track[l]; if (track.Used && track.ToBeRemoved && !_mixer.IsSoundHandleActive(track.MixChanHandle)) { this.Trace().Write(TraceSwitches.Music, "flushTracks() - soundId:{0}", track.SoundId); track.Clear(); } } } }
void FlushTrack(Track track) { track.ToBeRemoved = true; if (track.SouStreamUsed) { _mixer.StopHandle(track.MixChanHandle); } else if (track.Stream != null) { this.Trace().Write(TraceSwitches.Music, "FlushTrack() - soundId:{0}", track.SoundId); // Finalize the appendable stream, then remove our reference to it. // Note that there might still be some data left in the buffers of the // appendable stream. We play it nice and wait till all of it // played. The audio mixer will take care of it afterwards (and dispose it). track.Stream.Finish(); track.Stream = null; if (track.SoundDesc != null) { _sound.CloseSound(track.SoundDesc); track.SoundDesc = null; } } if (!_mixer.IsSoundHandleActive(track.MixChanHandle)) { track.Clear(); } }