audio_core: pass in memory reference

Because HLE::Source is initialized as an array in the member initializer, it is hard to let it accept the reference on ctor, so it has a second init stage performed by DspHle::Impl::Impl
This commit is contained in:
Weiyi Wang 2018-11-21 11:36:24 -05:00
parent 8bb404c82a
commit ec01975549
4 changed files with 24 additions and 4 deletions

View file

@ -14,6 +14,10 @@
#include "audio_core/interpolate.h"
#include "common/common_types.h"
namespace Memory {
class MemorySystem;
}
namespace AudioCore {
namespace HLE {
@ -35,6 +39,9 @@ public:
/// Resets internal state.
void Reset();
/// Sets the memory system to read data from
void SetMemory(Memory::MemorySystem& memory);
/**
* This is called once every audio frame. This performs per-source processing every frame.
* @param config The new configuration we've got for this Source from the application.
@ -56,6 +63,7 @@ public:
private:
const std::size_t source_id;
Memory::MemorySystem* memory_system;
StereoFrame16 current_frame;
using Format = SourceConfiguration::Configuration::Format;