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

            MediaState = MediaState.Playing;
            effect.Resume();
        }
Пример #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);
            }
        }
Пример #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]); });
        }
Пример #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();
            }
        }
Пример #9
0
 internal void Resume()
 {
     soundStream.Resume();
     timer.Start();
 }
Пример #10
0
 internal void Resume()
 {
     soundStream.Resume();
 }
Пример #11
0
 public void Resume()
 {
     _instance.Resume();
     _instance.Volume = _volume;
     _iSaidStop       = false;
 }
Пример #12
0
 public override void Resume() => instance.Resume();
Пример #13
0
 /// <summary>
 /// Resumes playback.
 /// </summary>
 public void Resume()
 {
     sfx.Resume();
 }
Пример #14
0
 public void Resume()
 {
     lock (sound) {
         sound.Resume();
     }
 }
Пример #15
0
 public override void Resume()
 {
     m_SoundInstance.Resume();
 }
Пример #16
0
 /// <summary>Used to resume the currently playing song.</summary>
 public void resume()
 {
     dynamicSound?.Resume();
 }