void OnDestroy() { if (outDevice != null) { outDevice.Dispose(); } }
public static OutputDevice CreateDevice(int deviceID, SynchronizationContext context) { OutputDevice ret = null; try { ret = new OutputDevice(deviceID, context); if (!ret.OpenMidi()) { ret.Dispose(); ret = null; } } catch { ret = null; } return(ret); }
/// <summary> /// Disposes the underying output device and removes the events from the source /// </summary> public void Dispose() { UnRegisterEvents(); FOutDevice.Dispose(); }
public static OutputDevice CreateDevice(int deviceID, SynchronizationContext context) { OutputDevice ret = null; try { ret = new OutputDevice(deviceID, context); if (!ret.OpenMidi()) { ret.Dispose(); ret = null; } } catch { ret = null; } return ret; }