20class MSXCommandController;
56 int balance,
unsigned numChannels);
126 struct SoundDeviceInfo {
127 SoundDeviceInfo(
unsigned numChannels);
130 std::unique_ptr<IntegerSetting> volumeSetting;
131 std::unique_ptr<IntegerSetting> balanceSetting;
134 std::unique_ptr<BooleanSetting>
mute;
137 float defaultVolume = 0.f;
138 float left1 = 0.f, right1 = 0.f, left2 = 0.f, right2 = 0.f;
141 void updateVolumeParams(SoundDeviceInfo& info);
142 void updateMasterVolume();
145 void generate(std::span<StereoFloat> output, EmuTime::param time);
148 void executeUntil(EmuTime::param time)
override;
153 void update(
const SpeedManager& speedManager)
noexcept override;
161 unsigned fragmentSize;
162 unsigned hostSampleRate;
165 std::vector<SoundDeviceInfo> infos;
177 struct SoundDeviceInfoTopic final :
InfoTopic {
178 explicit SoundDeviceInfoTopic(
InfoCommand& machineInfoCommand);
179 void execute(std::span<const TclObject> tokens,
181 [[nodiscard]] std::string help(std::span<const TclObject> tokens)
const override;
182 void tabCompletion(std::vector<std::string>& tokens)
const override;
186 unsigned synchronousCounter = 0;
Represents a clock with a variable frequency.
This class contains settings that are used by several other class (including some singletons).
A Setting with an integer value.
const DynamicClock & getHostSampleClock() const
Clock that ticks at the exact moment(s) in time that a host sample should be generated.
void mute()
TODO This methods (un)mute the sound.
void setRecorder(AviRecorder *recorder)
void registerSound(SoundDevice &device, float volume, int balance, unsigned numChannels)
Use this method to register a given SoundDevice.
void setSynchronousMode(bool synchronous)
If we're recording, we want to emulate sound at 100% EmuTime speed.
MSXMixer(const MSXMixer &)=delete
void updateSoftwareVolume(SoundDevice &device)
Used by SoundDevice::setSoftwareVolume()
MSXMixer & operator=(const MSXMixer &)=delete
unsigned getSampleRate() const
double getEffectiveSpeed() const
Returns the ratio of EmuTime-speed per realtime-speed.
SoundDevice * findDevice(std::string_view name) const
bool needStereoRecording() const
void updateStream(EmuTime::param time)
Use this method to force an 'early' call to all updateBuffer() methods.
static constexpr int AMP_BITS
bool isSynchronousMode() const
void setMixerParams(unsigned fragmentSize, unsigned sampleRate)
Set new fragment size and sample frequency.
void unregisterSound(SoundDevice &device)
Every SoundDevice must unregister before it is destructed.
Generic Gang-of-Four Observer class, templatized edition.
Every class that wants to get scheduled at some point must inherit from this class.
Manages the desired ratio between EmuTime and real time.
Manages the throttle state of openMSX.
This file implemented 3 utility functions:
std::unique_ptr< StringSetting > record
std::unique_ptr< BooleanSetting > mute