Esempio n. 1
0
 public VstDynamicPropertyDescriptor(VstSettings vstSettingsObject,
                                     string propertyName, Type propertyType, Attribute[] propertyAttributes)
     : base(propertyName, propertyAttributes)
 {
     this.vstSettingsObject = vstSettingsObject;
     this.propertyType      = propertyType;
 }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="vstPluginContext"></param>
        public VstPluginContextWrapper(VstPluginContext vstPluginContext)
        {
            f_Context = vstPluginContext;

            VstParameterIndexes = new Dictionary <string, int>();
            var vst = new VstSettings();

            vst.VstPluginContext = this;

            for (int i = 0; i < vstPluginContext.PluginInfo.ParameterCount; i++)
            {
                string name = vstPluginContext.PluginCommandStub.GetParameterName(i);
                float  val  = vstPluginContext.PluginCommandStub.GetParameter(i);
                vst.SetPropertyValue(name, val);
                VstParameterIndexes.Add(name, i);
            }

            VstSettings = vst;
        }
Esempio n. 3
0
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var obj = new VstSettings();

            while (reader.Read())
            {
                if (reader.TokenType == JsonToken.EndObject)
                {
                    break;
                }
                if (reader.TokenType == JsonToken.PropertyName)
                {
                    var prop = reader.Value?.ToString();
                    reader.Read();
                    float val = (float)((double)reader.Value);
                    obj.SetPropertyValue(prop, val);
                }
            }

            return(obj);
        }