Pipe.h
上传用户:zjb_0001
上传日期:2007-01-11
资源大小:154k
文件大小:1k
源码类别:

Audio

开发平台:

Visual C++

  1. // Pipe.h: interface for the CPipe class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_PIPE_H__71D36BFB_9EC3_4FEB_91BB_0178A52B8B7B__INCLUDED_)
  5. #define AFX_PIPE_H__71D36BFB_9EC3_4FEB_91BB_0178A52B8B7B__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include "soundin.h"
  10. #include "soundout.h"
  11. #include "soundfile.h"
  12. #include "ptrFIFO.h"
  13. class CPipe
  14. {
  15. public:
  16. CPipe();
  17. virtual ~CPipe();
  18. virtual void OnEndOfPlayingFile();
  19. public:
  20. void StopPlayingFromFile();
  21. void StartPlayingFromFile();
  22. void StopRecordingToFile();
  23. void StartRecordingToFile();
  24. void WriteSoundDataToFile(CBuffer* buffer);
  25. void ReadSoundDataFromFile(CBuffer* buffer);
  26. static void DataFromSoundIn(CBuffer* buffer, void* Owner);
  27. static void GetDataToSoundOut(CBuffer* buffer, void* Owner);
  28. private:
  29. CPtrFIFO m_FIFOFull; // FIFO holding pointers to buffers with sound
  30. CPtrFIFO m_FIFOEmpty; // FIFO holding pointers to empty buffers that can be reused
  31. CSoundFile* m_pFile;
  32. CSoundOut m_SoundOut;
  33. CSoundIn m_SoundIn;
  34. };
  35. #endif // !defined(AFX_PIPE_H__71D36BFB_9EC3_4FEB_91BB_0178A52B8B7B__INCLUDED_)