22class MSXCommandController;
48 std::unique_ptr<StringSetting>
record;
49 std::unique_ptr<BooleanSetting>
mute;
74 int balance,
unsigned numChannels);
140 [[nodiscard]]
const SoundDeviceInfo*
findDeviceInfo(std::string_view name)
const;
146 void updateVolumeParams(SoundDeviceInfo& info)
const;
147 void updateMasterVolume();
150 void generate(std::span<StereoFloat> output, EmuTime::param time);
153 void executeUntil(EmuTime::param time)
override;
158 void update(
const SpeedManager& speedManager)
noexcept override;
166 unsigned fragmentSize = 0;
167 unsigned hostSampleRate = 44100;
170 std::vector<SoundDeviceInfo> infos;
182 struct SoundDeviceInfoTopic final :
InfoTopic {
183 explicit SoundDeviceInfoTopic(
InfoCommand& machineInfoCommand);
184 void execute(std::span<const TclObject> tokens,
186 [[nodiscard]] std::string help(std::span<const TclObject> tokens)
const override;
187 void tabCompletion(std::vector<std::string>& tokens)
const override;
190 AviRecorder* recorder =
nullptr;
191 unsigned synchronousCounter = 0;
193 unsigned muteCount = 1;
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.
const SoundDeviceInfo * findDeviceInfo(std::string_view name) const
void setRecorder(AviRecorder *recorder)
void registerSound(SoundDevice &device, float volume, int balance, unsigned numChannels)
Use this method to register a given SoundDevice.
MSXMixer & operator=(MSXMixer &&)=delete
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.
const auto & getDeviceInfos() const
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
MSXMixer(MSXMixer &&)=delete
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
dynarray< ChannelSettings > channelSettings
std::unique_ptr< IntegerSetting > balanceSetting
std::unique_ptr< IntegerSetting > volumeSetting