예제 #1
0
파일: MidiPort.cs 프로젝트: walney/midi.net
        /// <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);
        }
예제 #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);
        }
예제 #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);
            }
        }