openMSX
DACSound16S.hh
Go to the documentation of this file.
1// This class implements a 16 bit signed DAC
2
3#ifndef DACSOUND16S_HH
4#define DACSOUND16S_HH
5
6#include "SoundDevice.hh"
7#include "BlipBuffer.hh"
8#include <cstdint>
9
10namespace openmsx {
11
13{
14public:
15 DACSound16S(std::string_view name, static_string_view desc,
16 const DeviceConfig& config);
17 virtual ~DACSound16S();
18
19 void reset(EmuTime::param time);
20 void writeDAC(int16_t value, EmuTime::param time);
21
22 template<typename Archive>
23 void serialize(Archive& ar, unsigned version);
24
25private:
26 // SoundDevice
27 void setOutputRate(unsigned hostSampleRate, double speed) override;
28 void generateChannels(std::span<float*> bufs, unsigned num) override;
29 bool updateBuffer(size_t length, float* buffer,
30 EmuTime::param time) override;
31
32private:
33 BlipBuffer blip;
34 int16_t lastWrittenValue = 0;
35};
36
37} // namespace openmsx
38
39#endif
void reset(EmuTime::param time)
void serialize(Archive &ar, unsigned version)
void writeDAC(int16_t value, EmuTime::param time)
static_string_view
This file implemented 3 utility functions:
Definition Autofire.cc:9