separated setting time and processing node functions

This commit is contained in:
itsmattkc
2019-08-27 23:38:24 +10:00
parent 35db54075d
commit b9ce02a0ec
29 changed files with 146 additions and 109 deletions
+4 -5
View File
@@ -84,11 +84,10 @@ NodeOutput *MediaInput::texture_output()
void MediaInput::SetFootage(Footage *f)
{
// FIXME: Need some protection for Time == 0
footage_input_->set_value(0, PtrToValue(f));
footage_input_->set_value(PtrToValue(f));
}
void MediaInput::Process(const rational &time)
void MediaInput::Process()
{
// Set default texture to no texture
texture_output_->set_value(0);
@@ -102,7 +101,7 @@ void MediaInput::Process(const rational &time)
}
// Get currently selected Footage
Footage* footage = ValueToPtr<Footage>(footage_input_->get_value(time));
Footage* footage = ValueToPtr<Footage>(footage_input_->get_value());
// If no footage is selected, return nothing
if (footage == nullptr) {
@@ -123,7 +122,7 @@ void MediaInput::Process(const rational &time)
}
// Get frame from Decoder
FramePtr frame = decoder_->Retrieve(time);
FramePtr frame = decoder_->Retrieve(time());
if (frame == nullptr) {
return;
+1 -4
View File
@@ -34,9 +34,6 @@
/**
* @brief A node that imports an image
*
* FIXME: This will likely be replaced by the Media node as the Media node will be set up to pull from various decoders
* from the beginning.
*/
class MediaInput : public Node
{
@@ -56,7 +53,7 @@ public:
void SetFootage(Footage* f);
protected:
virtual void Process(const rational &time) override;
virtual void Process() override;
private:
NodeInput* footage_input_;