protected static List <MssParamInfo> CreateDefaultPresetParamInfoList()
        {
            List <MssParamInfo> presetParamInfoList = new List <MssParamInfo>();

            MssParamInfo defaultParameterInfo = new MssNumberParamInfo();

            defaultParameterInfo.Init("");

            MssParamInfo tempParameterInfo;

            tempParameterInfo      = defaultParameterInfo.Clone();
            tempParameterInfo.Name = MssParameters.GetDefaultPresetName(MssParameterID.Preset1);
            presetParamInfoList.Add(tempParameterInfo);

            tempParameterInfo      = defaultParameterInfo.Clone();
            tempParameterInfo.Name = MssParameters.GetDefaultPresetName(MssParameterID.Preset2);
            presetParamInfoList.Add(tempParameterInfo);

            tempParameterInfo      = defaultParameterInfo.Clone();
            tempParameterInfo.Name = MssParameters.GetDefaultPresetName(MssParameterID.Preset3);
            presetParamInfoList.Add(tempParameterInfo);

            tempParameterInfo      = defaultParameterInfo.Clone();
            tempParameterInfo.Name = MssParameters.GetDefaultPresetName(MssParameterID.Preset4);
            presetParamInfoList.Add(tempParameterInfo);

            tempParameterInfo      = defaultParameterInfo.Clone();
            tempParameterInfo.Name = MssParameters.GetDefaultPresetName(MssParameterID.Preset5);
            presetParamInfoList.Add(tempParameterInfo);

            return(presetParamInfoList);
        }
        protected void ConstructNonSerializableMembers()
        {
            this.sendEventsToHostTrigger = new SendMssEventsToHostTrigger();
            this.paramMsgHandler         = new ParameterMsgHandler();
            this.dryMssEventHandler      = new DryMssEventHandler();

            this._dryMssEventRelay = new DryMssEventRelay();
            this._wetMssEventRelay = new WetMssEventRelay();
            this._hostInfoRelay    = new HostInfoRelay();

            this.mssEventGenrator        = new MssEventGenerator();
            this._mssParameters          = new MssParameters();
            this.msgEntryMetadataFactory = new Factory_MssMsgRangeEntryMetadata();
            this.msgInfoFactory          = new Factory_MssMsgInfo();
            this.transformPresetMgr      = new TransformPresetMgr();
            this.eventLogger             = new EventLogger();
        }
Exemplo n.º 3
0
 protected void OnProgramActivated()
 {
     //Send the info for each parameter from MssParameters to the host.
     foreach (MssParameterID paramId in MssParameterID.GetValues(typeof(MssParameterID)))
     {
         if (MssParameters.PRESET_PARAM_ID_LIST.Contains(paramId) && mssParameters.GetActiveMappingExists() == false)
         {
             MssParameters_ValueChanged(paramId, 0);
             MssParameters_NameChanged(paramId, MssParameters.GetDefaultPresetName(paramId));
         }
         else
         {
             MssParamInfo mssParamInfo = this.mssParameters.GetParameterInfoCopy(paramId);
             MssParameters_ValueChanged(paramId, mssParamInfo.GetValue());
             MssParameters_NameChanged(paramId, mssParamInfo.Name);
         }
     }
 }
        public void Init(MssParameters mssParameters,
                         IWetMssEventOutputPort wetEventOutput,
                         IDryMssEventInputPort dryEventInput,
                         IHostInfoOutputPort hostInfoOutput)
        {
            this.mssParameters  = mssParameters;
            this.wetEventOutput = wetEventOutput;
            this.dryEventInput  = dryEventInput;
            this.hostInfoOutput = hostInfoOutput;

            this.wetEventOutput.WetMssEventsReceived +=
                new WetMssEventReceivedEventHandler(WetEventReceived);

            this.mssParameters.ParameterValueChanged +=
                new ParameterValueChangedEventHandler(ParameterValueChanged);

            this.hostInfoOutput.BeforeProcessingCycleEnd +=
                new ProcessingCycleEndEventHandler(OnBeforeProcessingCycleEnd);
        }
Exemplo n.º 5
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);
        }
        protected override void SetMappingDlgEntryFieldCustomProperties()
        {
            this.EntryField1Lbl.Visible = true;
            this.EntryField1Lbl.Text    = "Parameter Name:";
            this.EntryField1.Visible    = true;

            for (int i = 0; i < MssParameters.ALL_PARAMS_ID_LIST.Count; i++)
            {
                MssParameterID curId = MssParameters.ALL_PARAMS_ID_LIST[i];

                if (MssParameters.PRESET_PARAM_ID_LIST.Contains(curId) &&
                    this.mappingDlg.UseMappingEntryForDefaultValues == false)
                {
                    ((ComboBox)EntryField1).Items.Add(MssParameters.GetDefaultPresetName(curId));
                }
                else
                {
                    MssParamInfo curParamInfo = this.parameterViewer.GetParameterInfoCopy(curId);
                    ((ComboBox)EntryField1).Items.Add(curParamInfo.Name);
                }
            }

            ((ComboBox)EntryField1).SelectedIndex = 0;
        }