mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-11 07:11:41 +02:00
36 lines
521 B
C++
36 lines
521 B
C++
#ifndef ENCODER_H
|
|
#define ENCODER_H
|
|
#include "message/pcmChunk.h"
|
|
#include "message/header.h"
|
|
#include "message/sampleFormat.h"
|
|
|
|
|
|
class Encoder
|
|
{
|
|
public:
|
|
Encoder(const msg::SampleFormat& format) : sampleFormat(format), headerChunk(NULL)
|
|
{
|
|
}
|
|
|
|
virtual ~Encoder()
|
|
{
|
|
if (headerChunk != NULL)
|
|
delete headerChunk;
|
|
}
|
|
|
|
virtual double encode(msg::PcmChunk* chunk) = 0;
|
|
|
|
virtual msg::Header* getHeader()
|
|
{
|
|
return headerChunk;
|
|
}
|
|
|
|
protected:
|
|
msg::SampleFormat sampleFormat;
|
|
msg::Header* headerChunk;
|
|
};
|
|
|
|
|
|
#endif
|
|
|
|
|