OXYGENHUB
◆ main openmsx / src / sound / SoundDriver.hh
812 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
1
#ifndef SOUNDDRIVER_HH
2
#define SOUNDDRIVER_HH
3
4
#include "Mixer.hh"
5
#include <span>
6
7
namespace openmsx {
8
9
class SoundDriver
10
{
11
public:
12
	virtual ~SoundDriver() = default;
13
14
	/** Mute the sound system
15
	 */
16
	virtual void mute() = 0;
17
18
	/** Unmute the sound system
19
	 */
20
	virtual void unmute() = 0;
21
22
	/** Returns the actual sample frequency. This might be different
23
	  * from the requested frequency ('frequency' setting).
24
	  */
25
	[[nodiscard]] virtual unsigned getFrequency() const = 0;
26
27
	/** Get the number of samples that should be created 'per fragment'.
28
	  * This is not the same value as the 'samples setting'.
29
	  */
30
	[[nodiscard]] virtual unsigned getSamples() const = 0;
31
32
	virtual void uploadBuffer(std::span<const StereoFloat> buffer) = 0;
33
34
protected:
35
	SoundDriver() = default;
36
};
37
38
} // namespace openmsx
39
40
#endif