renderer: updated audio to work with minor node overhaul

This commit is contained in:
itsmattkc
2020-06-12 03:28:43 +10:00
parent a6a5c113ca
commit e2e8a6859c
10 changed files with 111 additions and 74 deletions
+21 -5
View File
@@ -1,6 +1,7 @@
#ifndef SHADERINFO_H
#define SHADERINFO_H
#include "codec/samplebuffer.h"
#include "node/input.h"
#include "node/inputarray.h"
#include "node/value.h"
@@ -53,18 +54,33 @@ private:
class SampleJob : public AcceleratedJob {
public:
SampleJob(NodeInput* from = nullptr) :
from_(from)
SampleJob()
{
samples_ = nullptr;
}
NodeInput* from() const
SampleJob(const NodeValue& value)
{
return from_;
samples_ = value.data().value<SampleBufferPtr>();
}
SampleJob(NodeInput* from, NodeValueDatabase& db)
{
samples_ = db[from].Take(NodeParam::kSamples).value<SampleBufferPtr>();
}
SampleBufferPtr samples() const
{
return samples_;
}
bool HasSamples() const
{
return samples_ && samples_->is_allocated();
}
private:
NodeInput* from_;
SampleBufferPtr samples_;
};