/// <summary> /// Set the output pins of the node /// </summary> /// <param name="i">Current slice index</param> /// <param name="instance">Current instance</param> protected void SetOutputs(int i, VSTSignal instance) { if (FAutosafeIn[i] && instance.NeedsSave) { FSafeConfig[i] = instance.GetSaveString(); instance.NeedsSave = false; } //assign event sender? if(instance.MidiEventSender != FMidiEventsOut[i]) { FMidiEventsOut[i] = instance.MidiEventSender; } }
/// <summary> /// This should set the parameters of the given audio signal class /// </summary> /// <param name="i">Current index of the output signal spread</param> /// <param name="instance">Curretn instance</param> protected void SetParameters(int i, VSTSignal instance) { instance.Input = FInputSignals[i]; instance.Filename = FFilename[i]; foreach (var item in FChangedParamPins) { if (instance.PluginContext.PluginCommandStub.GetParameterName(item.ParamIndex) == item.ParamName) { double val; item.Pin.GetValue(i, out val); if (val <= 0) { Debug.WriteLine("0 val"); } instance.PluginContext.PluginCommandStub.SetParameter(item.ParamIndex, (float)val); } } instance.SetMidiEventSource(FMidiEventsIn[i]); instance.Bypass = FBypassIn[i]; }
/// <summary> /// This should return a new instance of the desired audio signal class /// </summary> /// <param name="i">The current slice index of the output signal</param> /// <returns>New instnace of the audio signal class</returns> protected VSTSignal GetInstance(int i) { var vst = new VSTSignal(FFilename[i], this); vst.LoadFromSafeString(FSafeConfig[i]); SetOutputSliceCount(CalculatedSpreadMax); if (vst.PluginContext != null) { FLatencyOut[i] = vst.PluginContext.PluginInfo.InitialDelay; FInChannelsOut[i] = vst.PluginContext.PluginInfo.AudioInputCount; FOutChannelsOut[i] = vst.PluginContext.PluginInfo.AudioOutputCount; } return vst; }
protected void DisposeInstance(VSTSignal instance) { if(instance != null) { instance.Dispose(); } }
private void numericUpDown1_ValueChanged(object sender, EventArgs e) { SelectedSignal = Node.GetPluginContext((int)((NumericUpDown)sender).Value); LoadPrograms(); SetEditor(); }