Beispiel #1
0
        private void Play()
        {
            if (_engineSettings.DisableSoundNotifications)
            {
                return;
            }

            var songToPlay = string.Empty;
            var repeat     = false;

            switch (_engine.Phase)
            {
            case PomodoroPhase.Work:
                songToPlay = _settings.WorkSong;
                repeat     = _settings.RepeatWorkSong;
                break;

            case PomodoroPhase.Break:
                songToPlay = _settings.BreakSong;
                repeat     = _settings.RepeatBreakSong;
                break;

            case PomodoroPhase.BreakEnded:
            case PomodoroPhase.WorkEnded:
                break;
            }

            if (File.Exists(songToPlay))
            {
                _musicPlayer.Load(songToPlay);
                _musicPlayer.Play(repeat, _engineSettings.Volume);
            }
        }
 private void PlayPeriodStart()
 {
     _musicPlayer.Load(_settings.PeriodStartSound);
     _musicPlayer.Play(volume: _engineSettings.Volume);
 }