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