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 <span>
8#include <string>
9
10namespace openmsx {
11
13{
14public:
16
17 virtual ~CassetteImage() = default;
18 [[nodiscard]] virtual int16_t getSampleAt(EmuTime::param time) const = 0;
19 [[nodiscard]] virtual EmuTime getEndTime() const = 0;
20 [[nodiscard]] virtual unsigned getFrequency() const = 0;
21 virtual void fillBuffer(unsigned pos, std::span<float*, 1> bufs, unsigned num) const = 0;
22 [[nodiscard]] virtual float getAmplificationFactorImpl() const = 0;
23
24 [[nodiscard]] FileType getFirstFileType() const { return firstFileType; }
25 [[nodiscard]] std::string getFirstFileTypeAsString() const;
26
34 [[nodiscard]] const Sha1Sum& getSha1Sum() const;
35
36protected:
37 CassetteImage() = default;
38 void setFirstFileType(FileType type) { firstFileType = type; }
39 void setSha1Sum(const Sha1Sum& sha1sum);
40
41private:
42 FileType firstFileType = UNKNOWN;
43 Sha1Sum sha1sum;
44};
45
46} // namespace openmsx
47
48#endif
void setSha1Sum(const Sha1Sum &sha1sum)
virtual void fillBuffer(unsigned pos, std::span< float *, 1 > bufs, unsigned num) const =0
std::string getFirstFileTypeAsString() const
virtual float getAmplificationFactorImpl() 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:24
This file implemented 3 utility functions:
Definition Autofire.cc:11