2023-06-20 04:33:09 +00:00
|
|
|
#ifndef STAR_MAIN_MIXER_HPP
|
|
|
|
#define STAR_MAIN_MIXER_HPP
|
|
|
|
|
|
|
|
#include "StarMixer.hpp"
|
|
|
|
#include "StarGameTypes.hpp"
|
|
|
|
|
|
|
|
namespace Star {
|
|
|
|
|
|
|
|
STAR_CLASS(UniverseClient);
|
2023-06-26 09:25:37 +00:00
|
|
|
STAR_CLASS(WorldPainter);
|
2023-06-20 04:33:09 +00:00
|
|
|
STAR_CLASS(MainMixer);
|
|
|
|
|
|
|
|
class MainMixer {
|
|
|
|
public:
|
|
|
|
MainMixer(unsigned sampleRate, unsigned channels);
|
|
|
|
|
|
|
|
void setUniverseClient(UniverseClientPtr universeClient);
|
2023-06-26 09:25:37 +00:00
|
|
|
void setWorldPainter(WorldPainterPtr worldPainter);
|
2023-06-20 04:33:09 +00:00
|
|
|
|
|
|
|
void update(bool muteSfx = false, bool muteMusic = false);
|
|
|
|
|
|
|
|
MixerPtr mixer() const;
|
|
|
|
|
|
|
|
void setVolume(float volume, float rampTime = 0.0f);
|
2023-07-12 12:16:12 +00:00
|
|
|
void read(int16_t* sampleData, size_t frameCount, Mixer::ExtraMixFunction = {});
|
2023-06-20 04:33:09 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
UniverseClientPtr m_universeClient;
|
2023-06-26 09:25:37 +00:00
|
|
|
WorldPainterPtr m_worldPainter;
|
2023-06-20 04:33:09 +00:00
|
|
|
MixerPtr m_mixer;
|
|
|
|
Set<MixerGroup> m_mutedGroups;
|
|
|
|
Map<MixerGroup, float> m_groupVolumes;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|