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 
10 namespace openmsx {
11 
12 class DACSound16S : public SoundDevice
13 {
14 public:
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 
25 private:
26  // SoundDevice
27  void setOutputRate(unsigned sampleRate) override;
28  void generateChannels(float** bufs, unsigned num) override;
29  bool updateBuffer(unsigned length, float* buffer,
30  EmuTime::param time) override;
31 
32 private:
33  BlipBuffer blip;
34  int16_t lastWrittenValue;
35 };
36 
37 } // namespace openmsx
38 
39 #endif
DACSound16S(std::string_view name, static_string_view desc, const DeviceConfig &config)
Definition: DACSound16S.cc:11
void reset(EmuTime::param time)
Definition: DACSound16S.cc:29
void serialize(Archive &ar, unsigned version)
Definition: DACSound16S.cc:62
virtual ~DACSound16S()
Definition: DACSound16S.cc:19
void writeDAC(int16_t value, EmuTime::param time)
Definition: DACSound16S.cc:34
static_string_view
T length(const vecN< N, T > &x)
Definition: gl_vec.hh:343
This file implemented 3 utility functions:
Definition: Autofire.cc:9