openMSX
ResampleAlgo.hh
Go to the documentation of this file.
1#ifndef RESAMPLEALGO_HH
2#define RESAMPLEALGO_HH
3
4#include "EmuTime.hh"
6
7namespace openmsx {
8
9class DynamicClock;
10
12{
13public:
14 virtual ~ResampleAlgo() = default;
15
16 bool generateOutput(float* dataOut, unsigned num, EmuTime::param time)
17 {
18 bool result = generateOutputImpl(dataOut, num, time);
19 auto& emuClk = getEmuClock(); (void)emuClk;
20 assert(emuClk.getTime() <= time);
21 assert(emuClk.getFastAdd(1) > time);
22 return result;
23 }
24
25protected:
27 [[nodiscard]] DynamicClock& getEmuClock() const { return input.getEmuClock(); }
28 virtual bool generateOutputImpl(float* dataOut, unsigned num,
29 EmuTime::param time) = 0;
30
31protected:
33};
34
35} // namespace openmsx
36
37#endif
Represents a clock with a variable frequency.
Definition: DynamicClock.hh:16
ResampleAlgo(ResampledSoundDevice &input_)
Definition: ResampleAlgo.hh:26
virtual ~ResampleAlgo()=default
ResampledSoundDevice & input
Definition: ResampleAlgo.hh:32
DynamicClock & getEmuClock() const
Definition: ResampleAlgo.hh:27
virtual bool generateOutputImpl(float *dataOut, unsigned num, EmuTime::param time)=0
bool generateOutput(float *dataOut, unsigned num, EmuTime::param time)
Definition: ResampleAlgo.hh:16
This file implemented 3 utility functions:
Definition: Autofire.cc:9