public Time GetTime(TimeType type) { #region Require if(IsDisposed) { throw new ObjectDisposedException("OutputStream"); } #endregion Time t = new Time(); t.type = (int)type; lock(lockObject) { int result = midiStreamPosition(Handle, ref t, Marshal.SizeOf(typeof(Time))); if(result != MidiDeviceException.MMSYSERR_NOERROR) { throw new OutputDeviceException(result); } } return t; }
private static extern int midiStreamPosition(int handle, ref Time t, int sizeOfTime);
public static extern int midiStreamPosition(IntPtr handle, ref Time t, int sizeOfTime);