Exemple #1
0
 /// <summary>
 /// Creates a <see cref="VstParameterManager"/> instance for the specified <paramref name="paramInfo"/> (this).
 /// </summary>
 /// <param name="paramInfo">Must not be null</param>
 /// <param name="hostAutomation">Can be null</param>
 /// <returns>Never returns null.</returns>
 public static VstParameterManager ToManager(this VstParameterInfo paramInfo, IVstHostAutomation hostAutomation)
 {
     return(new VstParameterManager(paramInfo)
     {
         HostAutomation = hostAutomation
     });
 }
Exemple #2
0
        private void InitializeParameters()
        {
            // all parameter definitions are added to a central list.
            VstParameterInfoCollection parameterInfos = _plugin.PluginPrograms.ParameterInfos;

            // retrieve the category for all delay parameters.
            VstParameterCategory paramCategory =
                _plugin.PluginPrograms.GetParameterCategory(ParameterCategoryName);

            // delay time parameter
            VstParameterInfo paramInfo = new VstParameterInfo();

            paramInfo.Category       = paramCategory;
            paramInfo.CanBeAutomated = true;
            paramInfo.Name           = "Transp.";
            paramInfo.Label          = "Halfs";
            paramInfo.ShortLabel     = "#";
            paramInfo.MinInteger     = -100;
            paramInfo.MaxInteger     = 100;
            paramInfo.LargeStepFloat = 5.0f;
            paramInfo.SmallStepFloat = 1.0f;
            paramInfo.StepFloat      = 2.0f;
            paramInfo.DefaultValue   = 0.0f;
            TransposeMgr             = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            parameterInfos.Add(paramInfo);
        }
Exemple #3
0
        private void InitializeParameters()
        {
            // all parameter definitions are added to a central list.
            VstParameterInfoCollection parameterInfos = _plugin.PluginPrograms.ParameterInfos;

            // retrieve the category for all delay parameters.
            VstParameterCategory paramCategory =
                _plugin.PluginPrograms.GetParameterCategory(ParameterCategoryName);

            // delay time parameter
            VstParameterInfo paramInfo = new VstParameterInfo();
            paramInfo.Category = paramCategory;
            paramInfo.CanBeAutomated = true;
            paramInfo.Name = "Gain";
            paramInfo.Label = "Db";
            paramInfo.ShortLabel = "Db";
            paramInfo.MinInteger = -100;
            paramInfo.MaxInteger = 100;
            paramInfo.LargeStepFloat = 20.0f;
            paramInfo.SmallStepFloat = 1.0f;
            paramInfo.StepFloat = 10.0f;
            paramInfo.DefaultValue = 0.0f;
            _gainMgr = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            parameterInfos.Add(paramInfo);
        }
Exemple #4
0
        private void InitializeParameters()
        {
            // all parameter definitions are added to a central list.
            VstParameterInfoCollection parameterInfos = _plugin.PluginPrograms.ParameterInfos;

            // retrieve the category for all delay parameters.
            VstParameterCategory paramCategory =
                _plugin.PluginPrograms.GetParameterCategory(ParameterCategoryName);

            // delay time parameter
            VstParameterInfo paramInfo = new VstParameterInfo
            {
                Category       = paramCategory,
                CanBeAutomated = true,
                Name           = "Gain",
                Label          = "Db",
                ShortLabel     = "Db",
                MinInteger     = -100,
                MaxInteger     = 100,
                LargeStepFloat = 20.0f,
                SmallStepFloat = 1.0f,
                StepFloat      = 10.0f,
                DefaultValue   = 0.0f
            };

            GainMgr = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            parameterInfos.Add(paramInfo);
        }
        private void InitializeParameters(PluginParameters parameters)
        {
            // all parameter definitions are added to a central list.
            VstParameterInfoCollection parameterInfos = parameters.ParameterInfos;

            // retrieve the category for all delay parameters.
            VstParameterCategory paramCategory =
                parameters.GetParameterCategory(ParameterCategoryName);

            // delay time parameter
            var paramInfo = new VstParameterInfo
            {
                Category       = paramCategory,
                CanBeAutomated = true,
                Name           = "Transp.",
                Label          = "Halfs",
                ShortLabel     = "#",
                MinInteger     = -100,
                MaxInteger     = 100,
                LargeStepFloat = 5.0f,
                SmallStepFloat = 1.0f,
                StepFloat      = 2.0f,
                DefaultValue   = 0.0f
            };

            TransposeMgr = paramInfo
                           .Normalize()
                           .ToManager();

            parameterInfos.Add(paramInfo);
        }
Exemple #6
0
        public void Test_VstParameterCollection_Index()
        {
            var paramInfo1 = new VstParameterInfo();

            paramInfo1.Name       = "Test1";
            paramInfo1.ShortLabel = "Tst1";
            paramInfo1.MaxInteger = 10;

            var col = new VstParameterCollection();

            var param1 = new VstParameter(paramInfo1);

            col.Add(param1);

            Assert.AreEqual(0, param1.Index, "Index of param1 is not as expected.");

            var paramInfo2 = new VstParameterInfo();

            paramInfo2.Name       = "Test2";
            paramInfo2.ShortLabel = "Tst2";
            paramInfo2.MaxInteger = 10;

            var param2 = new VstParameter(paramInfo2);

            col.Insert(0, param2);

            Assert.AreEqual(0, param2.Index, "Index of param2 is not as expected.");
            Assert.AreEqual(1, param1.Index, "Index of param1 is not as expected.");
        }
        public void Test_VstParameterCollection_Index()
        {
            var target = new VstParameterCollection();

            var paramInfo1 = new VstParameterInfo
            {
                Name       = "Test1",
                ShortLabel = "Tst1",
                MaxInteger = 10
            };

            var param1 = new VstParameter(paramInfo1);

            target.Add(param1);

            param1.Index.Should().Be(0);

            var paramInfo2 = new VstParameterInfo
            {
                Name       = "Test2",
                ShortLabel = "Tst2",
                MaxInteger = 10
            };

            var param2 = new VstParameter(paramInfo2);

            target.Insert(0, param2);

            param1.Index.Should().Be(1);
            param2.Index.Should().Be(0);
        }
Exemple #8
0
        private void InitializeParameters()
        {
            // all parameter definitions are added to a central list.
            var parameterInfos = _plugin.PluginPrograms.ParameterInfos;

            // retrieve the category for all delay parameters.
            var paramCategory =
                _plugin.PluginPrograms.GetParameterCategory(ParameterCategoryName);

            // delay time parameter
            var paramInfo = new VstParameterInfo();

            paramInfo.Category       = paramCategory;
            paramInfo.CanBeAutomated = true;
            paramInfo.Name           = "Down/Up";
            paramInfo.Label          = "D/U";
            paramInfo.ShortLabel     = "D/U";
            paramInfo.MinInteger     = 0;
            paramInfo.MaxInteger     = 1;
            paramInfo.LargeStepFloat = 1.0f;
            paramInfo.SmallStepFloat = 1.0f;
            paramInfo.StepFloat      = 1.0f;
            paramInfo.DefaultValue   = 1.0f;
            CascadeMgr = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            parameterInfos.Add(paramInfo);
        }
Exemple #9
0
        public override void SetUpParameter(PropertyInfo property, SynthParameter param)
        {
            var catName = param.Category ?? "Default";

            if (!(Categories.Contains(catName)))
            {
                Categories.Add(new VstParameterCategory()
                {
                    Name = catName
                });
            }
            var category = Categories[catName];

            var paramInfo = new VstParameterInfo();

            paramInfo.Category       = category;
            paramInfo.CanBeAutomated = true;
            paramInfo.Name           = param.Name;
            paramInfo.Label          = property.Name;
            paramInfo.ShortLabel     = param.ShortLabel;
            paramInfo.MinInteger     = param.Lo;
            paramInfo.MaxInteger     = param.Hi;
            paramInfo.DefaultValue   = param.DefaultValue;
            VstParameterNormalizationInfo.AttachTo(paramInfo);
            var manager = new VstParameterManager(paramInfo);

            _managers.Add(manager);
            if (property.PropertyType == typeof(float) || property.PropertyType == typeof(double))
            {
                manager.PropertyChanged += (object sender, PropertyChangedEventArgs e) =>
                {
                    if (e.PropertyName == "CurrentValue")
                    {
                        VstParameterManager paramMgr = (VstParameterManager)sender;
                        property.SetValue(this, paramMgr.CurrentValue);
                        OnPropertyChanged(property.Name);
                    }
                }
            }
            ;
            else if (property.PropertyType == typeof(int))
            {
                manager.PropertyChanged += (object sender, PropertyChangedEventArgs e) =>
                {
                    if (e.PropertyName == "CurrentValue")
                    {
                        VstParameterManager paramMgr = (VstParameterManager)sender;
                        property.SetValue(this, (int)(paramMgr.CurrentValue + 0.5f));
                        OnPropertyChanged(property.Name);
                    }
                }
            }
            ;
            else
            {
                throw new InvalidOperationException($"Parameter type {property.PropertyType} is not supported (yet?)");
            }
            ParameterInfos.Add(paramInfo);
        }
Exemple #10
0
        // create one parameter
        private VstParameter CreateParameter(VstParameterInfo parameterInfo)
        {
            VstParameter parameter = new VstParameter(parameterInfo);

            // Advanced: you can derive from VstParameter and add your own properties and logic.

            return(parameter);
        }
        public void Test_VstParameterNormalizationInfo_NegativeMinInteger()
        {
            var paramInfo = new VstParameterInfo();

            paramInfo.MinInteger = -10;
            paramInfo.MaxInteger = 10;

            AssertNormalizationInfo(paramInfo);
        }
        public void Test_VstParameterNormalizationInfo_PositiveRange()
        {
            var paramInfo = new VstParameterInfo();

            paramInfo.MinInteger = 10;
            paramInfo.MaxInteger = 20;

            AssertNormalizationInfo(paramInfo);
        }
        public void Test_VstParameterNormalizationInfo_ZeroMinInteger()
        {
            var paramInfo = new VstParameterInfo
            {
                MinInteger = 0,
                MaxInteger = 10
            };

            AssertNormalizationInfo(paramInfo);
        }
        public void Test_VstParameterNormalizationInfo_NegativeRange()
        {
            var paramInfo = new VstParameterInfo
            {
                MinInteger = -20,
                MaxInteger = -10
            };

            AssertNormalizationInfo(paramInfo);
        }
Exemple #15
0
        public PresetsManager(ApplicationBase creator)
        {
            this.creator           = creator;
            thresholdParameterInfo = new VstParameterInfo {
                CanBeAutomated = true, CanRamp = true, DefaultValue = 0.125f, Label = "Threshold"
            };
            var thresholdParamMgr = new VstParameterManager(thresholdParameterInfo);

            thresholdParamMgr.PropertyChanged += onThresholdChanged;
        }
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        // Use TestInitialize to run code before running each test
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion

        private void AssertNormalizationInfo(VstParameterInfo paramInfo)
        {
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            float actual = paramInfo.NormalizationInfo.GetRawValue(0);

            Assert.AreEqual(paramInfo.MinInteger, actual, "Raw Null value mismatch.");

            actual = paramInfo.NormalizationInfo.GetRawValue(1);
            Assert.AreEqual(paramInfo.MaxInteger, actual, "Raw Max value mismatch.");

            actual = paramInfo.NormalizationInfo.GetNormalizedValue(paramInfo.MinInteger);
            Assert.AreEqual(0, actual, "Normalized Null value mismatch.");

            actual = paramInfo.NormalizationInfo.GetNormalizedValue(paramInfo.MaxInteger);
            Assert.AreEqual(1, actual, "Normalized Max value mismatch.");
        }
        private void AssertNormalizationInfo(VstParameterInfo paramInfo)
        {
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            float actual = paramInfo.NormalizationInfo.GetRawValue(0);

            actual.Should().Be(paramInfo.MinInteger);

            actual = paramInfo.NormalizationInfo.GetRawValue(1);
            actual.Should().Be(paramInfo.MaxInteger);

            actual = paramInfo.NormalizationInfo.GetNormalizedValue(paramInfo.MinInteger);
            actual.Should().Be(0);

            actual = paramInfo.NormalizationInfo.GetNormalizedValue(paramInfo.MaxInteger);
            actual.Should().Be(1);
        }
Exemple #18
0
        public void Test_MaxLength_VstParameterInfo_ShortLabel()
        {
            VstParameterInfo pi = new VstParameterInfo();

            Assert.AreEqual(null, pi.ShortLabel);

            pi.ShortLabel = String.Empty;
            Assert.AreEqual(String.Empty, pi.ShortLabel);

            string testData = CreateString(Constants.MaxShortLabelLength);

            pi.ShortLabel = testData;
            Assert.AreEqual(testData, pi.ShortLabel);

            testData     += "X";
            pi.ShortLabel = testData;
            Assert.Fail("should have thrown an exception.");
        }
Exemple #19
0
        public void Test_MaxLength_VstParameterInfo_ShortLabel()
        {
            var pi = new VstParameterInfo();

            pi.ShortLabel.Should().BeEmpty();

            pi.ShortLabel = String.Empty;
            pi.ShortLabel.Should().BeEmpty();

            var testData = CreateString(Constants.MaxShortLabelLength);

            pi.ShortLabel = testData;
            pi.ShortLabel.Should().Be(testData);

            testData     += "X";
            pi.ShortLabel = testData;
            Assert.Fail("should have thrown an exception.");
        }
Exemple #20
0
        /// <summary>
        /// Sets up a parameter that can be learned or mapped to.
        /// </summary>
        private void InitializeParameters()
        {
            _plugin.PluginPrograms.ParameterCategories = new VstParameterCategoryCollection();
            _plugin.PluginPrograms.ParameterCategories.Add(new VstParameterCategory()
            {
                Name = "Transposer"
            });
            // Create parameter information:
            VstParameterInfo p = new VstParameterInfo()
            {
                Name             = "Trans",
                CanBeAutomated   = false, // false for now.  I don't know how to make the automatin respond to these changes.
                CanRamp          = true,
                DefaultValue     = 0.5f,
                IsSwitch         = false,
                Category         = _plugin.PluginPrograms.ParameterCategories[0],
                Label            = "Transpose",
                LargeStepFloat   = 1.0f,
                LargeStepInteger = 1,
                MaxInteger       = 12,
                MinInteger       = -12,
                ShortLabel       = "semitone", // max 8 characters!
                StepFloat        = 1.0f,
                StepInteger      = 1,
                SmallStepFloat   = 1
            };

            // ...

            // Create Parameter Managers:

            VstParameterNormalizationInfo.AttachTo(p);
            SemitonesManager = new VstParameterManager(p);

            // ...



            // Add ParameterInfos to the global collection in the plugin.
            _plugin.PluginPrograms.ParameterInfos = new VstParameterInfoCollection();
            _plugin.PluginPrograms.ParameterInfos.Add(p);
            // ...
        }
Exemple #21
0
        /// <summary>
        ///     Initialized VstParameterManagerDict by createing a VstParameterManager for each MSS
        ///     parameter.
        /// </summary>
        protected void InitializeVstParams()
        {
            // all parameter definitions are added to a central list.
            VstParameterInfoCollection parameterInfos = this.pluginPrograms.ParameterInfos;

            //itterate over each MssParameterID
            foreach (MssParameterID paramId in MssParameterID.GetValues(typeof(MssParameterID)))
            {
                VstParameterInfo paramInfo = MssToVstParameterInfo(paramId);

                parameterInfos.Add(paramInfo);

                VstParameterManager paramMgr = new VstParameterManager(paramInfo);

                //Adds listener to changes made to a parameter from the host
                paramMgr.PropertyChanged +=
                    new PropertyChangedEventHandler(VstParameterManager_PropertyChanged);
                VstParameterManagerDict.Add(paramId, paramMgr);
            }
        }
Exemple #22
0
        private float InitTrackBar(TrackBar trackBar, VstParameterInfo parameterInfo)
        {
            // A multiplication factor to convert floats (0.0-1.0)
            // to an integer range for the TrackBar to work with.
            float factor = 1.0f;

            if (parameterInfo.IsSwitch)
            {
                trackBar.Minimum     = 0;
                trackBar.Maximum     = 1;
                trackBar.LargeChange = 1;
                trackBar.SmallChange = 1;
                return(factor);
            }

            if (parameterInfo.IsStepIntegerValid)
            {
                trackBar.LargeChange = parameterInfo.LargeStepInteger;
                trackBar.SmallChange = parameterInfo.StepInteger;
            }
            else if (parameterInfo.IsStepFloatValid)
            {
                factor = 1 / parameterInfo.StepFloat;
                trackBar.LargeChange = (int)(parameterInfo.LargeStepFloat * factor);
                trackBar.SmallChange = (int)(parameterInfo.StepFloat * factor);
            }

            if (parameterInfo.IsMinMaxIntegerValid)
            {
                trackBar.Minimum = (int)(parameterInfo.MinInteger * factor);
                trackBar.Maximum = (int)(parameterInfo.MaxInteger * factor);
            }
            else
            {
                trackBar.Minimum = 0;
                trackBar.Maximum = (int)factor;
            }

            return(factor);
        }
Exemple #23
0
        /// <summary>
        /// Создаёт новый параметр и регистрирует его.
        /// </summary>
        /// <param name="name">Имя параметра.</param>
        /// <param name="defaultValue">Начальное значение.</param>
        /// <param name="valueChangedHandler">Обработчик изменения значения параметра.</param>
        /// <returns>Объект, управляющий созданным параметром.</returns>
        public VstParameterManager CreateParameterManager(
            string name        = null,
            float defaultValue = 0,
            Action <float> valueChangedHandler = null)
        {
            var parameterInfo = new VstParameterInfo()
            {
                Category     = parameterCategory,
                Name         = namePrefix + name,
                DefaultValue = defaultValue,
            };

            VstParameterNormalizationInfo.AttachTo(parameterInfo);

            programs.ParameterInfos.Add(parameterInfo);

            var manager = new VstParameterManager(parameterInfo);

            plugin.Opened += (sender, e) =>
            {
                manager.HostAutomation = plugin.Host.GetInstance <IVstHostAutomation>();
            };

            if (valueChangedHandler != null)
            {
                manager.PropertyChanged += (sender, e) =>
                {
                    if (e.PropertyName == "CurrentValue" || e.PropertyName == "ActiveParameter")
                    {
                        plugin.AudioProcessor.ProcessingMutex.WaitOne();
                        valueChangedHandler(manager.CurrentValue);
                        plugin.AudioProcessor.ProcessingMutex.ReleaseMutex();
                    }
                }
            }
            ;
            return(manager);
        }
    }
Exemple #24
0
        /// <summary>
        ///     Generates an instance of VstParameterInfo using information about an MSS parameter.
        /// </summary>
        /// <param name="paramId">Specifies the MSS parameter to get information from</param>
        /// <returns></returns>
        protected VstParameterInfo MssToVstParameterInfo(MssParameterID paramId)
        {
            // retrieve the category for all variable parameters.
            VstParameterCategory paramCategory =
                this.pluginPrograms.GetParameterCategory(DEFAULT_PARAMETER_CATEGORY_NAME);

            // Variable parameter
            VstParameterInfo paramInfo = new VstParameterInfo();

            paramInfo.Category       = paramCategory;
            paramInfo.CanBeAutomated = true;

            if (MssParameters.PRESET_PARAM_ID_LIST.Contains(paramId))
            {
                paramInfo.Name         = MssParameters.GetDefaultPresetName(paramId);
                paramInfo.DefaultValue = 0;
            }
            else if (MssParameters.VARIABLE_PARAM_ID_LIST.Contains(paramId))
            {
                MssParamInfo mssParamInfo = this.mssParameters.GetParameterInfoCopy(paramId);
                paramInfo.Name         = GetParamNameFromString(mssParamInfo.Name);
                paramInfo.DefaultValue = (float)this.mssParameters.GetRelativeParamValue(paramId);
            }
            else
            {
                Debug.Assert(false);
            }

            paramInfo.Label          = "";
            paramInfo.ShortLabel     = "";
            paramInfo.MinInteger     = VST_PARAM_MIN_VALUE;
            paramInfo.MaxInteger     = VST_PARAM_MAX_VALUE;
            paramInfo.LargeStepFloat = ((float)(VST_PARAM_MAX_VALUE - VST_PARAM_MIN_VALUE)) / 8;
            paramInfo.SmallStepFloat = ((float)(VST_PARAM_MAX_VALUE - VST_PARAM_MIN_VALUE)) / 128;
            paramInfo.StepFloat      = 0.03125f;
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            return(paramInfo);
        }
Exemple #25
0
        // create one parameter
        private VstParameter CreateParameter(VstParameterInfo parameterInfo)
        {
            VstParameter parameter = new VstParameter(parameterInfo);

            return(parameter);
        }
Exemple #26
0
        private void InitializeParameters()
        {
            // all parameter definitions are added to a central list.
            VstParameterInfoCollection parameterInfos = _plugin.PluginPrograms.ParameterInfos;

            // retrieve the category for all melter parameters.
            VstParameterCategory paramCategory =
                _plugin.PluginPrograms.GetParameterCategory(ParameterCategoryName);

            var paramInfo = new VstParameterInfo();

            paramInfo.Category       = paramCategory;
            paramInfo.CanBeAutomated = true;
            paramInfo.Name           = "Tap";
            paramInfo.Label          = "Tap";
            paramInfo.ShortLabel     = "|";
            paramInfo.MinInteger     = 0;
            paramInfo.MaxInteger     = 2;
            paramInfo.LargeStepFloat = 1.0f;
            paramInfo.SmallStepFloat = 1.0f;
            paramInfo.StepFloat      = 1.0f;
            paramInfo.CanRamp        = true;
            paramInfo.DefaultValue   = 0f;
            InputTapMgr = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            parameterInfos.Add(paramInfo);

            paramInfo                = new VstParameterInfo();
            paramInfo.Category       = paramCategory;
            paramInfo.CanBeAutomated = true;
            paramInfo.Name           = "LeftGain";
            paramInfo.Label          = "LftGn";
            paramInfo.ShortLabel     = "%";
            paramInfo.MinInteger     = 0;
            paramInfo.MaxInteger     = 1;
            paramInfo.LargeStepFloat = 0.10f;
            paramInfo.SmallStepFloat = 0.03f;
            paramInfo.StepFloat      = 0.05f;
            paramInfo.DefaultValue   = 1.0f;
            LeftVolumeMgr            = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            parameterInfos.Add(paramInfo);

            paramInfo                = new VstParameterInfo();
            paramInfo.Category       = paramCategory;
            paramInfo.CanBeAutomated = true;
            paramInfo.Name           = "RghtGain";
            paramInfo.Label          = "RghtGn";
            paramInfo.ShortLabel     = "%";
            paramInfo.MinInteger     = 0;
            paramInfo.MaxInteger     = 1;
            paramInfo.LargeStepFloat = 0.10f;
            paramInfo.SmallStepFloat = 0.03f;
            paramInfo.StepFloat      = 0.05f;
            paramInfo.DefaultValue   = 1.0f;
            RightVolumeMgr           = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            parameterInfos.Add(paramInfo);

            paramInfo                = new VstParameterInfo();
            paramInfo.Category       = paramCategory;
            paramInfo.CanBeAutomated = true;
            paramInfo.Name           = "Invert";
            paramInfo.Label          = "Invert";
            paramInfo.ShortLabel     = "!";
            paramInfo.MinInteger     = 0;
            paramInfo.MaxInteger     = 1;
            paramInfo.LargeStepFloat = 1f;
            paramInfo.SmallStepFloat = 1f;
            paramInfo.StepFloat      = 1f;
            paramInfo.IsSwitch       = true;
            paramInfo.DefaultValue   = 0f;
            this.InverterMgr         = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            parameterInfos.Add(paramInfo);

            paramInfo                = new VstParameterInfo();
            paramInfo.Category       = paramCategory;
            paramInfo.CanBeAutomated = true;
            paramInfo.Name           = "Balance";
            paramInfo.Label          = "Balance";
            paramInfo.ShortLabel     = "Bal";
            paramInfo.MinInteger     = 0;
            paramInfo.MaxInteger     = 240;
            paramInfo.LargeStepFloat = 10f;
            paramInfo.SmallStepFloat = 3f;
            paramInfo.StepFloat      = 5f;
            paramInfo.DefaultValue   = 120f;
            this.OutputBalanceMgr    = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            parameterInfos.Add(paramInfo);
        }
Exemple #27
0
        // create one parameter
        private VstParameter CreateParameter(VstParameterInfo parameterInfo)
        {
            VstParameter parameter = new VstParameter(parameterInfo);

            return parameter;
        }
Exemple #28
0
 /// <summary>
 /// Creates a <see cref="VstParameterManager"/> instance for the specified <paramref name="paramInfo"/> (this).
 /// </summary>
 /// <param name="paramInfo">Must not be null</param>
 /// <returns>Never returns null.</returns>
 public static VstParameterManager ToManager(this VstParameterInfo paramInfo)
 {
     return(new VstParameterManager(paramInfo));
 }
Exemple #29
0
        /// <summary>
        /// Constructeur
        /// </summary>
        public Delay()
        {
            // On instancie une nouvelle collection d'informations pour les paramètres du délai
            _paramInfos = new VstParameterInfoCollection();

            #region Initialize Parameters

            // Paramètres du temps du délai
            VstParameterInfo paramInfo = new VstParameterInfo();
            paramInfo.CanBeAutomated = true;
            paramInfo.Name           = "dt";
            paramInfo.Label          = "Delay Time";
            paramInfo.ShortLabel     = "T-Dly:";
            paramInfo.MinInteger     = 0;
            paramInfo.MaxInteger     = 1000;
            paramInfo.LargeStepFloat = 100.0f;
            paramInfo.SmallStepFloat = 1.0f;
            paramInfo.StepFloat      = 10.0f;
            paramInfo.DefaultValue   = 200f;
            _delayTimeMgr            = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            _paramInfos.Add(paramInfo);

            // Paramètre de feedback du délai
            paramInfo = new VstParameterInfo();
            paramInfo.CanBeAutomated = true;
            paramInfo.Name           = "fb";
            paramInfo.Label          = "Feedback";
            paramInfo.ShortLabel     = "Feedbk:";
            paramInfo.LargeStepFloat = 0.1f;
            paramInfo.SmallStepFloat = 0.01f;
            paramInfo.StepFloat      = 0.05f;
            paramInfo.DefaultValue   = 0.2f;
            _feedbackMgr             = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            _paramInfos.Add(paramInfo);

            // Paramètre de "dry" du délai (à quel niveau est le signal d'origine)
            paramInfo = new VstParameterInfo();
            paramInfo.CanBeAutomated = true;
            paramInfo.Name           = "dl";
            paramInfo.Label          = "Dry Level";
            paramInfo.ShortLabel     = "DryLvl:";
            paramInfo.LargeStepFloat = 0.1f;
            paramInfo.SmallStepFloat = 0.01f;
            paramInfo.StepFloat      = 0.05f;
            paramInfo.DefaultValue   = 0.8f;
            _dryLevelMgr             = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            _paramInfos.Add(paramInfo);

            // Paramètre de "wet" du délai (à quel niveau est le signal traité)
            paramInfo = new VstParameterInfo();
            paramInfo.CanBeAutomated = true;
            paramInfo.Name           = "wl";
            paramInfo.Label          = "Wet Level";
            paramInfo.ShortLabel     = "WetLvl:";
            paramInfo.LargeStepFloat = 0.1f;
            paramInfo.SmallStepFloat = 0.01f;
            paramInfo.StepFloat      = 0.05f;
            paramInfo.DefaultValue   = 0.4f;
            _wetLevelMgr             = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            _paramInfos.Add(paramInfo);

            #endregion

            // On s'abonne à l'event de changement de la propriété de temps du délai
            _delayTimeMgr.PropertyChanged += new PropertyChangedEventHandler(_delayTimeMgr_PropertyChanged);
        }
Exemple #30
0
        /// <summary>
        /// Constructs a new instance.
        /// </summary>
        public Delay()
        {
            _paramInfos = new VstParameterInfoCollection();

            #region Initialize Parameters

            // delay time parameter
            VstParameterInfo paramInfo = new VstParameterInfo();
            paramInfo.CanBeAutomated = true;
            paramInfo.Name           = "dt";
            paramInfo.Label          = "Delay Time";
            paramInfo.ShortLabel     = "T-Dly:";
            paramInfo.MinInteger     = 0;
            paramInfo.MaxInteger     = 1000;
            paramInfo.LargeStepFloat = 100.0f;
            paramInfo.SmallStepFloat = 1.0f;
            paramInfo.StepFloat      = 10.0f;
            paramInfo.DefaultValue   = 200f;
            _delayTimeMgr            = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            _paramInfos.Add(paramInfo);

            // feedback parameter
            paramInfo = new VstParameterInfo();
            paramInfo.CanBeAutomated = true;
            paramInfo.Name           = "fb";
            paramInfo.Label          = "Feedback";
            paramInfo.ShortLabel     = "Feedbk:";
            paramInfo.LargeStepFloat = 0.1f;
            paramInfo.SmallStepFloat = 0.01f;
            paramInfo.StepFloat      = 0.05f;
            paramInfo.DefaultValue   = 0.2f;
            _feedbackMgr             = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            _paramInfos.Add(paramInfo);

            // dry Level parameter
            paramInfo = new VstParameterInfo();
            paramInfo.CanBeAutomated = true;
            paramInfo.Name           = "dl";
            paramInfo.Label          = "Dry Level";
            paramInfo.ShortLabel     = "DryLvl:";
            paramInfo.LargeStepFloat = 0.1f;
            paramInfo.SmallStepFloat = 0.01f;
            paramInfo.StepFloat      = 0.05f;
            paramInfo.DefaultValue   = 0.8f;
            _dryLevelMgr             = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            _paramInfos.Add(paramInfo);

            // wet Level parameter
            paramInfo = new VstParameterInfo();
            paramInfo.CanBeAutomated = true;
            paramInfo.Name           = "wl";
            paramInfo.Label          = "Wet Level";
            paramInfo.ShortLabel     = "WetLvl:";
            paramInfo.LargeStepFloat = 0.1f;
            paramInfo.SmallStepFloat = 0.01f;
            paramInfo.StepFloat      = 0.05f;
            paramInfo.DefaultValue   = 0.4f;
            _wetLevelMgr             = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            _paramInfos.Add(paramInfo);

            #endregion

            //_delayTimeMgr.ValueChanged += new System.EventHandler<System.EventArgs>(_delayTimeMgr_ValueChanged);
            _delayTimeMgr.PropertyChanged += new PropertyChangedEventHandler(_delayTimeMgr_PropertyChanged);
        }
Exemple #31
0
        /// <summary>
        /// Constructs a new instance.
        /// </summary>
        public Delay()
        {
            _paramInfos = new VstParameterInfoCollection();

            #region Initialize Parameters

            // delay time parameter
            VstParameterInfo paramInfo = new VstParameterInfo
            {
                CanBeAutomated = true,
                Name           = "dt",
                Label          = "Delay Time",
                ShortLabel     = "T-Dly:",
                MinInteger     = 0,
                MaxInteger     = 1000,
                LargeStepFloat = 100.0f,
                SmallStepFloat = 1.0f,
                StepFloat      = 10.0f,
                DefaultValue   = 200f
            };
            _delayTimeMgr = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            _paramInfos.Add(paramInfo);

            // feedback parameter
            paramInfo = new VstParameterInfo
            {
                CanBeAutomated = true,
                Name           = "fb",
                Label          = "Feedback",
                ShortLabel     = "Feedbk:",
                LargeStepFloat = 0.1f,
                SmallStepFloat = 0.01f,
                StepFloat      = 0.05f,
                DefaultValue   = 0.2f
            };
            _feedbackMgr = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            _paramInfos.Add(paramInfo);

            // dry Level parameter
            paramInfo = new VstParameterInfo
            {
                CanBeAutomated = true,
                Name           = "dl",
                Label          = "Dry Level",
                ShortLabel     = "DryLvl:",
                LargeStepFloat = 0.1f,
                SmallStepFloat = 0.01f,
                StepFloat      = 0.05f,
                DefaultValue   = 0.8f
            };
            _dryLevelMgr = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            _paramInfos.Add(paramInfo);

            // wet Level parameter
            paramInfo = new VstParameterInfo
            {
                CanBeAutomated = true,
                Name           = "wl",
                Label          = "Wet Level",
                ShortLabel     = "WetLvl:",
                LargeStepFloat = 0.1f,
                SmallStepFloat = 0.01f,
                StepFloat      = 0.05f,
                DefaultValue   = 0.4f
            };
            _wetLevelMgr = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            _paramInfos.Add(paramInfo);

            #endregion

            _delayTimeMgr.PropertyChanged += new PropertyChangedEventHandler(_delayTimeMgr_PropertyChanged);
        }
        /// <summary>
        ///     Generates an instance of VstParameterInfo using information about an MSS parameter.
        /// </summary>
        /// <param name="paramId">Specifies the MSS parameter to get information from</param>
        /// <returns></returns>
        protected VstParameterInfo MssToVstParameterInfo(MssParameterID paramId)
        {
            // retrieve the category for all variable parameters.
            VstParameterCategory paramCategory =
                this.pluginPrograms.GetParameterCategory(DEFAULT_PARAMETER_CATEGORY_NAME);

            // Variable parameter
            VstParameterInfo paramInfo = new VstParameterInfo();
            paramInfo.Category = paramCategory;
            paramInfo.CanBeAutomated = true;

            if (MssParameters.PRESET_PARAM_ID_LIST.Contains(paramId))
            {
                paramInfo.Name = MssParameters.GetDefaultPresetName(paramId);
                paramInfo.DefaultValue = 0;
            }
            else if (MssParameters.VARIABLE_PARAM_ID_LIST.Contains(paramId))
            {
                MssParamInfo mssParamInfo = this.mssParameters.GetParameterInfoCopy(paramId);
                paramInfo.Name = GetParamNameFromString(mssParamInfo.Name);
                paramInfo.DefaultValue = (float)this.mssParameters.GetRelativeParamValue(paramId);
            }
            else {
                Debug.Assert(false);
            }

            paramInfo.Label = "";
            paramInfo.ShortLabel = "";
            paramInfo.MinInteger = VST_PARAM_MIN_VALUE;
            paramInfo.MaxInteger = VST_PARAM_MAX_VALUE;
            paramInfo.LargeStepFloat = ((float)(VST_PARAM_MAX_VALUE - VST_PARAM_MIN_VALUE)) / 8;
            paramInfo.SmallStepFloat = ((float)(VST_PARAM_MAX_VALUE - VST_PARAM_MIN_VALUE)) / 128;
            paramInfo.StepFloat = 0.03125f;
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            return paramInfo;
        }
Exemple #33
0
        // This method initializes the plugin parameters this Dsp component owns.
        private void InitializeParameters()
        {
            // all parameter definitions are added to a central list.
            VstParameterInfoCollection parameterInfos = _plugin.PluginPrograms.ParameterInfos;

            // retrieve the category for all delay parameters.
            VstParameterCategory paramCategory =
                _plugin.PluginPrograms.GetParameterCategory(ParameterCategoryName);

            // delay time parameter
            VstParameterInfo paramInfo = new VstParameterInfo();

            paramInfo.Category       = paramCategory;
            paramInfo.CanBeAutomated = true;
            paramInfo.Name           = "Time";
            paramInfo.Label          = "MilSecs";
            paramInfo.ShortLabel     = "ms";
            paramInfo.MinInteger     = 0;
            paramInfo.MaxInteger     = 1000;
            paramInfo.LargeStepFloat = 100.0f;
            paramInfo.SmallStepFloat = 1.0f;
            paramInfo.StepFloat      = 10.0f;
            paramInfo.DefaultValue   = 200f;
            DelayTimeMgr             = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            parameterInfos.Add(paramInfo);

            // feedback parameter
            paramInfo                = new VstParameterInfo();
            paramInfo.Category       = paramCategory;
            paramInfo.CanBeAutomated = true;
            paramInfo.Name           = "Feedbck";
            paramInfo.Label          = "Factor";
            paramInfo.ShortLabel     = "*";
            paramInfo.LargeStepFloat = 0.1f;
            paramInfo.SmallStepFloat = 0.01f;
            paramInfo.StepFloat      = 0.05f;
            paramInfo.DefaultValue   = 0.2f;
            FeedbackMgr              = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            parameterInfos.Add(paramInfo);

            // dry Level parameter
            paramInfo                = new VstParameterInfo();
            paramInfo.Category       = paramCategory;
            paramInfo.CanBeAutomated = true;
            paramInfo.Name           = "Dry Lvl";
            paramInfo.Label          = "Decibel";
            paramInfo.ShortLabel     = "Db";
            paramInfo.LargeStepFloat = 0.1f;
            paramInfo.SmallStepFloat = 0.01f;
            paramInfo.StepFloat      = 0.05f;
            paramInfo.DefaultValue   = 0.8f;
            DryLevelMgr              = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            parameterInfos.Add(paramInfo);

            // wet Level parameter
            paramInfo                = new VstParameterInfo();
            paramInfo.Category       = paramCategory;
            paramInfo.CanBeAutomated = true;
            paramInfo.Name           = "Wet Lvl";
            paramInfo.Label          = "Decibel";
            paramInfo.ShortLabel     = "Db";
            paramInfo.LargeStepFloat = 0.1f;
            paramInfo.SmallStepFloat = 0.01f;
            paramInfo.StepFloat      = 0.05f;
            paramInfo.DefaultValue   = 0.4f;
            WetLevelMgr              = new VstParameterManager(paramInfo);
            VstParameterNormalizationInfo.AttachTo(paramInfo);

            parameterInfos.Add(paramInfo);
        }