Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
 protected override void OnFormClosing(FormClosingEventArgs e)
 {
     CheckForSavedChanges();
     Configuration.SaveWindowProperties(this, _configuration);
     _configuration.SaveTry();
     WadSoundPlayer.StopSample();
     base.OnFormClosing(e);
 }
Exemplo n.º 3
0
        private void butOK_Click(object sender, EventArgs e)
        {
            _soundSource.SoundId  = _soundId;
            _soundSource.PlayMode = (SoundSourcePlayMode)comboPlayMode.SelectedIndex;

            DialogResult = DialogResult.OK;
            WadSoundPlayer.StopSample();
            Close();
        }
Exemplo n.º 4
0
 protected override void OnFormClosing(FormClosingEventArgs e)
 {
     base.OnFormClosing(e);
     _closing = true;
     if (DialogResult == DialogResult.OK)
     {
         ApplyChanges();
     }
     WadSoundPlayer.StopSample();
 }
Exemplo n.º 5
0
        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!
            }
        }
Exemplo n.º 6
0
 private void butCancel_Click(object sender, EventArgs e)
 {
     DialogResult = DialogResult.Cancel;
     WadSoundPlayer.StopSample();
     Close();
 }
Exemplo n.º 7
0
 protected override void OnFormClosing(FormClosingEventArgs e)
 {
     base.OnFormClosing(e);
     WadSoundPlayer.StopSample();
 }
Exemplo n.º 8
0
 public void PlayCurrentSoundInfo() => WadSoundPlayer.PlaySoundInfo(ReferenceLevel, SoundInfo);