openMSX
ResampleLQ.hh
Go to the documentation of this file.
1#ifndef RESAMPLELQ_HH
2#define RESAMPLELQ_HH
3
4#include "ResampleAlgo.hh"
5#include "FixedPoint.hh"
6#include <memory>
7
8namespace openmsx {
9
10class DynamicClock;
11class ResampledSoundDevice;
12
13template<unsigned CHANNELS>
15{
16public:
17 static std::unique_ptr<ResampleLQ<CHANNELS>> create(
19
20protected:
22 [[nodiscard]] bool fetchData(EmuTime::param time, unsigned& valid);
23
24protected:
27 const FP step;
28 float lastInput[2 * CHANNELS];
29};
30
31template<unsigned CHANNELS>
32class ResampleLQDown final : public ResampleLQ<CHANNELS>
33{
34public:
36private:
37 bool generateOutputImpl(float* dataOut, unsigned num,
38 EmuTime::param time) override;
39 using FP = typename ResampleLQ<CHANNELS>::FP;
40};
41
42template<unsigned CHANNELS>
43class ResampleLQUp final : public ResampleLQ<CHANNELS>
44{
45public:
47private:
48 bool generateOutputImpl(float* dataOut, unsigned num,
49 EmuTime::param time) override;
50 using FP = typename ResampleLQ<CHANNELS>::FP;
51};
52
53} // namespace openmsx
54
55#endif
constexpr unsigned CHANNELS
Definition: YM2413Test.cc:20
Represents a clock with a variable frequency.
Definition: DynamicClock.hh:16
A fixed point number, implemented by a 32-bit signed integer.
Definition: FixedPoint.hh:15
ResampledSoundDevice & input
Definition: ResampleAlgo.hh:32
ResampleLQDown(ResampledSoundDevice &input, const DynamicClock &hostClock)
Definition: ResampleLQ.cc:137
ResampleLQUp(ResampledSoundDevice &input, const DynamicClock &hostClock)
Definition: ResampleLQ.cc:97
ResampleLQ(ResampledSoundDevice &input, const DynamicClock &hostClock)
Definition: ResampleLQ.cc:33
bool fetchData(EmuTime::param time, unsigned &valid)
Definition: ResampleLQ.cc:55
float lastInput[2 *CHANNELS]
Definition: ResampleLQ.hh:28
static std::unique_ptr< ResampleLQ< CHANNELS > > create(ResampledSoundDevice &input, const DynamicClock &hostClock)
Definition: ResampleLQ.cc:20
const DynamicClock & hostClock
Definition: ResampleLQ.hh:25
This file implemented 3 utility functions:
Definition: Autofire.cc:9