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