public bool Prepare(IntPtr user) { this._user = user; MIDI_HEADER midi_HEADER = new MIDI_HEADER(this._data); midi_HEADER.User = this._user; if (midi_HEADER.Prepare(this._input, this._device)) { this._headerPtr = midi_HEADER.HeaderPtr; } return(this._headerPtr != IntPtr.Zero); }
public MidiSysExMessage(bool input, IntPtr handle, IntPtr headerPtr) { this.InitID(); this._input = input; this._device = handle; MIDI_HEADER midi_HEADER = new MIDI_HEADER(headerPtr); if (midi_HEADER.IsDone) { this._data = midi_HEADER.Data; this._user = midi_HEADER.User; } midi_HEADER.Unprepare(input, handle); }
public MidiSysExMessage(bool input, IntPtr handle, IntPtr headerPtr, MidiSysExMessage previous) { this.InitID(); this._input = input; this._device = handle; MIDI_HEADER midi_HEADER = new MIDI_HEADER(headerPtr); if (midi_HEADER.IsDone) { this._user = midi_HEADER.User; if (previous == null || previous.IsDone) { this._data = midi_HEADER.Data; } else { byte[] data = midi_HEADER.Data; if (data == null && previous.Message != null) { this._data = new byte[previous.Message.Length]; Array.Copy(previous.Message, 0, this._data, 0, previous.Message.Length); } else if (previous.Message != null) { this._data = new byte[data.Length + previous.Message.Length]; Array.Copy(previous.Message, 0, this._data, 0, previous.Message.Length); Array.Copy(data, 0, this._data, previous.Message.Length, data.Length); } else { this._data = data; } } } midi_HEADER.Unprepare(input, handle); }