public override Task OpenAsync() { Connection = MidiPortConnectionState.Pending; impl = MidiDeviceManager.OpenInput(((RtMidiPortDetails)Details).RawId); Connection = MidiPortConnectionState.Open; return(completed_task); }
public static RtMidiInputDevice OpenInput(int deviceID) { var dev = new RtMidiInputDevice(); dev.OpenPort(deviceID, GetDeviceInfo(deviceID).Name); return(dev); }
public override Task OpenAsync() { Connection = MidiPortConnectionState.Pending; impl = MidiDeviceManager.OpenInput (((RtMidiPortDetails) Details).RawId); Connection = MidiPortConnectionState.Open; return completed_task; }
public unsafe override Task OpenAsync() { Connection = MidiPortConnectionState.Pending; impl = MidiDeviceManager.OpenInput(((RtMidiPortDetails)Details).RawId); impl.SetCallback((timestamp, message, size, userData) => { var bytes = new byte [size]; System.Runtime.InteropServices.Marshal.Copy((IntPtr)message, bytes, 0, (int)size); MessageReceived(this, new MidiReceivedEventArgs { Data = bytes, Start = 0, Length = bytes.Length, Timestamp = (long)timestamp }); }, IntPtr.Zero); Connection = MidiPortConnectionState.Open; return(completed_task); }
public static RtMidiInputDevice OpenInput(int deviceID) { var dev = new RtMidiInputDevice (); dev.OpenPort (deviceID, GetDeviceInfo (deviceID).Name); return dev; }