internal MidiOutputDevice(int index) { _index = index; _CheckOutResult(midiOutGetDevCaps(index, ref _caps, Marshal.SizeOf(typeof(MIDIOUTCAPS)))); _handle = IntPtr.Zero; _outCallback = new MidiOutProc(_MidiOutProc); }
public MIDIOutDevice(int deviceID) : base(deviceID) { // query number of input devices int numOutputDevices = midiOutGetNumDevs(); if (numOutputDevices <= 0) { return; } // look for the input device that's MIDI controller for (int i = 0; i < numOutputDevices; i++) { MidiOutCaps caps = GetDeviceCapabilities(i); } // open the output device midiOutProc = HandleMessage; int result = midiOutOpen(ref hndle, deviceID, midiOutProc, 0, CALLBACK_FUNCTION); if (result != MIDIExceptions.MMSYSERR_NOERROR) { throw new OutputDeviceException(result); } }
public static extern uint midiOutOpen( out IntPtr lphmo, int uDeviceID, MidiOutProc dwCallback, int dwCallbackInstance, CALLBACK dwFlags );
/// <summary> /// Opens a MIDI output device. /// </summary> /// NOTE: This is adapted from the original Win32 function in order to make it typesafe. /// /// Win32 docs: http://msdn.microsoft.com/en-us/library/ms711632(VS.85).aspx public static MMRESULT midiOutOpen(out HMIDIOUT lphmo, UIntPtr uDeviceID, MidiOutProc dwCallback, UIntPtr dwCallbackInstance) { //return midiOutOpen(out lphmo, uDeviceID, dwCallback, dwCallbackInstance, // dwCallback == null ? MidiOpenFlags.CALLBACK_NULL : MidiOpenFlags.CALLBACK_FUNCTION); return(midiOutOpen(out lphmo, uDeviceID, dwCallback, dwCallbackInstance, dwCallback == null ? MidiOpenFlags.CALLBACK_NULL : MidiOpenFlags.CALLBACK_FUNCTION& MidiOpenFlags.MIDI_IO_STATUS)); }
/// <summary> /// Initializes output device. /// </summary> private void InitializeOutputDevice() { // Create delegate for handling messages from Windows. messageHandler = new MidiOutProc(OnMessage); // Create synchronized queue for holding headers. syncHeaderQueue = Queue.Synchronized(headerQueue); }
internal MidiStream(int index) : base(index) { _sendQueue = null; _sendQueuePosition = 0; _outCallback = new MidiOutProc(_MidiOutProc); _timerCallback = new TimerProc(_TimerProc); _tempoSyncEnabled = 0; _tempoSyncMessageCount = 100; _tempoSyncMessagesSentCount = 0; }
/// <summary> /// Initializes a new instance of the OutputDevice class. /// </summary> public OutputDevice(int deviceID) : base(deviceID) { midiOutProc = HandleMessage; int result = NativeMethods.midiOutOpen(out hndle, deviceID, midiOutProc, IntPtr.Zero, CALLBACK_FUNCTION); if(result != MidiDeviceException.MMSYSERR_NOERROR) { throw new OutputDeviceException(result); } }
public OutputStream(int deviceID) : base(deviceID) { midiOutProc = HandleMessage; int result = midiStreamOpen(ref hndle, ref deviceID, 1, midiOutProc, 0, CALLBACK_FUNCTION); if (result != MidiDeviceException.MMSYSERR_NOERROR) { throw new OutputDeviceException(result); } }
/// <summary> /// Initializes a new instance of the OutputDevice class. /// </summary> public OutputDevice(int deviceID) : base(deviceID) { midiOutProc = HandleMessage; int result = midiOutOpen(ref hndle, deviceID, midiOutProc, 0, CALLBACK_FUNCTION); if(result != MidiDeviceException.MMSYSERR_NOERROR) { throw new OutputDeviceException(result); } }
/// <summary> /// Initializes a new instance of the OutputDevice class. /// </summary> public OutputDevice(int deviceID) : base(deviceID) { midiOutProc = HandleMessage; int result = midiOutOpen(out handle, deviceID, midiOutProc, IntPtr.Zero, CALLBACK_FUNCTION); if (result != MidiDeviceException.MMSYSERR_NOERROR) { throw new OutputDeviceException(result); } }
internal MidiStream(int deviceIndex) { if (0 > deviceIndex) { throw new ArgumentOutOfRangeException("deviceIndex"); } _deviceIndex = deviceIndex; _handle = IntPtr.Zero; _sendHeader = default(MIDIHDR); _sendEventBuffer = IntPtr.Zero; _sendQueuePosition = 0; _outCallback = new MidiOutProc(_MidiOutProc); _timerCallback = new TimerProc(_TimerProc); _tempoSyncEnabled = 0; _tempoSyncMessageCount = 100; _tempoSyncMessagesSentCount = 0; }
public static extern int midiOutOpen(out int lphMidiOut, int uDeviceID, MidiOutProc proc, int dwInstance, int dwFlags);
static extern int midiStreamOpen(ref IntPtr handle, ref int deviceID, int cMidi, MidiOutProc proc, int instance, int flags);
/// <summary> /// Opens a MIDI output device. /// </summary> /// NOTE: This is adapted from the original Win32 function in order to make it typesafe. /// /// Win32 docs: http://msdn.microsoft.com/en-us/library/ms711632(VS.85).aspx public static MMRESULT midiOutOpen(out HMIDIOUT lphmo, UIntPtr uDeviceID, MidiOutProc dwCallback, UIntPtr dwCallbackInstance) { return midiOutOpen(out lphmo, uDeviceID, dwCallback, dwCallbackInstance, dwCallback == null ? MidiOpenFlags.CALLBACK_NULL : MidiOpenFlags.CALLBACK_FUNCTION); }
public static extern uint midiOutOpen(out IntPtr phmo, int uDeviceID, MidiOutProc dwCallback, uint dwInstance, uint fdwOpen);
/// <summary> /// Initializes a new instance of the OutputDevice class. /// </summary> OutputDevice(int deviceID, SynchronizationContext context) : base(deviceID) { this.context = context; midiOutProc = HandleMessage; }
/// <summary> /// Opens a MIDI output device. /// </summary> /// NOTE: This is adapted from the original Win32 function in order to make it typesafe. /// /// Win32 docs: http://msdn.microsoft.com/en-us/library/ms711632(VS.85).aspx public static MMRESULT midiOutOpen(out HMIDIOUT lphmo, UIntPtr uDeviceID, MidiOutProc dwCallback, UIntPtr dwCallbackInstance) { //return midiOutOpen(out lphmo, uDeviceID, dwCallback, dwCallbackInstance, // dwCallback == null ? MidiOpenFlags.CALLBACK_NULL : MidiOpenFlags.CALLBACK_FUNCTION); #region SysEx return midiOutOpen(out lphmo, uDeviceID, dwCallback, dwCallbackInstance, dwCallback == null ? MidiOpenFlags.CALLBACK_NULL : MidiOpenFlags.CALLBACK_FUNCTION & MidiOpenFlags.MIDI_IO_STATUS); #endregion }
internal static extern int midiOutOpen( out IntPtr hMidiOut, int uDeviceID, MidiOutProc dwCallback, IntPtr dwInstance, uint dwFlags);
private static extern int midiOutOpen(ref int handle, int deviceId, MidiOutProc proc, int instance, int flags);
public static extern int midiOutOpen(out IntPtr lphMidiOut, uint uDeviceID, MidiOutProc dwCallback, uint dwInstance, uint dwFlags);
/// <summary> /// 构造函数 /// </summary> /// <param name="deviceID"></param> public OutputDeviceBase(int deviceID) { midiOutProc = HandleMessage; int result = midiOutOpen(ref hndle, 0, midiOutProc, 0, CALLBACK_FUNCTION); }
private static extern int midiOutOpen( out HandleMidiOut lphMidiOut, UIntPtr uDeviceId, MidiOutProc dwCallback, UIntPtr dwCallbackInstance, MidiOpenFlags dwFlags);
private static extern int midiOutOpen(out IntPtr handle, int deviceID, MidiOutProc proc, int instance, int flags);
private static extern MMRESULT midiOutOpen(out HMIDIOUT lphmo, UIntPtr uDeviceID, MidiOutProc dwCallback, UIntPtr dwCallbackInstance, MidiOpenFlags dwFlags);
public static int MidiOutOpen(out HandleMidiOut lphMidiOut, UIntPtr uDeviceId, MidiOutProc dwCallback, UIntPtr dwCallbackInstance) => midiOutOpen( out lphMidiOut, uDeviceId, dwCallback, dwCallbackInstance, dwCallback == null ? MidiOpenFlags.CALLBACK_NULL : MidiOpenFlags.CALLBACK_FUNCTION & MidiOpenFlags.MIDI_IO_STATUS);
internal static extern int midiOutOpen( out IntPtr lphMidiOut, int uDeviceID, MidiOutProc dwCallback, IntPtr dwCallbackInstance, int dwFlags);
internal static extern int midiOutOpen(out IntPtr midiIn, uint deviceID, MidiOutProc callback, IntPtr callbackInstance, MidiOutOpenFlags flags);
private static extern int midiOutOpen(ref int handle, int deviceID, MidiOutProc proc, int instance, int flags);
public static extern int midiOutOpen(out IntPtr handle, int deviceID, MidiOutProc proc, IntPtr instance, int flags);
public static extern int midiStreamOpen(out IntPtr handle, ref int deviceID, int reserved, MidiOutProc proc, int instance, uint flag);
private static extern int midiOutOpen(out IntPtr handle, int deviceID, MidiOutProc proc, IntPtr instance, int flags);
public static extern int midiStreamOpen(out IntPtr handle, ref int deviceID, int reserved, MidiOutProc proc, IntPtr instance, uint flag);
static extern int midiOutOpen(ref IntPtr handle, int deviceID, MidiOutProc proc, int instance, int flags);
internal static extern EMMError midiOutOpen( out IntPtr lphMidiOut, uint uDeviceID, MidiOutProc dwCallback, IntPtr dwCallbackInstance, int dwFlags);