Example #1
0
        /// <summary>
        /// Disconnects this Midi Port from the specified <paramref name="outPort"/>.
        /// </summary>
        /// <param name="outPort">A reference to a Midi Out Port. Must not be null.</param>
        public virtual void Disconnect(MidiOutPort outPort)
        {
            Check.IfArgumentNull(outPort, nameof(outPort));
            ThrowIfDisposed();

            int result = NativeMethods.midiDisconnect(MidiSafeHandle, outPort.MidiSafeHandle, IntPtr.Zero);

            MidiOutPort.ThrowIfError(result);
        }
Example #2
0
        public virtual void Disconnect(MidiOutPort outPort)
        {
            Contract.Requires(outPort != null);
            Check.IfArgumentNull(outPort, "outPort");
            this.ThrowIfDisposed();

            int result = NativeMethods.midiDisconnect(MidiSafeHandle, outPort.MidiSafeHandle, IntPtr.Zero);

            MidiOutPort.ThrowIfError(result);
        }
Example #3
0
        /// <summary>
        /// Initializes the collection instance.
        /// </summary>
        public MidiOutPortCapsCollection()
            : base(new List <MidiOutPortCaps>())
        {
            int count = NativeMethods.midiOutGetNumDevs();

            for (int portId = 0; portId < count; portId++)
            {
                MidiOutPortCaps caps = MidiOutPort.GetPortCapabilities(portId);

                Items.Add(caps);
            }
        }