예제 #1
0
        protected void OnSoundInfoChanged(object sender, EventArgs e)
        {
            if (sender is DarkComboBox)
            {
                // Update play type hint

                switch (((DarkComboBox)sender).SelectedIndex)
                {
                case 0:
                    lblModeTooltip.Text = "Play in any case";
                    break;

                case 1:
                    lblModeTooltip.Text = "Ignore if already playing";
                    break;

                case 2:
                    lblModeTooltip.Text = "Rewind if already playing";
                    break;

                case 3:
                    lblModeTooltip.Text = "Loop until stopped by engine";
                    break;
                }
            }

            if (!_soundInfoCurrentlyChanging)
            {
                SoundInfoChanged?.Invoke(this, e);
            }
        }
예제 #2
0
        private void butResetToDefaults_Click(object sender, EventArgs e)
        {
            UpdateUI(new WadSoundInfo(SoundInfo.Id), true);

            if (!_soundInfoCurrentlyChanging)
            {
                SoundInfoChanged?.Invoke(this, e);
            }
        }
예제 #3
0
        public void Paste(bool onlyParams = false)
        {
            var data = Clipboard.GetData("SoundInfo") as byte[];

            if (data == null)
            {
                return;
            }

            // Load sound info
            using (MemoryStream stream = new MemoryStream(data, false))
            {
                var serializer = new XmlSerializer(typeof(WadSoundInfo));
                var pastedInfo = new WadSoundInfo((WadSoundInfo)serializer.Deserialize(stream));
                pastedInfo.Id = SoundInfo.Id; // ID is unchangeable from UI

                UpdateUI(pastedInfo, onlyParams);

                if (!_soundInfoCurrentlyChanging)
                {
                    SoundInfoChanged?.Invoke(this, new EventArgs());
                }
            }
        }