forked from nu774/qaac
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrawsource.h
More file actions
27 lines (24 loc) · 815 Bytes
/
rawsource.h
File metadata and controls
27 lines (24 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef _RAWSOURCE_H
#define _RAWSOURCE_H
#include "iointer.h"
class RawSource: public ISeekableSource {
uint64_t m_length;
int64_t m_position;
std::shared_ptr<FILE> m_fp;
std::vector<uint8_t> m_buffer;
AudioStreamBasicDescription m_asbd, m_oasbd;
public:
RawSource(const std::shared_ptr<FILE> &fp,
const AudioStreamBasicDescription &asbd);
uint64_t length() const { return m_length; }
const AudioStreamBasicDescription &getSampleFormat() const
{
return m_oasbd;
}
const std::vector<uint32_t> *getChannels() const { return 0; }
size_t readSamples(void *buffer, size_t nsamples);
bool isSeekable() { return util::is_seekable(fileno(m_fp.get())); }
void seekTo(int64_t count);
int64_t getPosition() { return m_position; }
};
#endif