Beispiel #1
0
 public void Resume()
 {
     lock ( effect )
     {
         effect.Resume();
     }
 }
Beispiel #2
0
 /// <summary>
 /// Used to resume the currently playing song.
 /// </summary>
 public void resume()
 {
     if (dynamicSound == null)
     {
         return;
     }
     dynamicSound.Resume();
 }
Beispiel #3
0
 public void Resume()
 {
     lock (ControlLock)
     {
         _State = SoundState.Playing;
         Inst?.Resume();
     }
 }
Beispiel #4
0
 /// <summary>
 /// Used to resume the currently playing song.
 /// </summary>
 public override void resumeSong()
 {
     if (dynamicSound == null)
     {
         return;
     }
     dynamicSound.Resume();
 }
Beispiel #5
0
        public void Resume()
        {
            if (MediaState != MediaState.Paused)
            {
                return;
            }

            MediaState = MediaState.Playing;
            effect.Resume();
        }
Beispiel #6
0
        public void Playback()
        {
            using (var instance = new DynamicSoundEffectInstance(48000, AudioChannels.Mono))
            {
                // Initially, the playback is stopped
                Assert.AreEqual(SoundState.Stopped, instance.State);

                // Submitting a buffer will not change the state
                instance.SubmitBuffer(GenerateSineWave(440, 48000, 1, 0.5f));
                Assert.AreEqual(SoundState.Stopped, instance.State);

                // Start playing
                instance.Play();
                Assert.AreEqual(SoundState.Playing, instance.State);

                // While still playing, pause the playback
                SleepWhileDispatching(300);
                instance.Pause();
                Assert.AreEqual(SoundState.Paused, instance.State);

                // Let it continue and run out of buffers
                instance.Resume();
                SleepWhileDispatching(300);
                Assert.AreEqual(0, instance.PendingBufferCount);
                Assert.AreEqual(SoundState.Playing, instance.State);

                // Submit a buffer and the playback should continue
                instance.SubmitBuffer(GenerateSineWave(466, 48000, 1, 1.0f));
                Assert.AreEqual(SoundState.Playing, instance.State);
                SleepWhileDispatching(500);

                // Stop immediately
                Assert.AreEqual(SoundState.Playing, instance.State);
                instance.Stop();
                SleepWhileDispatching(10); // XNA does not stop it until FrameworkDispatcher.Update is called
                Assert.AreEqual(SoundState.Stopped, instance.State);

                // And then resume
                instance.Resume();
                Assert.AreEqual(SoundState.Playing, instance.State);
            }
        }
Beispiel #7
0
        public void Playback_Exceptions()
        {
            var instance = new DynamicSoundEffectInstance(16000, AudioChannels.Mono);

            instance.Dispose();
            Assert.Throws <ObjectDisposedException>(() => { instance.Play(); });
            Assert.Throws <ObjectDisposedException>(() => { instance.Pause(); });
            Assert.Throws <ObjectDisposedException>(() => { instance.Resume(); });
            Assert.Throws <ObjectDisposedException>(() => { instance.Stop(); });
            Assert.Throws <ObjectDisposedException>(() => { instance.Stop(false); });
            Assert.Throws <ObjectDisposedException>(() => { instance.SubmitBuffer(new byte[0]); });
        }
Beispiel #8
0
        public void Resume()
        {
            checkDisposed();

            // Check the player state before attempting anything.
            if (State != MediaState.Paused)
            {
                return;
            }

            // Update the player state.
            State = MediaState.Playing;

            // Unpause timer, audio.
            timer.Start();
            if (audioStream != null)
            {
                audioStream.Resume();
            }
        }
Beispiel #9
0
 internal void Resume()
 {
     soundStream.Resume();
     timer.Start();
 }
Beispiel #10
0
 internal void Resume()
 {
     soundStream.Resume();
 }
Beispiel #11
0
 public void Resume()
 {
     _instance.Resume();
     _instance.Volume = _volume;
     _iSaidStop       = false;
 }
Beispiel #12
0
 public override void Resume() => instance.Resume();
Beispiel #13
0
 /// <summary>
 /// Resumes playback.
 /// </summary>
 public void Resume()
 {
     sfx.Resume();
 }
Beispiel #14
0
 public void Resume()
 {
     lock (sound) {
         sound.Resume();
     }
 }
Beispiel #15
0
 public override void Resume()
 {
     m_SoundInstance.Resume();
 }
 /// <summary>Used to resume the currently playing song.</summary>
 public void resume()
 {
     dynamicSound?.Resume();
 }