43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
#ifndef F1145346_5CCE_48F8_8398_073AFB8758C6
|
|
#define F1145346_5CCE_48F8_8398_073AFB8758C6
|
|
/*
|
|
*******************************************************************************
|
|
* INCLUDE
|
|
*******************************************************************************
|
|
*/
|
|
#include "SoundCard.h"
|
|
#include <alsa/asoundlib.h>
|
|
|
|
namespace Video
|
|
{
|
|
namespace ALSA
|
|
{
|
|
/*
|
|
*******************************************************************************
|
|
* CLASS DECLARE
|
|
*******************************************************************************
|
|
*/
|
|
class PCM
|
|
{
|
|
public:
|
|
PCM();
|
|
~PCM();
|
|
|
|
public:
|
|
int open(SoundCard::Ptr pSoundCard, snd_pcm_stream_t st);
|
|
int close();
|
|
|
|
int config(snd_pcm_access_t access, snd_pcm_format_t format, int channels, int rate, int framesz, int samplesz);
|
|
|
|
int write(const void* data, uint32_t framesz);
|
|
int write(void** datas, uint32_t framesz);
|
|
int read(void* buffer, uint32_t framesz);
|
|
int read(void** buffers, uint32_t framesz);
|
|
|
|
private:
|
|
void* _pPCM;
|
|
snd_pcm_stream_t _stream;
|
|
};
|
|
}
|
|
}
|
|
#endif
|