Ejemplo n.º 1
0
        // Private Methods
        //

        private void StopPlayingSound()
        {
            if (_soundPlayer != null)
            {
                _soundPlayer.Stop();
            }
            lnkPlaySound.Text = "Play Sound";
        }
Ejemplo n.º 2
0
 private void StopSound()
 {
     if (soundService != null)
     {
         soundService.Stop();
         soundService = null;
     }
 }
Ejemplo n.º 3
0
 public void PlaySounds(string[] soundFiles, EventHandler playingFinishedCallback)
 {
     CodeContract.Requires(soundFiles != null && soundFiles.Length > 0);
     if (_soundFiles != null)
     {
         _soundPlayer.Stop();
     }
     else if (!QuietMode)
     {
         ProcessHelper.ExecCommand(_config.Commands.BeforePlaying);
     }
     _soundFiles              = soundFiles;
     _currentSoundFileIndex   = 0;
     _playingFinishedCallback = playingFinishedCallback;
     if (QuietMode)
     {
         _playingFinishedCallback.RaiseEvent(this);
     }
     else
     {
         _soundPlayer.Play(_soundFiles[0]);
     }
 }
        private void StopAction(int soundId)
        {
            var soundEntity = _soundEntityCache[soundId];

            if (soundEntity != null && soundEntity.hasAudioSourceKey)
            {
                var key = soundEntity.audioSourceKey.Value;
                if (_soundPlayer.IsPlaying(key))
                {
                    _soundPlayer.Stop(key);
                }
            }

            RemoveSoundEntity(soundId);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Стоп плеера
 /// </summary>
 /// <returns>если плеер поставленн на стоп то true</returns>
 public bool StopPlayer()
 {
     _player.Stop();
     return(GetPlayerStatus == SoundPlayerStatus.Stop);
 }