/// <summary> /// waveOutProc /// </summary> /// <param name="hWaveOut"></param> /// <param name="msg"></param> /// <param name="dwInstance"></param> /// <param name="wParam"></param> /// <param name="lParam"></param> private void waveOutProc(IntPtr hWaveOut, Win32.WOM_Messages msg, IntPtr dwInstance, Win32.WAVEHDR *pWaveHeader, IntPtr lParam) { try { switch (msg) { //Open case Win32.WOM_Messages.OPEN: break; //Done case Win32.WOM_Messages.DONE: //Vermerken das Daten ankommen IsStarted = true; AutoResetEventDataPlayed.Set(); break; //Close case Win32.WOM_Messages.CLOSE: IsStarted = false; IsWaveOutOpened = false; IsPaused = false; IsClosed = true; AutoResetEventDataPlayed.Set(); this.hWaveOut = IntPtr.Zero; break; } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(String.Format("Player.cs | waveOutProc() | {0}", ex.Message)); AutoResetEventDataPlayed.Set(); } }
/// <summary> /// waveOutProc /// </summary> /// <param name="hWaveOut"></param> /// <param name="msg"></param> /// <param name="dwInstance"></param> /// <param name="wParam"></param> /// <param name="lParam"></param> private void waveOutProc(IntPtr hWaveOut, Win32.WOM_Messages msg, IntPtr dwInstance, Win32.WAVEHDR *pWaveHeader, IntPtr lParam) { switch (msg) { case Win32.WOM_Messages.OPEN: break; case Win32.WOM_Messages.DONE: break; case Win32.WOM_Messages.CLOSE: this.hWaveOut = IntPtr.Zero; break; } }
/// <summary> /// waveInProc /// </summary> /// <param name="hWaveIn"></param> /// <param name="msg"></param> /// <param name="dwInstance"></param> /// <param name="wParam"></param> /// <param name="lParam"></param> private void waveInProc(IntPtr hWaveIn, Win32.WIM_Messages msg, IntPtr dwInstance, Win32.WAVEHDR *pWaveHdr, IntPtr lParam) { switch (msg) { //Open case Win32.WIM_Messages.OPEN: break; //Data case Win32.WIM_Messages.DATA: //Ankommende Daten vermerken IsDataIncomming = true; //Aufgenommenen Buffer merken CurrentRecordedHeader = pWaveHdr; //Event setzen AutoResetEventDataRecorded.Set(); break; //Close case Win32.WIM_Messages.CLOSE: IsDataIncomming = false; IsWaveInOpened = false; AutoResetEventDataRecorded.Set(); this.hWaveIn = IntPtr.Zero; break; } }
/// <summary> /// waveOutProc /// </summary> /// <param name="hWaveOut"></param> /// <param name="msg"></param> /// <param name="dwInstance"></param> /// <param name="wParam"></param> /// <param name="lParam"></param> private void waveOutProc(IntPtr hWaveOut, Win32.WOM_Messages msg, IntPtr dwInstance, Win32.WAVEHDR *pWaveHeader, IntPtr lParam) { switch (msg) { //Open case Win32.WOM_Messages.OPEN: break; //Close case Win32.WOM_Messages.CLOSE: IsWaveOutOpened = false; AutoResetEventDataRecorded.Set(); this.hWaveOut = IntPtr.Zero; break; } }