24 void DACSound16S::setOutputRate(
unsigned hostSampleRate,
double )
36 int delta = value - lastWrittenValue;
37 if (delta == 0)
return;
38 lastWrittenValue = value;
45 void DACSound16S::generateChannels(
float** bufs,
unsigned num)
55 bool DACSound16S::updateBuffer(
unsigned length,
float* buffer,
61 template<
typename Archive>
67 int16_t lastValue = lastWrittenValue;
68 ar.serialize(
"lastValue", lastValue);
69 if constexpr (Archive::IS_LOADER) {
bool readSamples(float *out, unsigned samples)
void addDelta(TimeIndex time, float delta)
DACSound16S(std::string_view name, static_string_view desc, const DeviceConfig &config)
void reset(EmuTime::param time)
void serialize(Archive &ar, unsigned version)
void writeDAC(int16_t value, EmuTime::param time)
unsigned getTicksTill(EmuTime::param e) const
Calculate the number of ticks for this clock until the given time.
A fixed point number, implemented by a 32-bit signed integer.
bool mixChannels(float *dataOut, unsigned samples)
Calls generateChannels() and combines the output to a single channel.
const DynamicClock & getHostSampleClock() const
See MSXMixer::getHostSampleClock().
void setInputRate(unsigned sampleRate)
void unregisterSound()
Unregisters this sound device with the Mixer.
void registerSound(const DeviceConfig &config)
Registers this sound device with the Mixer.
T length(const vecN< N, T > &x)
This file implemented 3 utility functions:
constexpr unsigned DUMMY_INPUT_RATE
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)