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() { if (this._headerPtr == IntPtr.Zero) { return(false); } MIDIError midierror; if (this._input) { midierror = Midi.MIDI_InAddBuffer(this._device, this._headerPtr); } else { midierror = Midi.MIDI_OutLongMsg(this._device, this._headerPtr); } return(midierror == MIDIError.MIDI_OK); }
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); }