Holds all the banks.
More...
#include <vae_bank_manager.hpp>
Holds all the banks.
Definition at line 15 of file vae_bank_manager.hpp.
◆ addBank()
Result vae::core::BankManager::addBank |
( |
Bank & |
bank | ) |
|
|
inline |
◆ addEvent()
Definition at line 135 of file vae_bank_manager.hpp.
137 auto& bank =
mBanks[bankHandle];
139 if (bank.events.size() <= event.
id) {
140 bank.events.resize(event.id + 1);
142 bank.events[
event.id] = std::move(event);
std::unique_lock< Mutex > Lock
#define VAE_PROFILER_SCOPE()
Profiles a scope.
◆ addMixer()
Definition at line 146 of file vae_bank_manager.hpp.
151 auto& bank =
mBanks[bankHandle];
152 if (bank.mixers.size() <= mixer.
id) {
153 bank.mixers.resize(mixer.id + 1);
155 bank.mixers[mixer.id] = std::move(mixer);
constexpr Size MaxBlock
Maximum block size.
constexpr unsigned char MaxChannels
Maximum channel count used to pre allocate buffers.
◆ addSource()
Definition at line 121 of file vae_bank_manager.hpp.
123 if (source.resample && source.signal.sampleRate && source.signal.sampleRate != sampleRate) {
126 auto& bank =
mBanks[bankHandle];
128 if (bank.sources.size() <= source.id) {
129 bank.sources.resize(source.id + 1);
131 bank.sources[source.id] = std::move(source);
static void resample(Buffer &buffer, const uint rateOut, const uchar quality=5)
Resamples the provided buffer from its sampleRate to the target rate.
◆ all()
◆ forEach()
template<class Func >
void vae::core::BankManager::forEach |
( |
const Func && |
func | ) |
|
|
inline |
Iterate all loaded banks.
- Template Parameters
-
- Parameters
-
Definition at line 65 of file vae_bank_manager.hpp.
constexpr BankHandle InvalidBankHandle
#define VAE_PROFILER_SCOPE_NAMED(name)
Profiles a scope and names it.
◆ get()
◆ has()
bool vae::core::BankManager::has |
( |
BankHandle |
bank | ) |
|
|
inline |
◆ init()
void vae::core::BankManager::init |
( |
const char * |
rootPath, |
|
|
int |
sampleRate |
|
) |
| |
|
inline |
Will unload all the banks.
- Parameters
-
Definition at line 40 of file vae_bank_manager.hpp.
Result unloadFromId(BankHandle bankHandle)
◆ initMixer()
void vae::core::BankManager::initMixer |
( |
Mixer & |
mixer, |
|
|
Size |
sampleRate |
|
) |
| |
|
inlineprivate |
Definition at line 20 of file vae_bank_manager.hpp.
23 for (auto& i : mixer.effects) {
24 if (i.name.empty()) {
continue; }
26 if (i.effect ==
nullptr) {
27 VAE_ERROR(
"Effect %s could not be loaded.", i.name.c_str())
30 i.effect->
init(sampleRate);
void init(const char *rootPath, int sampleRate)
Will unload all the banks.
static EffectBase * create(IdString &id)
#define VAE_ERROR(msg,...)
◆ load() [1/2]
Result vae::core::BankManager::load |
( |
Bank & |
bank, |
|
|
int |
sampleRate |
|
) |
| |
|
inline |
Definition at line 86 of file vae_bank_manager.hpp.
90 if (bank.mixers.empty()) {
92 bank.mixers.resize(1);
93 bank.mixers[0].id = 0;
94 bank.mixers[0].name =
"Bank Master";
97 for (
auto& m : bank.mixers) {
103 for (auto& s : bank.sources) {
104 if (s.resample && s.signal.sampleRate && s.signal.sampleRate != sampleRate) {
112 if (
mBanks.size() < bank.id + 1) {
113 mBanks.resize(bank.id + 1);
115 mBanks[bank.id] = std::move(bank);
void initMixer(Mixer &mixer, Size sampleRate)
Result
Return Types for most engine functions.
#define VAE_INFO(msg,...)
◆ load() [2/2]
Result vae::core::BankManager::load |
( |
const char * |
path, |
|
|
Size |
size, |
|
|
const char * |
rootPath, |
|
|
int |
sampleRate |
|
) |
| |
|
inline |
Definition at line 74 of file vae_bank_manager.hpp.
76 VAE_INFO("Loading bank from file %s%s", rootPath, path)
79 if (result !=
Result::Success) {
80 VAE_ERROR(
"Failed to load bank from file %s%s", rootPath, path)
83 return load(bank, sampleRate);
Result load(const char *path, Size size, const char *rootPath, int sampleRate)
◆ lock()
void vae::core::BankManager::lock |
( |
| ) |
|
|
inline |
◆ unloadAll()
void vae::core::BankManager::unloadAll |
( |
| ) |
|
|
inline |
◆ unloadFromId()
Definition at line 167 of file vae_bank_manager.hpp.
170 if (
mBanks.size() <= bankHandle) {
171 VAE_WARN(
"Could not unload bank with handle %i", bankHandle)
174 auto& bank =
mBanks[bankHandle];
176 VAE_INFO(
"Unloading bank %s", bank.name.c_str())
178 for (auto& m : bank.mixers) {
179 for (
auto& e : m.effects) {
180 if (e.effect !=
nullptr) {
@ ElementNotFound
Referenced data not found.
#define VAE_WARN(msg,...)
#define VAE_ASSERT(condition)
◆ unlock()
void vae::core::BankManager::unlock |
( |
| ) |
|
|
inline |
◆ mBankLoader
◆ mBanks
The documentation for this class was generated from the following file: