openMSX
CassetteImage.hh
Go to the documentation of this file.
1 #ifndef CASSETTEIMAGE_HH
2 #define CASSETTEIMAGE_HH
3 
4 #include "EmuTime.hh"
5 #include "sha1.hh"
6 #include <cstdint>
7 #include <string>
8 
9 namespace openmsx {
10 
12 {
13 public:
15 
16  virtual ~CassetteImage() = default;
17  virtual int16_t getSampleAt(EmuTime::param time) = 0;
18  virtual EmuTime getEndTime() const = 0;
19  virtual unsigned getFrequency() const = 0;
20  virtual void fillBuffer(unsigned pos, float** bufs, unsigned num) const = 0;
21  virtual float getAmplificationFactorImpl() const = 0;
22 
23  FileType getFirstFileType() const { return firstFileType; }
24  std::string getFirstFileTypeAsString() const;
25 
33  const Sha1Sum& getSha1Sum() const;
34 
35 protected:
36  CassetteImage() = default;
37  void setFirstFileType(FileType type) { firstFileType = type; }
38  void setSha1Sum(const Sha1Sum& sha1sum);
39 
40 private:
41  FileType firstFileType = UNKNOWN;
42  Sha1Sum sha1sum;
43 };
44 
45 } // namespace openmsx
46 
47 #endif
openmsx::CassetteImage::UNKNOWN
@ UNKNOWN
Definition: CassetteImage.hh:14
openmsx::CassetteImage::getFirstFileTypeAsString
std::string getFirstFileTypeAsString() const
Definition: CassetteImage.cc:6
openmsx::CassetteImage::setFirstFileType
void setFirstFileType(FileType type)
Definition: CassetteImage.hh:37
openmsx::CassetteImage::getSampleAt
virtual int16_t getSampleAt(EmuTime::param time)=0
sha1.hh
openmsx::CassetteImage::getAmplificationFactorImpl
virtual float getAmplificationFactorImpl() const =0
openmsx::CassetteImage::getFrequency
virtual unsigned getFrequency() const =0
openmsx::CassetteImage
Definition: CassetteImage.hh:12
openmsx::CassetteImage::~CassetteImage
virtual ~CassetteImage()=default
openmsx::CassetteImage::CassetteImage
CassetteImage()=default
openmsx::CassetteImage::BASIC
@ BASIC
Definition: CassetteImage.hh:14
openmsx::CassetteImage::setSha1Sum
void setSha1Sum(const Sha1Sum &sha1sum)
Definition: CassetteImage.cc:19
openmsx::CassetteImage::BINARY
@ BINARY
Definition: CassetteImage.hh:14
openmsx::CassetteImage::getEndTime
virtual EmuTime getEndTime() const =0
openmsx::Sha1Sum
This class represents the result of a sha1 calculation (a 160-bit value).
Definition: sha1.hh:20
openmsx::CassetteImage::FileType
FileType
Definition: CassetteImage.hh:14
openmsx::CassetteImage::fillBuffer
virtual void fillBuffer(unsigned pos, float **bufs, unsigned num) const =0
openmsx::CassetteImage::getSha1Sum
const Sha1Sum & getSha1Sum() const
Get sha1sum for this image.
Definition: CassetteImage.cc:25
EmuTime.hh
openmsx::CassetteImage::ASCII
@ ASCII
Definition: CassetteImage.hh:14
openmsx::CassetteImage::getFirstFileType
FileType getFirstFileType() const
Definition: CassetteImage.hh:23
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5