coastline 0.0.4
Loading...
Searching...
No Matches
wavesample.h
Go to the documentation of this file.
1#ifndef COASTLINE_EAR_WAVESAMPLE_H
2#define COASTLINE_EAR_WAVESAMPLE_H
3
4#include <cstdint>
5
6#include "ear/wavechunks.h"
7
13
15class [[gnu::packed]] EarWaveSample {
16public:
28
41 int LoadWaveSample(const void *source, EarWaveSampleSource sourceKind);
42
47 char *GetWaveSampleBuffer() const;
48
54
60
61private:
69 int ReadWaveSampleData(const void *source);
70
77 int AcceptWaveSampleData();
78
79 char *buffer;
80 DWORD byteCount;
81 EarWaveFormat format;
82 EarWaveSampleSource sourceKind;
83 std::uint32_t unknown1c;
84 [[maybe_unused]] std::uint32_t unknown20; /* +0x20 */
85};
86
87#endif /* COASTLINE_EAR_WAVESAMPLE_H */
EarWaveSample()
Initialise empty sample storage and file-source defaults without assigning a wave format.
int LoadWaveSample(const void *source, EarWaveSampleSource sourceKind)
Load wave samples into allocated storage with sample-memory budget accounting.
EarWaveFormat CopyWaveSampleFormat() const
~EarWaveSample()
Free allocated sample storage and subtract its tracked byte count from the sample budget.
char * GetWaveSampleBuffer() const
DWORD GetWaveSampleByteCount() const
WAVEFORMATEX EarWaveFormat
Definition wavechunks.h:23
EarWaveSampleSource
The source of a wave sample, as RegisterPreset passes it.
Definition wavesample.h:9
@ EAR_WAVE_SAMPLE_SOURCE_FILE
Definition wavesample.h:10
@ EAR_WAVE_SAMPLE_SOURCE_MEMORY
Definition wavesample.h:11
typedef DWORD