snapcast/client/alsaPlayer.h
(no author) 0a20924e66 code cleanup
git-svn-id: svn://elaine/murooma/trunk@337 d8a302eb-03bc-478d-80e4-98257eca68ef
2015-01-01 18:15:20 +00:00

35 lines
556 B
C++

#ifndef PLAYER_H
#define PLAYER_H
#include <string>
#include <thread>
#include <atomic>
#include <vector>
#include <alsa/asoundlib.h>
#include "stream.h"
#include "pcmDevice.h"
class Player
{
public:
Player(const PcmDevice& pcmDevice, Stream* stream);
virtual ~Player();
void start();
void stop();
static std::vector<PcmDevice> pcm_list(void);
private:
void worker();
snd_pcm_t* pcm_handle_;
snd_pcm_uframes_t frames_;
char *buff_;
std::atomic<bool> active_;
Stream* stream_;
std::thread* playerThread_;
PcmDevice pcmDevice_;
};
#endif