public void TemporaryShutdown()
 {
     if (CurrentSourceVoice == null)
     {
         throw new Exception();     // TEMP
     }
     savedSamplesPlayed = (int)CurrentSourceVoice.SamplesPlayed;
     CurrentSourceVoice.Stop();
     CurrentStream.Dispose();
 }
예제 #2
0
        /// <summary>
        /// Selects a track without playing it. If the stream is already selected, the player carries on.
        /// </summary>
        /// <param name="stream">The track to select.</param>
        public void Select(WaveStream stream)
        {
            if (CurrentStream != stream)
            {
                CurrentOut?.Dispose();
                CurrentStream?.Dispose();

                CurrentOut = new WaveOut(WaveCallbackInfo.FunctionCallback());      // using the function callback makes playback independent of GUI thread, apparently
                CurrentOut.PlaybackStopped += PlaybackStopped;
                CurrentOut.Volume           = _Volume;
                CurrentStream = stream;
                CurrentOut.Init(stream);
                StreamSource = null;
            }
        }
 public void Dispose()
 {
     CurrentStream?.Dispose();
 }
예제 #4
0
 protected override void DisposeCode()
 {
     CurrentStream.Dispose();
 }
예제 #5
0
 /// <summary>
 /// Releases the underlying stream.
 /// </summary>
 public override void Dispose()
 {
     CurrentStream?.Dispose();
 }
 public void Dispose()
 {
     CurrentStream.Dispose();
     CurrentChannel = null;
 }