public void TemporaryShutdown()
 {
     if (CurrentSourceVoice == null)
     {
         throw new Exception();     // TEMP
     }
     savedSamplesPlayed = (int)CurrentSourceVoice.SamplesPlayed;
     CurrentSourceVoice.Stop();
     CurrentStream.Dispose();
 }
Exemplo n.º 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();
 }
Exemplo n.º 4
0
 protected override void DisposeCode()
 {
     CurrentStream.Dispose();
 }
Exemplo n.º 5
0
 /// <summary>
 /// Releases the underlying stream.
 /// </summary>
 public override void Dispose()
 {
     CurrentStream?.Dispose();
 }
 public void Dispose()
 {
     CurrentStream.Dispose();
     CurrentChannel = null;
 }