openMSX
ResampleHQ.hh
Go to the documentation of this file.
1 #ifndef RESAMPLEHQ_HH
2 #define RESAMPLEHQ_HH
3 
4 #include "ResampleAlgo.hh"
5 #include "DynamicClock.hh"
6 #include <cstdint>
7 #include <vector>
8 
9 namespace openmsx {
10 
11 class ResampledSoundDevice;
12 
13 template<unsigned CHANNELS>
14 class ResampleHQ final : public ResampleAlgo
15 {
16 public:
18  ~ResampleHQ() override;
19  ResampleHQ(const ResampleHQ&) = delete;
20  ResampleHQ& operator=(const ResampleHQ&) = delete;
21 
22  bool generateOutputImpl(float* dataOut, unsigned num,
23  EmuTime::param time) override;
24 
25 private:
26  void calcOutput(float pos, float* output);
27  void prepareData(unsigned emuNum);
28 
29 private:
30  const DynamicClock& hostClock;
31  const float ratio;
32  unsigned bufStart;
33  unsigned bufEnd;
34  unsigned nonzeroSamples;
35  unsigned filterLen;
36  std::vector<float> buffer;
37  float* table;
38  int16_t* permute;
39 };
40 
41 } // namespace openmsx
42 
43 #endif
Represents a clock with a variable frequency.
Definition: DynamicClock.hh:17
ResampledSoundDevice & input
Definition: ResampleAlgo.hh:32
ResampleHQ(const ResampleHQ &)=delete
bool generateOutputImpl(float *dataOut, unsigned num, EmuTime::param time) override
Definition: ResampleHQ.cc:645
ResampleHQ(ResampledSoundDevice &input, const DynamicClock &hostClock)
Definition: ResampleHQ.cc:376
~ResampleHQ() override
Definition: ResampleHQ.cc:394
ResampleHQ & operator=(const ResampleHQ &)=delete
This file implemented 3 utility functions:
Definition: Autofire.cc:5