//this method is called by vvvv when the node is created public void SetPluginHost(IPluginHost Host) { //assign host FHost = Host; //create config FHost.CreateStringConfig("Cases", TSliceMode.Single, TPinVisibility.OnlyInspector, out FCases); FCases.SetSubType("one, two", false); //create inputs FHost.CreateStringInput("Switch", TSliceMode.Dynamic, TPinVisibility.True, out FSwitch); FSwitch.SetSubType("one", false); FHost.CreateValueInput("one", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FIn0); FIn0.SetSubType(double.MinValue, double.MaxValue, 0.01, 0.0, false, false, false); FHost.CreateValueInput("two", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FIn1); FIn1.SetSubType(double.MinValue, double.MaxValue, 0.01, 0.0, false, false, false); //create outputs FHost.CreateValueOutput("Value Output", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FOutput); FOutput.SetSubType(double.MinValue, double.MaxValue, 0.01, 0, false, false, false); FHit[0] = 0; FPinArr[0] = FIn0; FCaseArr[0] = "one"; FPinArr[1] = FIn1; FCaseArr[1] = "two"; }
protected override void CreatePins() { FHost.CreateValueConfig(FPin.Name + "-Time" + FSliceIndex.ToString(), 1, null, TSliceMode.Dynamic, TPinVisibility.Hidden, out FStateTime); FStateTime.SliceCount = 0; FStateTime.SetSubType(Double.MinValue, Double.MaxValue, 0.001D, 0, false, false, false); FHost.CreateStringConfig(FPin.Name + "-Name" + FSliceIndex.ToString(), TSliceMode.Dynamic, TPinVisibility.Hidden, out FStateName); FStateName.SliceCount = 0; FStateName.SetSubType("default", false); FHost.CreateStringConfig(FPin.Name + "-Events" + FSliceIndex.ToString(), TSliceMode.Dynamic, TPinVisibility.Hidden, out FStateEvents); FStateEvents.SliceCount = 0; FStateEvents.SetSubType("default", false); }
protected override void CreatePins() { base.CreatePins(); FHost.CreateStringConfig(Name + "-Filename", TSliceMode.Single, TPinVisibility.True, out FFilenameIn); FFilenameIn.Order = Order; FFilenameIn.SetSubType("*.mid", true); FHost.CreateValueOutput(Name + "-Channel", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FChannelOut); FChannelOut.SliceCount = 128; FChannelOut.Order = Order; FChannelOut.SetSubType(0, 15, 1, 0, false, false, true); FHost.CreateValueOutput(Name + "-Velocity", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FVelocityOut); FVelocityOut.SliceCount = 128; FVelocityOut.Order = Order; FVelocityOut.SetSubType(0, 1, 1 / 128, 0, false, false, false); }