Shkyera Engine
Easy to use, game engine for Python
Loading...
Searching...
No Matches
shkyera::AudioSystem Class Reference

System that manages audio playback and spatial audio. More...

#include <AudioSystem.hpp>

Inheritance diagram for shkyera::AudioSystem:
[legend]

Public Member Functions

 AudioSystem (std::shared_ptr< Registry > registry)
 
 ~AudioSystem ()
 
void update ()
 Updates audio playback state and spatial audio.
 
- Public Member Functions inherited from shkyera::RegistryViewer
template<typename... Resources>
 RegistryViewer (std::shared_ptr< Registry > registry, ReadAccess< Resources... > read)
 
template<typename... Resources>
 RegistryViewer (std::shared_ptr< Registry > registry, WriteAccess< Resources... > read)
 
template<typename... ReadResources, typename... WriteResources>
 RegistryViewer (std::shared_ptr< Registry > registry, ReadAccess< ReadResources... > read, WriteAccess< WriteResources... > write)
 
const PolicygetPolicy () const
 
template<typename Component , typename... Args>
Componentadd (Entity entity, Args &&... args)
 
template<typename Component >
void clear ()
 
template<typename Component >
bool has (Entity entity) const
 
template<typename Component >
Componentwrite (Entity entity)
 
template<typename Component >
const Componentread (Entity entity) const
 
template<NonSingletonComponentType Component>
const autoread () const
 
template<SingletonComponentType Component>
const autoread () const
 
template<NonSingletonComponentType Component>
autowrite ()
 
template<SingletonComponentType Component>
autowrite ()
 
template<SingletonComponentType Component>
std::optional< EntitygetEntity () const
 
const std::optional< EntitygetParent (Entity entity) const
 
template<typename Component >
SparseSet< Component > & writeAll ()
 
template<typename Component >
const SparseSet< Component > & readAll () const
 

Private Member Functions

bool ensureLoaded (AudioSourceComponent &audioSource)
 
void handlePlayback (AudioSourceComponent &audioSource)
 
void handleVolume ()
 Updates volume for all audio sources.
 
void handleSpatiality ()
 Updates spatial audio based on camera position.
 

Private Attributes

std::unique_ptr< ma_engine_engine
 Miniaudio engine instance.
 

Detailed Description

System that manages audio playback and spatial audio.

Constructor & Destructor Documentation

◆ AudioSystem()

shkyera::AudioSystem::AudioSystem ( std::shared_ptr< Registry registry)
explicit
Parameters
registryRegistry to read audio components from

◆ ~AudioSystem()

shkyera::AudioSystem::~AudioSystem ( )

Member Function Documentation

◆ ensureLoaded()

bool shkyera::AudioSystem::ensureLoaded ( AudioSourceComponent audioSource)
private
Parameters
audioSourceAudio source to check
Returns
Whether the audio source is properly loaded

◆ handlePlayback()

void shkyera::AudioSystem::handlePlayback ( AudioSourceComponent audioSource)
private
Parameters
audioSourceAudio source to update playback for

◆ handleSpatiality()

void shkyera::AudioSystem::handleSpatiality ( )
private

Updates spatial audio based on camera position.

◆ handleVolume()

void shkyera::AudioSystem::handleVolume ( )
private

Updates volume for all audio sources.

◆ update()

void shkyera::AudioSystem::update ( )

Updates audio playback state and spatial audio.

Member Data Documentation

◆ _engine

std::unique_ptr<ma_engine> shkyera::AudioSystem::_engine
private

Miniaudio engine instance.


The documentation for this class was generated from the following files: