Ejemplo n.º 1
0
        public EffectPluginControl(AudioPluginEngine audioPluginEngine, VstPlugin vstPlugin, string[] effectNames)
        {
            mAudioPluginEngine = audioPluginEngine;
            InitializeComponent();

            mVstPlugin = vstPlugin;

            cbEnabled.Checked = (vstPlugin.State == Common.PluginState.Activated);
            cbEffectNames.Items.AddRange(effectNames);

            if (vstPlugin.State == PluginState.Empty)
            {
                cbEffectNames.SelectedIndex = 0;
            }
            else
            {
                try
                {
                    cbEffectNames.SelectedItem = vstPlugin.PluginName;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }

            cbEnabled.Enabled = cbEffectNames.SelectedIndex != 0;
            btnEdit.Enabled   = vstPlugin.State != PluginState.Empty;
            mIgnoreEvents     = false;
        }
Ejemplo n.º 2
0
        public void SetAudioPluginEngine(AudioPluginEngine engine)
        {
            mAudioPluginEngine = engine;

            List <string> items = new List <string>();

            items.Add("Empty");
            foreach (VstInfo vst in mAudioPluginEngine.AvailableInstrumentPlugins)
            {
                items.Add(vst.Name);
            }
            cbInstrument.Items = items.ToArray();
        }
        public void ShowEffectInserts(AudioPluginEngine engine, VstPlugin[] effectPlugins)
        {
            flpFxInserts.Controls.Clear();
            mEffectPlugins = effectPlugins;
            List <string> vstEffectNames = new List <string>();

            vstEffectNames.Add("None");
            vstEffectNames.AddRange(engine.AvailableEffectPlugins.Select(x => x.Name));
            string[] fxNames = vstEffectNames.ToArray();

            foreach (VstPlugin effectPlugin in effectPlugins)
            {
                EffectPluginControl c = new EffectPluginControl(engine, effectPlugin, fxNames);
                c.OnEffectInsertChanged += c_OnEffectInsertChanged;
                flpFxInserts.Controls.Add(c);
            }
            this.Visible = true;
        }