// WARNING: you must not call this if any devices are open public virtual void refreshDeviceLists() { if (openCount > 0) { throw new CsPortMidiException(pmStreamOpen, "RefreshDeviceLists called while stream is open"); } checkError(CsPortMidiApi.Pm_Terminate()); checkError(CsPortMidiApi.Pm_Initialize()); }
protected internal bool trace = false; // used to print midi msgs for debugging public CsPortMidi() { if (pmRefCount == 0) { pm = new CsPortMidiApi(); pmRefCount++; checkError(CsPortMidiApi.Pm_Initialize()); } buffer = new CsPortMidiApi.PmEvent(); }