Example #1
0
        public override bool ConfigurationMenu(Form parent, ActionCoreController cp, List <string> eventvars)
        {
            string             path;
            ConditionVariables vars;

            FromString(userdata, out path, out vars);

            WaveConfigureDialog cfg = new WaveConfigureDialog();

            cfg.Init(cp.AudioQueueWave, false, "Select file, volume and effects", "Configure Play Command", 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)
            {
                ConditionVariables cond = new ConditionVariables(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);
        }
Example #2
0
        private void WC(float size)
        {
            theme.FontSize = size;
            AudioDriverCSCore ad = new AudioDriverCSCore();
            AudioQueue        q  = new AudioQueue(ad);

            WaveConfigureDialog c = new WaveConfigureDialog();

            Variables ef = new Variables();

            c.Init(q, false, "Check SC", "Caption title", this.Icon,
                   @"c:\",
                   true, AudioQueue.Priority.High,
                   "sn", "en", "100", ef);

            c.ShowDialog(this);
        }
Example #3
0
        public void ConfigureWave(string title)
        {
            string             volume  = persistentglobalvariables.GetString(ActionPlay.globalvarplayvolume, "60");
            ConditionVariables effects = new ConditionVariables(persistentglobalvariables.GetString(ActionPlay.globalvarplayeffects, ""), ConditionVariables.FromMode.MultiEntryComma);

            WaveConfigureDialog dlg = new WaveConfigureDialog();

            dlg.Init(discoveryform.AudioQueueWave, true, "Select Default device, volume and effects", title, "",
                     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 = discoveryform.AudioQueueWave.Driver.GetAudioEndpoint();
            }
        }