miscellaneous other changes to make audio rendering work
Many changes were made throughout the codebase to support audio, these are most of the small changes necessary. The audio support still is not perfect. I still need to write in resampling support. After that it should work correctly with all audio types.
This commit is contained in:
@@ -110,6 +110,7 @@ QVariant Block::Value(NodeOutput *output)
|
||||
void Block::EdgeAddedSlot(NodeEdgePtr edge)
|
||||
{
|
||||
if (edge->input() == previous_input()) {
|
||||
// FIXME: No protection for if this connection is not a node
|
||||
static_cast<Block*>(edge->output()->parent())->next_ = this;
|
||||
|
||||
// The blocks surrounding this one have changed, we need to Refresh()
|
||||
@@ -123,6 +124,7 @@ void Block::EdgeAddedSlot(NodeEdgePtr edge)
|
||||
void Block::EdgeRemovedSlot(NodeEdgePtr edge)
|
||||
{
|
||||
if (edge->input() == previous_input()) {
|
||||
// FIXME: No protection for if this connection is not a node
|
||||
static_cast<Block*>(edge->output()->parent())->next_ = nullptr;
|
||||
|
||||
// The blocks surrounding this one have changed, we need to Refresh()
|
||||
|
||||
@@ -26,22 +26,17 @@ QString AudioInput::Description()
|
||||
return tr("Import an audio footage stream.");
|
||||
}
|
||||
|
||||
QVariant AudioInput::Value(NodeOutput *)
|
||||
NodeOutput *AudioInput::samples_output()
|
||||
{
|
||||
/*if (output == samples_output_) {
|
||||
// Make sure decoder is set up
|
||||
if (!SetupDecoder()) {
|
||||
return 0;
|
||||
}
|
||||
return samples_output_;
|
||||
}
|
||||
|
||||
// Retrieve audio samples from decoder
|
||||
frame_ = decoder_->Retrieve(in, out - in);
|
||||
QVariant AudioInput::Value(NodeOutput *output)
|
||||
{
|
||||
if (output == samples_output_) {
|
||||
// Simple passthrough from footage input
|
||||
return footage_input_->value();
|
||||
}
|
||||
|
||||
QByteArray samples;
|
||||
samples.resize(frame_->audio_params().samples_to_bytes(frame_->sample_count()));
|
||||
memcpy(samples.data(), frame_->data(), static_cast<size_t>(samples.size()));
|
||||
return samples;
|
||||
}*/
|
||||
|
||||
return 0;
|
||||
return MediaInput::Value(output);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ public:
|
||||
virtual QString Category() override;
|
||||
virtual QString Description() override;
|
||||
|
||||
NodeOutput* samples_output();
|
||||
|
||||
protected:
|
||||
virtual QVariant Value(NodeOutput* output) override;
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ public:
|
||||
//virtual void Hash(QCryptographicHash *hash, NodeOutput* from, const rational &time) override;
|
||||
|
||||
protected:
|
||||
//virtual QVariant Value(NodeOutput* output, const rational& in, const rational& out) override;
|
||||
|
||||
private:
|
||||
NodeInput* matrix_input_;
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ public:
|
||||
void drop_cached_values();
|
||||
|
||||
private:
|
||||
QMap<TimeRange, QVariant> cached_values_;
|
||||
QHash<TimeRange, QVariant> cached_values_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user