예제 #1
0
파일: WaveOut.cs 프로젝트: okrekov/CAPI
 internal static void WaveOutProc(IntPtr hdrvr, int uMsg, int dwUser, ref Win32.WAVEHDR wavhdr, int dwParam2)
 {
     if (uMsg == (int)Win32.Enum_MM_MessageOutput.MM_WOM_DONE)
     {
         try
         {
             WaveOutBuffer loBuffer = (WaveOutBuffer)(((GCHandle)wavhdr.ClientInfo).Target);
             loBuffer.OnDataSent();
         }
         catch
         {
         }
     }
 }
예제 #2
0
파일: WaveOut.cs 프로젝트: okrekov/CAPI
        private void ClearBuffer()
        {
            if (m_Buffer != null)
            {
                WaveOutBuffer loCurrentBuffer = m_Buffer.NextBuffer;
                do
                {
                    WaveOutBuffer loNextBuffer = loCurrentBuffer.NextBuffer;
                    loCurrentBuffer.Dispose();
                    loCurrentBuffer = loNextBuffer;
                } while (loCurrentBuffer != m_Buffer);

                m_Buffer.Dispose();
                m_Buffer = null;
            }
        }
예제 #3
0
파일: WaveOut.cs 프로젝트: okrekov/CAPI
        private void CreateBuffer(int liBufferSize)
        {
            ClearBuffer();
            m_Buffer = new WaveOutBuffer(m_DeviceHandle, liBufferSize);
            WaveOutBuffer loPreviousBuffer = m_Buffer;

            try
            {
                for (int i = 1; i < 3; i++)
                {
                    WaveOutBuffer loLocalBuffer = new WaveOutBuffer(m_DeviceHandle, liBufferSize);
                    loPreviousBuffer.NextBuffer = loLocalBuffer;
                    loPreviousBuffer            = loLocalBuffer;
                }
            }
            finally
            {
                loPreviousBuffer.NextBuffer = m_Buffer;
            }
            m_CurrentBuffer = m_Buffer;
        }
예제 #4
0
파일: WaveOut.cs 프로젝트: okrekov/CAPI
 private void SwitchBuffer()
 {
     m_CurrentBuffer = m_CurrentBuffer.NextBuffer;
 }