Exemple #1
0
        /// <summary>
        /// Sets a property to the port.
        /// </summary>
        /// <param name="flags">Indication of what property to write.</param>
        /// <param name="value">The value of the property.</param>
        private void SetProperty(uint flags, uint value)
        {
            MidiOutStreamPortProperty prop = new MidiOutStreamPortProperty(value);

            int result = NativeMethods.midiStreamProperty(
                MidiSafeHandle,
                ref prop,
                flags | NativeMethods.MIDIPROP_SET);

            ThrowIfError(result);
        }
Exemple #2
0
        /// <summary>
        /// Returns a property from the port.
        /// </summary>
        /// <param name="flags">Indication of what property to read.</param>
        /// <returns>Returns the property value read.</returns>
        private uint GetProperty(uint flags)
        {
            MidiOutStreamPortProperty prop = new MidiOutStreamPortProperty(0);

            int result = NativeMethods.midiStreamProperty(
                MidiSafeHandle,
                ref prop,
                flags | NativeMethods.MIDIPROP_GET);

            ThrowIfError(result);

            return(prop.PropertyValue);
        }
Exemple #3
0
 public static extern int midiStreamProperty(MidiSafeHandle handle, ref MidiOutStreamPortProperty prop, uint flags);