Пример #1
0
 public void AudioFilesHaveCorrectNames()
 {
     Enum.GetValues(typeof(IDEEventType)).Cast <IDEEventType>().Where(x => x != IDEEventType.Unknown).ToList().ForEach(x =>
     {
         Assert.IsTrue(File.Exists(IDEEventTypeMapper.IDEEventTypeToSoundPath(x)));
     });
 }
Пример #2
0
 public void PauseIsWorking()
 {
     Enum.GetValues(typeof(IDEEventType)).Cast <IDEEventType>().Where(x => x != IDEEventType.Unknown).ToList().ForEach(x =>
     {
         Assert.IsTrue(File.Exists(IDEEventTypeMapper.IDEEventTypeToSoundPath(x)));
     });
 }
Пример #3
0
 public void CheckAudioFiles()
 {
     Enum.GetValues(typeof(IDEEventType)).Cast <IDEEventType>().Where(x => x != IDEEventType.Unknown).ToList().ForEach(x =>
     {
         SoundPlayer player = new SoundPlayer(IDEEventTypeMapper.IDEEventTypeToSoundPath(x));
         player.Play();
     });
 }
Пример #4
0
        public void PlaySound(IDEEventType iDEEventType, bool loop = false)
        {
            var path = IDEEventTypeMapper.IDEEventTypeToSoundPath(iDEEventType);

            _player.Stop();
            _player.SoundLocation = path;

            if (MakeTheSoundEventCatcher.Instance.OptionsPage.IsAudioActive(iDEEventType))
            {
                if (loop)
                {
                    _player.PlayLooping();
                }
                else
                {
                    _player.Play();
                }
            }
        }