/// <summary> /// Resets the MIDI out device /// </summary> public void Reset() { MmException.Try(MidiInterop.midiOutReset(hMidiOut), "midiOutReset"); }
/// <summary> /// Sends a MIDI message to the MIDI out device /// </summary> /// <param name="message">The message to send</param> public void Send(int message) { MmException.Try(MidiInterop.midiOutShortMsg(hMidiOut, message), "midiOutShortMsg"); }
/// <summary> /// Opens a specified MIDI out device /// </summary> /// <param name="deviceNo">The device number</param> public MidiOut(int deviceNo) { this.callback = new MidiInterop.MidiOutCallback(Callback); MmException.Try(MidiInterop.midiOutOpen(out hMidiOut, (IntPtr)deviceNo, callback, IntPtr.Zero, MidiInterop.CALLBACK_FUNCTION), "midiOutOpen"); }
public void StopRecording() { this.recording = false; this.callbackEvent.Set(); MmException.Try(WaveInterop.waveInStop(this.waveInHandle), "waveInStop"); }
private void OpenWaveInDevice() { this.CloseWaveInDevice(); MmException.Try(WaveInterop.waveInOpenWindow(out this.waveInHandle, (IntPtr)this.DeviceNumber, this.WaveFormat, this.callbackEvent.SafeWaitHandle.DangerousGetHandle(), IntPtr.Zero, WaveInterop.WaveInOutOpenFlags.CallbackEvent), "waveInOpen"); this.CreateBuffers(); }
private void OpenWaveInDevice() { this.CloseWaveInDevice(); MmException.Try(this.callbackInfo.WaveInOpen(out this.waveInHandle, this.DeviceNumber, this.WaveFormat, this.callback), "waveInOpen"); this.CreateBuffers(); }
public static IEnumerable <AcmDriver> EnumerateAcmDrivers() { AcmDriver.drivers = new List <AcmDriver>(); MmException.Try(AcmInterop.acmDriverEnum(new AcmInterop.AcmDriverEnumCallback(AcmDriver.DriverEnumCallback), IntPtr.Zero, (AcmDriverEnumFlags)0), "acmDriverEnum"); return(AcmDriver.drivers); }
/// <summary> /// Sends a MIDI out message /// </summary> /// <param name="message">Message</param> /// <param name="param1">Parameter 1</param> /// <param name="param2">Parameter 2</param> public void SendDriverMessage(int message, int param1, int param2) { MmException.Try(MidiInterop.midiOutMessage(hMidiOut, message, (IntPtr)param1, (IntPtr)param2), "midiOutMessage"); }
/// <summary> /// Stop the MIDI in device /// </summary> public void Stop() { MmException.Try(MidiInterop.midiInStop(hMidiIn), "midiInStop"); }
/// <summary> /// Start the MIDI in device /// </summary> public void Start() { MmException.Try(MidiInterop.midiInStart(hMidiIn), "midiInStart"); }
/// <summary> /// Stop recording /// </summary> public void StopRecording() { recording = false; this.callbackEvent.Set(); // signal the thread to exit MmException.Try(WaveInterop.waveInStop(waveInHandle), "waveInStop"); }
public void Reuse() { MmException.Try(WaveInterop.waveInUnprepareHeader(this.waveInHandle, this.header, Marshal.SizeOf(this.header)), "waveUnprepareHeader"); MmException.Try(WaveInterop.waveInPrepareHeader(this.waveInHandle, this.header, Marshal.SizeOf(this.header)), "waveInPrepareHeader"); MmException.Try(WaveInterop.waveInAddBuffer(this.waveInHandle, this.header, Marshal.SizeOf(this.header)), "waveInAddBuffer"); }