public FormSoundNotifyConfig(SoundNotifier module)
     : this()
 {
     this.ParentModule = module;
     this.Text = String.Format("Sound Notify ({0})", ParentModule.Player);
     numericUpDownQueueDelay.Value = Convert.ToDecimal(ParentModule.Settings.Value.QueueDefDelay);
     textBoxQueSoundName.Text = ParentModule.GetQueueSoundForUI();
     UpdateMutedState();
 }
        public FormSoundNotifyConfigDialog(SoundNotifier module, FormSoundNotifyConfigDialogMode mode, PlaylistEntry parPlaylistEntry = null)
            : this()
        {
            this.ParentModule = module;
            listBoxChooseSound.Items.AddRange(SoundBank.GetSoundsArray());
            listBoxChooseSound.Sorted = true;

            checkedListBoxSearchIn.Items.AddRange((object[])GameLogTypesEX.GetAllNames());

            if (mode == FormSoundNotifyConfigDialogMode.Edit)
            {
                // change title
                this.Text = "Edit entry";
                // choose sound
                if (listBoxChooseSound.Items.Contains((object)parPlaylistEntry.SoundName))
                {
                    listBoxChooseSound.SetSelected((int)(listBoxChooseSound.Items.IndexOf((object)(parPlaylistEntry.SoundName))), true);
                }
                // input condition
                if (!parPlaylistEntry.isCustomRegex) textBoxChooseCond.Text = ParentModule.ConvertRegexToCondOutput(parPlaylistEntry.Condition);
                else textBoxChooseCond.Text = parPlaylistEntry.Condition;
                // choose logs
                foreach (var cond in parPlaylistEntry.SpecialSettings)
                {
                    if (GameLogTypesEX.doesTypeExist(cond))
                    {
                        checkedListBoxSearchIn.SetItemChecked(checkedListBoxSearchIn.Items.IndexOf((object)(cond)), true);
                    }
                }
                // choose specials
                foreach (var cond in parPlaylistEntry.SpecialSettings)
                {
                    if (cond == "s:CustomRegex")
                    {
                        checkBoxUseRegexSemantics.Checked = true;
                    }
                }
            }
        }
 public void RemoveNotifier(SoundNotifier notifier)
 {
     AllNotifiers.Remove(notifier.Player);
     Settings.Value.ActiveCharacterNames.Remove(notifier.Player);
     Settings.DelayedSave();
     MainUI.RemoveNotifierController(notifier.GetUIHandle());
 }
 public void AddNotifier(string charName)
 {
     var notifier = new SoundNotifier(this, charName, this.ModuleDataDir);
     MainUI.AddNotifierController(notifier.GetUIHandle());
     AllNotifiers.Add(charName, notifier);
     Settings.Value.ActiveCharacterNames.Add(charName);
     Settings.DelayedSave();
 }