public bool AddSysExBuffer() { if (this._closing) { return(true); } if (this._device == IntPtr.Zero || this._disposing) { return(false); } bool result = false; try { MidiSysExMessage midiSysExMessage = new MidiSysExMessage(true, this._device); midiSysExMessage.CreateBuffer(this._sysexBufferSize); if (midiSysExMessage.Prepare(this._user)) { result = midiSysExMessage.Send(); } } catch { } return(result); }
public bool Send(MidiSysExMessage sysexMessage) { if (!this.IsOpened || sysexMessage.IsInput || sysexMessage.Device != this.Device || sysexMessage.IsPrepared) { return(false); } if (sysexMessage.Prepare(this._user)) { this._lastError = Midi.MIDI_OutLongMsg(this._device, sysexMessage.MessageAsIntPtr); return(this._lastError == MIDIError.MIDI_OK); } return(false); }
public bool Send(IEnumerable <byte> sysexMessage) { if (!this.IsOpened || sysexMessage == null) { return(false); } MidiSysExMessage midiSysExMessage = new MidiSysExMessage(false, this._device); if (!midiSysExMessage.CreateBuffer(sysexMessage)) { return(false); } if (midiSysExMessage.Prepare(this._user)) { this._lastError = Midi.MIDI_OutLongMsg(this._device, midiSysExMessage.MessageAsIntPtr); return(this._lastError == MIDIError.MIDI_OK); } return(false); }