public override bool ConfigurationMenu(Form parent, ActionCoreController cp, List <BaseUtils.TypeHelpers.PropertyNameInfo> eventvars) { string path; Variables vars; FromString(userdata, out path, out vars); ExtendedAudioForms.WaveConfigureDialog cfg = new ExtendedAudioForms.WaveConfigureDialog(); cfg.Init(cp.AudioQueueWave, false, "Select file, volume and effects", "Configure Play Command", cp.Icon, path, vars.Exists(waitname), AudioQueue.GetPriority(vars.GetString(priorityname, "Normal")), vars.GetString(startname, ""), vars.GetString(finishname, ""), vars.GetString(volumename, "Default"), vars); if (cfg.ShowDialog(parent) == DialogResult.OK) { Variables cond = new Variables(cfg.Effects);// add on any effects variables (and may add in some previous variables, since we did not purge) cond.SetOrRemove(cfg.Wait, waitname, "1"); cond.SetOrRemove(cfg.Priority != AudioQueue.Priority.Normal, priorityname, cfg.Priority.ToString()); cond.SetOrRemove(cfg.StartEvent.Length > 0, startname, cfg.StartEvent); cond.SetOrRemove(cfg.StartEvent.Length > 0, finishname, cfg.FinishEvent); cond.SetOrRemove(!cfg.Volume.Equals("Default", StringComparison.InvariantCultureIgnoreCase), volumename, cfg.Volume); userdata = ToString(cfg.Path, cond); return(true); } return(false); }
public void ConfigureWave(string title) { string volume = Globals.GetString(ActionPlay.globalvarplayvolume, "60"); ConditionVariables effects = new ConditionVariables(PersistentVariables.GetString(ActionPlay.globalvarplayeffects, ""), ConditionVariables.FromMode.MultiEntryComma); ExtendedAudioForms.WaveConfigureDialog dlg = new ExtendedAudioForms.WaveConfigureDialog(); dlg.Init(AudioQueueWave, true, "Select Default device, volume and effects", title, this.Icon, "", false, AudioExtensions.AudioQueue.Priority.Normal, "", "", volume, effects); if (dlg.ShowDialog(discoveryform) == DialogResult.OK) { ConditionVariables cond = new ConditionVariables(dlg.Effects);// add on any effects variables (and may add in some previous variables, since we did not purge) SetPeristentGlobal(ActionPlay.globalvarplayvolume, dlg.Volume); SetPeristentGlobal(ActionPlay.globalvarplayeffects, dlg.Effects.ToString()); EDDConfig.Instance.DefaultWaveDevice = AudioQueueWave.Driver.GetAudioEndpoint(); } }