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) const = 0;
18  [[nodiscard]] virtual EmuTime getEndTime() const = 0;
19  [[nodiscard]] virtual unsigned getFrequency() const = 0;
20  virtual void fillBuffer(unsigned pos, float** bufs, unsigned num) const = 0;
21  [[nodiscard]] virtual float getAmplificationFactorImpl() const = 0;
22 
23  [[nodiscard]] FileType getFirstFileType() const { return firstFileType; }
24  [[nodiscard]] std::string getFirstFileTypeAsString() const;
25 
33  [[nodiscard]] 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
void setSha1Sum(const Sha1Sum &sha1sum)
std::string getFirstFileTypeAsString() const
Definition: CassetteImage.cc:6
virtual float getAmplificationFactorImpl() const =0
virtual void fillBuffer(unsigned pos, float **bufs, unsigned num) const =0
const Sha1Sum & getSha1Sum() const
Get sha1sum for this image.
FileType getFirstFileType() const
virtual int16_t getSampleAt(EmuTime::param time) const =0
virtual ~CassetteImage()=default
void setFirstFileType(FileType type)
virtual EmuTime getEndTime() const =0
virtual unsigned getFrequency() const =0
This class represents the result of a sha1 calculation (a 160-bit value).
Definition: sha1.hh:22
This file implemented 3 utility functions:
Definition: Autofire.cc:9