Example #1
0
        /*private void soundList_KeyDown(object sender, KeyEventArgs e)
         * {
         *  if (e.KeyCode == Keys.Oemplus)
         *  {
         *      buttonAddSound_Click(null, null);
         *  }
         *  if (e.KeyCode == Keys.OemMinus || e.KeyCode == Keys.Delete)
         *  {
         *      buttonRemoveSound_Click(null, null);
         *  }
         *  if (e.KeyCode == Keys.Enter)
         *  {
         *      renameButton_Click(null, null);
         *  }
         *  if (e.KeyCode == Keys.Space)
         *  {
         *      soundList_DoubleClick(null, null);
         *  }
         * }*/

        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void soundList_DoubleClick(object sender, EventArgs e)
        {
            if (scriptArrayEditor.SelectedObject is SEMScript sound)
            {
                // TODO: figure out how these values are stored
                var pitch = sound.GetOPCodeValue(0x0C);
                if (pitch == -1)
                {
                    pitch = 0;
                }
                var reverb = sound.GetOPCodeValue(0x10);
                if (reverb == -1)
                {
                    reverb = 0;
                }
                _soundBankEditor.PlaySound(pitch, reverb);
            }
        }