예제 #1
0
 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);
 }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }