/// <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); }
/// <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); }
public static extern int midiStreamProperty(MidiSafeHandle handle, ref MidiOutStreamPortProperty prop, uint flags);