Click here to Skip to main content
15,895,784 members
Articles / Desktop Programming / Windows Forms

MIDI Out Setter

Rate me:
Please Sign up or sign in to vote.
5.00/5 (16 votes)
10 May 2009CPOL3 min read 102.2K   7.6K   32  
Allows changing of the default MIDI out device in Vista and Windows 7
using System;
using System.Runtime.InteropServices;

namespace MIDI.Interop
{
    /// <summary>
    /// Describes the capabilities of a MIDI output device.
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    internal struct MIDIOUTCAPS
    {
        /// <summary>
        /// Manufacturer identifier of the device driver for the MIDI output device.
        /// </summary>
        public UInt16 wMid;
        /// <summary>
        /// Product identifier of the MIDI output device.
        /// </summary>
        public UInt16 wPid;
        /// <summary>
        /// Version number of the device driver for the MIDI output device.
        /// The high-order byte is the major version number, and the low-order byte is the minor version number.
        /// </summary>
        public UInt32 vDriverVersion;
        /// <summary>
        /// Product name in a null-terminated string.
        /// </summary>
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Constants.MAXPNAMELEN)]
        public string szPname;
        /// <summary>
        /// Type of the MIDI output device.
        /// </summary>
        public UInt16 wTechnology;
        /// <summary>
        /// Number of voices supported by an internal synthesizer device.
        /// If the device is a port, this member is not meaningful and is set to 0.
        /// </summary>
        public UInt16 wVoices;
        /// <summary>
        /// Maximum number of simultaneous notes that can be played by an internal synthesizer device.
        /// If the device is a port, this member is not meaningful and is set to 0.
        /// </summary>
        public UInt16 wNotes;
        /// <summary>
        /// Channels that an internal synthesizer device responds to, where the least significant bit refers to channel 0 and the most significant bit to channel 15.
        /// </summary>
        public UInt16 wChannelMask;
        /// <summary>
        /// Optional functionality supported by the device.
        /// </summary>
        public UInt32 dwSupport;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
CEO Dave Meadowcroft
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions