2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00
yuzu/src/audio_core/effect_context.cpp

45 lines
1.1 KiB
C++
Raw Normal View History

// Copyright 2020 yuzu Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
2020-07-25 03:32:05 +01:00
#include <algorithm>
#include "audio_core/effect_context.h"
namespace AudioCore {
EffectContext::EffectContext(std::size_t effect_count) : effect_count(effect_count) {
2020-07-25 03:32:05 +01:00
effects.reserve(effect_count);
std::generate_n(std::back_inserter(effects), effect_count,
[] { return std::make_unique<EffectStubbed>(); });
}
EffectContext::~EffectContext() = default;
std::size_t EffectContext::GetCount() const {
return effect_count;
}
EffectBase* EffectContext::GetInfo(std::size_t i) {
return effects.at(i).get();
}
2020-07-25 03:32:05 +01:00
const EffectBase* EffectContext::GetInfo(std::size_t i) const {
return effects.at(i).get();
}
EffectStubbed::EffectStubbed() : EffectBase::EffectBase() {}
EffectStubbed::~EffectStubbed() = default;
void EffectStubbed::Update(EffectInfo::InParams& in_params) {
if (in_params.is_new) {
usage = UsageStatus::New;
}
}
EffectBase::EffectBase() = default;
EffectBase::~EffectBase() = default;
UsageStatus EffectBase::GetUsage() const {
return usage;
}
} // namespace AudioCore