Capycore Engine  0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
Loading...
Searching...
No Matches
SoundFactory Class Reference

Factory class for creating SoundResource instances based on SoundType. The reason for shared pointers is to manage the lifetime of sound resources and instances easily share them across different parts of the audio system without worrying about ownership. More...

#include <sound_factory.h>

Public Member Functions

 SoundFactory ()=delete
 
 ~SoundFactory ()=delete
 

Static Public Member Functions

static std::shared_ptr< SoundResourcecreate_sound_resource (const std::string &file_path, const std::string &name, SoundType type=SoundType::GENERIC)
 
static std::unique_ptr< SoundInstancecreate_sound_instance (std::shared_ptr< SoundResource > &resource, float volume=1.0f)
 

Detailed Description

Factory class for creating SoundResource instances based on SoundType. The reason for shared pointers is to manage the lifetime of sound resources and instances easily share them across different parts of the audio system without worrying about ownership.

Constructor & Destructor Documentation

◆ SoundFactory()

SoundFactory::SoundFactory ( )
delete

◆ ~SoundFactory()

SoundFactory::~SoundFactory ( )
delete

Member Function Documentation

◆ create_sound_instance()

static std::unique_ptr< SoundInstance > SoundFactory::create_sound_instance ( std::shared_ptr< SoundResource > &  resource,
float  volume = 1.0f 
)
static

◆ create_sound_resource()

static std::shared_ptr< SoundResource > SoundFactory::create_sound_resource ( const std::string &  file_path,
const std::string &  name,
SoundType  type = SoundType::GENERIC 
)
static

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