openMSX
WavAudioInput.hh
Go to the documentation of this file.
1#ifndef WAVAUDIOINPUT_HH
2#define WAVAUDIOINPUT_HH
3
4#include "AudioInputDevice.hh"
5#include "EmuTime.hh"
6#include "FilenameSetting.hh"
7#include "Observer.hh"
8#include "WavData.hh"
9
10namespace openmsx {
11
12class CommandController;
13
14class WavAudioInput final : public AudioInputDevice, private Observer<Setting>
15{
16public:
17 explicit WavAudioInput(CommandController& commandController);
18 ~WavAudioInput() override;
19
20 // AudioInputDevice
21 [[nodiscard]] std::string_view getName() const override;
22 [[nodiscard]] std::string_view getDescription() const override;
23 void plugHelper(Connector& connector, EmuTime::param time) override;
24 void unplugHelper(EmuTime::param time) override;
25 [[nodiscard]] int16_t readSample(EmuTime::param time) override;
26
27 template<typename Archive>
28 void serialize(Archive& ar, unsigned version);
29
30private:
31 void loadWave();
32 void update(const Setting& setting) noexcept override;
33
34private:
35 FilenameSetting audioInputFilenameSetting;
36 WavData wav;
37 EmuTime reference = EmuTime::zero();
38};
39
40} // namespace openmsx
41
42#endif
BaseSetting * setting
Represents something you can plug devices into.
Definition Connector.hh:21
Generic Gang-of-Four Observer class, templatized edition.
Definition Observer.hh:10
void serialize(Archive &ar, unsigned version)
void unplugHelper(EmuTime::param time) override
void plugHelper(Connector &connector, EmuTime::param time) override
std::string_view getDescription() const override
Description for this pluggable.
std::string_view getName() const override
Name used to identify this pluggable.
int16_t readSample(EmuTime::param time) override
Read wave data.
This file implemented 3 utility functions:
Definition Autofire.cc:11