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 "openmsx.hh"
6 #include <vector>
7 
8 namespace openmsx {
9 
10 class CliComm;
11 class Filename;
12 class FilePool;
13 
17 class CasImage : public CassetteImage
18 {
19 public:
20  CasImage(const Filename& fileName, FilePool& filePool, CliComm& cliComm);
21 
22  // CassetteImage
23  virtual short getSampleAt(EmuTime::param time);
24  virtual EmuTime getEndTime() const;
25  virtual unsigned getFrequency() const;
26  virtual void fillBuffer(unsigned pos, int** bufs, unsigned num) const;
27 
28 private:
29  void write0();
30  void write1();
31  void writeHeader(int s);
32  void writeSilence(int s);
33  void writeByte(byte b);
34  bool writeData(const byte* buf, size_t size, size_t& pos);
35  void convert(const Filename& filename, FilePool& filePool, CliComm& cliComm);
36 
37  std::vector<signed char> output;
38 };
39 
40 } // namespace openmsx
41 
42 #endif