Ejemplo n.º 1
0
        /// <summary>
        /// Send short Midi message.
        /// </summary>
        /// <param name="message">
        /// The short Midi message to send.
        /// </param>
        /// <param name="status">
        /// A flag indicating whether or not the status value should be sent.
        /// </param>
        /// <exception cref="OutputDeviceException">
        /// Thrown if an error occurred while sending the message.
        /// </exception>
        public void Send(ShortMessage message, bool status)
        {
            // If the device is open.
            if (opened)
            {
                // If status value is to be sent with message.
                if (status)
                {
                    // Send message with status value.
                    ThrowOnError(midiOutShortMsg(handle, message.Message));
                }
                // Else running status is used.
                else
                {
                    // Remove status value.
                    int msg = message.Message >> StatusShift;

                    // Send message.
                    ThrowOnError(midiOutShortMsg(handle, msg));
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Send short Midi message.
        /// </summary>
        /// <param name="message">
        /// The short Midi message to send.
        /// </param>
        /// <param name="status">
        /// A flag indicating whether or not the status value should be sent.
        /// </param>
        /// <exception cref="OutputDeviceException">
        /// Thrown if an error occurred while sending the message.
        /// </exception>
        public void Send(ShortMessage message, bool status)
        {
            // If the device is open.
            if(opened)
            {
                // If status value is to be sent with message.
                if(status)
                {
                    // Send message with status value.
                    ThrowOnError(midiOutShortMsg(handle, message.Message));
                }
                // Else running status is used.
                else
                {
                    // Remove status value.
                    int msg = message.Message >> StatusShift;

                    // Send message.
                    ThrowOnError(midiOutShortMsg(handle, msg));
                }
            }
        }