//cons public VSTPanel(VSTRig _rig, int _plugNum) { InitializeComponent(); rig = _rig; audiwin = rig.controlPanel.auditwin; host = rig.controlPanel.host; midiDevices = rig.controlPanel.midiDevices; plugNum = _plugNum; this.lblPlugName.Text = plugName; plugPath = null; fileName = null; plugin = null; this.Size = new Size(PANELWIDTH, PANELHEIGHT); pluginInfoWnd = null; paramEditorWnd = null; editorWindow = null; midiInDevice = null; midiInUnit = null; midiOutDeviceNum = -1; audioOut = "no output"; }
//- midi i/o connections ---------------------------------------------- public void connectMidiInput(InputDevice indev, PanelMidiIn pluginMidiIn) { //InputDevice indev = midiDevices.inputDevices[idx]; try { indev.open(); indev.connectUnit(pluginMidiIn); indev.start(); } catch { //Console.WriteLine("error connecting midi input"); } }
public void setMidiIn(String deviceName) { InputDevice indev = midiDevices.findInputDevice(deviceName); if (midiInDevice != indev) { if (midiInUnit != null) { disconnectMidiInput(midiInDevice, midiInUnit); } midiInDevice = indev; if (midiInDevice != null) { midiInUnit = new PanelMidiIn(this); connectMidiInput(midiInDevice, midiInUnit); } else { midiInUnit = null; } } }
public void disconnectMidiInput(InputDevice indev, PanelMidiIn pluginMidiIn) { //InputDevice indev = midiDevices.inputDevices[idx]; //indev.disconnectUnit(pluginMidiIn); }