Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 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           = "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);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes the new instance.
        /// </summary>
        public PluginParameterFactory()
        {
            VstParameterCategory paramCat = new VstParameterCategory();

            paramCat.Name = "Delay";

            Categories.Add(paramCat);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Initializes the new instance.
        /// </summary>
        public PluginParameterFactory()
        {
            VstParameterCategory paramCat = new VstParameterCategory
            {
                Name = "Compressor"
            };

            Categories.Add(paramCat);
        }
Exemplo n.º 6
0
 /// <summary>
 /// Инициализирует новый объект типа ParameterFactory, принадлежащий заданному
 /// плагину и имеющий переданную категорию и префикс имени параметра.
 /// </summary>
 /// <param name="plugin"></param>
 /// <param name="category"></param>
 /// <param name="namePrefix"></param>
 public ParameterFactory(Plugin plugin, string category = "", string namePrefix = "")
 {
     this.plugin       = plugin;
     programs          = plugin.Programs;
     this.namePrefix   = namePrefix;
     parameterCategory = new VstParameterCategory()
     {
         Name = category
     };
     if (programs.ParameterCategories.All(x => x.Name != category))
     {
         programs.ParameterCategories.Add(parameterCategory);
     }
 }
Exemplo n.º 7
0
        /// <summary>
        /// Retrieves a parameter category object for the specified <paramref name="categoryName"/>.
        /// </summary>
        /// <param name="categoryName">The name of the parameter category. Typically the name of the Dsp component.</param>
        /// <returns>Never returns null.</returns>
        public VstParameterCategory GetParameterCategory(string categoryName)
        {
            if (ParameterCategories.Contains(categoryName))
            {
                return ParameterCategories[categoryName];
            }

            // create a new parameter category object
            VstParameterCategory paramCategory = new VstParameterCategory();
            paramCategory.Name = categoryName;

            ParameterCategories.Add(paramCategory);

            return paramCategory;
        }
Exemplo n.º 8
0
        /// <summary>
        /// Retrieves a parameter category object for the specified <paramref name="categoryName"/>.
        /// </summary>
        /// <param name="categoryName">The name of the parameter category. Typically the name of the Dsp component.</param>
        /// <returns>Never returns null.</returns>
        public VstParameterCategory GetParameterCategory(string categoryName)
        {
            if (ParameterCategories.Contains(categoryName))
            {
                return ParameterCategories[categoryName];
            }

            // create a new parameter category object
            VstParameterCategory paramCategory = new VstParameterCategory();
            paramCategory.Name = categoryName;

            ParameterCategories.Add(paramCategory);

            return paramCategory;
        }
Exemplo n.º 9
0
        /// <summary>
        /// Retrieves a parameter category object for the specified <paramref name="categoryName"/>.
        /// </summary>
        /// <param name="categoryName">The name of the parameter category.
        /// Typically the name of a Dsp component, an effect or function.</param>
        /// <returns>Never returns null.</returns>
        public VstParameterCategory GetParameterCategory(string categoryName)
        {
            if (Categories.Contains(categoryName))
            {
                return(Categories[categoryName]);
            }

            // create a new parameter category object
            var paramCategory = new VstParameterCategory
            {
                Name = categoryName
            };

            Categories.Add(paramCategory);

            return(paramCategory);
        }
Exemplo n.º 10
0
        public void Test_MaxLength_VstParameterCategory_Name()
        {
            VstParameterCategory pc = new VstParameterCategory();

            Assert.AreEqual(null, pc.Name);

            pc.Name = String.Empty;
            Assert.AreEqual(String.Empty, pc.Name);

            string testData = CreateString(Constants.MaxCategoryLabelLength);

            pc.Name = testData;
            Assert.AreEqual(testData, pc.Name);

            testData += "X";
            pc.Name   = testData;
            Assert.Fail("should have thrown an exception.");
        }
Exemplo n.º 11
0
        public void Test_MaxLength_VstParameterCategory_Name()
        {
            var pc = new VstParameterCategory();

            pc.Name.Should().BeEmpty();

            pc.Name = String.Empty;
            pc.Name.Should().BeEmpty();

            var testData = CreateString(Constants.MaxCategoryLabelLength);

            pc.Name = testData;
            pc.Name.Should().Be(testData);

            testData += "X";
            pc.Name   = testData;
            Assert.Fail("should have thrown an exception.");
        }
Exemplo n.º 12
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);
        }
Exemplo n.º 13
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);
        }
Exemplo n.º 14
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);
        }
Exemplo n.º 15
0
        // This method initializes the plugin parameters this Dsp component owns.
        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             = "Time",
                Label            = "MilSecs",
                ShortLabel       = "ms",
                MinInteger       = 0,
                MaxInteger       = 1000,
                LargeStepInteger = 100,
                StepInteger      = 10,
                DefaultValue     = 200f
            };

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

            parameterInfos.Add(paramInfo);

            // feedback parameter
            paramInfo = new VstParameterInfo
            {
                Category       = paramCategory,
                CanBeAutomated = true,
                Name           = "Feedbck",
                Label          = "Factor",
                ShortLabel     = "*",
                LargeStepFloat = 0.1f,
                SmallStepFloat = 0.01f,
                StepFloat      = 0.05f,
                DefaultValue   = 0.4f
            };
            FeedbackMgr = paramInfo
                          .Normalize()
                          .ToManager();

            parameterInfos.Add(paramInfo);

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

            parameterInfos.Add(paramInfo);

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

            parameterInfos.Add(paramInfo);
        }