openMSX
CasImage.hh
Go to the documentation of this file.
1#ifndef CASIMAGE_HH
2#define CASIMAGE_HH
3
4#include "CassetteImage.hh"
5#include <cstdint>
6#include <vector>
7
8namespace openmsx {
9
10class CliComm;
11class Filename;
12class FilePool;
13
17class CasImage final : public CassetteImage
18{
19public:
20 CasImage(const Filename& fileName, FilePool& filePool, CliComm& cliComm);
21
22 // CassetteImage
23 [[nodiscard]] int16_t getSampleAt(EmuTime::param time) const override;
24 [[nodiscard]] EmuTime getEndTime() const override;
25 [[nodiscard]] unsigned getFrequency() const override;
26 void fillBuffer(unsigned pos, std::span<float*, 1> bufs, unsigned num) const override;
27 [[nodiscard]] float getAmplificationFactorImpl() const override;
28
29 struct Data {
30 std::vector<int8_t> wave;
31 unsigned frequency;
32 };
33
34private:
35 Data init(const Filename& filename, FilePool& filePool, CliComm& cliComm);
36
37private:
38 const Data data;
39};
40
41} // namespace openmsx
42
43#endif
Code based on "cas2wav" tool by Vincent van Dam.
Definition CasImage.hh:18
int16_t getSampleAt(EmuTime::param time) const override
Definition CasImage.cc:298
unsigned getFrequency() const override
Definition CasImage.cc:311
void fillBuffer(unsigned pos, std::span< float *, 1 > bufs, unsigned num) const override
Definition CasImage.cc:316
EmuTime getEndTime() const override
Definition CasImage.cc:305
float getAmplificationFactorImpl() const override
Definition CasImage.cc:331
This class represents a filename.
Definition Filename.hh:18
This file implemented 3 utility functions:
Definition Autofire.cc:9
std::vector< int8_t > wave
Definition CasImage.hh:30