-
Notifications
You must be signed in to change notification settings - Fork 1
/
rwtrack.h
48 lines (35 loc) · 1019 Bytes
/
rwtrack.h
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef _rwtrack_h
#define _rwtrack_h
#include <memory>
#include <string>
#include <cstdint>
namespace rws
{
class file;
//---------------------------------------------------------------------------
class track
{
public:
track(uint32_t);
~track();
inline uint32_t id() { return m_id; }
inline std::string name() { return m_name; }
void read_location(file&);
void read_size(file&);
void read_name(file&);
void read_data(file&, off64_t data_start,
uint32_t cluster_size, uint32_t cluster_used_bytes);
void set_layout(uint8_t channels, uint32_t sample_rate);
void write(std::string const& filename);
protected:
uint32_t const m_id;
uint32_t m_byte_count; // bytes used by all clusters, including padding
uint32_t m_byte_offset;
uint32_t m_size; // bytes of actual sample data (m_data size)
std::string m_name;
uint8_t m_channels;
uint32_t m_sample_rate;
std::unique_ptr<uint8_t[]> m_samples;
};
}
#endif