private void butPlay_Click(object sender, EventArgs e) { if (_soundId == -1) { return; } var soundInfo = _soundInfos.FirstOrDefault(soundInfo_ => soundInfo_.Id == _soundId); if (soundInfo == null) { DarkMessageBox.Show(this, "This sound is missing.", "Unable to play sound.", MessageBoxIcon.Information); return; } try { WadSoundPlayer.PlaySoundInfo(_editor.Level, soundInfo); } catch (Exception exc) { logger.Warn(exc, "Unable to play sample"); DarkMessageBox.Show(this, "Playing sound failed. " + exc, "Unable to play sound.", MessageBoxIcon.Information); } }
protected override void OnFormClosing(FormClosingEventArgs e) { CheckForSavedChanges(); Configuration.SaveWindowProperties(this, _configuration); _configuration.SaveTry(); WadSoundPlayer.StopSample(); base.OnFormClosing(e); }
private void butOK_Click(object sender, EventArgs e) { _soundSource.SoundId = _soundId; _soundSource.PlayMode = (SoundSourcePlayMode)comboPlayMode.SelectedIndex; DialogResult = DialogResult.OK; WadSoundPlayer.StopSample(); Close(); }
protected override void OnFormClosing(FormClosingEventArgs e) { base.OnFormClosing(e); _closing = true; if (DialogResult == DialogResult.OK) { ApplyChanges(); } WadSoundPlayer.StopSample(); }
private void butPlaySound_Click(object sender, EventArgs e) { if (_editor.Tool.ReferenceLevel == null || _editor.Tool.ReferenceLevel.Settings.GlobalSoundMap.Count == 0) { return; } var soundInfo = _editor.Tool.ReferenceLevel.Settings.GlobalSoundMap.FirstOrDefault(soundInfo_ => soundInfo_.Id == (int)nudSoundId.Value); if (soundInfo != null) { try { WadSoundPlayer.PlaySoundInfo(_editor.Tool.ReferenceLevel, soundInfo); } catch (Exception exc) { } // FIXME: do something! } }
private void butCancel_Click(object sender, EventArgs e) { DialogResult = DialogResult.Cancel; WadSoundPlayer.StopSample(); Close(); }
protected override void OnFormClosing(FormClosingEventArgs e) { base.OnFormClosing(e); WadSoundPlayer.StopSample(); }
public void PlayCurrentSoundInfo() => WadSoundPlayer.PlaySoundInfo(ReferenceLevel, SoundInfo);