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 
8 namespace openmsx {
9 
10 class CliComm;
11 class Filename;
12 class FilePool;
13 
17 class CasImage final : public CassetteImage
18 {
19 public:
20  CasImage(const Filename& fileName, FilePool& filePool, CliComm& cliComm);
21 
22  // CassetteImage
23  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, float** 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 
34 private:
35  Data init(const Filename& filename, FilePool& filePool, CliComm& cliComm);
36 
37 private:
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:294
unsigned getFrequency() const override
Definition: CasImage.cc:307
CasImage(const Filename &fileName, FilePool &filePool, CliComm &cliComm)
Definition: CasImage.cc:289
void fillBuffer(unsigned pos, float **bufs, unsigned num) const override
Definition: CasImage.cc:312
EmuTime getEndTime() const override
Definition: CasImage.cc:301
float getAmplificationFactorImpl() const override
Definition: CasImage.cc:327
This class represents a filename.
Definition: Filename.hh:18
This file implemented 3 utility functions:
Definition: Autofire.cc:9
constexpr const char *const filename
std::vector< int8_t > wave
Definition: CasImage.hh:30