osb/source/frontend/StarMainMixer.hpp

36 lines
809 B
C++
Raw Permalink Normal View History

#pragma once
2023-06-20 04:33:09 +00:00
#include "StarMixer.hpp"
#include "StarGameTypes.hpp"
namespace Star {
STAR_CLASS(UniverseClient);
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);
void setWorldPainter(WorldPainterPtr worldPainter);
2023-06-20 04:33:09 +00:00
void update(float dt, bool muteSfx = false, bool muteMusic = false);
2023-06-20 04:33:09 +00:00
MixerPtr mixer() const;
void setSpeed(float speed);
2023-06-20 04:33:09 +00:00
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;
WorldPainterPtr m_worldPainter;
2023-06-20 04:33:09 +00:00
MixerPtr m_mixer;
Set<MixerGroup> m_mutedGroups;
Map<MixerGroup, float> m_groupVolumes;
};
}