private void pbPlay_Click(object sender, EventArgs e) { if (mMP3Player.PlayBackState == PlaybackState.Stopped) { int index = scrollListRecordings.SelectedIndex; string name = scrollListRecordings.Items[index]; string fileName = Path.Combine(RecordingsFolder, name); pbPlay.Image = Properties.Resources.pause; pbStop.Enabled = true; mMP3Player.FileName = fileName; mMP3Player.Play(); trackBarPosition.Enabled = true; timerPlay.Enabled = true; } else { if (mMP3Player.PlayBackState == PlaybackState.Playing) { // Pause pbPlay.Image = Properties.Resources.play; mMP3Player.Pauze(); timerPlay.Enabled = false; } else { // Resume pbPlay.Image = Properties.Resources.pause; mMP3Player.Play(); timerPlay.Enabled = true; } } }
private void OnButtonPlayClick(object sender, EventArgs e) { mWasapiPlayer.Play(); }